Skip to content

Restore the v0.2 approval card style for every card - #178

Merged
sudoHG merged 3 commits into
mainfrom
sudoHG/177-v02-card-style
Oct 9, 2026
Merged

sudoHG merged 3 commits into
mainfrom
sudoHG/177-v02-card-style

Conversation

@sudoHG

@sudoHG sudoHG commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #177

Summary

  • Every approval card uses the v0.2 read-card layout again: the 64-point icon, one bold sentence with the subject, one subtitle line, a centered Details › link, the buttons and the Expires in m:ss · Esc to decide later footer. Titles, subtitles and buttons follow the Restore the v0.2 approval card style for every card #177 table in both languages, with “ ” quotes in both.
  • Details is one two-column list. Labels sit in a fixed-width column in the secondary color, and values and labels are 12 pt; only the command and item names are monospaced, at the same size. Nothing repeats the title or subtitle. The rows per card, in order:
    • read: requester (not verified), purpose (not verified), the full command, the directory, what is handed over (Staging API → environment variable X), and the timed scope.
    • create: requester, purpose, contents (name · how it is given to programs), instructions, and the value with Authenticate to View.
    • change and replace: requester, purpose, the changed items with their tags, the instruction diff with a Removed: line (only if changed), the group A → B (only if changed), and the value when new values exist.
    • delete: requester, purpose, the item names.
    • organize: requester, purpose, then one row per step.
  • Expanded Details scroll inside the 640-point cap. While lines are hidden, the edge fades and a scroll bar stays visible, so no line looks cut in half. The panel moves up just enough to stay inside the screen's visible frame (AppDelegate+Approval.swift, display only).
  • A cancelled Touch ID keeps the same buttons in the same order and adds one gray line, and the default never becomes the 30-minute option. Replacing or removing values and merging groups use the red button, which is never the default.
  • The Pending requests list says the card's title sentence. The Show which components change in a modify approval #174 per-component value digests and the Broker, Vault, decisions and authentication are unchanged. Unused card code and strings are removed, including the section views, item headings, byte counts, overflow hints and approval consequences.

Diff stat

git diff --stat origin/main: 27 files changed, 1685 insertions(+), 1887 deletions(-).

  • Sources: 11 files in Sources/AskKeyAppKit/App/, including the new ApprovalDetailsContent.swift and ApprovalDetailsView.swift, the removed FrozenWriteApprovalContent.swift, FrozenOrganizationApprovalContent.swift renamed to FrozenOrganizationSummaryContent.swift, and the panel clamp in AppDelegate+Approval.swift. Also PendingRequestPresentation.swift and Localizable.xcstrings: 66 keys removed, 56 added, and 2 Chinese values changed back to v0.2 (允许 %lld 分钟, %@ 后失效).
  • Tests: 10 App test files and ScreenshotE2ETests.swift.
  • No changes under AskKeyBroker or AskKeyVault.

Tests

swift build passed. On f01ce7a:

swift test --filter "ApprovalDetailsContentTests|ApprovalPromptContentTests|ApprovalCardLayoutTests|FrozenWriteSummaryContentTests|OrganizationApprovalContentTests|ScreenPresentationTests|WorkspaceInteractionTests|LocalizationUnificationTests|LocalizationRemediationTests|Batch4SettingsLanguageTests|WorkspacePrototypeContractTests|AppLanguageCatalogTests|AgentAccessPresentationTests|ReviewLocalizationTests|AgentWriteComponentDigestTests|AgentApprovalPanelTests|BrokerRuntimeRecoveryTests|CredentialWorkspaceExperienceTests|ManagementAuthenticationTests|CredentialEditorComponentTests"

127 run, 0 failed, 0 skipped. Per suite, compared with the tests main declares:

