feat: Add Init Script Indicator visibility feature for worktrees

This commit introduces a new feature allowing users to toggle the visibility of the Init Script Indicator for each project. Key changes include:

1. **State Management**: Added `showInitScriptIndicatorByProject` to manage the visibility state per project.
2. **UI Components**: Implemented a checkbox in the WorktreesSection to enable or disable the Init Script Indicator, enhancing user control over the UI.
3. **BoardView Updates**: Modified the BoardView to conditionally render the Init Script Indicator based on the new visibility state.

These enhancements improve the user experience by providing customizable visibility options for the Init Script Indicator, streamlining project management workflows.
This commit is contained in:
Kacper
2026-01-10 23:03:29 +01:00
parent c24e6207d0
commit aeb5bd829f
4 changed files with 80 additions and 2 deletions

View File

@@ -665,6 +665,10 @@ export interface AppState {
// Whether the worktree panel row is visible (default: true)
worktreePanelVisibleByProject: Record<string, boolean>;
// Init Script Indicator Visibility (per-project, keyed by project path)
// Whether to show the floating init script indicator panel (default: true)
showInitScriptIndicatorByProject: Record<string, boolean>;
// UI State (previously in localStorage, now synced via API)
/** Whether worktree panel is collapsed in board view */
worktreePanelCollapsed: boolean;
@@ -1078,6 +1082,10 @@ export interface AppActions {
setWorktreePanelVisible: (projectPath: string, visible: boolean) => void;
getWorktreePanelVisible: (projectPath: string) => boolean;
// Init Script Indicator Visibility actions (per-project)
setShowInitScriptIndicator: (projectPath: string, visible: boolean) => void;
getShowInitScriptIndicator: (projectPath: string) => boolean;
// UI State actions (previously in localStorage, now synced via API)
setWorktreePanelCollapsed: (collapsed: boolean) => void;
setLastProjectDir: (dir: string) => void;
@@ -1208,6 +1216,7 @@ const initialState: AppState = {
codexModelsLastFetched: null,
pipelineConfigByProject: {},
worktreePanelVisibleByProject: {},
showInitScriptIndicatorByProject: {},
// UI State (previously in localStorage, now synced via API)
worktreePanelCollapsed: false,
lastProjectDir: '',
@@ -3124,6 +3133,21 @@ export const useAppStore = create<AppState & AppActions>()((set, get) => ({
return get().worktreePanelVisibleByProject[projectPath] ?? true;
},
// Init Script Indicator Visibility actions (per-project)
setShowInitScriptIndicator: (projectPath, visible) => {
set({
showInitScriptIndicatorByProject: {
...get().showInitScriptIndicatorByProject,
[projectPath]: visible,
},
});
},
getShowInitScriptIndicator: (projectPath) => {
// Default to true (visible) if not set
return get().showInitScriptIndicatorByProject[projectPath] ?? true;
},
// UI State actions (previously in localStorage, now synced via API)
setWorktreePanelCollapsed: (collapsed) => set({ worktreePanelCollapsed: collapsed }),
setLastProjectDir: (dir) => set({ lastProjectDir: dir }),