Skip to content

Add collapsible Schema View sidebar with shared sidebar shell#1875

Open
kmcginnes wants to merge 1 commit into
aws:mainfrom
kmcginnes:slice-2-schema-sidebar
Open

Add collapsible Schema View sidebar with shared sidebar shell#1875
kmcginnes wants to merge 1 commit into
aws:mainfrom
kmcginnes:slice-2-schema-sidebar

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a collapsible, persisted sidebar to the Schema View, matching the behavior the Graph View sidebar already has, and resolves the open auto-open question from #1541.

What users get:

  • Collapse / expand — click the active tab to collapse the sidebar to an icon strip; click any tab to reopen it.
  • Persistence — the active tab and sidebar width are remembered across sessions (new schema-view-layout IndexedDB key).
  • Auto-open details — a toggle in the Details panel header (enabled by default); selecting a single node type or edge connection switches to the Details tab. Multiple/cleared selections do not, so the user is never dumped on an empty Details state. This preference is persisted and independent from the Graph View's.

The shared sidebar shell (CollapsibleSidebar + tab sub-components) is extracted to @/components now that a second view needs it, and the Graph View sidebar is refactored onto it — so both views share one presentational implementation and one default width. As a small consistency pass that the shared shell motivates, all sidebar-header buttons now use the icon-small size.

A prior PR (#1874) did the graph-view layout rename + hook flattening this builds on.

Validation

  • pnpm checks passes (types, lint, format).
  • pnpm test passes. New coverage: schemaViewLayout.test.ts (toggle/close/resize/persist + all three auto-open states + toggle states), toSchemaGraphSelection.test.ts (the single-selection auto-open gate), and component-level collapse/reopen in SchemaExplorerSidebar.test.tsx.
  • Reviewer focus: confirm the Schema View sidebar collapses on active-tab click, reopens on any tab, persists width/tab across reload, and that auto-open only fires for a single selection.

How to read

  1. CollapsibleSidebar.tsx — the extracted shared shell (Resizable + Radix tab sub-components); owns the closed/default width
  2. schemaViewLayoutDefaults.ts — the SchemaViewLayout type + default (dependency-free leaf)
  3. schemaViewLayout.ts — useSchemaViewSidebar hook (toggle/resize/close/auto-open)
  4. SchemaExplorerSidebar.tsx — the schema sidebar composed onto the shared shell
  5. SchemaGraph.tsx — wires selection → auto-open via the single-selection gate (shouldAutoOpenDetailsForSelection)
  6. Sidebar.tsx — the Graph View sidebar refactored onto the same shell (its second consumer)

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Add a persisted, collapsible sidebar to the Schema View (issues aws#1722,
aws#1541) and extract the shared presentational shell now that a second
view consumes it.

Schema View:
- schemaViewLayoutAtom (key "schema-view-layout") storing active tab,
  width, and detailsAutoOpenOnSelection
- useSchemaViewSidebar deep hook (toggle, resize, close, auto-open,
  toggleDetailsAutoOpen)
- collapse-to-icon-strip behavior; auto-open details only fires for a
  single selection (shouldAutoOpenDetailsForSelection), matching the
  graph view — a multiple/cleared selection no longer yanks the user to
  the empty Details state
- DetailsPanelHeader and the Node/Edge Styling panels all carry the
  sidebar close button

Shared shell:
- extract CollapsibleSidebar + tab sub-components to @/components, and
  refactor the Graph View sidebar onto it (its second consumer); drop the
  now-unused CLOSED_SIDEBAR_WIDTH constant. BadgeIndicator keeps wrapping
  every trigger in `.stack` as before.
- CollapsibleSidebar owns the closed/default width directly (no
  defaultWidth prop); SidebarTabs no longer takes an unused slot prop.

Both sidebars share one default width (DEFAULT_SIDEBAR_WIDTH); the schema
view no longer defines its own width constant.

Sidebar-header buttons are uniformly size "icon-small" across both views
(schema Details header plus the graph view's auto-open and refresh
buttons).

Auto-open: treat undefined detailsAutoOpenOnSelection as enabled, and
toggle via toggleDetailsAutoOpen so the button flips state internally.
All three value states are covered by tests in both views.

Docs: document the schema sidebar in docs/features/schema-view.md and
align "Schema Explorer" → "Schema View" wording in
docs/agents/{schema,product}.md.
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.

Add collapsible sidebar to Schema Explorer Add auto show details option to schema explorer sidebar

1 participant