Repository navigation
Schema Types sidenav: inline expand/collapse + QueryNodeViewer integration - #962
Conversation
Replace slide-out SchemaTypesSubPanel with inline Collapsible.Root pattern matching Collections section. Expanded state is persisted via layout store (schemaTypesExpanded, version 3 of LayoutPersistenceService). - Delete schema-types-sub-panel.svelte - Add Collapsible.Root accordion in navigation-sidebar.svelte (mirrors Collections) - Add schemaTypesExpanded to LayoutState + setSchemaTypesExpanded helper - Bump LayoutPersistenceService to version 3 with chained migration - Update layout store and persistence service tests Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Code Review — PR #962: Schema Types sidenav inline expand/collapseInitial review. No prior reviews exist on this PR. Overall Assessment: This is a clean, well-scoped change that is a net positive. The slide-out sub-panel has been replaced with the inline Findings[Improvement] Missing empty-state when both schema groups are emptyFile: The deleted The issue spec says "Empty state for custom types: show a subtle 'No custom types' message or nothing." That applies to the custom types group, not the overall state. The old file handled the case where even built-in schemas fail to load. In practice, Recommendation: add a minimal fallback inside [Improvement]
|
| Criterion | Status |
|---|---|
| Schema Types expands/collapses inline — no slide-out panel | PASS |
Expanded state persisted in layout store (schemaTypesExpanded) |
PASS |
Built-in types shown first (only task), custom types below with separator |
PASS |
| Empty state handled when no custom types | PASS (custom group simply not rendered) |
schema-types-sub-panel.svelte deleted |
PASS — confirmed no remaining references |
| Visual style mirrors Collections (indentation, font-size, hover) | PASS |
| Collapsed sidebar icon expands sidebar and opens section | PASS |
Tests pass (bun run test:all) |
PASS — 3720/3720 |
Part 2 is correctly deferred pending #441.
Migration Chain
v1 → v2 → v3 chain is correct. The sequential if (s.version === 1) / if (s.version === 2) guards handle chained migration properly without a return between steps. v3 identity (no-op) is implicitly correct because neither condition matches. The new test case "does not modify version 3 state" closes the coverage gap that was left when the v2 test was renamed.
Verdict: Approve with the improvements above noted. The behavioral gap (empty state on failed schema load) is low probability in practice given task is a core type, but the test coverage gap for setSchemaTypesExpanded is a straightforward fix. Neither is a blocker for a pre-release greenfield project, but both should be addressed before this pattern is replicated for additional sidenav sections.
🤖 Reviewed by Claude Sonnet 4.6 via /pragmatic-code-review
malibio
left a comment
There was a problem hiding this comment.
Implementation is correct and clean. Two non-blocking improvements noted in the inline review comment: add an empty-state fallback when schema load fails (defensive against the try/catch swallowing errors on mount), and add a setSchemaTypesExpanded unit test block parallel to the existing setCollectionsExpanded coverage. Migration chain and deletion are verified clean.
- Add empty-state fallback ("No types available") inside Collapsible.Content
when getAllSchemas() fails or returns empty — closes behavioral regression
vs. deleted sub-panel
- Extract {#snippet schemaTypeItemIcon()} to DRY duplicate SVG in both
builtInSchemas and customSchemas loops
- Add setSchemaTypesExpanded unit test block in layout.test.ts parallel to
setCollectionsExpanded coverage
- Fix load log in layout-persistence-service.ts to include all three fields
(consistent with save log)
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Review Feedback AddressedAll 4 recommendations from the review have been implemented: ✅ Empty-state fallback — Added ✅ Duplicate SVG DRY — Extracted ✅ ✅ Load log consistency — Updated Tests: 3722/3722 ✅ | Quality: clean ✅ |
…ation (#962) * Schema Types sidenav: inline expand/collapse (closes #960 Part 1) Replace slide-out SchemaTypesSubPanel with inline Collapsible.Root pattern matching Collections section. Expanded state is persisted via layout store (schemaTypesExpanded, version 3 of LayoutPersistenceService). - Delete schema-types-sub-panel.svelte - Add Collapsible.Root accordion in navigation-sidebar.svelte (mirrors Collections) - Add schemaTypesExpanded to LayoutState + setSchemaTypesExpanded helper - Bump LayoutPersistenceService to version 3 with chained migration - Update layout store and persistence service tests Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Address review feedback for PR #962 - Add empty-state fallback ("No types available") inside Collapsible.Content when getAllSchemas() fails or returns empty — closes behavioral regression vs. deleted sub-panel - Extract {#snippet schemaTypeItemIcon()} to DRY duplicate SVG in both builtInSchemas and customSchemas loops - Add setSchemaTypesExpanded unit test block in layout.test.ts parallel to setCollectionsExpanded coverage - Fix load log in layout-persistence-service.ts to include all three fields (consistent with save log) Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Closes #960