Skip to content

feat(tui): approve via focus-gated card menu, suspend composer - #284

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/approval-focus
Aug 6, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/approval-focus

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

Approval decisions now flow through a boxed approval card that claims focus when a HITL request arrives. Up/Down select an option, Enter confirms, Esc cancels (= deny). The composer is suspended behind a waiting_border while the approval is pending, and pre-typed text is preserved in place. Typed answers (yes/no/remember) and deny-with-feedback are removed.

Decisions locked in the design grill session:

  • Cancel = Esc = Deny (no new action)
  • FocusBlock::Approval added to the Tab cycle; menu keys only route while the card holds focus, so the operator can Tab away mid-approval (file navigation, panels) and return
  • Composer is not the approval answer input; it dims with a waiting border and keeps existing text
  • Deny-with-note option removed entirely
  • Boxed approval card (not a left-rail accent)
  • Both new palette tokens added to all 5 shipped themes

Changes

  • Focus: FocusBlock::Approval in the cycle; sync_approval_focus claims focus once per new approval (runs from the event loop, never render, so Tab-away isn't re-grabbed)
  • Input: menu keys (Up/Down/Enter/Esc) gated on focus.block == Approval; type_to_compose blocked while pending; stale typed submissions preserve text and show the card hint
  • Render: boxed card with ┌─ ⏸ APPROVAL REQUIRED ─┐, wrapped command, menu rows, and hint ↑↓ select · Enter confirm · Esc cancel; focused border uses approval_accent
  • Composer: waiting state renders waiting_border + dim, hides the placeholder hint, keeps typed text
  • Themes: waiting_border + approval_accent added to forge-config palette model with fallbacks, and to solarized-dark/light, kanagawa-wave, gruvbox-dark, catppuccin-mocha
  • Removed: parse_approval_line/ApprovalAction/InputRoute::ResolveApproval, ApprovalMenuPhase, ApprovalMenuKind::DenyWithNote, ConversationRenderKey::approval_menu_deny_feedback

Tests

  • Menu-driven approval flow rewritten (allow-once, allow-pattern, remember, deny)
  • Tab-away keeps approval pending and menu keys gated; Esc returns focus
  • Card renders in every shipped theme at 100/120 cols with no line overflow
  • Long-command (250 chars) wraps within the card
  • New approval (different call_id) resets menu selection; same-id sync doesn't
  • Shell commands offer no Remember row

Validation

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings clean
  • cargo test --workspace --all-targets --locked green except 3 pre-existing forge-config::permissions failures caused by this machine's real ~/Library/Application Support/forge/permissions.toml (confirmed failing on base commit 5b67c9b, unrelated to this PR)
  • Release build + forge --version OK

Approval decisions now flow through a boxed card that claims focus when an
approval arrives. Up/Down select, Enter confirms, Esc cancels (= deny). The
composer is suspended behind a waiting border with pre-typed text preserved.
Typed answers ("yes"/"no"/"remember") and deny-with-feedback are removed.

- Add FocusBlock::Approval to the Tab cycle; menu keys only route while the
  card holds focus, so operators can Tab away mid-approval.
- Composer shows waiting_border and dims while an approval is pending.
- New palette tokens waiting_border/approval_accent across all 5 shipped
  themes, with config-side fallbacks for older theme files.
- Tests: menu-driven approval flow, Tab-away gating, card render in every
  shipped theme, long-command wrapping, call_id menu-selection reset.
@github-actions
github-actions Bot enabled auto-merge (squash) August 6, 2026 07:09
@github-actions
github-actions Bot merged commit b69b4d1 into main Aug 6, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
Approval decisions now flow through a boxed card that claims focus when an
approval arrives. Up/Down select, Enter confirms, Esc cancels (= deny). The
composer is suspended behind a waiting border with pre-typed text preserved.
Typed answers ("yes"/"no"/"remember") and deny-with-feedback are removed.

- Add FocusBlock::Approval to the Tab cycle; menu keys only route while the
  card holds focus, so operators can Tab away mid-approval.
- Composer shows waiting_border and dims while an approval is pending.
- New palette tokens waiting_border/approval_accent across all 5 shipped
  themes, with config-side fallbacks for older theme files.
- Tests: menu-driven approval flow, Tab-away gating, card render in every
  shipped theme, long-command wrapping, call_id menu-selection reset.
mohitranka added a commit that referenced this pull request Sep 11, 2026
Approval decisions now flow through a boxed card that claims focus when an
approval arrives. Up/Down select, Enter confirms, Esc cancels (= deny). The
composer is suspended behind a waiting border with pre-typed text preserved.
Typed answers ("yes"/"no"/"remember") and deny-with-feedback are removed.

- Add FocusBlock::Approval to the Tab cycle; menu keys only route while the
  card holds focus, so operators can Tab away mid-approval.
- Composer shows waiting_border and dims while an approval is pending.
- New palette tokens waiting_border/approval_accent across all 5 shipped
  themes, with config-side fallbacks for older theme files.
- Tests: menu-driven approval flow, Tab-away gating, card render in every
  shipped theme, long-command wrapping, call_id menu-selection reset.
mohitranka added a commit that referenced this pull request Sep 11, 2026
Approval decisions now flow through a boxed card that claims focus when an
approval arrives. Up/Down select, Enter confirms, Esc cancels (= deny). The
composer is suspended behind a waiting border with pre-typed text preserved.
Typed answers ("yes"/"no"/"remember") and deny-with-feedback are removed.

- Add FocusBlock::Approval to the Tab cycle; menu keys only route while the
  card holds focus, so operators can Tab away mid-approval.
- Composer shows waiting_border and dims while an approval is pending.
- New palette tokens waiting_border/approval_accent across all 5 shipped
  themes, with config-side fallbacks for older theme files.
- Tests: menu-driven approval flow, Tab-away gating, card render in every
  shipped theme, long-command wrapping, call_id menu-selection reset.
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