Skip to content

feat(sql): add SQL landing/overview page#2541

Draft
c-julin wants to merge 6 commits into
masterfrom
jc/sql-landing-page
Draft

feat(sql): add SQL landing/overview page#2541
c-julin wants to merge 6 commits into
masterfrom
jc/sql-landing-page

Conversation

@c-julin

@c-julin c-julin commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What

Adds a standalone landing/overview page as the default view for the /sql route, independent from the query editor studio. Ported from the "RP SQL" design.

  • sql-page.tsx — new /sql route component. Holds the view state (landing | editor, persisted per session) and switches between two independent experiences.
  • sql-landing.tsx — the standalone overview: hero, derived-metric strip, catalogs & tables, suggested queries, recent queries, docs. No studio chrome.
  • sql-workspace.tsx — the editor studio is now editor-only, with a back-to-overview arrow in its header, and accepts entry intent (seedQuery / autoRun / openWizardOnMount) from the landing.
  • use-sql-catalogs.ts — shared catalog/identity/tables fetching, used by whichever view is mounted (only one at a time, so no double-fetch).

Capability gating (embedded vs standalone)

The design shows data that has no backend in either deployment yet — observability metric tiles (queries·24h, p50 latency, bytes scanned, bridge-lag) and the connection-details card (host/port/JDBC/psql). The landing renders only the real, wireable data today (catalogs & tables, role, recent queries from localStorage, derived counts), so standalone deployments degrade gracefully with no placeholder numbers. The unbacked sections are documented as capability-gated extension points in sql-landing.tsx.

Testing

  • sql-landing.test.tsx — 6 new tests (populated overview, suggested-query run, open-editor, recent-from-history, admin/viewer onboarding).
  • All 34 SQL tests pass; project typecheck and ultracite lint clean.

Not yet visually verified in a running cloud-ui + Console MF stack.

Add a standalone landing/overview page as the default view for the /sql
route, independent from the query editor studio. SqlPage switches between
the landing and the editor (which gains a back-to-overview affordance);
shared catalog/identity fetching is extracted into useSqlCatalogs.

The landing renders only the data that has a real backend today (catalogs
and tables, role, recent queries from localStorage, derived counts).
Observability metric tiles and the connection-details card from the design
have no backend yet and are documented as capability-gated extension points,
so standalone deployments degrade gracefully without placeholder numbers.
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🚨 Registry drift detected

App: frontend · Scope: diff vs origin/master · Files: 19

Count
⚠️ Outdated registry components 2
🛠 Locally-modified components 0
❓ Unknown to registry 0
🎨 Off-token palette colours 0
🔢 Ad-hoc utility classes 0
Components needing attention
Status Component Uses Detail
⚠️ outdated dropdown-menu installed 2.2.0 → latest 2.3.0
⚠️ outdated tabs installed 2.2.0 → latest 2.3.0

Refresh command:

bunx shadcn@latest add @redpanda/dropdown-menu @redpanda/tabs --overwrite

Generated by lookout audit-changes.

Match the landing page layout width to line up
with other pages and reduce unused space.

The catalog and query rows used bg-selected-hover,
an undefined token, so hovering did nothing; they
were also plain buttons with no pointer cursor.

Bump the catalog header to text-sm so it is no
longer smaller than the table rows it groups.
@r-vasquez r-vasquez force-pushed the jc/sql-landing-page branch from 3cacc69 to 1cfbf54 Compare June 29, 2026 22:16
c-julin added 4 commits July 6, 2026 12:40
- /sql is now a layout with real child routes: the landing at /sql and the
  editor at /sql/editor with seed/run/wizard search params — deep-linkable,
  back-button friendly, no sessionStorage view state
- SQLService fallback redirect moved to the layout so it covers the landing
- useSqlCatalogs tracks catalogs+tables+identity loading and exposes
  isError/refetch; the landing renders distinct loading and error states
  instead of flashing the empty-state onboarding, and only claims
  "Connected" after a successful load
- query history extracted to sql-history.ts (one key+schema for editor and
  landing, cluster-scoped when embedded); landing-initiated auto-runs go
  through the editor's run path so they're recorded
- landing rebuilt on registry Card/Spinner/Button primitives; shared
  previewSql helper; table-id keys; prettyMilliseconds timestamps
- catalog/identity/table queries get a long staleTime (invalidation stays
  the freshness trigger); wizard topic listing fetches only when the wizard
  opens; SqlEditorView pass-through inlined; dark-border remap defined once
Sidebar items can now declare children rendered as a collapsible sub-menu
(SidebarMenuSub + chevron SidebarMenuAction). The SQL entry exposes Editor,
linking straight to /sql/editor without going via the landing page. The
section auto-expands while a /sql route is active; the parent row highlights
only on its exact page once a child can claim the highlight.
The workspace view is now consistently called Studio: the route moves from
/sql/editor to /sql/studio, the sidebar sub-item reads Studio, and the
landing CTAs become "Open studio" / "Browse in studio". Internal names for
the CodeMirror text-editing pane (SqlEditor) are unchanged — that pane is an
editor inside the studio.
The federation SidebarItem contract gains an optional children field so the
host (Cloud UI) can render the SQL → Studio sub-item; updateSidebarItems maps
the route children through. Hosts that ignore the field are unaffected.
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