Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ struct DeviceTreeView: View {
confirmRemove: { _ in confirmComputerRemoval() }
)
}
if showAddDevice != nil {
addComputerRow
}
} footer: {
Text(L10n.string(
"mobile.computers.footer",
Expand All @@ -97,10 +100,7 @@ struct DeviceTreeView: View {
.toolbar {
if showAddDevice != nil {
ToolbarItem(placement: .topBarLeading) {
Button {
showAddDevice?()
dismiss()
} label: {
Button(action: addComputer) {
Image(systemName: "plus")
}
.accessibilityLabel(L10n.string("mobile.computers.add", defaultValue: "Add Computer"))
Expand Down Expand Up @@ -134,6 +134,26 @@ struct DeviceTreeView: View {
.accessibilityIdentifier("MobileDeviceTree")
}

/// End-of-list affordance mirroring the top-left toolbar button, so users who
/// scroll past their Macs can add another without scrolling back up. Same
/// action path (`addComputer`) as the toolbar button.
private var addComputerRow: some View {
Button(action: addComputer) {
Label(
L10n.string("mobile.computers.add", defaultValue: "Add Computer"),
systemImage: "plus"
)
}
.accessibilityIdentifier("MobileComputersAddRow")
}

/// Present the add-device (pairing) flow, then dismiss this screen. Shared by
/// the top-left toolbar button and the end-of-list row.
private func addComputer() {
showAddDevice?()
dismiss()
}

@ViewBuilder
private var emptySection: some View {
Section {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct DisconnectedWorkspaceShellView: View {
Button(action: showAddDevice) {
Text(
savedMacs.isEmpty
? L10n.string("mobile.addDevice.title", defaultValue: "Add device")
? L10n.string("mobile.addDevice.title", defaultValue: "Add Computer")
: L10n.string("mobile.addDevice.another", defaultValue: "Add another Mac")
)
}
Expand Down Expand Up @@ -199,7 +199,7 @@ struct DisconnectedWorkspaceShellView: View {
Button(action: showAddDevice) {
Image(systemName: "plus")
}
.accessibilityLabel(L10n.string("mobile.addDevice.title", defaultValue: "Add device"))
.accessibilityLabel(L10n.string("mobile.addDevice.title", defaultValue: "Add Computer"))
.accessibilityIdentifier("MobileShowAddDeviceToolbarButton")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct MobileMacConnectionStatusRow: View {

if let addDevice {
Button(action: addDevice) {
Text(L10n.string("mobile.addDevice.title", defaultValue: "Add device"))
Text(L10n.string("mobile.addDevice.title", defaultValue: "Add Computer"))
}
.buttonStyle(.bordered)
.controlSize(.small)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct PairingView: View {
.addDeviceInputBehavior(.number)
.accessibilityIdentifier("MobileAddDevicePortField")
} header: {
Text(L10n.string("mobile.addDevice.title", defaultValue: "Add device"))
Text(L10n.string("mobile.addDevice.title", defaultValue: "Add Computer"))
} footer: {
Text(L10n.string("mobile.addDevice.help", defaultValue: "Enter a Tailscale, LAN, or local host and port. QR/link pairing from that computer is still the safest setup path."))
}
Expand All @@ -88,7 +88,7 @@ struct PairingView: View {
Color.clear
.frame(width: 1, height: 1)
.accessibilityElement(children: .ignore)
.accessibilityLabel(L10n.string("mobile.addDevice.formAccessibilityLabel", defaultValue: "Add device form"))
.accessibilityLabel(L10n.string("mobile.addDevice.formAccessibilityLabel", defaultValue: "Add Computer form"))
.accessibilityIdentifier("MobileAddDeviceForm")
}
#endif
Expand Down Expand Up @@ -221,7 +221,7 @@ struct PairingView: View {
.ignoresSafeArea(edges: .bottom)
}
}
.navigationTitle(L10n.string("mobile.addDevice.title", defaultValue: "Add device"))
.navigationTitle(L10n.string("mobile.addDevice.title", defaultValue: "Add Computer"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update Mac pairing instructions to match the renamed action

This rename makes the iOS pairing entry point read “Add Computer”, but the Mac-side QR pairing instructions still tell users to “Tap Add device” (Sources/Mobile/Pairing/MobilePairingView.swift:351, backed by Resources/Localizable.xcstrings). Users pairing from the Mac window now see instructions that name a control that no longer exists on the phone, so update that Mac string and its Japanese localization as part of the same terminology change.

Useful? React with 👍 / 👎.

.mobileInlineNavigationTitle()
.toolbar {
#if os(iOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct SetupHelpView: View {

Text(L10n.string(
"mobile.setupHelp.lanBody",
defaultValue: "No Tailscale? On the same Wi-Fi you can still connect by typing the Mac's local address and port by hand in Add device. That link is unencrypted, so only use it on a network you trust."
defaultValue: "No Tailscale? On the same Wi-Fi you can still connect by typing the Mac's local address and port by hand in Add Computer. That link is unencrypted, so only use it on a network you trust."
))
Comment on lines 153 to 156

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reference the control label users actually see.

Line 155 now tells users to enter the address in “Add Computer”, but the disconnected recovery screen still shows “Add another Mac” when paired Macs already exist (Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/DisconnectedWorkspaceShellView.swift Lines 91-95). In that path the help text points to a button name that is not on screen. Use neutral copy here, or pass in the caller-specific CTA label.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/SetupHelpView.swift`
around lines 153 - 156, The help text in SetupHelpView uses a CTA label that may
not match what users actually see on the disconnected recovery screen. Update
the lanBody copy in SetupHelpView to use neutral wording, or make it accept a
caller-provided label so DisconnectedWorkspaceShellView can pass its actual CTA
text (“Add another Mac”) and keep the message consistent with the visible
control.

.font(.footnote)
.foregroundStyle(.secondary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ extension WorkspaceListView {
}
}
.labelsVisibility(.visible)
if let showAddDevice {
Divider()
Button {
showAddDevice()
} label: {
Label(
L10n.string("mobile.computers.add", defaultValue: "Add Computer"),
systemImage: "plus"
)
}
.accessibilityIdentifier("MobileWorkspaceMacPickerAdd")
}
} label: {
WorkspaceMacTitlePickerLabel(title: macTitlePickerTitle)
}
Expand Down
12 changes: 6 additions & 6 deletions ios/cmux/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,13 @@
"en": {
"stringUnit": {
"state": "translated",
"value": "Add device form"
"value": "Add Computer form"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "デバイス追加フォーム"
"value": "コンピュータ追加フォーム"
}
}
}
Expand Down Expand Up @@ -670,13 +670,13 @@
"en": {
"stringUnit": {
"state": "translated",
"value": "Add device"
"value": "Add Computer"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "デバイスを追加"
"value": "コンピュータを追加"
}
}
}
Expand Down Expand Up @@ -4138,13 +4138,13 @@
"en": {
"stringUnit": {
"state": "translated",
"value": "No Tailscale? On the same Wi-Fi you can still connect by typing the Mac's local address and port by hand in Add device. That link is unencrypted, so only use it on a network you trust."
"value": "No Tailscale? On the same Wi-Fi you can still connect by typing the Mac's local address and port by hand in Add Computer. That link is unencrypted, so only use it on a network you trust."
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "Tailscaleがない場合でも、同じWi-Fiなら、「デバイスを追加」でMacのローカルアドレスとポートを手入力して接続できます。その接続は暗号化されないため、信頼できるネットワークでのみ使用してください。"
"value": "Tailscaleがない場合でも、同じWi-Fiなら、「コンピュータを追加」でMacのローカルアドレスとポートを手入力して接続できます。その接続は暗号化されないため、信頼できるネットワークでのみ使用してください。"
}
}
}
Expand Down
Loading