Repository navigation
Add a refresh button to the database panel in the Web UI - #108958
Conversation
In the Web UI (`play.html`), when a database is expanded in the database panel, show a refresh button (`↻`) to the right of the database name. Clicking it reloads the list of tables without collapsing the database. The button reuses the same top-right slot as the loading hourglass (only one is shown at a time): the hourglass appears while tables are loading and the refresh button is shown once the list is ready. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [804009f] Summary: ✅
AI ReviewSummaryThe PR adds a refresh button for expanded databases in Final Verdict✅ No findings to post. |
…lapsed database The new database refresh button could repopulate the table list of a row after the user had already collapsed it. Sequence: open a database, click the refresh button, then click the database name (collapsing the row) before the `loadTables` request returns. The collapse path deletes `dataset.opened`, removes the refresh button and clears `.tables`, but it did not invalidate the in-flight request, so when the promise resolved, `loadTables` still mutated the same container and repopulated tables for a row that was no longer open. The global `load_tables_request_num` does not help here: collapse issues no new `loadTables`, so the counter stays equal, and bumping it on collapse would wrongly cancel a concurrent open of a different row. Add a per-row generation counter, bumped on every refresh and on collapse. An in-flight load captures the generation and `loadTables` bails out (before touching the DOM) if it is no longer current when its query returns. The refresh button's visibility is also restored only when the load is still current. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the AI review's "Request changes" (the only outstanding item) in d445bd2. The full pre-fix CI run on What the bug was: the new refresh button could repopulate the table list of a database row after it had been collapsed — open a database, click Fix: a per-row The review thread is resolved; CI should re-run on the new commit. |
…nel is closed
A follow-up to the previous per-row generation guard. That guard invalidated
an in-flight refresh on collapse and on a newer refresh, but not when the whole
database panel is closed. Sequence: open a database, click the refresh button,
then hide the panel before `loadTables` returns. `toggleDatabases` (and a full
`loadDatabases` reload) removes all database row nodes without bumping
`row_load_generation`, so the row's generation is unchanged and the in-flight
load was still considered current. When its query returned, `loadTables` reached
`container.parentElement.querySelector('.current')` with `container.parentElement`
now `null`, raising a JavaScript exception instead of quietly dropping the stale
refresh.
Extend the `is_current` predicate with `database.isConnected`, so a load whose
row was detached from the document (panel closed, or database list reloaded)
bails out before touching the DOM, exactly like the collapse and supersession
cases. The check covers both the `loadTables` bail-out and the refresh button's
visibility restore, since both go through `is_current`.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the AI review's follow-up "Request changes" (the only outstanding item) in 4c4e2c9. What the new finding was: closing the whole database panel while a refresh was in flight could crash the load. The previous per-row generation guard invalidated a refresh on collapse and on supersession, but not when the entire panel is closed. Fix: extend the The previous CI run on |
|
Merged Why re-merge: Integration verified:
The net diff vs current |
…ed-databases Resolve the `programs/server/play.html` conflict with the database refresh button feature that landed on master (#108958). Both features independently reworked the database-list loop body and the 6th parameter of `loadTables`: this PR added `openDatabase(set_current)` plus the `opened_databases` restore set and a per-container `WeakMap` staleness token with a `set_current`/`current_selection_num` highlight guard, while master added `refreshTables`, the per-row `row_load_generation` counter and the `is_current` predicate for the refresh button. The merge keeps both: `refreshTables` now takes `set_current` (defaulting to true, preserving master's refresh behaviour) and threads it into `loadTables`; `openDatabase` wraps `refreshTables` to mark the row opened, remember it in `opened_databases` and attach the refresh button; restore calls `openDatabase(false)` so it never moves the current-database highlight. `loadTables` keeps the per-container token, the `is_current` predicate guard and the latest-selection highlight guard together.
…refresh-button Add a refresh button to the database panel in the Web UI
…ed-databases Resolve the `programs/server/play.html` conflict with the database refresh button feature that landed on master (ClickHouse#108958). Both features independently reworked the database-list loop body and the 6th parameter of `loadTables`: this PR added `openDatabase(set_current)` plus the `opened_databases` restore set and a per-container `WeakMap` staleness token with a `set_current`/`current_selection_num` highlight guard, while master added `refreshTables`, the per-row `row_load_generation` counter and the `is_current` predicate for the refresh button. The merge keeps both: `refreshTables` now takes `set_current` (defaulting to true, preserving master's refresh behaviour) and threads it into `loadTables`; `openDatabase` wraps `refreshTables` to mark the row opened, remember it in `opened_databases` and attach the refresh button; restore calls `openDatabase(false)` so it never moves the current-database highlight. `loadTables` keeps the per-container token, the `is_current` predicate guard and the latest-selection highlight guard together.

In the Web UI (
play.html), when a database is expanded in the database panel, a refresh button (↻) is now shown to the right of the database name. Clicking it reloads the list of tables without collapsing the database.The button reuses the same top-right slot as the loading hourglass (only one is shown at a time): the hourglass appears while tables load, and the refresh button is shown once the list is ready.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Web UI: show a refresh button next to an expanded database to reload its list of tables.
Version info
26.7.1.366(included in26.7and later)