fix(tool-card): collapse sub-agent tree with parent chevron#3140
Conversation
During streaming, assistant messages rendered raw text instead of formatted markdown. Users saw literal table pipes, bold markers, and code spans until the turn completed, at which point everything snapped into formatted markdown in one jump. Now Markdown runs on every token. The component already uses useDeferredValue internally, so the cursor and scroll update at high priority while the expensive markdown parse catches up in idle frames - no layout jitter, no visual jump on completion. This is a focused re-do of esengine#3140, scoped to Message.tsx only. The ToolCard collapse and Go backend changes from the original PR are split into separate PRs.
3096fd8 to
1ed1540
Compare
|
Update: This PR has been rebased on the latest What changed vs the original #3140
Cursor placementThe cursor renders as a sibling after Relationship to #3337This PR achieves the same goal as #3337 but is rebased on the current |
|
#3444 ("render markdown in real time during streaming") just merged and overlaps heavily with this PR — they conflict now. If #3444 already covers the streaming-markdown part, feel free to close this; otherwise please rebase onto latest main-v2 and resolve (keeping only the sub-agent-tree-collapse delta that #3444 doesn't have). Thanks! |
The parent task tool card chevron only toggled args/output visibility;
nested sub-agent calls (read_file / grep / ls from an /explore run)
always rendered underneath. A 50-step /explore flooded the transcript
with its full step list, with no way to fold it back.
Now the open state also controls nested items. A single chevron click
collapses or expands the whole subagent tree. Behavior:
- Open by default while the sub-agent is still "running" so the user
can watch progress.
- Closed by default once it settles, so a finished explore folds to
a single summary line ("12 steps") on first paint.
- Individual sub-calls can still be expanded/collapsed independently.
This is the ToolCard half of the original esengine#3140. The streaming-markdown
half has been merged via esengine#3444.
1ed1540 to
a194f80
Compare
|
@esengine Done. #3140 is now scoped to only the ToolCard collapse (+10/−3 in Changes: the |
|
哥们你是做了我的markdown渲染的问题是吗? |
esengine
left a comment
There was a problem hiding this comment.
Nested sub-agent calls now fold under the parent chevron (open while running, collapsed once settled). Good fix for /explore flooding the transcript.
Summary
The parent task tool card's chevron only toggled args/output visibility; nested sub-agent calls (read_file / grep / ls from an /explore run) always rendered underneath. A 50-step /explore flooded the transcript with its full step list, with no way to fold it back.
This is the ToolCard half of the original #3140. The streaming-markdown half has been merged via #3444.
Fix
The
openstate now also controls nested items. A single chevron click collapses or expands the whole subagent tree:runningso the user can watch progress.Diff
Scope
ToolCard.tsx(+10 / −3)Verification
pnpm typecheck✅ cleanvite build✅ built in 28.58s