fix(tui): label session-scoped approval honestly, not "always" (#3766)#3773
Conversation
The approval modal's option 2 / `a` maps to `ReviewDecision::ApprovedForSession` and is stored only in the in-memory `app.approval_session_approved` set, yet the compact controls said "always" and the full option said "Approve always for this kind". That is a trust-boundary copy bug: the real cross-session persistence path is the separate `[s]` save-rule action, so users could believe a session-only approval was permanent. - Compact controls now render `[a] session` (en) / `本会话` (zh-Hans). - Full option label is now session-scoped in en/es-419/ja/pt-BR/vi; the zh-Hans/zh-Hant strings already said 本会话/本會話 and are unchanged. - Keyboard hints (`a`, option 2) are unchanged. - Adds `approval_option_two_reads_as_session_scoped_not_always`, asserting both the full and compact paths say "session" and never "always". Fixes #3766
|
Claude finished @Hmbown's task in 1m 13s —— View job PR Review: fix(tui): label session-scoped approval honestly, not "always"
SummaryThis is a correct, well-scoped fix. Option 2 / What's Good
Findings1. Stale identifiers now semantically wrong (not a blocker, but creates future confusion)
2.
3. Regression test uses only the default (
4. No correctness bugs, panics, or unsafe code introduced All changed paths are pure rendering — no fallible operations, no new allocations beyond existing patterns. VerdictReady to merge. The fix is correct and the regression test gives appropriate coverage. The stale |
Summary
Closes #3766. Approval option 2 /
amaps toReviewDecision::ApprovedForSession(stored only in the in-memoryapp.approval_session_approvedset), but the UI said "always" / "Approve always for this kind" — implying permanence. The actual cross-session persistence path is the separate[s]save-rule action. This corrects the copy so the trust boundary is honest.Changes
crates/tui/src/tui/widgets/mod.rs):[a]now renderssession(en) /本会话(zh-Hans) instead ofalways/始终.ApprovalOptionApproveAlways): now session-scoped inen,es-419,ja,pt-BR,vi.zh-Hans/zh-Hantalready said本会话/本會話and are unchanged.a, option 2) unchanged.approval_option_two_reads_as_session_scoped_not_alwaysasserts both full and compact paths say "session" and never "always".Validation
cargo test -p codewhale-tui --bin codewhale-tui approval→ 167 passed (incl.benign_a_two_approves_for_sessionand the new test).Acceptance criteria
benign_a_two_approves_for_sessionstill passes