Suite Run (branch) main
ApprovalDetailsContentTests (new) 7 —
ApprovalPromptContentTests 7 7
ApprovalCardLayoutTests 5 6
FrozenWriteSummaryContentTests 12 10
OrganizationApprovalContentTests 5 5
AgentApprovalPanelTests 2 1
AgentWriteComponentDigestTests (#174, unchanged) 2 2
ScreenPresentationTests, WorkspaceInteractionTests 5, 7 5, 7
LocalizationUnificationTests, LocalizationRemediationTests 8, 11 8, 11
Batch4SettingsLanguageTests, WorkspacePrototypeContractTests 6, 7 6, 7
AppLanguageCatalogTests, AgentAccessPresentationTests, ReviewLocalizationTests 6, 10, 2 6, 10, 2
BrokerRuntimeRecoveryTests, CredentialWorkspaceExperienceTests, ManagementAuthenticationTests, CredentialEditorComponentTests 8, 2, 13, 4 8, 2, 13, 4

What the tests cover:

  • testEveryCardShowsItsTitleSubtitleAndButtonsInBothLanguages covers 16 cards, every row of the Restore the v0.2 approval card style for every card #177 table, in English and Simplified Chinese.
  • ApprovalDetailsContentTests asserts the Details labels and values of every card type in both languages. It also checks that no row repeats the title or subtitle, that there is no After you approve row, and that the label column is the same for every card.
  • The cancelled Touch ID test checks that the buttons and the default stay the same. The red-button test checks irreversible actions.
  • The layout tests check the 640-point cap, extreme content, and the order in which Details and long titles give up height. The panel test checks that a taller panel moves up into the visible frame.

Renders: I rendered every card offscreen, collapsed and expanded, in Chinese and English, with the real app icon from a built AskKeyApp.app, and checked each one for mixed sizes, truncation and repetition. The collapsed Chinese read card stays pixel-identical to 425e29e (checked in the previous round; collapsed cards are unchanged in this one).

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.
  • Every changed source file is under 600 lines (largest: AppDelegate+Approval.swift, 332; the largest card file is FrozenAgentApprovalPrompt.swift, 195).
  • CI on f01ce7a (run 37945177683):
    • build-and-test passed: 1106 tests, 3 skipped, 0 failures.
    • basic-ui-flows passed: 15 required flows with 0 failures. All 5 ScreenshotE2ETests passed and all 17 screenshots were exported. Screenshot 13 shows the read Details and screenshot 17 the organize steps scrolled inside the cap.
  • Earlier runs: 37936942390 on 8b2b198, where the optional screenshot step failed because expanded cards pushed the buttons off screen (fixed in ec3209c); and 37940449353 on ec3209c, all green.

Deviations and questions

  • AppDelegate+Approval.swift is outside the original Scope. The planner approved the panel clamp through Orca and updated Restore the v0.2 approval card style for every card #177's Scope.
  • The planner decided these points through Orca:
    • An "other change" that also replaces a value is red and says 旧值将无法找回.
    • The Pending requests list uses the card titles.
    • 删除 is the normal default.
    • Organize is red only when it merges.
    • The Details rework follows the maintainer's rules from review.
  • Details choices beyond the rules:
    • Before approval, read cards know only the variable of a single-item credential, so the handed-over line names the credential (Staging API → environment variable X). A multi-item credential stays unnamed until approval.
    • Changed items show their tag and name only.
    • A new group in a change reads “A” → “B” (new group).
  • CHANGELOG.md (0.3.0) still describes the Make agent approval cards readable at a glance #175 cards. It is outside this issue's Scope, so I left it unchanged; it needs a decision before Build, notarize and publish v0.3.0 #169.
  • Screenshot 15 captures the create card's front, and its Details content is asserted after expanding. Screenshot 17 captures the organize steps inside Details.

sudoHG added 3 commits October 9, 2026 21:26
Every approval card is again the v0.2 read card: the app icon, one bold
sentence that names the requester and the object, one short line under
it, a Details link, the buttons and a small footer. Write and organize
cards use the same layout with their own titles, subtitles and buttons;
the items, tags, instruction diff, group change, organize steps, value
view, requester note and stated purpose move behind Details, which
scrolls inside the 640-point cap so the buttons stay visible.

A cancelled authentication keeps the same buttons in the same order and
adds one gray line, so the default never becomes the 30-minute option.
Irreversible actions (replacing or removing values, merging groups) are
red and never the default. The Pending requests list says the same
sentence as the card title. Card code and strings that became unused are
removed; the per-component value digests are unchanged.

Closes #177
Expanding Details can grow a card from about 300 to 640 points from its
top, which pushed the buttons below a 768-point screen. The panel now
moves up just enough to stay inside the screen's visible frame and stays
where it is when it fits.
Details mixed two layouts and three text sizes, repeated the subtitle in
an "After you approve" paragraph, and cut lines off at the bottom. Every
card now lists fixed rows with a fixed-width label column and 12-point
values: the requester and purpose (both not verified), then per card the
command, directory, what is handed over and the timed scope; the new
items, instructions and value; the changed items with their tags, the
instruction diff, the group change and the value; the deleted items; or
each organize step. Nothing repeats the title or subtitle. When Details
scroll, the hidden edge fades and the scroll bar stays visible.

The write-card section views, item headings, byte counts and the
approval consequences they showed are removed with their strings.
@sudoHG
sudoHG merged commit f18e92b into main Oct 9, 2026
2 checks passed
@sudoHG
sudoHG deleted the sudoHG/177-v02-card-style branch October 9, 2026 14:51
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.

Restore the v0.2 approval card style for every card

1 participant