← Back to Pull requests

Chat: minimize approval and question cards to a pill (closes #559) #561

Closed
unknown closed this pull request without merging on Nov 27, 2026 21:50 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 15:50 UTC
Author

What and why

An open approval or question card covers much of the chat. This adds a down arrow in the card's top-right corner that minimizes it to a small pill, so the chat behind it can be read and scrolled. The pill says what waits ("Approval needed" or "Question waiting", plus "+N more" when others are queued) and has an up arrow; a tap anywhere on it brings the card back. Answering stays on the card only: the pill has no answer buttons, and on the desktop Enter / Esc don't answer while it's a pill.

What the user started is kept across minimize and restore: the picked choices (single and multi-select), the typed text and which question of a batch was in view. That state now lives in a small ClarifyDraft held by the panel per request, instead of inside the card's content.

closes #559

A new request while minimized

The card opens again whenever a request arrives that wasn't open when it was minimized, so a new approval or question is never hidden behind a pill. The oldest request still goes first, now with the new one counted. A request answered elsewhere (another client, a notification) while it's a pill leaves the pill in place, showing the next one that was already queued.

An approval brought back from the pill keeps its existing short arming delay, so the tap on the pill can't land on Allow once.

Scope

  • Approvals and clarify questions only. Sudo passwords, secrets, vault codes and "save login" cards have no minimize: they are short, and a hidden password prompt is easy to forget.

  • Shared code (InputRequestPanel in shared/ui), so it applies to the Android chat and the desktop chat and assistant panel alike. No gateway calls change.

  • The minimize button is the design system's IconButton (48 dp touch target, "Minimize" content description, tooltip on the desktop). The pill is at least 48 dp tall, is one button for a screen reader ("Approval needed", action "Expand"), and uses the card's own soft ring and surface colours in both themes.

  • New strings in all seven locales; ROADMAP item added under Interactive requests.
  • How I tested it

  • MinimizedRequestTest (commonTest): when the panel is a pill: only after minimize, not after a new request, still after one answered elsewhere, never for a password in front, nothing for no request.

  • MinimizeRequestCardTest (Robolectric, 360 dp): an approval minimizes to a pill that hides its answers and comes back; a two-question batch with a choice picked and text typed in the second question comes back on the second question with the text, and Send sends both answers; a new request while minimized opens the card with "+1 more"; one answered elsewhere keeps the pill; a password card has no minimize.

  • Locally: :shared:ui:testAndroidHostTest, :shared:ui:jvmTest (includes StringCatalogueTest), :androidApp:lintDebug, :androidApp:assembleDev and :desktopApp:compileKotlinJvm pass.

  • On an emulator with the minified Dev build against a throwaway Hermes 0.23.4 gateway (webapp listener) whose fake model calls terminal and clarify, so the gateway raised a real approval and a real two-question clarify: minimized and restored each, light theme at the default width, and the multi-select question in dark theme at 360 dp (wm density 480). The choices and text came back, and the answer reached the gateway.

  • Not checked by hand: the desktop window (built only) and the legacy dashboard path (the panel doesn't depend on it).
  • Screenshots

    Test gateway and a scripted fake model; no real chats.

    | Approval card | Minimized | Restored |
    | --- | --- | --- |
    | !Approval card with the down arrow in its corner | !The approval as an "Approval needed" pill with the chat readable above | !The approval card back |

    | Question, answer started | Minimized | Restored with the choice and text |
    | --- | --- | --- |
    | !Question with "dev" picked and text typed | !The question as a "Question waiting" pill | !The question back with "dev" and the text kept |

    | Dark, 360 dp: multi-select | Minimized | Restored with both picks |
    | --- | --- | --- |
    | !Multi-select question with two boxes ticked, dark theme | !Dark "Question waiting" pill | !Dark question back with both picks |

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Giton22 Review duration: 360m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #561"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%