Repository navigation
chat: stabilize collapse scrolling and simplify tool errors - #337759
Merged
Merged
Conversation
- Prevent completed and stopped responses from retaining empty scroll space by limiting compensation to automatic collapses and bounding it to the viewport. - Keep readers oriented by anchoring below pinned prompts, waiting for deferred collapse content before cleanup, and consuming existing space during manual expansion instead of briefly clamping the scroll position. - Avoid adding padding for manual collapses, while preserving scroll-up intent and selection holds. - Keep failed tool calls visually consistent with normal tool rows: restore the pre-card content renderer and change only the associated neutral error icon. - Add regression coverage and interactive fixtures for animation-frame stability, lifecycle cleanup, sticky prompts, and live/restored tool errors. Validation: 678 tests passed with one pre-existing skip; client type-check, targeted ESLint, Stylelint, and whitespace checks passed. Live component checks verified zero header movement during expansion and neutral error icons across dark, light, and high-contrast themes. Follow-up to #337425. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Failed tools are not exposed accessibly, and denied tools can lose their only error indicator.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Stabilizes chat collapse scrolling and simplifies failed tool-call rendering.
Changes:
- Bounds automatic-collapse scroll reservations and improves cleanup/anchoring.
- Restores normal tool rows for failures with neutral error icons.
- Adds regression tests, accessibility help, and interactive fixtures.
| File | Description |
|---|---|
chatWidget.fixture.ts |
Adds failed-tool fixtures. |
chatScrollAnchoring.fixture.ts |
Adds interactive anchoring scenarios. |
chatListWidget.test.ts |
Expands scroll-reservation coverage. |
chatListRenderer.test.ts |
Tests failed-tool rendering. |
chatToolProgressPart.test.ts |
Tests failure detection and icons. |
chat.css |
Keeps tool-error icons neutral. |
chatListWidget.ts |
Manages bounded scroll reservations. |
chatListRenderer.ts |
Coordinates collapse completion and cleanup. |
chatToolProgressPart.ts |
Restores standard tool-row content. |
chatToolPartUtilities.ts |
Centralizes tool-failure detection. |
chatToolInvocationSubPart.ts |
Selects error icons for failures. |
chatToolInvocationPart.ts |
Applies tool failure styling and icons. |
chatThinkingContent.css |
Suppresses duplicate error icons. |
chatConfirmationWidget.css |
Neutralizes failed-tool confirmation icons. |
chatThinkingContentPart.ts |
Propagates errors into grouped tool icons. |
chatContentParts.ts |
Documents automatic-collapse callbacks. |
chatCollapsibleContentPart.ts |
Excludes manual collapses from reservation. |
chatAccessibilityHelp.ts |
Documents updated behavior. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
- Preserve denial indicators when suppressing duplicate failure icons, without changing the neutral failed-tool presentation. - Keep failures distinguishable to screen-reader users by including error reasons and terminal exit codes in response labels and the Accessible View. - Keep diff totals centered with their disclosure title and use compact chevrons after they move outside the title button. - Cover live and restored tool states, header geometry at multiple font sizes, and interactive failed/denied examples. Validation: affected renderer, tool progress, accessibility, response-model, thinking, and chat-list suites passed; client type-check, targeted ESLint, Stylelint, and whitespace checks passed. Live dark/light and narrow-layout checks confirmed aligned counts and 12px compact chevrons. Refs #337759. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
- Derive the offscreen header target from the preview's measured height instead of assuming the transcript can scroll 600px past it. - Preserve the exact positioning, visibility, bounded-padding, and anchoring checks while covering both initially visible and offscreen headers. The full CI stylesheet set makes the 48-tool preview shorter than in a focused run, clamping the old setup to -541px and failing the same two tests in Electron, Chromium, and WebKit. Validation: reproduced both failures before the change; all 41 collapse-anchoring tests now pass with the full module/stylesheet set in Electron, Chromium, and WebKit, and in the focused Electron runner. Targeted ESLint and git diff --check pass. Refs #337759. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
Justin Chen (justschen)
marked this pull request as ready for review
September 24, 2026 19:49
Justin Chen (justschen)
enabled auto-merge (squash)
September 24, 2026 19:49
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 24, 2026
Justin Chen (justschen)
deleted the
justschen/chat-collapse-scrolling
branch
September 24, 2026 19:51
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

fix #337727
Validation: 678 tests passed with one pre-existing skip; client type-check, targeted ESLint, Stylelint, and whitespace checks passed. Live component checks verified zero header movement during expansion and neutral error icons across dark, light, and high-contrast themes.
Follow-up to #337425.
(Commit message generated by Copilot)
Co-authored-by: Copilot [email protected]