feat(context-panel): add plan view to sidebar panel (#446)

This commit is contained in:
Nelson Pires
2026-02-19 00:52:18 +02:00
committed by GitHub
parent 057bdb584c
commit 34c8ff3962
3 changed files with 72 additions and 4 deletions
+25 -1
View File
@@ -6,7 +6,7 @@ import { SEMANTIC_TYPOGRAPHY, getTypographyVariable, type SemanticTypographyKey
export type MainTab = 'chat' | 'plan' | 'git' | 'diff' | 'terminal' | 'files';
export type RightSidebarTab = 'git' | 'files';
export type ContextPanelMode = 'diff' | 'file' | 'context';
export type ContextPanelMode = 'diff' | 'file' | 'context' | 'plan';
type ContextPanelDirectoryState = {
isOpen: boolean;
@@ -225,6 +225,7 @@ interface UIStore {
openContextDiff: (directory: string, filePath: string) => void;
openContextFile: (directory: string, filePath: string) => void;
openContextOverview: (directory: string) => void;
openContextPlan: (directory: string) => void;
closeContextPanel: (directory: string) => void;
toggleContextPanelExpanded: (directory: string) => void;
setContextPanelWidth: (directory: string, width: number) => void;
@@ -549,6 +550,29 @@ export const useUIStore = create<UIStore>()(
});
},
openContextPlan: (directory) => {
const normalizedDirectory = normalizeDirectoryPath((directory || '').trim());
if (!normalizedDirectory) {
return;
}
set((state) => {
const prev = state.contextPanelByDirectory[normalizedDirectory];
const current = touchContextPanelState(prev);
const byDirectory = {
...state.contextPanelByDirectory,
[normalizedDirectory]: {
...current,
isOpen: true,
mode: 'plan' as const,
targetPath: null,
},
};
return { contextPanelByDirectory: clampContextPanelRoots(byDirectory, 20) };
});
},
closeContextPanel: (directory) => {
const normalizedDirectory = normalizeDirectoryPath((directory || '').trim());
if (!normalizedDirectory) {