Repository navigation
Tell the Mac approval card when a request goes to the iPhone - #355
Conversation
The approval panel's footer shows one moving number at a time (ADR 0014, amendment for #345; #344 decision 6). While an eligible request waits for its 20-second send to an approver with room under the 16-request limit, it counts down to the send ("iPhone can decide in 18 s"). While a copy saved to an approver's inbox is outstanding, it says "Also on iPhone · Expires in 4:39". Otherwise it is unchanged. The coordinator gains a read-only accessor for that state, the panel's privacy check carries it into RemoteApprovalPanelState, and the footer ticks just after each whole second of the number it shows. A footer too long for one line puts the text and "Esc to decide later" on a line each. The card's front, Details, buttons and the sending rules are unchanged.
…ter renders Recording an approver's decision clears the footer's hint at once, so "Also on iPhone" never shows next to "Approved on". The footer renders are taken again when a render outlasts the number it shows, Details renders 11 and 12 show the saved copy's footer, and a test checks that the panel follows the hint and that a footer growing to two lines keeps the panel's top edge, so the buttons stay in place.
ADR 0014 asks VoiceOver to read the footer as one sentence. The footer is now one accessibility element labeled with its text and "Esc to decide later", with the button trait and the decide-later action; mouse and Esc work as before, and the visible text and the label share one timeline tick. The screenshot flow matches "Esc to decide later" inside that label (scope extension approved for #350).
Cross review (GPT-6 Astra xhigh + Opus 5.5 xhigh, read-only, two rounds each)Reviewed head a9341d9; fixes are in 0331cc3 and 84b0ca9. CI run 43746076425 on 84b0ca9 is green on all four jobs: build-and-test 2177 tests, 3 skipped, 0 failed; basic-ui-flows required 18/18 and screenshots 19/19, with captures 12–14 in Both reviewers found the coordinator conditions correct: eligibility, the 16-request limit, saved versus unsaved copies, decided and closed copies, and replacements. They also found the timer arithmetic, the lock path, the unchanged card front and the exact Chinese wording correct. No P0. Fixed
Declined
Still open for the maintainer: the English sent form takes two lines on the 300-pt card (render |
Closes #350
Summary
The Mac approval panel's footer now shows one moving number at a time (ADR 0014 → "Amendment: iPhone history, tabs and the Mac card hint (#345)"; #344 decision 6):
iPhone can decide in 18 s · Esc to decide later18 秒后 iPhone 也能处理 · Esc 稍后处理Also on iPhone · Expires in 4:39 · Esc to decide lateriPhone 也能处理 · 4:39 后失效 · Esc 稍后处理Expires in 4:59 · Esc to decide later4:59 后失效 · Esc 稍后处理DeviceCoordinator.remoteFooterHint(for:)(read-only,DeviceCoordinator+Presentation.swift) reads the track's phase and send time,remoteSendingAllowed, the active approvers andoutstandingCount(for:)againstmaximumOutstandingPerApprover, the same conditionsreconcileRemoteRequests/deliverRemoteRequestuse. It changes nothing about when or whether a request is sent.RemoteApprovalPanelState.footer; it is nil once the request left pending, and a lock still closes the panel at once, so the hint never shows on a locked screen.TimelineViewusesRemoteApprovalFooterSchedule, which ticks just after each whole second before the number's anchor (the send time while waiting, otherwise the expiry), so the countdown changes on time, once a second, 20 → 1, with tabular digits. The count goes throughAppLanguage.localizedCount.Diff stat
Tests
swift build: passed.swift test --filter AskKeyAppTests: 853 tests, 1 skipped, 0 failed (main3a735ec: 836, 1 skipped). New:RemoteApprovalFooterTests(6) andRemoteApprovalFooterHintTests(11).steppath: in English the sent form grows the panel by one line downward with its top edge fixed, so the buttons stay in place; in Chinese every form keeps one line..sentand nothing is sent; with only an approver-less iPhone the footer is unchanged through 25 s..sent), every copy closed, and the iPhone's own decision.Renders
RemoteApprovalRenderTestsadds six PNGs to theaskkey-remote-approval-rendersartifact (36 in all, from 30), built throughAppDelegate.makeFrozenApprovalPanellike the existing panel renders, with Details collapsed so the whole front shows:17-en-panel-footer-iphone-in-18s.png,17-zh-panel-footer-iphone-in-18s.png: before the send, at 18 s.18-en-panel-footer-also-on-iphone.png,18-zh-panel-footer-also-on-iphone.png: after the send,4:39.19-en-panel-footer-no-approver.png,19-zh-panel-footer-no-approver.png: unchanged footer when no approver can take the request.Details renders 11 and 12 (a saved, still open copy) now show the "Also on iPhone" footer; 13 and 14 are unchanged. A footer render that outlasts the number it shows (0.9 s) is taken again.
Checks
python3 scripts/check_hygiene.py: passed (size=0, test-support=0, debug=0, local-path=0, non-ascii-name=0, multica=0, cjk=0).python3 scripts/check_module_deps.py: passed.AppDelegate+Approval.swift, 496 lines.Deviations and questions
Also on iPhone · Expires in 4:39 · Esc to decide lateris about 15 pt wider than the 300-pt card's 268-pt content width at the caption size, so the footer is aViewThatFits: one line when it fits, otherwise the text and "Esc to decide later" on a line each (render18-en). The English card therefore grows by one caption line at the moment of the send. Every Chinese form and the other English forms fit on one line. The wording follows the amendment; a shorter English string would avoid the second line if the maintainer prefers.oneandother(iPhone can decide in %lld s), because "s" inflects in neither catalog language; a language that inflects can add plural variations to that key without a code change.Tests/AskKeyE2ETests/ScreenshotE2ETests.swift:175now matches "Esc to decide later" withcontaining: true, because the footer's single VoiceOver label is "Expires in … · Esc to decide later". It was the only exact match on the footer inTests/(Tests/UI/required-flows.jsonhas none).swift test.