Repository navigation
Fix horizontal scroll reset in Web UI when clicking a link in a table cell - #108941
Merged
Merged
Conversation
… cell In the Web UI (`play.html`), selecting a result cell called `this.focus()` on the whole `query-result` element. Because that element spans the full width with its left edge at the start of the scroll container, the browser scrolled it into view both on `focus` and when the tab was re-focused (e.g. after opening a cell link in a new tab and returning), resetting the horizontal scroll position back to the left. Focus the selected cell instead. Every scroll-into-view now targets the cell, which is already at the scrolled position, so the horizontal scroll is preserved. Keyboard navigation still works because `keydown` bubbles from the focused cell to the listener on the component. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [1ad7652] Summary: ✅
AI ReviewSummary
PR Metadata
### Changelog category (leave one):
- Bug Fix (user-visible misbehavior in an official stable release)Missing context / blind spots
Final Verdict
|
The previous commit added a CSS comment containing backticks (`.td-selected`) inside the `this.shadowRoot.innerHTML = ` template literal of `QueryResultElement`. A backtick inside a template literal terminates the string, so the parser closed the template early and read the following text as JavaScript, throwing `selected is not defined` in the constructor. This aborted construction of every `query-result` element, so all queries failed in the Web UI (followed by a cascading `Cannot read properties of undefined (reading 'firstChild')` in `_clearElement`). Drop the backticks from the comment. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Member
Author
|
Continue-PR status (no code changes) — head Review state: AI Review verdict is ✅ Approve, 0 unresolved review threads, human/AI reviews clean. The only AI note is the changelog-category suggestion ( Both CI reds are unrelated flakes — this is a static
Re-triggered both failed stress jobs (run |
alexey-milovidov
added a commit
that referenced
this pull request
Jul 1, 2026
…-arrow-nav Resolve the conflict in `programs/server/play.html` between this branch's keyboard-navigation work and master's Web UI changes that landed in the same area (`#108891` table count, `#108941` horizontal-scroll fix). Both branches independently extracted the result-table cell-selection logic into a `_selectCell` method, so the merge left two definitions. Keep master's `_selectCell` (it additionally focuses the cell with `td.focus({ preventScroll: true })` and manages a roving `tabindex`, which fixes the horizontal-scroll reset from `#108941`) and drop this branch's duplicate, which was a strict subset. The result-table keydown handler is attached to the host element and reads `_current_selected_cell`, so master's per-cell focus composes correctly with the arrow-key navigation added here. At the arrow-move call site, keep master's `cell.removeAttribute('tabindex')` before `_selectCell(new_cell)` to maintain the roving tabindex. All of master's additions (`.database-table-count`, `td:focus { outline: none }`, the table-count feature in `loadTables`/`loadDatabases`) and all of this branch's features (database-panel arrow navigation, focused-row balloon, toolbar/theme keyboard access, download-menu tab sequence) are preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 1, 2026
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…tal-scroll-link Fix horizontal scroll reset in Web UI when clicking a link in a table cell
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…-arrow-nav Resolve the conflict in `programs/server/play.html` between this branch's keyboard-navigation work and master's Web UI changes that landed in the same area (`ClickHouse#108891` table count, `ClickHouse#108941` horizontal-scroll fix). Both branches independently extracted the result-table cell-selection logic into a `_selectCell` method, so the merge left two definitions. Keep master's `_selectCell` (it additionally focuses the cell with `td.focus({ preventScroll: true })` and manages a roving `tabindex`, which fixes the horizontal-scroll reset from `ClickHouse#108941`) and drop this branch's duplicate, which was a strict subset. The result-table keydown handler is attached to the host element and reads `_current_selected_cell`, so master's per-cell focus composes correctly with the arrow-key navigation added here. At the arrow-move call site, keep master's `cell.removeAttribute('tabindex')` before `_selectCell(new_cell)` to maintain the roving tabindex. All of master's additions (`.database-table-count`, `td:focus { outline: none }`, the table-count feature in `loadTables`/`loadDatabases`) and all of this branch's features (database-panel arrow navigation, focused-row balloon, toolbar/theme keyboard access, download-menu tab sequence) are preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
When a result cell contained a link and the table was scrolled horizontally to the right, clicking the link (which opens in a new tab) and returning to the Web UI reset the horizontal scroll position back to the left.
The cause: selecting a cell called
this.focus()on the wholequery-resultelement. That element spans the full width with its left edge at the start of the scroll container, so the browser scrolled it into view both onfocusand when the tab was re-focused on return, resetting the horizontal scroll.The fix focuses the selected cell itself instead. Every scroll-into-view now targets the cell, which is already at the scrolled position, so the horizontal scroll is preserved. Keyboard navigation still works because
keydownbubbles from the focused cell up to the listener on the component.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed the horizontal scroll position of the result table being reset in the Web UI when clicking a link in a cell and returning to the page.
Documentation entry for user-facing changes
Version info
26.7.1.309(included in26.7and later)