Skip to content

fix(flow-chat): stabilize tool card collapse behavior - #2367

Merged
wsp1911 merged 3 commits into
GCWing:1.0.0-explorefrom
wsp1911:refine-flowchat-space
Aug 18, 2026
Merged

fix(flow-chat): stabilize tool card collapse behavior#2367
wsp1911 merged 3 commits into
GCWing:1.0.0-explorefrom
wsp1911:refine-flowchat-space

Conversation

@wsp1911

@wsp1911 wsp1911 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Keep completed Write and Edit cards on their compact preview throughout
    automatic collapse.
  • Keep TodoWrite cards collapsed during streaming and status updates until
    explicitly expanded by the user.
  • Add focused regression coverage for both behaviors.

Type and Areas

Type:

Regression fix / UI/UX / test

Areas:

Web UI / FlowChat tool cards

Motivation / Impact

Completed file cards could briefly switch from the compact preview to the
larger diff preview before collapsing. Tail-follow interpreted this transient
height increase as new output and moved earlier chat content upward.

File cards now retain their compact preview from the first completed render
through collapse unmount. Manually expanded cards still show the full diff
preview.

TodoWrite cards previously remained expanded while all tasks were pending.
They now stay collapsed throughout streaming and task-status updates. Expansion
changes only in response to an explicit user click.

Verification

Passed:

  • pnpm --dir src/web-ui exec vitest run src/flow_chat/tool-cards/FileOperationToolCard.test.tsx src/flow_chat/tool-cards/useToolCardHeightContract.test.tsx --pool=threads --maxWorkers=1
    • 2 test files, 16 tests passed
  • pnpm --dir src/web-ui exec vitest run src/flow_chat/tool-cards/TodoWriteDisplay.test.tsx src/flow_chat/tool-cards/useToolCardHeightContract.test.tsx --pool=threads --maxWorkers=1
    • 2 test files, 4 tests passed
  • Targeted ESLint checks for FileOperationToolCard.tsx and
    TodoWriteDisplay.tsx
  • git diff --check

Not run:

  • Post-change manual UI verification
  • Remote scenario verification; these changes affect only local presentation
    state and do not change transport or persisted data contracts

Reviewer Notes

The file-card fix intentionally changes preview selection rather than adding
scroll compensation or modifying the FlowChat follow/hold rules. This prevents
the transient height from entering viewport geometry in the first place.

TodoWrite no longer has an automatic expansion state. User-selected expansion
is preserved across subsequent streaming updates.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Keep auto-managed completed file cards on the compact preview from
the first completed render through collapse unmount.

This prevents transient expanded diff height from advancing the
tail-follow target and moving earlier chat content upward. Preserve
the full diff preview for manually expanded cards and cover both
completion and collapse transitions in tests.
Keep TodoWrite cards collapsed while tasks stream or change status.
Preserve expansion only after an explicit user toggle and cover the
behavior with focused interaction tests.
Register workspace menu, option, divider, and active state descriptors
so the Appearance contract audit recognizes the existing DOM markers.
@wsp1911
wsp1911 merged commit 5dc9ddf into GCWing:1.0.0-explore Aug 18, 2026
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