From c23b743580fc3992d068179668016691f6c68e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CBeeRad=E2=80=9D?= Date: Sun, 15 Feb 2026 09:10:38 +1100 Subject: [PATCH] refactor: move guides from left toolbar to settings - Remove guides from LeftToolbar pane type buttons - Remove 'guides' from PaneType union and PANE_LABELS - Remove GuidesPane from pane exports and ThreePanelLayout rendering - Add migration to reset persisted slots that had type 'guides' - Guides remain accessible via Settings modal (GuidesViewer tab) Co-Authored-By: Claude Opus 4.6 --- src/components/layout/LeftToolbar.tsx | 9 +++----- src/components/layout/ThreePanelLayout.tsx | 26 +++++++++++----------- src/components/panes/index.ts | 1 - src/components/panes/types.ts | 9 +++----- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/components/layout/LeftToolbar.tsx b/src/components/layout/LeftToolbar.tsx index 09c288e..ab62c0e 100644 --- a/src/components/layout/LeftToolbar.tsx +++ b/src/components/layout/LeftToolbar.tsx @@ -7,7 +7,6 @@ import { LayoutList, Map, Folder, - FileText, Settings, } from 'lucide-react'; import type { PaneType } from '../panes/types'; @@ -22,23 +21,21 @@ interface LeftToolbarProps { slotBType: PaneType | null; } -// Map pane types to their icons (chat removed in rah-light) +// Map pane types to their icons (chat removed in rah-light, guides moved to settings) const PANE_TYPE_ICONS: Record = { views: LayoutList, map: Map, dimensions: Folder, - guides: FileText, }; const PANE_TYPE_LABELS: Record = { views: 'Feed', map: 'Map', dimensions: 'Dimensions', - guides: 'Guides', }; -// Pane types shown in the toolbar (excludes 'node' which is opened via Feed, chat removed in rah-light) -const TOOLBAR_PANE_TYPES: PaneType[] = ['views', 'map', 'dimensions', 'guides']; +// Pane types shown in the toolbar (excludes 'node', 'chat', and 'guides' which is in settings) +const TOOLBAR_PANE_TYPES: PaneType[] = ['views', 'map', 'dimensions']; interface ToolbarButtonProps { icon: typeof Search; diff --git a/src/components/layout/ThreePanelLayout.tsx b/src/components/layout/ThreePanelLayout.tsx index 5c468a8..ef18fad 100644 --- a/src/components/layout/ThreePanelLayout.tsx +++ b/src/components/layout/ThreePanelLayout.tsx @@ -25,8 +25,8 @@ type AgentDelegation = { import LeftToolbar from './LeftToolbar'; import SplitHandle from './SplitHandle'; -// Pane components (ChatPane removed in rah-light) -import { NodePane, GuidesPane, DimensionsPane, MapPane, ViewsPane } from '../panes'; +// Pane components (ChatPane removed in rah-light, GuidesPane moved to settings) +import { NodePane, DimensionsPane, MapPane, ViewsPane } from '../panes'; import QuickAddInput from '../agents/QuickAddInput'; import type { PaneType, SlotState, PaneAction } from '../panes/types'; @@ -47,6 +47,16 @@ export default function ThreePanelLayout() { // SlotB width as percentage (when open) const [slotBWidth, setSlotBWidth] = usePersistentState('ui.slotBWidth', 50); + // Migration: if a slot was persisted with type 'guides' (now moved to settings), reset it + useEffect(() => { + if (slotA && (slotA.type as string) === 'guides') { + setSlotA({ type: 'views' }); + } + if (slotB && (slotB.type as string) === 'guides') { + setSlotB(null); + } + }, []); // eslint-disable-line react-hooks/exhaustive-deps + // Track which pane is active (last interacted with) const [activePane, setActivePane] = useState<'A' | 'B'>('A'); @@ -806,17 +816,7 @@ export default function ThreePanelLayout() { ); // case 'chat' removed in rah-light - - case 'guides': - return ( - - ); + // case 'guides' removed — moved to settings modal case 'dimensions': return ( diff --git a/src/components/panes/index.ts b/src/components/panes/index.ts index ed204ed..4f74d00 100644 --- a/src/components/panes/index.ts +++ b/src/components/panes/index.ts @@ -1,5 +1,4 @@ export { default as NodePane } from './NodePane'; -export { default as GuidesPane } from './GuidesPane'; export { default as DimensionsPane } from './DimensionsPane'; export { default as MapPane } from './MapPane'; export { default as ViewsPane } from './ViewsPane'; diff --git a/src/components/panes/types.ts b/src/components/panes/types.ts index 195d9dc..f2a4f81 100644 --- a/src/components/panes/types.ts +++ b/src/components/panes/types.ts @@ -14,8 +14,8 @@ export type AgentDelegation = { updatedAt: string; }; -// The five pane types (chat removed in rah-light) -export type PaneType = 'node' | 'guides' | 'dimensions' | 'map' | 'views'; +// The four pane types (chat removed in rah-light, guides moved to settings) +export type PaneType = 'node' | 'dimensions' | 'map' | 'views'; // State for each slot export interface SlotState { @@ -68,8 +68,6 @@ export interface HighlightedPassage { // ChatPaneProps removed in rah-light -// GuidesPaneProps - just uses BasePaneProps (guides are self-contained) - // DimensionsPane specific props export interface DimensionsPaneProps extends BasePaneProps { onNodeOpen: (nodeId: number) => void; @@ -103,7 +101,6 @@ export interface PaneHeaderProps { // Labels for pane types export const PANE_LABELS: Record = { node: 'Nodes', - guides: 'Guides', dimensions: 'Dimensions', map: 'Map', views: 'Feed', @@ -117,5 +114,5 @@ export const DEFAULT_SLOT_A: SlotState = { }; export const DEFAULT_SLOT_B: SlotState = { - type: 'guides', + type: 'views', };