Skip to content

Commit 4312c01

Browse files
Copilothotlong
andcommitted
feat: P1-P3 Console navigation integration — replace HTML5 DnD with @dnd-kit, add nav pinning, add AppSchemaRenderer slots
- P1: Replace native HTML5 DnD in AppSidebar with NavigationRenderer's @dnd-kit - Remove custom DndContext, draggable attributes, onDragStart/Over/Drop handlers - Delegate to NavigationRenderer with enableReorder + onReorder props - Adapt useNavOrder hook to work with NavigationRenderer's onReorder callback - PointerSensor + KeyboardSensor with 5px activation distance (from layout pkg) - P2: Add navigation pin functionality - Create useNavPins hook with localStorage persistence - Integrate with NavigationRenderer's enablePinning + onPinToggle - Apply pin state to navigation items via applyPins() - Coexists with existing useFavorites (record-level favorites) - P3: AppSchemaRenderer migration (Phase 1) - Add sidebarHeader, sidebarExtra slots to AppSchemaRenderer - AppSidebar delegates navigation rendering to NavigationRenderer - Console-specific features preserved (app switcher, user footer, favorites, recent items) - Remove duplicated NavigationTree/NavigationItemRenderer code (~120 lines removed) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 4165a7a commit 4312c01

4 files changed

Lines changed: 213 additions & 286 deletions

File tree

apps/console/src/__tests__/AppSidebar.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ vi.mock('../hooks/useFavorites', () => ({
7272
useFavorites: () => ({ favorites: [], removeFavorite: vi.fn() }),
7373
}));
7474

75+
vi.mock('../hooks/useNavPins', () => ({
76+
useNavPins: () => ({
77+
pinnedIds: [],
78+
togglePin: vi.fn(),
79+
isPinned: () => false,
80+
applyPins: (items: any[]) => items,
81+
clearPins: vi.fn(),
82+
}),
83+
}));
84+
7585
vi.mock('../utils', () => ({
7686
resolveI18nLabel: (label: any) => (typeof label === 'string' ? label : label?.en || ''),
7787
}));

0 commit comments

Comments
 (0)