Skip to content

fix(vscode): restore chat turn spacing broken by virtualizer#9141

Open
marius-kilocode wants to merge 2 commits intomainfrom
orange-soup
Open

fix(vscode): restore chat turn spacing broken by virtualizer#9141
marius-kilocode wants to merge 2 commits intomainfrom
orange-soup

Conversation

@marius-kilocode
Copy link
Copy Markdown
Collaborator

@marius-kilocode marius-kilocode commented Apr 17, 2026

Summary

  • The prior spacing fix (fix(vscode): restore chat tool spacing #9025) relied on flex gap on .message-list-content, but perf(vscode): paginated message loading with virtualized scroll #8911 introduced virtua's Virtualizer which positions items absolutely based on measured box size — so gap no longer applied between turns.
  • The missing spacing was most visible when the last assistant part was a sub-agent's expanded task tool (two bordered boxes with 0px between them, per user report).
  • Bakes the 12px into each turn's own padding-bottom so virtua measures it as part of the item height. This uniformly restores spacing for all turn terminators (text, bash, todos, diffs, subagents, errors).
  • Adds a Storybook story (MessageList — sub-agent to queued user spacing) that reproduces the failing case.

Before:

image image

After:
image
image

The prior spacing fix (#9025) relied on flex `gap` on `.message-list-content`,
but #8911 introduced virtua's `Virtualizer` which positions items absolutely
based on measured box size — so `gap` no longer applies between turns. The
missing spacing was most visible when the last assistant part was a sub-agent's
expanded task tool (two bordered boxes with 0px between them). Bake the 12px
into each turn's own padding so virtua measures it as part of the item height.
@marius-kilocode marius-kilocode enabled auto-merge (squash) April 17, 2026 15:49
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Apr 17, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx 407 New visual-regression story does not populate the child sub-agent session, so the expanded task body never renders and the reported spacing bug is not actually covered by the baseline.

Fix these issues in Kilo Cloud

Other Observations (not in diff)

No additional issues outside the diff.

Files Reviewed (5 files)
  • .changeset/vscode-subagent-spacing.md - 0 issues
  • packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/chat/message-list-subagent-to-queued-user-spacing-chromium-linux.png - 0 issues
  • packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/composite-webview/diff-summary-collapsed-chromium-linux.png - 0 issues
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/styles/chat-layout.css - 0 issues

Reviewed by gpt-5.4-20260305 · 409,010 tokens

Comment thread packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx
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