Skip to content

feat(admin): Make System Queries results readable and the editor easier to use - #8569

Merged
MeredithAnya merged 2 commits into
masterfrom
meredith/10-19-26-admin
Oct 20, 2026
Merged

MeredithAnya merged 2 commits into
masterfrom
meredith/10-19-26-admin

Conversation

@MeredithAnya

@MeredithAnya MeredithAnya commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

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 feat(admin): Bring the System Queries layout to the Querylog page #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.
Screenshot 2026-10-19 at 6 04 20 PM

🤖 Generated with Claude Code

…er to use

Rebuild the System Queries results as a table that scrolls on its own, keep
storage, host and Execute in view when the editor is closed, add copy
formats and a way to clear saved results, and stop the Execute button and
host warning from flickering.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@MeredithAnya
MeredithAnya requested a review from a team as a code owner October 20, 2026 01:05
…dmin

# Conflicts:
#	snuba/admin/static/clickhouse_queries/index.tsx
#	snuba/admin/static/clickhouse_queries/query_display.tsx
#	snuba/admin/static/clickhouse_queries/query_history_entry.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 52abc7a. Configure here.

<Text size="sm" fw={600} aria-hidden>
&nbsp;
</Text>
{executeControl}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Editor toggle allows duplicate executes

Medium Severity

Opening or closing the editor remounts ExecuteButton, which keeps isExecuting in local state. A query already in flight no longer blocks Execute, so another click can start a second run, including a sudo statement.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 52abc7a. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thats expected

@onewland onewland left a comment

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.

Mostly down to merge, but I don't love the icon-only buttons. Could we remove a couple of the less useful ones and retain text? I almost never copy JSON, for one thing

@MeredithAnya

Copy link
Copy Markdown
Member Author

Mostly down to merge, but I don't love the icon-only buttons. Could we remove a couple of the less useful ones and retain text? I almost never copy JSON, for one thing

When you hover it does tell you what they are
Screenshot 2026-10-20 at 9 35 34 AM

happy to remove json one though, i never use it

@onewland

Copy link
Copy Markdown
Contributor

let's just merge and we can iterate later. another thought I had is that a one-click "re-run" button matches my workflow a lot

@MeredithAnya
MeredithAnya merged commit 05c3cb9 into master Oct 20, 2026
69 checks passed
@MeredithAnya
MeredithAnya deleted the meredith/10-19-26-admin branch October 20, 2026 20:03
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