Skip to content

Add category visibility toggles to the schema visualizer - #124963

Merged
alexey-milovidov merged 7 commits into
ClickHouse:masterfrom
mneedham:schema-legend-toggles
Oct 11, 2026
Merged

alexey-milovidov merged 7 commits into
ClickHouse:masterfrom
mneedham:schema-legend-toggles

Conversation

@mneedham

@mneedham mneedham commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Make the schema visualizer's seven table-category labels (including a new "Other table" entry for engines such as Kafka, Memory, Log) clickable to hide or show the corresponding nodes and their connecting lines. Add a Hide all / Show all control so users can focus on individual parts of a schema and reveal categories during a walkthrough. Hidden categories are dimmed, toggles support keyboard activation and expose their state with aria-pressed, and hiding a selected node closes its details panel.

I thought of having it like this to make it easier to demo a database that has a bunch of these things setup. If we could introduce each category individually, I think it'd be easier to grasp what's going on

Screenshots using a representative demo schema:

All categories visible

Schema visualizer with all categories visible

Materialized View and Refreshable MV categories hidden

Schema visualizer with materialized and refreshable views hidden

Changelog category (leave one):

  • Improvement

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

The schema visualizer supports hiding and showing table categories by clicking their legend labels, with a Hide all / Show all control.


Workflow [PR]
Sync PR [sync-upstream/pr/124963]

Version info

  • Merged into: 26.10.1.2149-master (included in 26.10 and later)

@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1c45cfa]

Summary: ✅


AI Review

Summary

This PR makes the schema visualizer legend categories clickable, adds a Hide all / Show all control, and fixes the earlier filter-driven selection/sidebar sync issues. One stale-selection path still remains: a fresh schema reload bypasses the new selection-sync helper, so loading a different schema can leave the old details panel open even though the selected node no longer exists in the rendered graph.

Findings

⚠️ Majors

  • [programs/server/schema.html:2189] renderWithVisibleSelection now handles category and database-filter changes, but loadAll() still finishes with a bare render() at programs/server/schema.html:1104. Reloading a different server/schema can therefore leave state.selectedKey pointing at a missing or newly hidden node while the stale sidebar stays open until another visibility-changing action happens. Route the post-load paint through renderWithVisibleSelection() or clear/revalidate state.selectedKey when the graph is rebuilt.
Final Verdict

⚠️ Changes requested — the selection/sidebar contract is still violated on a fresh reload.

@clickhouse-gh clickhouse-gh Bot added pr-improvement Pull request with some product improvements comp-protocols Server wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc... labels Oct 9, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 9, 2026
Comment thread programs/server/schema.html Resolved
alexey-milovidov and others added 2 commits October 10, 2026 07:38
Tables whose engine is classified as `other` (e.g. `Kafka`, `Memory`, `Log`)
are rendered with their own `--header-other` palette, so they get their own
legend entry and toggle instead of being folded into `MergeTree / Table`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread programs/server/schema.html Resolved
@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 1c45cfa61 with master 5a4550297 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 46dfb8152; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

When a category toggle hides neighbours of the selected node but keeps the
node itself visible, `render` recomputes the links of the filtered graph but
left the highlight and the sidebar stale, still listing the hidden tables.
Re-run `selectNode` after the redraw so both reflect the visible graph.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 @groeneai, investigate the failure: 05210_lightweight_update_materialized_cte_in_ignore fails with UNKNOWN_TABLE under parallel replicas (https://s3.amazonaws.com/clickhouse-test-reports/PRs/124963/f5516707984c8ee627b09d1c27238cbc232cdbbf/pr/result_stateless_tests_arm_binary_parallelreplicas_s3_storage_parallel.json, job Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)), and provide a fix in a separate PR. If the fix is already in progress, link it here. This PR only changes programs/server/schema.html. The other red job, Stateless tests (arm_asan_ubsan, azure, sequential), failed in the ci_logs_export step (infrastructure), not in a test.

@groeneai

Copy link
Copy Markdown
Collaborator

Not caused by this PR. The fix is #123121 (mine, open).

This run fails in query 26 with the same UNKNOWN_TABLE on _materialized_cte_c_* that #123121 fixes. It is the parallel replicas race from #112642: the initiator's local plan waits for the materialized CTE only in its own branch, so the query sent to the other replicas can start before the temporary table exists. With a slow CTE body that query fails 10 of 10 runs on master and passes 10 of 10 with #123121. Since 2026-10-08 the test failed on 81 PRs and on 14 master commits. #123121 has been waiting for review since 2026-09-30 (requested from @ novikd and @ devcrafter).

Comment thread programs/server/schema.html Resolved
alexey-milovidov and others added 2 commits October 11, 2026 03:46
Extract the post-render selection sync into `renderWithVisibleSelection` and use it
for the `db-filter` handler too, so switching the database either clears a selection
that became hidden or refreshes the highlight and the sidebar of a still-visible one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread programs/server/schema.html Resolved
`renderWithVisibleSelection` kept `state.selectedKey` when it pointed at a node missing from the
freshly loaded graph, so toggling a category or changing the database filter dimmed every node and
left the stale sidebar open. Treat a missing node the same as a hidden one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
/// (a reload may have replaced the graph), and refresh the highlight and the sidebar of a still-visible
/// selected node, because the redraw recomputes the links of the filtered graph and they must not
/// refer to just-hidden neighbours.
function renderWithVisibleSelection() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This helper now centralizes the post-render selection sync for visibility changes, but a fresh schema reload still bypasses it: loadAll() ends with a bare render() at programs/server/schema.html:1104. Repro: select a table, load a different server/schema where that key is absent (or now filtered out), and the graph redraws while the old details sidebar stays open until the user touches the database/category filters. Please route the final paint in loadAll() through renderWithVisibleSelection() (or clear/revalidate state.selectedKey when rebuilding state.nodes) so a reload immediately drops or refreshes the selection.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 11, 2026
Merged via the queue into ClickHouse:master with commit df90906 Oct 11, 2026
165 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 2026
@clickhouse-gh clickhouse-gh Bot added comp-web-ui Web UI embedded in the server: Play, the dashboards, the merges and processors visualisers, the w... and removed comp-protocols Server wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc... labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-web-ui Web UI embedded in the server: Play, the dashboards, the merges and processors visualisers, the w... 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