Skip to content

Make the left panel in play.html scroll independently of the page - #102498

Merged
pamarcos merged 22 commits into
masterfrom
play-html-independent-left-panel-scroll
May 5, 2026
Merged

pamarcos merged 22 commits into
masterfrom
play-html-independent-left-panel-scroll

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Apr 12, 2026 •

Copy link
Copy Markdown
Member

The databases/tables list in the left menu now has its own vertical scrollbar instead of extending the whole page height. The menu is position: sticky so it stays visible when the page is scrolled vertically due to large query results.

The table info balloons (showing size, rows, engine) use position: fixed with JavaScript-based positioning so they are not clipped by the scroll container. The #menu stacking context is above #main so balloons render on top of result table headers and selected cells.

Clicking a table name or a balloon item (size, rows, engine) now scrolls the page to the top so that the query textarea is visible.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The left panel in the web UI (play.html) now scrolls independently, stays visible when the page is scrolled, and clicking a table scrolls to the query area.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.286

The databases/tables list in the left menu now has its own vertical
scrollbar instead of extending the whole page height. The menu is
also sticky so it stays visible when the page is scrolled vertically
due to large query results.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3f3ac40]

Summary: ✅


AI Review

Summary

This PR updates play.html so the left menu scrolls independently, table info balloons remain correctly layered and positioned, and table clicks bring the query area back into view. I did not find blocker or major correctness/safety/performance issues in the final state of the change.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Apr 12, 2026
@alexey-milovidov
alexey-milovidov marked this pull request as draft April 12, 2026 14:53
The table info balloons (showing size, rows, engine) had two issues
after making the left panel scroll independently:
- Vertical position was incorrect because the balloon lacked a proper
  positioning context.
- Balloon was clipped at the right edge of the panel because the scroll
  container clips overflowing content.

Switch the balloon to position: fixed with JavaScript-based positioning
on mouseenter, so it escapes the overflow clipping of the scroll
container. Give #main an explicit stacking context (z-index: 0) so the
balloon from #menu (z-index: 1) renders above result table headers and
selected cells.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@alexey-milovidov
alexey-milovidov marked this pull request as ready for review April 12, 2026 15:20
When clicking a table name or one of the balloon items (size, rows,
engine) sets the query, scroll the page to the top so that the query
textarea is visible.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@pamarcos pamarcos self-assigned this Apr 13, 2026

@pamarcos pamarcos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The left panel vertical scroll works ok, but now the balloon stays fixed at the position and looks weird:

mouse hover, before scrolling

Image

without moving the mouse, after scrolling (using down key)

Image

The balloons use position:fixed and detach from their anchors when
the databases panel is scrolled. Hide them via visibility:hidden on
scroll and restore on the next mouseenter.
@pamarcos

Copy link
Copy Markdown
Member

The left panel vertical scroll works ok, but now the balloon stays fixed at the position and looks weird:

I hope you don't mind that I pushed 0ce3f2c to address it. That's the simplest way I found, but feel free to modify it as needed

alexey-milovidov added a commit that referenced this pull request Apr 13, 2026
… empty columns

The `chassert(!res.empty())` assertion can fire in debug builds when
`getStructureOfRemoteTableInShard` returns empty columns for a local
shard. This can happen due to a race with concurrent DDL operations
(e.g. REPLACE TABLE or lazy storage initialization).

Restore the original defensive behavior that falls through to remote
shards when the local shard returns empty columns.

BuzzHouse (amd_debug) failure:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102498&sha=0ce3f2c0db68a6f6eae31a5cf54636285b1a640c&name_0=PR&name_1=BuzzHouse%20%28amd_debug%29
PR: #102498

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
alexey-milovidov and others added 5 commits April 19, 2026 13:52
Address review on #102498:
the previous listener was attached to `#databases`, but `scroll` events
do not bubble, so scrolls happening elsewhere (page, `#main`, or any
other scroll container) left the `position: fixed` balloon detached
from its anchor. Use a capture-phase listener on `document` so any
scroll triggers the hide.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Comment thread programs/server/play.html Resolved
Track the most recently shown table-info balloon and hide only that one
on scroll, instead of running `querySelectorAll('.table-addendum')` and
updating every balloon on each scroll event. Only one balloon is open
at a time (the one the cursor most recently entered), so this avoids
O(N) work per scroll event when there are many tables.
Comment thread programs/server/play.html Resolved
@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov investigated the hung test on this CI run. TL;DR: single transient timeout on 03809_time64_not_monotonic at the very edge of the amd_msan, WasmEdge time budget — not a chronic flake. Recommend re-trigger over a stabilization PR, but happy to send one if you'd prefer.

What hung

Only one stateless test exceeded its budget: 03809_time64_not_monotonic at 600.21s. The "Some queries hung" entry below it is the post-hook reflecting that single timeout, not a separate test.

Why this is transient, not chronic

CIDB over 90 days for this test:

Why amd_msan, WasmEdge specifically

