Skip to content

Schema Types sidenav: inline expand/collapse + QueryNodeViewer integration #960

Closed

Description

@malibio

Overview

Follow-up to #940. Two improvements to the Schema Types sidenav item:

  1. Part 1 (no dependencies): Replace the current slide-out sub-panel with an inline expand/collapse list — matching exactly how Collections works in the sidenav.
  2. Part 2 (depends on QueryNodeViewer with Multi-View Rendering Support #441): When a schema type is clicked, open a new tab in the active panel routed to QueryNodeViewer, passing the schema's nodeId.

Part 1: Inline Expand/Collapse (no dependency on #441)

Problem

The current Schema Types sidenav item opens a SchemaTypesSubPanel that slides out to the right — inconsistent with the Collections section which expands inline (vertically) using Collapsible.Root from bits-ui.

Solution

Replace the sub-panel approach with the same Collapsible.Root pattern used by Collections in navigation-sidebar.svelte (lines 347–454).

Structure:

▼ Schema Types          ← toggle header (click to expand/collapse)
    ◆ Task              ← built-in types (isCore === true, only 'task' shown for now)
    ─────────────       ← separator when both groups present
    ◆ My Custom Type    ← user-defined types (isCore === false)
    ◆ Another Type
  • Uses Collapsible.Root with open state persisted in layout store (same as collectionsExpanded)
  • Indentation matches Collections item depth (padding-left: 1.25rem)
  • Icon: existing 4-shape Schema Types icon (unchanged)
  • Filter: only show isCore === true schemas where id === 'task' (same rule as Schema Types sidenav item listing available node types #940)
  • Empty state for custom types: show a subtle "No custom types" message or nothing

Files to Modify

  • packages/desktop-app/src/lib/components/layout/navigation-sidebar.svelte — replace schema types section with Collapsible.Root inline pattern
  • packages/desktop-app/src/lib/stores/layout.js — add schemaTypesExpanded persisted state (parallel to collectionsExpanded)
  • packages/desktop-app/src/lib/components/layout/schema-types-sub-panel.svelte — delete this file (no longer needed)

Part 2: Open QueryNodeViewer on Type Click (depends on #441)

Problem

Currently handleSchemaClick() in navigation-sidebar.svelte opens a tab with nodeType: 'schema', which routes to the schema editor viewer. It should instead open the QueryNodeViewer to show all nodes of that type.

Solution

Update handleSchemaClick(schemaId: string) to open a new tab in the active panel passing the schema's nodeId. Since every schema is a node, and QueryNodeViewer accepts a nodeId, no synthetic config is needed — the schema node IS the entry point.

function handleSchemaTypeClick(schemaId: string) {
  // schemaId is the schema node's id (e.g. 'task', or a custom schema's node id)
  // QueryNodeViewer will load the schema node, derive targetType and columns from it
  navigationService.openNodeInActivePane(schemaId, 'query');
}

The tab opens in the active panel (same pane, new tab). Clicking a row in the resulting table opens the node in another panel — that behavior is handled inside QueryNodeViewer via navigateToNodeInOtherPane() (implemented in #441).

Files to Modify

  • packages/desktop-app/src/lib/components/layout/navigation-sidebar.svelte — update handleSchemaClick() to use nodeType: 'query'

Acceptance Criteria

Part 1

  • Schema Types section expands/collapses inline (vertically) — no slide-out panel
  • Expanded state persisted in layout store (schemaTypesExpanded)
  • Built-in types shown first (only task for now), custom types below with a separator
  • Empty state handled when no custom types exist
  • schema-types-sub-panel.svelte deleted
  • Visual style matches Collections section exactly (indentation, icon weight, toggle arrow)

Part 2 (implement after #441 is merged)

  • Clicking a schema type opens a new tab in the active panel routed to QueryNodeViewer
  • The schema's nodeId is passed — no synthetic query config
  • Tab title shows the schema type's name (e.g. "Task")
  • Clicking a node row in the table opens it in the other panel (handled by QueryNodeViewer with Multi-View Rendering Support #441)

Both Parts

  • Tests pass (bun run test:all)
  • Code passes bun run quality:fix

Technical References

  • Collections expand/collapse pattern: navigation-sidebar.svelte lines 347–454 — replicate exactly
  • Layout store: packages/desktop-app/src/lib/stores/layout.js — add schemaTypesExpanded alongside collectionsExpanded
  • Schema data: backendAdapter.getAllSchemas() returns SchemaNode[] with id, content, isCore
  • Navigation: packages/desktop-app/src/lib/services/navigation-service.ts — navigateToNodeInOtherPane() for row clicks (in QueryNodeViewer with Multi-View Rendering Support #441), openNodeInActivePane() for tab open

Dependencies

Related Issues

Activity

  1. malibio commented on Mar 16, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 118 test files, 3719 tests passed

  2. self-assigned this
    on Mar 16, 2026
  3. added 2 commits that reference this issue on Mar 16, 2026
    bef0d08
    a5ace4b
  4. added 2 commits that reference this issue on Jun 22, 2026
    5513c8e
    12b2242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions