Skip to content

feat: canvas tab groups#9594

Open
nishantmonu51 wants to merge 17 commits into
mainfrom
canvas_tabs
Open

feat: canvas tab groups#9594
nishantmonu51 wants to merge 17 commits into
mainfrom
canvas_tabs

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

Adds inline tab groups to canvas dashboards.

  • A top-level rows: entry is either a plain row (items:) or a tab group (tabs:); a canvas can interleave free rows with multiple independent tab groups.
  • Query isolation: only the active tab's components mount, so inactive tabs issue no queries until selected. Existing canvases render unchanged.
  • Backend: CanvasTabGroup/CanvasTab proto messages; parser validation (no items+tabs, no nesting, ≥1 tab, unique group/tab names); recursive component-name collection; schema + generated docs.
  • Frontend state/render: LayoutBlock/TabGroup model with per-tab grids, prefixed component paths, and per-group ?tabs=group:tab URL state (keys percent-encoded so names with :/, round-trip).
  • Visual editor: add/rename/delete/reorder tabs (menu + drag), add a tab group from the + menu, convert rows to a tab group, cross-container component drag, delete-with-unwrap, in-tab/below-tab add affordances, and a group boundary treatment.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

Add inline tab groups to canvas dashboards. A top-level `rows:` entry is
either a plain row or a `tabs:` group; a canvas can interleave free rows with
multiple independent tab groups. Only the active tab's components mount, so
inactive tabs issue no queries. Existing canvases render unchanged.

- Proto/parser/reconciler: `CanvasTabGroup`/`CanvasTab` messages, parser
  validation (no items+tabs, no nesting, ≥1 tab, unique group/tab names),
  recursive component-name collection, schema + generated docs.
- Frontend: `LayoutBlock`/`TabGroup` state, per-tab grids, prefixed component
  paths, query isolation via `{#if}`, per-group `?tabs=` URL state.
- Visual editor: add/rename/delete/reorder tabs (menu + drag), add tab group
  from the add menu, convert rows to a tab group, cross-container component
  drag, delete-with-unwrap, in/outside add affordances, group boundary.
@nishantmonu51 nishantmonu51 requested a review from djbarnwal June 20, 2026 07:10
Comment thread web-common/vite.config.ts
Comment on lines +24 to +28
// it so web-common unit tests that pull in canvas-entity can resolve the import graph.
alias.push({
find: "@rilldata/web-admin/client",
replacement: "/../web-common/tests/web-admin-client.mock.ts",
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@AdityaHegde does this make sense?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ya we need this for the new tests added. It is due the hacky way we get bookmark info in canvas. In explore it is passed from parent vs in canvas where only in admin it is pulled in canvas-entity.

@AdityaHegde

AdityaHegde commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Some initial UXQA,

  1. Cannot drag drop into an empty tab.
  2. Should we add a delete button for the tab group? It is not apparant that we need to delete the last tab for it to go away. Maybe we need to add a confirmation if there are components inside components.
  3. Tab name editing is inline vs everything else that is to the right. Maybe we should move the controls to the right? This way we could add tab specific filters in there. Also scales well with any more config.
  4. How about a clone button for tab? I can see people adding a bunch of components and wanting to duplicate them. This might be needed for sure if and when we add local filters for tab.
  5. For the full canvas we only show the large Add widget to tab when there are no components, we should do the same for tabs.
  6. Empty tabs should show No components added in preview. Showing a collapsed tab feels like a bad experience.
  7. Tab selection doesnt persist in edit mode. The url doesnt seem to be updated.
  8. Focusing a tab and moving tabs left or right doesnt keep the focus on the tab, the focus shoud be retained.

Will take a deeper look at the code before commenting on #9594 (comment)

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.

3 participants