It is the slowest CI lane by an order of magnitude. For 03809_time64_not_monotonic over the last 30 days on this lane (4,989 passing runs):

  • avg: 121.6s
  • p95: 324s
  • p99: 404s
  • max passing: 563s
  • timeout: 600s

Compare to amd_tsan, parallel: avg 14.8s. Roughly an 8× MSan + WasmEdge tax. The 600s timeout is hit when randomized settings stack unfavorably (this run had merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability 0.85, max_insert_threads 12, etc.) — pushing a normally ~120s test past the wall. Confirmed transient by clickhouse-test --diagnose-random-settings, which re-ran with the same randomized settings and got Runs: 1, Failed: 0, Passed: 1 → Result: All reruns passed. The failure is not reproducible (likely a transient issue).

What I recommend

Retrigger the lane. The test's pass rate is 99.995% and master is clean — there is nothing deterministic to fix.

If you'd still like a stabilization PR (you asked for one), the minimum-disruptive options are:

  1. Reduce LIMIT 100000 → LIMIT 10000 in the INSERT. Still creates 10K granules with index_granularity = 1, which is ample for the binary search in MergeTreeSetIndex to exercise the non-monotonic-Time64 path the test guards against. Would cut amd_msan WasmEdge runtime by ~10×.
  2. Add -- Tags: long to widen the timeout budget on slow sanitizers.

Both weaken the test's coverage slightly (option 1) or expand its CI footprint (option 2). Given the 1-in-195K rate, my preference is to do nothing; option 1 is my second choice if you want a fix. Let me know which you'd like and I'll send the PR.

alexey-milovidov and others added 3 commits April 28, 2026 20:45
#main is the explicit scroll container (overflow: auto in CSS), so
calling document.body.scrollTo(0, 0) is a no-op when content overflows
#main. Switch to scrolling #main so clicking a table or balloon item
reliably brings the query textarea back into view, as the PR description
promises.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai do a stabilization PR, option 2 with tagging the test as "long".

@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov — opened the stabilization PR: #103718

Tags 03809_time64_not_monotonic as long. Single-line change, no test logic touched. Once it lands, the amd_msan, WasmEdge timeouts on the slowest lane stop being a stability concern.

alexey-milovidov and others added 8 commits April 30, 2026 01:58
After scrolling, a different table button can move under a stationary
cursor and trigger the CSS `:hover` rule for its `.table-addendum`.
Because `mouseenter` only fires on actual mouse movement, the JS that
positions the balloon never runs in that case, and the balloon would
appear at its un-positioned default coordinates.

Address review on #102498:
on scroll, set `suppress-balloons` on `body` (in addition to hiding the
currently visible balloon) and clear it on the next `mousemove`. While
the class is set, a higher-specificity CSS rule overrides the hover-
show rule, so no balloon can appear from a hover state that the user
did not establish by moving the cursor.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@pamarcos The original report (balloon staying at the same screen position after scrolling without moving the mouse) was first addressed in 0ce3f2c0db6 (and then refined in 5f144c6f37f and 9eb750e48850): a capture-phase scroll listener on document now hides the visible balloon as soon as any scroll happens (page, #main, #databases, or any other scroll container).

The latest commit 3f3ac40b611 covers a related case I noticed while reviewing your scenario again. After the scroll-hide fires, a different table button can move under the stationary cursor and trigger the CSS :hover rule for its .table-addendum. Because mouseenter only fires on actual mouse movement, the JS that positions the balloon would not run, and the new balloon would appear at its un-positioned default coordinates. The new commit sets suppress-balloons on body until the next mousemove, with a CSS rule that overrides hover-show while the class is present, so no balloon can appear from a hover state the user did not establish by moving the cursor.

Could you re-test and let me know if the behaviour now matches what you'd expect?

@pamarcos pamarcos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it works perfect according to my tests. Ship it 🚀

@pamarcos
pamarcos added this pull request to the merge queue May 5, 2026
Merged via the queue into master with commit 8b8a237 May 5, 2026
165 checks passed
@pamarcos
pamarcos deleted the play-html-independent-left-panel-scroll branch May 5, 2026 14:29
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label May 5, 2026
pull Bot pushed a commit to stnxo2023/ClickHouse that referenced this pull request May 14, 2026
Adds the `long` tag to opt this test into the long-test budget,
bypassing the 600s timeout that occasionally hits on the slowest CI
lane (`amd_msan, WasmEdge`, ~8x slower than `amd_tsan`).

Per @alexey-milovidov directive on PR ClickHouse#102498:
ClickHouse#102498 (comment)

Triage data: 195,745 runs over 90 days, 10 timeouts (99.995% pass rate),
p99 = 404s, max passing = 563s. Pure transient timeout on the slow
lane — `long` tag is the right fix per existing precedents
(`01049_join_low_card_bug_long`, `01516_drop_table_stress_long`,
`01443_merge_truncate_long`).

No test logic changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants