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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d723212ed3
commit
c23b743580
@@ -7,7 +7,6 @@ import {
|
|||||||
LayoutList,
|
LayoutList,
|
||||||
Map,
|
Map,
|
||||||
Folder,
|
Folder,
|
||||||
FileText,
|
|
||||||
Settings,
|
Settings,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import type { PaneType } from '../panes/types';
|
import type { PaneType } from '../panes/types';
|
||||||
@@ -22,23 +21,21 @@ interface LeftToolbarProps {
|
|||||||
slotBType: PaneType | null;
|
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<string, typeof LayoutList> = {
|
const PANE_TYPE_ICONS: Record<string, typeof LayoutList> = {
|
||||||
views: LayoutList,
|
views: LayoutList,
|
||||||
map: Map,
|
map: Map,
|
||||||
dimensions: Folder,
|
dimensions: Folder,
|
||||||
guides: FileText,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const PANE_TYPE_LABELS: Record<string, string> = {
|
const PANE_TYPE_LABELS: Record<string, string> = {
|
||||||
views: 'Feed',
|
views: 'Feed',
|
||||||
map: 'Map',
|
map: 'Map',
|
||||||
dimensions: 'Dimensions',
|
dimensions: 'Dimensions',
|
||||||
guides: 'Guides',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Pane types shown in the toolbar (excludes 'node' which is opened via Feed, chat removed in rah-light)
|
// Pane types shown in the toolbar (excludes 'node', 'chat', and 'guides' which is in settings)
|
||||||
const TOOLBAR_PANE_TYPES: PaneType[] = ['views', 'map', 'dimensions', 'guides'];
|
const TOOLBAR_PANE_TYPES: PaneType[] = ['views', 'map', 'dimensions'];
|
||||||
|
|
||||||
interface ToolbarButtonProps {
|
interface ToolbarButtonProps {
|
||||||
icon: typeof Search;
|
icon: typeof Search;
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ type AgentDelegation = {
|
|||||||
import LeftToolbar from './LeftToolbar';
|
import LeftToolbar from './LeftToolbar';
|
||||||
import SplitHandle from './SplitHandle';
|
import SplitHandle from './SplitHandle';
|
||||||
|
|
||||||
// Pane components (ChatPane removed in rah-light)
|
// Pane components (ChatPane removed in rah-light, GuidesPane moved to settings)
|
||||||
import { NodePane, GuidesPane, DimensionsPane, MapPane, ViewsPane } from '../panes';
|
import { NodePane, DimensionsPane, MapPane, ViewsPane } from '../panes';
|
||||||
import QuickAddInput from '../agents/QuickAddInput';
|
import QuickAddInput from '../agents/QuickAddInput';
|
||||||
import type { PaneType, SlotState, PaneAction } from '../panes/types';
|
import type { PaneType, SlotState, PaneAction } from '../panes/types';
|
||||||
|
|
||||||
@@ -47,6 +47,16 @@ export default function ThreePanelLayout() {
|
|||||||
// SlotB width as percentage (when open)
|
// SlotB width as percentage (when open)
|
||||||
const [slotBWidth, setSlotBWidth] = usePersistentState<number>('ui.slotBWidth', 50);
|
const [slotBWidth, setSlotBWidth] = usePersistentState<number>('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)
|
// Track which pane is active (last interacted with)
|
||||||
const [activePane, setActivePane] = useState<'A' | 'B'>('A');
|
const [activePane, setActivePane] = useState<'A' | 'B'>('A');
|
||||||
|
|
||||||
@@ -806,17 +816,7 @@ export default function ThreePanelLayout() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// case 'chat' removed in rah-light
|
// case 'chat' removed in rah-light
|
||||||
|
// case 'guides' removed — moved to settings modal
|
||||||
case 'guides':
|
|
||||||
return (
|
|
||||||
<GuidesPane
|
|
||||||
slot={slot}
|
|
||||||
isActive={isActive}
|
|
||||||
onPaneAction={slot === 'A' ? handleSlotAAction : handleSlotBAction}
|
|
||||||
onCollapse={onCollapse}
|
|
||||||
onSwapPanes={slotB ? handleSwapPanes : undefined}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'dimensions':
|
case 'dimensions':
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
export { default as NodePane } from './NodePane';
|
export { default as NodePane } from './NodePane';
|
||||||
export { default as GuidesPane } from './GuidesPane';
|
|
||||||
export { default as DimensionsPane } from './DimensionsPane';
|
export { default as DimensionsPane } from './DimensionsPane';
|
||||||
export { default as MapPane } from './MapPane';
|
export { default as MapPane } from './MapPane';
|
||||||
export { default as ViewsPane } from './ViewsPane';
|
export { default as ViewsPane } from './ViewsPane';
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ export type AgentDelegation = {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The five pane types (chat removed in rah-light)
|
// The four pane types (chat removed in rah-light, guides moved to settings)
|
||||||
export type PaneType = 'node' | 'guides' | 'dimensions' | 'map' | 'views';
|
export type PaneType = 'node' | 'dimensions' | 'map' | 'views';
|
||||||
|
|
||||||
// State for each slot
|
// State for each slot
|
||||||
export interface SlotState {
|
export interface SlotState {
|
||||||
@@ -68,8 +68,6 @@ export interface HighlightedPassage {
|
|||||||
|
|
||||||
// ChatPaneProps removed in rah-light
|
// ChatPaneProps removed in rah-light
|
||||||
|
|
||||||
// GuidesPaneProps - just uses BasePaneProps (guides are self-contained)
|
|
||||||
|
|
||||||
// DimensionsPane specific props
|
// DimensionsPane specific props
|
||||||
export interface DimensionsPaneProps extends BasePaneProps {
|
export interface DimensionsPaneProps extends BasePaneProps {
|
||||||
onNodeOpen: (nodeId: number) => void;
|
onNodeOpen: (nodeId: number) => void;
|
||||||
@@ -103,7 +101,6 @@ export interface PaneHeaderProps {
|
|||||||
// Labels for pane types
|
// Labels for pane types
|
||||||
export const PANE_LABELS: Record<PaneType, string> = {
|
export const PANE_LABELS: Record<PaneType, string> = {
|
||||||
node: 'Nodes',
|
node: 'Nodes',
|
||||||
guides: 'Guides',
|
|
||||||
dimensions: 'Dimensions',
|
dimensions: 'Dimensions',
|
||||||
map: 'Map',
|
map: 'Map',
|
||||||
views: 'Feed',
|
views: 'Feed',
|
||||||
@@ -117,5 +114,5 @@ export const DEFAULT_SLOT_A: SlotState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const DEFAULT_SLOT_B: SlotState = {
|
export const DEFAULT_SLOT_B: SlotState = {
|
||||||
type: 'guides',
|
type: 'views',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user