Skip to content

refactor(pairing): one way in on each side instead of three - #234

Merged
arzafran merged 1 commit into
refactor/settings-consolidationfrom
refactor/pairing-cleanup
Jul 31, 2026
Merged

refactor(pairing): one way in on each side instead of three#234
arzafran merged 1 commit into
refactor/settings-consolidationfrom
refactor/pairing-cleanup

Conversation

@arzafran

Copy link
Copy Markdown
Member

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-fallback DisclosureGroup; the pairing subtitle no longer promises payload-and-token entry
  • ios/.../PairConnectView.swift: removed the Advanced section and the duplicate Connect button; the remaining button picks up the isConnecting guard the removed one owned
  • pairingTicketDraft / pairingTokenDraft stay on AppStoreapplyPairingCode still fills them and connectManually still reads them, they are simply no longer bound to text fields
  • Nine localization keys dropped across the two catalogs; pairing.connect.useCodeButton retranslated for its new label

Why 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 programa builds
  • xcodebuild -scheme ProgramaSpike builds for iOS Simulator
  • Mac: Settings ▸ Phone ▸ Pair a Device — QR renders, code is selectable, Copy works, countdown still ticks
  • Phone: scan the QR, and separately paste the copied code and press Connect

Note

Stacked on #232 and based on that branch so this shows one commit, and so both ship in a single release.

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.
@arzafran
arzafran merged commit 1b26c22 into refactor/settings-consolidation Jul 31, 2026
4 checks passed
@arzafran
arzafran deleted the refactor/pairing-cleanup branch July 31, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant