Skip to content

Support duplicated views via named view instances (#292) - #294

Merged
azat merged 7 commits into
mainfrom
views-instances
Aug 12, 2026
Merged

Support duplicated views via named view instances (#292)#294
azat merged 7 commits into
mainfrom
views-instances

Conversation

@azat

@azat azat commented Aug 12, 2026

Copy link
Copy Markdown
Owner

A views: entry with a view: field defines a named instance of a view type, referenceable from the layout — so the same view can be opened in several panes with different settings. Also adds a query_kind per-view setting.

views:
  last_selects:
    view: last_queries
    query_kind: Select
  last_inserts:
    view: last_queries
    query_kind: Insert
layout:
  panes: [last_selects, last_inserts, cpu_flamegraph]

Fixes: #292

azat and others added 5 commits August 11, 2026 23:53
Prepares for several instances of one view type (#292): events are
dispatched to the view name they carry instead of a hardcoded widget
name, per-view event channels, and view names/action owners become
Arc<str> so they can be non-'static.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A 'views:' entry with a 'view:' field defines a named instance of that
view type; the key becomes the instance name, referenceable from
'layout.panes' and 'layout.focus'. The same base type may now appear in
the layout several times via instances.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ViewProvider::show() gets the instance name; queries, server_logs and
flamegraph views name their widget after it, so several instances of
one view type can be shown side by side, each with its own settings
(filter/start/end/limit/level) and '/'-filter state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Restricts a queries view to the given query_kind values (a single value
or a list), e.g. 'query_kind: [Create, Drop, Alter]' for a DDL pane.
Filters the initial query's kind in the query_log views; needs 23.2+
for the live queries view (system.processes.query_kind).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@azat
azat force-pushed the views-instances branch from 34f09cc to 65f1bfa Compare August 12, 2026 11:12
azat and others added 2 commits August 12, 2026 13:29
They shared one enum_key each, and the deferred slot keeps only the
newest same-key event: with three flamegraph panes in a layout the
middle request was dropped and its pane stayed a stub forever (live
refreshes could starve a pane the same way). UpdateFlameGraph's slot
has no name, so its key uses the Arc identity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An instance so named would receive the filtered-logs popup's updates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@azat
azat merged commit 3484db0 into main Aug 12, 2026
9 checks passed
@azat
azat deleted the views-instances branch August 12, 2026 11:55
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.

Ability to open duplicated views (with different settings)

1 participant