feat(cards): cap height + collapsible inline approval/ask/path-grant cards#85
Merged
Conversation
…cards The inline ask_user / permission / path-grant cards rendered in-flow at the end of the conversation with no max-height and no overflow, so a long prompt or several stacked cards grew unbounded and — with auto-scroll to bottom — swallowed the viewport, hiding the conversation (the F9 report). Keep them embedded in flow (the right model: the decision needs its conversation context) and bound them instead: - Each card body is capped at min(60vh, 600px) and scrolls internally past the cap, so it can never fully cover the conversation. Action buttons live inside and are reachable by scrolling within the card. - A collapse toggle in each card header squishes the body to a one-line summary (the command / the path / the question) so the user can peek at the conversation behind a pending card, then expand to act. Default expanded; AskUserPanel resets to expanded per new request. All frontend, no backend change. Adds collapse regression tests for the AskUserPanel and InlineApprovalCard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the inline approval / ask_user / path-grant cards behave well when
they're tall or stacked. Each card now:
min(60vh, 600px)with internal scrolling, so a longask_userprompt (or three cards stacked) can no longer swallow theconversation.
▾/▸to squish the body to aone-line summary so the user can peek at the conversation behind a
pending card, then expand to act.
Default state is expanded (the card is waiting for an action).
ask_userauto-resets to expanded on each new question; the list cards track collapse
per
requestIdso flipping workspace or re-issuing doesn't lose state.Why
F9 surfaced in the Windows QA doc: inline cards had no
max-heightand nointernal
overflow, so anask_userwith eight long options, or severalcards stacked, grew unbounded and pushed the conversation out of view.
The fix keeps the cards embedded in the conversation flow (where they
already are — that's the right model for "decisions need conversation
context") and fixes the actual defect: unbounded growth. I deliberately
did not float/minimize them away from their context.
Where it lives
src/components/AskUserPanel/AskUserPanel.tsxsrc/components/AskUserPanel/AskUserPanel.module.csssrc/components/InlineApprovalCard.tsxsrc/components/InlineApprovalCard.module.csssrc/components/InlinePathGrantCard.tsxsrc/components/InlinePathGrantCard.module.cssTests
AskUserPanel,InlineApprovalCard).tsc/eslint --max-warnings 0/vitest(128, +2) /vite buildall clean on the linux-latest branch CI (Check & Build).Manual verification (since F9 is a visual concern)
Tested locally on the branch — three card shapes:
ask_user— long question + 8 long options renders capped, scrollinternally, header toggle hides the body and shows the question summary.
curlinvocation triggers the approval card; cap +collapse work; after approval the command runs (exit 7 here, expected).
same as
InlineApprovalCard(same CSS hooks).Heads-up for future readers
bash_execpolicyfull(everything allowed) does not produce a cardfor an unknown binary — the shell just returns "not found" before any
permission gate can intercept. To exercise the approval card during manual
testing, run something the policy actually gates (network access,
confirm-required prefix, sensitive path read). This is true on every
release, not introduced here.
Not in this PR (deliberate follow-ups)
A "pending action" pill pinned near the composer that appears only when a
pending card is scrolled out of view — covers the one scenario embedding
doesn't handle on its own. Worth a separate PR if you find yourself
scrolling past waiting prompts often.