refactor(pairing): one way in on each side instead of three - #234
Merged
arzafran merged 1 commit intoJul 31, 2026
Merged
Conversation
Pairing offered three entry points and two buttons for a single action, and the two devices did not agree on what pairing even looked like. The phone had: scan a QR, paste a combined code with a "Use This Code" button, and an Advanced section with separate ticket and token fields behind its own "Connect" button. Two buttons that both connect, one of which only worked with the fields nobody was meant to use. Its own doc comment called the split fields legacy. The Mac had: a QR, the combined code shown as selectable text with a Copy button, and below that a "Can't scan? Paste the payload and token manually" disclosure repeating the same secret split in two. Both legacy paths are gone. The Mac shows the QR and the one combined code that the QR encodes; copying that is the fallback for anyone who cannot scan. The phone scans or pastes that code, and its single button is now called Connect because connecting is what it does. The ticket and token drafts stay on AppStore, since applyPairingCode still fills them and connectManually still reads them. They are just no longer bound to fields. The Connect button also picks up the isConnecting guard the removed button used to own. Both apps build. Nine localization keys dropped across the two catalogs, and pairing.connect.useCodeButton retranslated for its new label.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Pairing a phone offered three entry points and two buttons for a single action, and the two devices did not agree on what pairing looked like.
The phone screen had a QR scanner, a combined-code field with a "Use This Code" button, and an Advanced section holding separate ticket and token fields behind its own "Connect" button. Two buttons that both connect, one of which only worked with the fields nobody was meant to use. The file's own doc comment described those fields as legacy.
The Mac had the QR, the combined code shown as selectable text with a Copy button, and directly below that a "Can't scan? Paste the payload and token manually" disclosure showing the same secret split into two labelled boxes. The question it asked was already answered by the copyable code sitting above it.
Both legacy paths are gone. The Mac shows the QR and the one code the QR encodes. The phone scans or pastes that code, and its single button now says Connect.
Summary
Sources/SettingsView.swift: removed the manual-fallbackDisclosureGroup; the pairing subtitle no longer promises payload-and-token entryios/.../PairConnectView.swift: removed the Advanced section and the duplicate Connect button; the remaining button picks up theisConnectingguard the removed one ownedpairingTicketDraft/pairingTokenDraftstay onAppStore—applyPairingCodestill fills them andconnectManuallystill reads them, they are simply no longer bound to text fieldspairing.connect.useCodeButtonretranslated for its new labelWhy this is safe to remove rather than keep as a fallback
The fallback existed for "cannot scan, or the combined paste did not parse". The Mac renders the exact string the QR encodes, selectable, with a Copy button. Pasting that is the fallback. The split fields only ever offered a second way to transfer the same two values, which is what made the screen confusing.
Test plan
xcodebuild -scheme programabuildsxcodebuild -scheme ProgramaSpikebuilds for iOS SimulatorNote
Stacked on #232 and based on that branch so this shows one commit, and so both ship in a single release.