feat: query activity drawer - #612
Conversation
Web Console deploy preview
|
|
Reviewing PR #612 at level 3 Issues
Adjacent findings (not blocking — file as issues)None. Summary
|
|
Reviewing PR #612 at level 3 (full mission-critical pass), against head Verdict: request changes. The new SQL formatter silently changes or breaks some valid QuestDB queries. That is the one Critical finding. The other eleven findings are ten Moderate and one Minor. PR title and description
Issues
Adjacent findingsNone met the evidence bar. Summary
|
Bump @questdb/sql-parser to 0.1.19. The formatter no longer inserts a space inside hex, float-suffixed, geohash-precision and nanosecond literals, so Format Document, AI apply and Query Activity keep the query intact (#1). Render bidi and C0 control characters as visible markers in HighlightedSql, and let the share-link review dialog scroll long lines instead of hiding them (#3). Derive Query Activity's finished rows in the same render as the snapshot, so a row keeps its node and focus when the query ends, and release a row's hold on unmount so held rows expire (#5). Reset the Query Activity source on every open and close, so a failed reopen shows the error state instead of the previous session, and freeze a finished duration at the last poll that listed the query (#6). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Reviewing PR #612 at level 3 (head PR title and description
Issues
Adjacent findingsNone met the evidence bar. Summary
|
|
Reviewing PR #612 at level 3 (head Verdict: approve with comments. No finding reaches Critical, and typecheck, lint, unit tests (99 files, 2,161 tests) and build all pass. There are 10 Moderate findings and 1 Minor. Please fix #1–#4 before merge: they change existing behaviour for users who never open the new drawer. The rest can follow. Every behavioural finding below was reproduced by a separate agent that first tried to disprove it, with the same steps run at base. PR title and description
Issues
Adjacent findings (not blocking; pre-existing at base)
Summary
|
Query Activity drawer
A new Query Activity button in the right sidebar, directly below Table Details, opens a drawer that lists the queries currently running on the server. It is built on the server's
query_activity()function, which now reports live memory usage per query.What the drawer shows
Header. The title carries a badge with the number of running queries.
Summary tiles.
Search. The search box filters the list as you type. It matches the query text, the query id, and the username, case-insensitively. Pressing Escape clears the box. Pressing Escape on an empty box closes the drawer.
Sort. A dropdown offers six orders: Memory used, Start time, and Query ID, each ascending or descending. The default is Memory used descending, so the query holding the most memory is on top. Queries with no memory data always sort last under Memory used. There is no Duration order, because sorting by start time already answers "which query has run longest".
Auto refresh. The refresh toggle polls the server once a second while it is on. Turning it on fetches a fresh list at once. Turning it off stops polling and sends nothing further, so the list freezes. The choice is remembered across sessions.
Last updated. A line under the toolbar reports the age of the list, for example
Last updated 3s ago. It is always visible, so a frozen or failing list never looks live. A spinner appears to its left while an automatic refresh is in flight, but only once the request outlasts 500 ms, and it then stays for at least 500 ms. A normal round trip therefore shows nothing at all. A manual refresh, from Retry or after a cancel, shows no spinner while auto refresh is on.What a query row shows
used / limit. Background work showsN/A.Started 1m 12s ago, updated every second. Hover it to see the start time in ISO format, to the millisecond, with a copy button.The row reports when a query started, never how long it ran. The server sends no stop time, and while auto refresh is off it sends nothing at all, so any runtime figure would be a guess that grows without limit. A start time stays true no matter when the list was last refreshed. The
Last updatedline tells you how old the Running label itself is.Cancelling a query
Cancel asks for confirmation, then sends a cancel request to the server. The row usually switches to Finished, because the server drops a cancelled query within milliseconds and the next poll no longer lists it. A row shows Cancelled only when a poll catches the query while the server is still winding it down.
Cancel is not offered for WAL rows, because the server refuses to cancel them, nor for rows that are already cancelled or finished. On Enterprise, cancelling another user's query requires the SQL ENGINE ADMIN permission; the server's error is shown as a notification. The list refreshes after a cancel whether it succeeded or failed, so a row for a query that has already gone clears itself.
Memory warnings
Only memory produces a warning or error tone, and only for queries that run under a memory limit. The tone reflects how much of that limit the query holds. Queries without a limit, and background work that reports no memory, are never coloured. Elapsed time never colours a row, since what counts as long depends on the workload.
Cancelled queries are never graded.
How a query disappears
The server only lists queries while they run. It does not report an outcome. When a poll no longer returns a query, the row switches to Finished with the hover text "The query left the registry. It finished, failed, or timed out." The row stays for five seconds, then fades out.
While your mouse is over the row, or keyboard focus is inside it, the row stays as long as you like. When you leave it, a fresh five seconds starts. A cancelled query that leaves the server lingers the same way but keeps its Cancelled state.
Other things to know
Changes outside the drawer
SQL formatter
Format Document now uses
@questdb/sql-parserinstead ofsql-formatter. Output changes for most queries. The new formatter keeps every token across about 100 QuestDB-specific shapes, and it is much faster than the old one.A new editor setting, Capitalize keywords on format, controls whether the formatter upper-cases keywords. It is off by default.
Static SQL blocks
Read-only SQL blocks elsewhere in the console, in the AI chat, the table details DDL, and the shared link confirmation, now render as static highlighted text instead of an embedded editor. Their text can be selected with the mouse, and their copy button now appears on hover, like the open-in-editor action already did. For a typical short statement this is lighter than mounting an editor.
Two known limits, both tracked separately:
Escape in drawers
Escape now behaves the same way in every drawer. While focus is in a text field that holds content, Escape does not close the drawer. The Query Activity and chat history search boxes clear themselves on the first press, so the next press closes the drawer. Other fields keep their content, so the user must clear the field or move focus before Escape closes the drawer. This keeps drafts that were previously lost, for example in the AI chat and the CSV import forms.
Shared toolbar spinner
The notebook cell toolbar spinner moved from
src/scenes/Editor/Notebook/cells/Spinner.tsxtosrc/components/Spinner, so the query activity toolbar can use the same neutral control. Its timing is now a shareduseDelayedFlaghook, which turns a flag on only once work outlasts a delay and then holds it for a minimum, so a short wait never flashes an indicator.🤖 Generated with Claude Code