Repository navigation
Chat: align scroll-to-latest with the session activity bar - #343220
Lee Murray (mrleemurray) wants to merge 3 commits into
Conversation
Match the floating control to the activity bar and align it in the chat gutter. Keep it clickable above the prompt timeline and avoid clipping or overlap as the activity bar moves or the transcript shrinks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
6 open issues
applyPosition()(and the downstreamupdateScrollDownButtonPosition()call) now runs on every… · NewResizeObserver+MutationObservercan fire in bursts, and calling… · Newgap = 8is a hard-coded spacing value that is also asserted in tests (e.g., expecting an 8px… · NewgetBoundingClientRect()values can vary by 0–1px due to rounding/subpixel layout differences… · NewgetBoundingClientRect()values can vary by 0–1px due to rounding/subpixel layout differences… · New This test asserts several CSS values viaelement.style.*, which is brittle because (a) production… · New
What changed in this PR
Updates the chat “scroll-to-latest” control to visually align with the session activity bar and ensures it remains visible/clickable around overlapping UI (activity bar + prompt timeline), with added regression tests.
Changes:
- Restyles the scroll-to-latest button (rounded-square, new colors/shadow, hover behavior) and updates labeling/icon usage.
- Exposes the scroll-down button DOM node through widget/view layers so the session activity bar can reposition it when overlapping.
- Adds browser tests covering activation (click/keyboard), overlap avoidance, resize fallbacks, and hit-testing.
| File | Description |
|---|---|
| src/vs/workbench/test/browser/componentFixtures/chat/chatWidget.fixture.ts | Expands fixture theme coverage for the scroll-to-latest control. |
| src/vs/workbench/contrib/chat/test/browser/widget/chatListWidget.test.ts | Adds activation + styling assertions for the scroll-to-latest button. |
| src/vs/workbench/contrib/chat/browser/widget/media/chat.css | Restyles the scroll-to-latest button dimensions, radius, and hover visuals. |
| src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts | Exposes scroll-down button DOM node from ChatWidget. |
| src/vs/workbench/contrib/chat/browser/widget/chatListWidget.ts | Updates button label/icon/theme styles and exposes the underlying DOM node. |
| src/vs/sessions/test/browser/sessionActivityBar.test.ts | Adds tests for overlap avoidance, fallback placement, and pointer hit-testing. |
| src/vs/sessions/test/browser/chatGroupsView.test.ts | Updates test expectations around transcript alignment (removes scroll-down positioning assertion). |
| src/vs/sessions/contrib/chat/test/browser/sessionActivityBar.fixture.ts | Wires the list widget’s scroll-down node into the activity bar fixture. |
| src/vs/sessions/contrib/chat/test/browser/chatView.test.ts | Adds hit-testing test vs prompt timeline rail + alignment tests vs activity bar gutter. |
| src/vs/sessions/contrib/chat/browser/media/chatView.css | Aligns scroll-down button inset to activity bar and raises z-index above the timeline rail. |
| src/vs/sessions/contrib/chat/browser/chatView.ts | Exposes scroll-down button DOM node from ChatView. |
| src/vs/sessions/browser/parts/sessionView.ts | Passes the visible view’s scroll-down button to the standalone activity bar during layout. |
| src/vs/sessions/browser/parts/sessionActivityBar.ts | Adds observers + translate-based repositioning to avoid overlap with the activity bar. |
| src/vs/sessions/browser/parts/media/chatGroupsView.css | Removes older split-chat scroll-down positioning rule (now handled elsewhere). |
| src/vs/sessions/browser/parts/chatView.ts | Adds a default scrollDownButtonDomNode getter to the abstract view. |
| src/vs/sessions/browser/parts/chatGroupView.ts | Passes current view’s scroll-down button to the session activity bar during layout. |
Review effort: Lite
Skip geometry reads for hidden or detached controls and batch observer notifications with the shared animation-frame scheduler. Name the collision gap and stabilize gap and computed-style coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c9b711a
Screenshot ChangesBase: Changed (33)
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
6 open issues
updateScrollDownButtonPosition()performs layout reads (getBoundingClientRect) and is called… · NewupdateScrollDownButtonPosition()performs layout reads (getBoundingClientRect) and is called… · NewupdateScrollDownButtonPosition()performs layout reads (getBoundingClientRect) and is called… · NewupdateScrollDownButtonPosition()performs layout reads (getBoundingClientRect) and is called… · New UsingkeyCodeinKeyboardEventinit is non-standard/deprecated and may be ignored by some… · New The constant namechatScrollToBottomIconconflicts with the updated user-facing label ('Scroll to… · New
6 resolved since last review
This test asserts several CSS values viaelement.style.*, which is brittle because (a) production…getBoundingClientRect()values can vary by 0–1px due to rounding/subpixel layout differences…getBoundingClientRect()values can vary by 0–1px due to rounding/subpixel layout differences…gap = 8is a hard-coded spacing value that is also asserted in tests (e.g., expecting an 8px…ResizeObserver+MutationObservercan fire in bursts, and calling…applyPosition()(and the downstreamupdateScrollDownButtonPosition()call) now runs on every…
Review effort: Lite
Use the per-button animation-frame scheduler for attachment, layout and drag collision updates. Verify coalescing across every update source, synthesize keyboard events without relying on legacy constructor fields, and align the icon constant name with scroll-to-latest semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3fc83a7



Summary
Issues addressed
Validation
All commands below passed against the final source changes. Existing successful results were reused where their inputs were unchanged.
npm run build-fast -- --client-only./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/widget/chatListWidget.test.ts --run src/vs/sessions/test/browser/chatGroupsView.test.ts --run src/vs/sessions/contrib/chat/test/browser/chatView.test.ts --run src/vs/sessions/test/browser/sessionActivityBar.test.ts --run src/vs/sessions/test/browser/sessionView.test.ts --reporter dotnpm run typecheck-clientnpm run eslint -- src/vs/sessions/browser/parts/chatGroupView.ts src/vs/sessions/browser/parts/chatView.ts src/vs/sessions/browser/parts/sessionActivityBar.ts src/vs/sessions/browser/parts/sessionView.ts src/vs/sessions/contrib/chat/browser/chatView.ts src/vs/sessions/contrib/chat/test/browser/chatView.test.ts src/vs/sessions/contrib/chat/test/browser/sessionActivityBar.fixture.ts src/vs/sessions/test/browser/chatGroupsView.test.ts src/vs/sessions/test/browser/sessionActivityBar.test.ts src/vs/workbench/contrib/chat/browser/widget/chatListWidget.ts src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts src/vs/workbench/contrib/chat/test/browser/widget/chatListWidget.test.ts src/vs/workbench/test/browser/componentFixtures/chat/chatWidget.fixture.tsnpm run stylelint -- src/vs/sessions/browser/parts/media/chatGroupsView.css src/vs/sessions/contrib/chat/browser/media/chatView.css src/vs/workbench/contrib/chat/browser/widget/media/chat.cssnpm run valid-layers-checkgit diff --checkgit commit(pre-commit hygiene hook)gh pr checks 343220 --repo microsoft/vscodeManual checks
Visual evidence
Manual attachment pending: the author requested one combined image to upload manually:
scroll-control-before-after.png. No hosted image is attached yet.The image contains comparable before/after captures in dark and light themes: the same
WorkspaceChatfixture, 640 x 500 surface, seed conversation, and scroll position (100). Component Explorer rendered both fixtures successfully on the detached merge base2deba53c562and this branch. The temporary baseline worktree was removed after capture.Review status