Skip to content

Give the iPhone app Requests, History and Macs tabs - #358

Merged
sudoHG merged 4 commits into
mainfrom
sudoHG/optimistic-shannon-61751c
Nov 16, 2026
Merged

sudoHG merged 4 commits into
mainfrom
sudoHG/optimistic-shannon-61751c

Conversation

@sudoHG

@sudoHG sudoHG commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #346

Summary

  • The iPhone app opens to three tabs in the system TabView, each with its own navigation stack and large title: Requests (tray), History (clock.arrow.circlepath) and Macs (laptopcomputer). The welcome and unusable-identity screens stay full screen; pairing stays a sheet; a request's page opens as a sheet over every tab. PairedMacsView is gone.
  • Requests lists only requests that can still be decided or wait for the Mac (decision 7): the card sentence, names bold, in at most two lines, and the time left (orange under a minute) or "Sent, waiting for the Mac"; tapping a row opens its page. Banners for iCloud (reusing list.account.*) and for notifications turned off, each with Open Settings. Empty states for no paired Mac (with Pair a Mac) and no requests (with the reachability capsule, orange only while an iCloud banner shows). Pull to refresh and the 10 s / 2 s foreground polls are unchanged.
  • The Requests badge counts requests that can still be decided and is redrawn when an undecided countdown ends. In front, a notification is presented as banner, list and sound (decision 8); the page never opens by itself, and the new row is highlighted for two seconds.
  • History shows only its empty state (Keep a 30-day history of requests on the iPhone #349 fills it). Macs has + in the toolbar, one list of Macs with relative "Last reached" times, the rule in its footer, a This iPhone section (iCloud, notifications, last delivery check; the five-row delivery list is gone), the no-values line and the version, and the removal notice as a dismissible row at the top. Mac detail is a grouped list with iPhone: retire Approve Requests from This Mac and Stop Approving #342's status line and Remove wording unchanged.
  • Notification authorization is read through NotificationCenterAccess.authorization() at launch, after the welcome's prompt and whenever the scene becomes active, and faked in tests. The tab screens are drawn as SwiftUI stacks (GroupedSection, ValueRow, BannerRow, EmptyStateView) so ImageRenderer renders the real views; buttons use system styles; no ActionButtonStyle or NoticeCard on these screens.

Diff stat

54 files changed, 2380 insertions(+), 586 deletions(-). New: Views/RequestsView.swift, Views/MacsView.swift, Views/HistoryView.swift, AskKeyiOSKitTests/HomeTests.swift, AskKeyiOSKitTests/RenderChrome.swift; deleted: Views/PairedMacsView.swift. Most of the added lines are the 33 new catalog entries; no existing string changed.

Tests

  • bash scripts/build-ios.sh test on 83adfc2, and again with it rebased locally on main after AskKeyDevices: reserve kind 14 and remove the approver code #357 (1b2ca91), same counts: AskKeyiOSKitTests 180 passed, 0 failed, 0 skipped; AskKeyiOSNotificationServiceTests 44 passed, 0 failed. 110 screens rendered. On c21c0bb, before this PR, the same command gave 163 and 44 with 88 screens: +16 HomeTests, render tests −2 (old home) +3 (tabs).
  • HomeTests covers: the Requests rows and badge as requests are closed by the Mac, denied here (waiting) and time out; a card still being checked left out of the badge; the badge's redraw dates; a request arriving in front (presentation options, no page, no tab change); the arrival highlight (kept across tabs until the Requests tab shows it, dropped with its request, never for requests reopened at launch); a row opening its page with the card; the notification authorization at launch, after the welcome's prompt and on becoming active, and what the Notifications row shows for each state; the capsule's three forms (orange only with an iCloud banner, green count, hidden without an approving Mac); shortened names in a row; the spoken time left; the approving-Mac count; the last delivery check; Touch ID.
  • Full Swift suite and desktop flows: left to CI, as AGENTS.md asks.

Checks

  • bash scripts/build-ios.sh build: passed (catalog check included; tab. and history. added to its key scan).
  • python3 scripts/check_hygiene.py: passed (size=0, test-support=0, debug=0, local-path=0, non-ascii-name=0, multica=0, cjk=0). Largest touched source files: AppModel.swift 467 lines, RequestCardView.swift 401, Components.swift 346.
  • Disk check before each simulator build: 143 GiB free.

Renders

askkey-ios-screens artifact of the CI run, in English (-en) and Simplified Chinese (-zh-Hans):

  • 44-requests-two-requests (one under a minute, one sent and waiting; badge 1)
  • 45-requests-empty
  • 46-requests-not-paired
  • 47-requests-both-banners
  • 48-history-empty
  • 49-macs
  • 50-macs-removal-notice
  • 51-macs-problems (a Mac without the approval flag, a notice the Mac could not get, iCloud signed out, notifications off, no delivery check yet)
  • 52-macs-empty
  • 53-requests-sending-touch-id (a decision stored but not yet saved; the Touch ID footnote)
  • 54-requests-empty-one-mac
  • 55-macs-icloud-restricted (notifications never answered read Off), 56-macs-icloud-unavailable
  • 57-requests-accessibility-size (accessibility text size, a long requester name shortened in the row)
  • 58-requests-notifications-off (only the notifications-off banner; the capsule stays green)
  • 34-mac-detail-approving, 35-mac-detail-without-approval-flag, 36-mac-detail-remove-confirmation, 37-mac-detail-rename-and-removal-failed

ImageRenderer cannot draw UIKit-backed views, so the renders draw stand-ins for the system chrome around the real content (RenderChrome.swift: large title, +, tab bar with the badge, back button), as ActionSheetStandIn already does for the dialog. The stand-in lays the content out the way tabScaffold() does in its scroll view, so the empty states' centering in the renders is the app's. Renders 11–13 and 15 (the old home) are removed.

Deviations and questions

  1. Remove keeps iPhone: retire Approve Requests from This Mac and Stop Approving #342's label and adds no footer. Mac detail's red button still says Remove / 移除 (list.remove), not "Remove This Mac", because iPhone: retire Approve Requests from This Mac and Stop Approving #342's Remove wording stays word for word and both privacy pages say "choose Remove". iPhone: retire Approve Requests from This Mac and Stop Approving #342 merged no footer string, and a footer quoting part of its confirmation would drop the caveat that the Mac keeps trusting the iPhone until it gets the notice, so the Remove section's footer only says when a removal failed. The confirmation dialog is unchanged.
  2. Strings that differ from the table. request.row.left %@ is not added: request.timeLeft.value %@ already says "%@ left" / 还剩 %@ and is reused. request.empty.reachable is two keys, request.empty.reachableOne ("1 Mac can reach this iPhone") and request.empty.reachable %@, instead of a plural variation, because the catalog check in build-ios.sh reads only top-level string units and its key scan maps every interpolation to %@, and the Scope allows changing only the prefix list there. history.empty.detail's Chinese says 结束后 instead of 处理后, to match "after they end" (expired and cancelled requests are recorded too).
  3. Strings the table does not list: request.row.sending ("Sending your decision…", a decision stored but not yet saved by CloudKit), request.list.footnote.touchID, list.iCloud.signedIn/signedOut/restricted/unavailable, list.notifications, list.notifications.stateOn/stateOff, list.lastDeliveryCheck.none, list.version %@, mac.detail.paired, mac.detail.lastReached. Removed as unused: list.title, list.empty, list.deliveries.*, list.pairedOn %@, request.section.title. Every new string is in a render.
  4. Rows. A Requests row shortens the requester's and the Mac's names to 24 characters, so a long agent-chosen name cannot push the credential out of the two lines; the page shows them in full. The Macs rows keep iPhone: retire Approve Requests from This Mac and Stop Approving #342's exception line (list.notApprover, orange) for an entry without the approval flag.
  5. Badge and capsule. The badge leaves out a card fetched by name for a tapped notification until the following zone poll shows it can be decided (Show a notified request at once when the iPhone app opens #337); the row still lists it. The capsule counts Macs whose entry carries the approval flag, is orange with "Your Macs can't reach this iPhone right now" only while an iCloud banner shows (signed out, restricted or unreachable), and is hidden when no listed Mac has the flag and no iCloud banner shows. With only the notifications-off banner it keeps its green count, because requests still arrive and that banner already says what is wrong (the maintainer's decision on this PR; the issue had it orange while any banner shows).
  6. Arrival highlight. Arrivals are tracked in the model: requests reopened at launch are not highlighted, and a request that arrives while another tab shows stays highlighted until the Requests tab has shown it for two seconds.
  7. This iPhone shows Notifications On only when allowed (Off when denied or never answered, nothing before the first read) and no iCloud state before the first account check; Restricted and Can't connect cover the other account states.
  8. Mac detail. Rename is a tinted action without a chevron, because it opens an alert rather than a page. The status line is centered under the name, the not-approving warning in orange.
  9. Other. Open Settings uses .bordered at the regular size inside each banner rather than .large, with the banner's sentence as its VoiceOver hint. The Macs tab also refreshes on pull, as the old home did. RequestList, the old home's list of full cards in RequestCardView.swift, is deleted as dead code; the request sheet is untouched. The privacy pages are unchanged: the tab names in both languages are the amendment's (Requests / 请求, History / 记录, Macs / Mac) and Remove keeps its name.
  10. Parallel work: none of AskKeyDevices: reserve kind 14 and remove the approver code #343's files is changed (ApprovalFakes.swift, ApproverTests.swift, OpenedRequestTests.swift, ApprovalRequestTests.swift, LocalizationTests.swift and AppModel+Approvals.swift are untouched).

Maintainer decisions on this PR (after reviewing the renders):

  • The delivery check the Mac sends right after pairing also shows its generic banner and sound while the app is in front, because every notification does, as decision 8 says. Accepted for this PR; changing it is a separate follow-up. Filtering to requests the extension verified was tried and reverted, because it would also silence a real request whose details the extension could not verify.
  • With only notifications off, the capsule no longer says the Macs can't reach this iPhone: the orange form shows only while an iCloud banner shows, and render 58 shows the green form under the notifications-off banner. Render 47 (both banners, orange) is unchanged.
  • Until Keep a 30-day history of requests on the iPhone #349, a request that ends while its page is closed (including "not applied" and a sent Allow that timed out) leaves every screen at once, as decision 7 says; on main it stayed as a card. Acknowledged: Give the iPhone app Requests, History and Macs tabs #346 reaches testers together with Keep a 30-day history of requests on the iPhone #349.

The iPhone app opens to three tabs in the system TabView, each with its
own navigation stack and large title. Requests lists only requests that
can still be decided or wait for the Mac, with banners for iCloud and
notifications turned off and empty states for no Mac and no request; its
badge counts the requests that can still be decided. A notification for
the app in front shows as a banner and never opens the request's page;
the new row is highlighted instead. History shows its empty state until
#349. Macs lists the Macs with a + to pair, this iPhone's iCloud,
notification and delivery-check status, the version and the removal
notice. Mac detail becomes a grouped list with #342's wording unchanged.

Notification authorization is read through the environment at launch,
after the welcome's prompt and whenever the scene becomes active. The
tab screens are drawn as SwiftUI stacks so the renders use the real
views; the render tests draw stand-ins for the system chrome.
Show a notification in front only for a request the notification
extension verified, so the delivery check after pairing stays silent.
Track arrivals in the model so requests reopened at launch are not
highlighted and a request that arrives on another tab stays highlighted
until the Requests tab shows it. Leave a card that is still being
checked out of the badge, show Notifications as On only when allowed,
and hide the capsule when no Mac can send requests. Drop the Remove
footer so #342's wording stays only in its confirmation, make Rename a
tinted action, read the time left to VoiceOver as a duration, and name
the problem in each Open Settings hint. Render every new string.
Show every notification in front as decision 8 specifies again, so a
request the extension could not verify still gets its banner. Center the
Mac detail's status line and give the not-approving warning orange text.
Shorten long requester and Mac names in a Requests row so they cannot
push the credential out of its two lines. Say nothing about iCloud on
This iPhone before the first account check. Give Open Settings the
regular size and the removal notice's dismiss button a 44-point target,
draw the tab bar under the Mac detail renders, and render the Requests
tab at an accessibility text size.
@luoji-bot

luoji-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

Cross adversarial review of ff95d97: GPT-6 Astra (xhigh) and Opus 5.5 (xhigh), read-only, two rounds each (round 1 independent; round 2 each ruled on the other's report against a frozen checkout). No P0 or P1.

Fixed in 91aaf0e and e78dc6a:

  1. Arrival highlight: tracked in the model, so requests reopened at launch are not highlighted, and a request that arrives on another tab stays highlighted until the Requests tab has shown it for two seconds. Tested.
  2. The badge leaves out a card fetched by name for a tapped notification until the following zone poll shows it can be decided. Tested.
  3. This iPhone: Notifications reads On only when allowed (Off when denied or never answered, nothing before the first read); no iCloud state before the first account check. Tested.
  4. Every new string is now in a render: 53 (sending, Touch ID footnote), 54 (one Mac), 55 and 56 (iCloud restricted, unavailable), plus 57 at an accessibility text size.
  5. Dropped the new footer under Remove: quoting half of iPhone: retire Approve Requests from This Mac and Stop Approving #342's confirmation lost its caveat. iPhone: retire Approve Requests from This Mac and Stop Approving #342's wording now appears only in the unchanged dialog.
  6. The capsule is hidden when no Mac carries the approval flag and no banner shows (no "0 Macs").
  7. Opening a request from the Requests tab no longer closes the Mac detail on the Macs tab.
  8. Mac detail: Rename is a tinted action without a chevron; the status line is centered and the not-approving warning is orange.
  9. Accessibility: the time left is read as a duration, rows update frequently, each Open Settings carries its banner's sentence as a hint and has the regular size, and the dismiss button has a 44-point target.
  10. A Requests row shortens the requester's and the Mac's names to 24 characters, so an agent-chosen name cannot push the credential out of the two lines.
  11. history.empty.detail in Chinese says 结束后 rather than 处理后, matching "after they end".
  12. The Mac detail renders draw the tab bar.

Tried and reverted: showing the foreground banner only for requests the extension verified (Opus round 1, P2). In round 2 both reviewers ruled the issue's banner, list and sound for every notification correct, because the filter would also silence a real request the extension could not verify.

Declined:

  • A card still being checked stays listed; only the badge leaves it out. It is verified, becomes decidable after one poll, and the page that opened it already shows "Checking".
  • The iCloud banners' Open Settings opens Ask Key's settings page. There is no public URL for iCloud settings, the issue specifies the button, and that page fixes the unavailable case (Wireless Data).
  • Wording suggestions on the issue's table strings (执行 → 处理, 发来请求 → 联系, 要用 → 需要, "No Requests" against 没有待处理的请求, the scope of list.footer), and 配对于 → 配对日期. These are kept as approved in the table and the prototype for the maintainer's render review.
  • The badge's redraw at a countdown end is tested only through the dates that drive the TimelineView; the hostless test bundle cannot run the view.
  • Not verified on a device, or minor: a brief "No Paired Macs Yet" before the list read; a possible empty-state shift as the large title collapses; the "2 min." abbreviation; banners turned off while notifications stay allowed.

For the maintainer: the delivery check after pairing now shows its generic banner in front; the capsule says "can't reach" with only notifications off; until #349, a request that ends while its page is closed leaves every screen. Details are under "Questions for the maintainer" in the PR description.

After the fixes, bash scripts/build-ios.sh test on e78dc6a: kit 179/0, extension 44/0, 108 screens. Hygiene passed.

With only notifications off, requests still arrive and the banner says
what is wrong, so the empty state's capsule keeps counting the Macs. The
orange form now follows the iCloud banners alone, as the maintainer
decided from the renders; the capsule stays hidden without an approving
Mac. Render 58 shows the green capsule under the notifications-off
banner.
@sudoHG
sudoHG merged commit d2f9310 into main Nov 16, 2026
4 checks passed
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.

Give the iPhone app Requests, History and Macs tabs

1 participant