Skip to content

feat(admin): Bring the System Queries layout to the Querylog page - #8565

Merged
onewland merged 1 commit into
masterfrom
feat/querylog-editor-panel
Oct 19, 2026
Merged

onewland merged 1 commit into
masterfrom
feat/querylog-editor-panel

Conversation

@onewland

@onewland onewland commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Brings the recent System Queries styling to the ClickHouse Querylog page: the sticky, closable editor panel, results as history cards with sticky table headers, and Share query links.

Share links look like #querylog?query=... and pre-fill the editor without running anything. Unlike System Queries, the Querylog page shows no "filled in from a link" warning, since the querylog cluster isn't production. Pasting a link while already on the page also works.

"View Querylog Schema" used to push the schema into the results history, mixed in with real query results. It's now a "Querylog schema" button in the editor's title row that opens a drawer on the right, below the page header. The drawer has no overlay, so you can keep editing while it's open. It shows only the name, type and comment columns from DESCRIBE, with a filter box, and fetches the schema the first time it's opened.

Screenshots:
Screenshot 2026-10-19 at 2 36 29 PM

Screenshot 2026-10-19 at 2 37 05 PM

To avoid duplicating the System Queries UI, the shared pieces are pulled out and used by both pages:

  • editor_panel.tsx: the sticky editor panel layout, the prefill warning, and the sticky table header styles
  • query_history_entry.tsx: the history card, now generic. clickhouse_queries/query_history_entry.tsx is a thin wrapper that still parses storage and host out of saved System Queries entries, so that page works as before.
  • buildHashUrl in clickhouse_queries/prefill.tsx, used by both pages' share links

Things to look at in review:

  • Wide Querylog results now wrap instead of scrolling sideways. Sticky headers don't work inside a scrolling container, and System Queries already made the same trade-off.
  • Querylog errors now show inline, like System Queries, instead of in a window.alert.

I couldn't test this against real data locally, because setting up a querylog cluster in a local environment is cumbersome. Coverage comes from new Jest tests (static/tests/querylog/index.spec.tsx) with a mocked API. They cover link round-trips, pre-filling from a link, the editor closing after a run, Share query, and the schema drawer and its filter. The existing System Queries tests pass unchanged.

🤖 Generated with Claude Code

Give the Querylog page the sticky, closable editor panel, history cards
and share links from System Queries. Links of the form
#querylog?query=... pre-fill the editor; unlike System Queries there's
no warning, since the querylog cluster isn't production.

The querylog schema moves out of the results into a drawer beside the
editor, which starts below the page header.

The editor panel, prefill warning and history card are extracted into
shared components so both pages use the same code.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@onewland
onewland marked this pull request as ready for review October 19, 2026 21:37
@onewland
onewland requested a review from a team as a code owner October 19, 2026 21:37
@onewland
onewland merged commit a19d97b into master Oct 19, 2026
69 checks passed
@onewland
onewland deleted the feat/querylog-editor-panel branch October 19, 2026 23:26
MeredithAnya added a commit that referenced this pull request Oct 20, 2026
…er to use (#8569)

Follow-up to #8554 and #8550.

### Bugs fixed
- Large results no longer break scrolling. Long values wrapped a few
characters per line, and wide tables couldn't scroll sideways.
- The page no longer jumps to the results after Execute.
- The open editor no longer covers the results as you scroll.
- The "Select a host" warning no longer flashes while the node list
loads.
- The Execute button no longer changes size or flickers while a query
runs.
- Copy buttons now work when admin is served over plain http.
- A long query no longer pushes the errors off screen. The query box is
capped at 40% of the window height and scrolls inside it.

### Behaviour changed
- Storage, Host and the host entry toggle sit in a row at the top that
stays visible when the editor is closed. The manual-host rules moved
into a tooltip.
- The User/Sudo toggle and the predefined query dropdown moved into the
editor's title row, next to Close. Their help text and descriptions show
on hover.
- Errors show under the query, next to Execute, which is pinned to the
right. Errors are hidden with the editor, and a failed run reopens it.
- Older results collapse when a newer run becomes the latest.
- Results no longer show their SQL inline; a small SQL button toggles
it.
- The copy buttons on results are now icons with tooltips.
- The result card changes also apply to the Querylog page, which shares
the card with System Queries since #8565.

### Behaviour added
- A results table for System Queries: row numbers, a header that stays
visible, single-line values you can click to expand, and an "Expand to
all N rows" button for long results.
- Execute next to Storage and Host when the editor is closed.
- Host auto-fills with the storage's first node. Links that don't name a
host are left alone.
- "Copy as table" (tab-separated, pastes into spreadsheets) and "Copy as
Markdown".
- A "No results" label on empty results.
- A trash icon to clear saved results.

<img width="1501" height="760" alt="Screenshot 2026-10-19 at 6 04 20 PM"
src="https://github.com/user-attachments/assets/84b61a62-bdb9-4348-b1c0-63a82197abdb"
/>


🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants