Skip to content

fix(web-ui): auto-collapse completed tail tool cards - #1910

Merged
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:dev2
Jul 30, 2026
Merged

fix(web-ui): auto-collapse completed tail tool cards#1910
wsp1911 merged 2 commits into
GCWing:mainfrom
wsp1911:dev2

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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 lint
  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run src/flow_chat/tool-cards/ExecProcessToolCardView.test.tsx src/flow_chat/tool-cards/FileOperationToolCard.test.tsx
  • Result: lint passed, type-check passed, 20 focused tests passed.

Reviewer Notes

  • The grace period is centralized in useToolCardCompletionGracePeriod.
  • The duration is configured by TOOL_CARD_COMPLETION_PREVIEW_GRACE_MS and currently set to 800 ms.
  • Collapse transitions continue to use the existing tool-card height contract.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above.
  • No user-facing strings or locale resources were changed.

wsp1911 added 2 commits July 31, 2026 01:17
- 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.
@wsp1911
wsp1911 merged commit b740103 into GCWing:main Jul 30, 2026
4 checks passed
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