feat(chat-scrolling): Add visual navigation markers for quick access …#3979
Open
entitycs wants to merge 2 commits into
Open
feat(chat-scrolling): Add visual navigation markers for quick access …#3979entitycs wants to merge 2 commits into
entitycs wants to merge 2 commits into
Conversation
50451a4 to
9a9921e
Compare
…to user message within chat windows.
- Introduces a new chatUserScrollMarker.js module that renders clickable indicators along the scrollbar gutter representing each of my responses in current sessions.
The component uses absolute positioning and event listeners so you can tap any marker to view the associated message instantly (no scroll needed).
New Features:
• New 'scroll-marker-track' element overlaying content area, containing per-message markers styled as thin vertical lines or pills
- Respects theme colors via CSS custom properties for consistent styling across themes.
The module includes ResizeObserver and MutationObserver handlers to adapt layout changes without page reloads.
Tech Implementation Details:
• New scroll-markers are placed at half-way points between the viewport centerline when each user message would be in view (calculating relative positions based on getBoundingClientRect).
- Use 'pointer-events: none' for container but enable click handling per-marker via CSS classes.
Includes fallback to document.documentElement querySelector('#scroll-container') if shadowRoot not present.
Note: Proposed Changes:
• This commit introduces a root level js file. Proposal would be to refactor chatRenderer.js, and eventually place this file into /static/js/chat/render/userMessageScrollMarker.js; or to use some similar structure / convention down the road.
9a9921e to
1bfe2c6
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…to user message within chat windows.
I often find myself needing to find code I've pasted or questions I've asked in previous chats - either to find my place, ask them again, or feed them to a different model. This makes finding such artifacts much easier.
I chose marking user messages over marking assistant responses. This is because user messages are often shorter and (imo) better for re-aligning oneself within a conversation that has either gone stale or one that is relatively long-winded.
Note: Proposed Changes:
• This commit introduces a root level js file. Proposal would be to refactor chatRenderer.js, and eventually place this file into /static/js/chat/render/userMessageScrollMarker.js; or to use some similar structure / convention down the road.
Summary
Created to assist with ease of use and accessibility. Modifies style.css, and the minimal additions to render as a standalone module (sw.js, index.html). Adds new 'scroll-marker-track' element overlaying chat-container content area. Scroll track contains per-user-message markers styled as thin vertical lines or pills. Respects theme colors via CSS custom properties for consistent styling across themes. The module includes ResizeObserver and MutationObserver handlers to adapt layout changes, along with window resizes.
Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Closes #3878
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
docker compose up -d --buildand navigating to the app eg.,http://localhost:7000*These are all tests that I've carried out on the following browsers on Windows (latest as of posting): Brave, Chrome, Edge, Comet, Zen. Untested: Firefox, et.al.
Note that the accuracy of alignment varies some per browser, but please report if you experience a noticeable misalignment. I am unaware of any reliable way to measure each browser's implementation of scrollbar arrows and scrollbar handle sizing without using some generic formulas / average values.
Visual / UI changes — REQUIRED if you touched anything that renders
Anything that changes what the UI looks like — buttons, icons, padding, colors, fonts, spacing, layout, CSS, HTML, SVG, or any
static/js/module that draws to the DOM — needs all of the following. PRs that change rendering without these WILL be closed.--red,--fg,--bg,--card,--border, etc.) — do not introduce new color values, font sizes, or spacing units.static/index.html) or plain text.Fira Code) for primary UI text. Don't override.Screenshots / clips