fix(web-ui): auto-collapse completed tail tool cards - #1910
Merged
Conversation
- Explain why the change is needed: completed ExecCommand and Write cards could remain expanded while the next model response was delayed, making users think the command was still running. - Add a shared 800 ms completion-preview grace period with one-shot timers. - Apply the behavior to ExecProcess, Terminal, and file-operation cards. - Preserve typewriter reveals and add timer-based regression coverage.
- Update the scroll-stability document to match the current coordinator, follow-output, collapse, and completion-preview implementations. - Add local FlowChat instructions requiring stability documentation review before changes and focused automated verification afterward. - Document the motivation: prevent competing scroll writers and stale guidance from reintroducing flashes, header drops, tail whitespace, and ownership races. - Require users to perform the complex manual viewport regression scenarios, since agents cannot reliably validate timing-sensitive interactive behavior.
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.
Summary
Prevent completed tail tool cards from staying expanded indefinitely when the next model response is delayed.
Type and Areas
Type: Bug fix / UI/UX / test
Areas: Web UI, FlowChat tool cards
Motivation / Impact
Completed ExecCommand and Write cards previously remained expanded until another renderable conversation item arrived. If the next model response took a while, the UI could make users think the command was still executing.
This change adds a shared 800 ms completion-preview grace period. Cards remain visible briefly for a stable completion transition, then collapse automatically if no newer item arrives. Newer content still collapses them immediately, user-manual expansion remains respected, and Write/Edit typewriter reveals are allowed to finish before the timer starts.
Verification
pnpm --dir src/web-ui run lintpnpm run type-check:webpnpm --dir src/web-ui run test:run src/flow_chat/tool-cards/ExecProcessToolCardView.test.tsx src/flow_chat/tool-cards/FileOperationToolCard.test.tsxReviewer Notes
useToolCardCompletionGracePeriod.TOOL_CARD_COMPLETION_PREVIEW_GRACE_MSand currently set to 800 ms.Checklist