@brimveyn/aimux 1.20.4 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -25
- package/package.json +2 -2
- package/src/app-runtime/auto-commit-driver.ts +22 -27
- package/src/app-runtime/backend-attach-runtime.ts +43 -36
- package/src/app-runtime/backend-runtime-events.ts +107 -88
- package/src/app-runtime/editor-actions.ts +201 -0
- package/src/app-runtime/git-actions.ts +197 -0
- package/src/app-runtime/measure-ref.ts +19 -0
- package/src/app-runtime/navigation-actions.ts +213 -0
- package/src/app-runtime/project-actions.ts +188 -0
- package/src/app-runtime/prompt-injection.ts +123 -0
- package/src/app-runtime/selection.ts +29 -0
- package/src/app-runtime/settings-actions.ts +156 -0
- package/src/app-runtime/setup-actions.ts +237 -0
- package/src/app-runtime/side-effect-context.ts +33 -0
- package/src/app-runtime/side-effects.ts +305 -1589
- package/src/app-runtime/snippet-actions.ts +3 -2
- package/src/app-runtime/split-drag-controller.ts +4 -8
- package/src/app-runtime/tab-actions.ts +218 -0
- package/src/app-runtime/tab-runtime-timeouts.ts +1 -1
- package/src/app-runtime/use-auto-commit-driver.ts +14 -13
- package/src/app-runtime/use-backend-runtime.ts +12 -11
- package/src/app-runtime/use-directory-search.ts +5 -4
- package/src/app-runtime/use-mouse-handlers.ts +28 -42
- package/src/app-runtime/{use-workspace-autosave.ts → use-project-autosave.ts} +4 -4
- package/src/app-runtime/use-renderer-bindings.ts +2 -1
- package/src/app-runtime/use-setup-runner.ts +96 -0
- package/src/app-runtime/use-terminal-resize.ts +28 -33
- package/src/app-runtime/workspace-actions.ts +366 -0
- package/src/app-runtime/workspace-activity.ts +138 -0
- package/src/app-runtime/workspace-naming.ts +90 -0
- package/src/app.tsx +102 -85
- package/src/assets/sounds/bell.wav +0 -0
- package/src/assets/sounds/ding.wav +0 -0
- package/src/assets/sounds/plane.wav +0 -0
- package/src/cli/client/daemon-client.ts +2 -2
- package/src/cli/client/project-resolver.ts +112 -0
- package/src/cli/commands/project/close.ts +32 -0
- package/src/cli/commands/project/create.ts +93 -0
- package/src/cli/commands/project/list.ts +25 -0
- package/src/cli/commands/project/show.ts +32 -0
- package/src/cli/commands/{workspace → project}/switch.ts +19 -19
- package/src/cli/commands/tab/await.ts +2 -2
- package/src/cli/commands/tab/close.ts +3 -3
- package/src/cli/commands/tab/create.ts +74 -73
- package/src/cli/commands/tab/focus.ts +3 -3
- package/src/cli/commands/tab/list.ts +6 -6
- package/src/cli/commands/tab/run.ts +2 -2
- package/src/cli/commands/tab/send.ts +2 -2
- package/src/cli/commands/tab/snapshot.ts +2 -2
- package/src/cli/commands/tab/tail.ts +2 -2
- package/src/cli/commands/tab/wait.ts +2 -2
- package/src/cli/commands/worker/await.ts +3 -3
- package/src/cli/commands/worker/doctor.ts +30 -30
- package/src/cli/commands/worker/list.ts +15 -15
- package/src/cli/commands/worker/prompt.ts +3 -3
- package/src/cli/commands/worker/run.ts +23 -23
- package/src/cli/commands/worker/shared.ts +53 -59
- package/src/cli/commands/worker/stop.ts +29 -29
- package/src/cli/commands/worker/submit.ts +3 -3
- package/src/cli/commands/{worktree → workspace}/create-core.ts +26 -26
- package/src/cli/commands/workspace/create.ts +30 -68
- package/src/cli/commands/workspace/list.ts +52 -9
- package/src/cli/commands/workspace/remove.ts +81 -0
- package/src/cli/completion/plan.ts +2 -2
- package/src/cli/completion/sources.ts +18 -18
- package/src/cli/context.ts +13 -13
- package/src/cli/flags.ts +30 -10
- package/src/cli/index.ts +26 -16
- package/src/cli/output.ts +1 -1
- package/src/cli/registry.ts +12 -12
- package/src/config/loader.ts +16 -5
- package/src/config.ts +149 -101
- package/src/daemon/catalog-writer.ts +67 -67
- package/src/daemon/daemon.ts +205 -201
- package/src/daemon/session-manager.ts +39 -39
- package/src/daemon/session-registry.ts +14 -14
- package/src/git/divergence.ts +33 -2
- package/src/git/git-poller.ts +1 -1
- package/src/git/git-status.ts +2 -2
- package/src/git/{move-worktree.ts → move-workspace.ts} +5 -5
- package/src/git/pr-merge.ts +64 -0
- package/src/git/pr-status-poller.ts +57 -0
- package/src/git/pr-status.ts +227 -0
- package/src/git/repo-discovery.ts +1 -1
- package/src/git/use-repo-discovery.ts +1 -1
- package/src/git/workspace-branch-poller.ts +54 -0
- package/src/git/workspace-divergence-poller.ts +65 -0
- package/src/git/worktree.ts +29 -0
- package/src/index.tsx +11 -6
- package/src/input/keymap/help-entries.ts +7 -5
- package/src/input/modes/bridge.ts +13 -12
- package/src/input/modes/handlers/shared.ts +1 -1
- package/src/input/modes/transitions.ts +34 -21
- package/src/input/modes/types.ts +48 -31
- package/src/ipc/manager-protocol.ts +44 -44
- package/src/ipc/protocol.ts +192 -166
- package/src/platform/open-url.ts +39 -0
- package/src/platform/play-sound.ts +184 -0
- package/src/platform/project-search.ts +8 -8
- package/src/platform/worktree-paths.ts +8 -6
- package/src/pty/assistant-question-extractor.ts +1 -1
- package/src/pty/assistant-status-detection-loop.ts +79 -55
- package/src/pty/assistant-status-detector.ts +40 -15
- package/src/pty/command-registry.ts +81 -1
- package/src/restart-terminal-manager.ts +1 -1
- package/src/services/ai-usage/provider.ts +9 -2
- package/src/services/ai-usage/spawn.ts +3 -1
- package/src/session-backend/bootstrap.ts +4 -4
- package/src/session-backend/local-session-backend.ts +78 -75
- package/src/session-backend/remote-session-backend.ts +64 -52
- package/src/session-backend/types.ts +43 -32
- package/src/settings/live.ts +90 -0
- package/src/settings/search.ts +43 -0
- package/src/settings/sections/about.ts +49 -0
- package/src/settings/sections/appearance.ts +54 -0
- package/src/settings/sections/automation.ts +105 -0
- package/src/settings/sections/commands.ts +72 -0
- package/src/settings/sections/editor.ts +56 -0
- package/src/settings/sections/experimental.ts +57 -0
- package/src/settings/sections/git.ts +112 -0
- package/src/settings/sections/index.ts +95 -0
- package/src/settings/sections/integrations.ts +23 -0
- package/src/settings/sections/layout.ts +72 -0
- package/src/settings/sections/notifications.ts +99 -0
- package/src/settings/sections/setup.ts +54 -0
- package/src/settings/sections/status-bar.ts +63 -0
- package/src/settings/settings-store.ts +207 -0
- package/src/settings/types.ts +108 -0
- package/src/snippets/run-shell-var.ts +48 -22
- package/src/state/actions.ts +342 -0
- package/src/state/app-store.ts +2 -1
- package/src/state/bars.ts +75 -0
- package/src/state/dispatch-ref.ts +1 -1
- package/src/state/git-pane-sizing.ts +0 -9
- package/src/state/layout-resize.ts +2 -2
- package/src/state/pr-status-store.ts +39 -0
- package/src/state/project-catalog.ts +275 -0
- package/src/state/project-data.ts +143 -0
- package/src/state/{session-persistence.ts → project-persistence.ts} +77 -73
- package/src/state/project-save.ts +46 -0
- package/src/state/project-workspaces.ts +392 -0
- package/src/state/reducers/auto-commit-state.ts +11 -10
- package/src/state/reducers/git-commit-modal-state.ts +122 -0
- package/src/state/reducers/git-mode-state.ts +1 -1
- package/src/state/reducers/git-panel-state.ts +10 -53
- package/src/state/reducers/modal-state.ts +290 -681
- package/src/state/reducers/multi-repo-state.ts +3 -6
- package/src/state/reducers/project-state.ts +312 -0
- package/src/state/reducers/settings-state.ts +80 -0
- package/src/state/reducers/tab-state.ts +107 -60
- package/src/state/reducers/ui-state.ts +86 -15
- package/src/state/selectors.ts +49 -37
- package/src/state/store.ts +83 -57
- package/src/state/types.ts +261 -417
- package/src/state/validation.ts +14 -12
- package/src/terminal-manager/manager-client.ts +32 -32
- package/src/terminal-manager/terminal-manager.ts +24 -24
- package/src/ui/components/git/diff-renderer/pierre-diff.tsx +2 -1
- package/src/ui/components/git/git-panel.tsx +2 -2
- package/src/ui/components/git/git-view.tsx +12 -12
- package/src/ui/components/git/image-diff/image-diff-view.tsx +1 -1
- package/src/ui/components/git/pane/git-pane-header.tsx +105 -39
- package/src/ui/components/git/pane/git-pane-widget.tsx +37 -23
- package/src/ui/components/git/pane/pr-checks-panel.tsx +197 -0
- package/src/ui/components/git/pane/pr-state-row.tsx +103 -0
- package/src/ui/components/layout/bar.tsx +191 -0
- package/src/ui/components/layout/sidebar/project-list.tsx +444 -0
- package/src/ui/components/layout/sidebar/tab-item.tsx +27 -12
- package/src/ui/components/layout/sidebar/use-sidebar-auto-scroll.ts +1 -1
- package/src/ui/components/layout/sidebar/workspace-row.tsx +253 -0
- package/src/ui/components/layout/status-bar.tsx +6 -2
- package/src/ui/components/layout/terminal-pane.tsx +34 -29
- package/src/ui/components/layout/top-tab-bar.tsx +48 -37
- package/src/ui/components/modals/git/git-commit-modal.tsx +8 -8
- package/src/ui/components/modals/{sessions/create-session-modal.tsx → projects/create-project-modal.tsx} +12 -12
- package/src/ui/components/modals/{sessions/session-name-modal.tsx → projects/project-name-modal.tsx} +2 -2
- package/src/ui/components/modals/{sessions/session-picker-modal.tsx → projects/project-picker-modal.tsx} +33 -35
- package/src/ui/components/modals/settings/settings-search-modal.tsx +70 -0
- package/src/ui/components/modals/shared/form.tsx +34 -22
- package/src/ui/components/modals/shared/picker.tsx +10 -10
- package/src/ui/components/modals/shared/{worktree-delete-confirm.tsx → workspace-delete-confirm.tsx} +9 -9
- package/src/ui/components/modals/tabs/new-tab-modal.tsx +30 -324
- package/src/ui/components/modals/workspace/create-workspace-modal.tsx +101 -0
- package/src/ui/components/modals/{worktree/worktree-move-confirm-modal.tsx → workspace/workspace-move-confirm-modal.tsx} +5 -5
- package/src/ui/components/modals/{worktree/worktree-move-modal.tsx → workspace/workspace-move-modal.tsx} +29 -27
- package/src/ui/components/primitives/input-field.tsx +7 -3
- package/src/ui/components/primitives/surface.tsx +3 -0
- package/src/ui/components/settings/row-value.tsx +74 -0
- package/src/ui/components/settings/settings-row.tsx +78 -0
- package/src/ui/components/settings/settings-view.tsx +169 -0
- package/src/ui/components/setup/setup-widget.tsx +152 -0
- package/src/ui/flash/build-labels.ts +27 -27
- package/src/ui/hooks/use-activity-sprite.ts +73 -0
- package/src/ui/hooks/use-scroll-active-into-view.ts +26 -0
- package/src/ui/{session-ordering.ts → project-ordering.ts} +4 -4
- package/src/ui/root.tsx +164 -230
- package/src/ui/status-bar-model.ts +48 -34
- package/src/ui/terminal-graphics/kitty.ts +28 -2
- package/src/ui/terminal-graphics/sprites/done@330/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/done@330/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/idle@1000/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/idle@1000/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/waiting@170/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/waiting@170/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/2.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/3.png +0 -0
- package/src/ui/terminal-graphics/sprites.ts +246 -0
- package/src/ui/truncate.ts +7 -0
- package/src/ui/widgets/registry.tsx +21 -0
- package/src/ui/widgets/widget-context-menu.ts +85 -0
- package/src/update.ts +2 -2
- package/src/app-runtime/session-actions.ts +0 -187
- package/src/cli/client/workspace-resolver.ts +0 -110
- package/src/cli/commands/workspace/close.ts +0 -32
- package/src/cli/commands/workspace/show.ts +0 -32
- package/src/cli/commands/worktree/create.ts +0 -55
- package/src/cli/commands/worktree/list.ts +0 -68
- package/src/cli/commands/worktree/remove.ts +0 -81
- package/src/git/worktree-branch-poller.ts +0 -54
- package/src/git/worktree-divergence-poller.ts +0 -59
- package/src/state/reducers/session-state.ts +0 -262
- package/src/state/session-catalog.ts +0 -143
- package/src/state/session-worktrees.ts +0 -260
- package/src/state/workspace-save.ts +0 -45
- package/src/ui/components/git/pane/git-pane-context-menu.ts +0 -26
- package/src/ui/components/layout/sidebar/sidebar.tsx +0 -163
- package/src/ui/components/layout/sidebar/use-top-tab-bar-auto-scroll.ts +0 -30
- package/src/ui/components/layout/sidebar/workspace-list.tsx +0 -418
- package/src/ui/components/layout/sidebar/worktree-row.tsx +0 -149
- /package/src/ui/{components/git/image-diff → terminal-graphics}/dimensions.ts +0 -0
package/src/state/store.ts
CHANGED
|
@@ -1,131 +1,154 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppAction } from './actions'
|
|
2
2
|
|
|
3
|
+
import { clampBarWidth, KNOWN_WIDGET_IDS } from './bars'
|
|
3
4
|
import { reduceAutoCommit } from './reducers/auto-commit-state'
|
|
4
5
|
import { emptyGitMode, reduceGitModeState } from './reducers/git-mode-state'
|
|
5
6
|
import { emptyGitPanel, reduceGitPanelState } from './reducers/git-panel-state'
|
|
6
7
|
import { emptyModal, reduceModalState } from './reducers/modal-state'
|
|
7
8
|
import { reduceMultiRepoState } from './reducers/multi-repo-state'
|
|
8
|
-
import {
|
|
9
|
+
import { reduceProjectState } from './reducers/project-state'
|
|
10
|
+
import { emptySettingsUI, reduceSettingsState } from './reducers/settings-state'
|
|
9
11
|
import { reduceTabState } from './reducers/tab-state'
|
|
10
12
|
import { reduceUIState } from './reducers/ui-state'
|
|
11
13
|
import { filterSnippets } from './selectors'
|
|
12
14
|
import {
|
|
13
|
-
type AppAction,
|
|
14
15
|
type AppState,
|
|
16
|
+
type BarsState,
|
|
15
17
|
EMPTY_AUTO_COMMIT_STATE,
|
|
16
18
|
EMPTY_MULTI_REPO_STATE,
|
|
17
19
|
type GitModeState,
|
|
18
|
-
type GitPaneMode,
|
|
19
|
-
type GitPanePosition,
|
|
20
20
|
type GitPaneState,
|
|
21
|
-
type
|
|
21
|
+
type ProjectRecord,
|
|
22
22
|
type SnippetRecord,
|
|
23
23
|
} from './types'
|
|
24
24
|
|
|
25
|
-
const DEFAULT_SIDEBAR_WIDTH = 28
|
|
26
|
-
const DEFAULT_SIDEBAR_MIN_WIDTH = 18
|
|
27
|
-
const DEFAULT_SIDEBAR_MAX_WIDTH = 42
|
|
28
25
|
const DEFAULT_TERMINAL_COLS = 80
|
|
29
26
|
const DEFAULT_TERMINAL_ROWS = 24
|
|
30
27
|
|
|
31
28
|
export interface InitialStateOverrides {
|
|
32
29
|
gitMode?: Partial<GitModeState>
|
|
33
30
|
gitPane?: Partial<GitPaneState>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
worktreeTemplates?: WorktreeTemplate[]
|
|
31
|
+
bars?: BarsState
|
|
32
|
+
projectBarVisible?: boolean
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
const DEFAULT_GIT_PANE: GitPaneState = {
|
|
40
36
|
diffCount: { enabled: true },
|
|
41
37
|
diffModeRatio: 0.35,
|
|
42
|
-
embeddedRatio: 0.5,
|
|
43
38
|
fileListMode: 'tree',
|
|
44
|
-
mode: 'embedded',
|
|
45
|
-
paneRatio: 0.5,
|
|
46
39
|
path: { enabled: true },
|
|
47
|
-
position: 'bottom',
|
|
48
40
|
prefetchRadius: 5,
|
|
49
41
|
treeCompaction: true,
|
|
50
|
-
visible: true,
|
|
51
42
|
}
|
|
52
43
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
export const DEFAULT_BARS: BarsState = {
|
|
45
|
+
left: {
|
|
46
|
+
visible: true,
|
|
47
|
+
widgets: [
|
|
48
|
+
{ grow: 50, id: 'projects', visible: true },
|
|
49
|
+
{ grow: 50, id: 'git', visible: true },
|
|
50
|
+
// Opt-in: reachable via the bar's right-click menu ("Show Setup"). Present
|
|
51
|
+
// here so sanitizeBars places it rather than treating it as corruption.
|
|
52
|
+
{ grow: 50, id: 'setup', visible: false },
|
|
53
|
+
],
|
|
54
|
+
width: 28,
|
|
55
|
+
},
|
|
56
|
+
right: { visible: false, widgets: [], width: 40 },
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Persisted widget ids from before the project/workspace rename. Without this
|
|
61
|
+
* the old id is simply unknown, so the widget is pruned, the bar renders empty
|
|
62
|
+
* and the emptied layout is written straight back to aimux.json.
|
|
63
|
+
*
|
|
64
|
+
* ponytail: drop with the other rename shims.
|
|
65
|
+
*/
|
|
66
|
+
const LEGACY_WIDGET_IDS: Record<string, string> = { workspaces: 'projects' }
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Drop widget ids this build cannot render (config written by a newer or
|
|
70
|
+
* patched version) and normalise widths — the only place unknown ids can enter.
|
|
71
|
+
*/
|
|
72
|
+
function sanitizeBars(bars: BarsState): BarsState {
|
|
73
|
+
const sanitizeBar = (bar: BarsState[keyof BarsState]): BarsState[keyof BarsState] => ({
|
|
74
|
+
...bar,
|
|
75
|
+
widgets: bar.widgets
|
|
76
|
+
.map((widget) => ({ ...widget, id: LEGACY_WIDGET_IDS[widget.id] ?? widget.id }))
|
|
77
|
+
.filter((widget) => (KNOWN_WIDGET_IDS as readonly string[]).includes(widget.id))
|
|
78
|
+
.map((widget) => ({ ...widget, grow: Math.max(1, Math.round(widget.grow)) })),
|
|
79
|
+
width: clampBarWidth(bar.width),
|
|
80
|
+
})
|
|
81
|
+
const sanitized: BarsState = { left: sanitizeBar(bars.left), right: sanitizeBar(bars.right) }
|
|
82
|
+
|
|
83
|
+
// A widget can only ever be moved between bars or hidden, never deleted, so
|
|
84
|
+
// one that is in neither bar means the persisted layout was corrupted —
|
|
85
|
+
// which is exactly what the pre-rename `workspaces` id did to older files
|
|
86
|
+
// before LEGACY_WIDGET_IDS existed. Put it back where it ships by default,
|
|
87
|
+
// otherwise the bar renders empty forever and re-saves that emptiness.
|
|
88
|
+
for (const side of ['left', 'right'] as const) {
|
|
89
|
+
for (const fallback of DEFAULT_BARS[side].widgets) {
|
|
90
|
+
const present =
|
|
91
|
+
sanitized.left.widgets.some((w) => w.id === fallback.id) ||
|
|
92
|
+
sanitized.right.widgets.some((w) => w.id === fallback.id)
|
|
93
|
+
if (!present) {
|
|
94
|
+
sanitized[side] = { ...sanitized[side], widgets: [...sanitized[side].widgets, fallback] }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return sanitized
|
|
62
99
|
}
|
|
63
100
|
|
|
64
101
|
export function createInitialState(
|
|
65
102
|
customCommands: Record<string, string> = {},
|
|
66
|
-
|
|
103
|
+
projects: ProjectRecord[] = [],
|
|
67
104
|
snippets: SnippetRecord[] = [],
|
|
68
|
-
|
|
105
|
+
showProjectPicker = false,
|
|
69
106
|
overrides: InitialStateOverrides = {}
|
|
70
107
|
): AppState {
|
|
71
|
-
const gitPaneMode = overrides.gitPane?.mode ?? DEFAULT_GIT_PANE.mode
|
|
72
|
-
const gitPanePosition = resolveGitPanePosition(
|
|
73
|
-
gitPaneMode,
|
|
74
|
-
overrides.gitPane?.position ?? DEFAULT_GIT_PANE.position
|
|
75
|
-
)
|
|
76
108
|
return {
|
|
77
109
|
activeTabId: null,
|
|
78
110
|
autoCommit: EMPTY_AUTO_COMMIT_STATE,
|
|
79
|
-
|
|
111
|
+
bars: sanitizeBars(overrides.bars ?? DEFAULT_BARS),
|
|
112
|
+
currentProjectId: null,
|
|
80
113
|
customCommands,
|
|
81
|
-
focusMode:
|
|
114
|
+
focusMode: showProjectPicker ? 'command-edit' : 'navigation',
|
|
82
115
|
gitMode: { ...emptyGitMode(), ...overrides.gitMode },
|
|
83
|
-
gitPane: {
|
|
84
|
-
...DEFAULT_GIT_PANE,
|
|
85
|
-
...overrides.gitPane,
|
|
86
|
-
mode: gitPaneMode,
|
|
87
|
-
position: gitPanePosition,
|
|
88
|
-
},
|
|
116
|
+
gitPane: { ...DEFAULT_GIT_PANE, ...overrides.gitPane },
|
|
89
117
|
gitPanel: emptyGitPanel(),
|
|
90
|
-
|
|
118
|
+
lastActiveTabByWorkspace: {},
|
|
91
119
|
layout: {
|
|
92
120
|
terminalCols: DEFAULT_TERMINAL_COLS,
|
|
93
121
|
terminalRows: DEFAULT_TERMINAL_ROWS,
|
|
94
122
|
},
|
|
95
123
|
layoutTrees: {},
|
|
96
|
-
modal:
|
|
124
|
+
modal: showProjectPicker
|
|
97
125
|
? {
|
|
98
126
|
cursorPos: 0,
|
|
99
127
|
editBuffer: '',
|
|
128
|
+
projectTargetId: null,
|
|
100
129
|
selectedIndex: 0,
|
|
101
|
-
|
|
102
|
-
type: 'session-picker',
|
|
130
|
+
type: 'project-picker',
|
|
103
131
|
}
|
|
104
132
|
: emptyModal(),
|
|
105
133
|
multiRepo: EMPTY_MULTI_REPO_STATE,
|
|
106
134
|
pendingChords: null,
|
|
107
|
-
|
|
108
|
-
visible: overrides.
|
|
109
|
-
},
|
|
110
|
-
sessions,
|
|
111
|
-
sessionStatuses: {},
|
|
112
|
-
sidebar: {
|
|
113
|
-
maxWidth: DEFAULT_SIDEBAR_MAX_WIDTH,
|
|
114
|
-
minWidth: DEFAULT_SIDEBAR_MIN_WIDTH,
|
|
115
|
-
visible: overrides.sidebar?.visible ?? true,
|
|
116
|
-
width: clampSidebarWidth(overrides.sidebar?.width ?? DEFAULT_SIDEBAR_WIDTH),
|
|
135
|
+
projectBar: {
|
|
136
|
+
visible: overrides.projectBarVisible ?? true,
|
|
117
137
|
},
|
|
138
|
+
projects,
|
|
139
|
+
projectStatuses: {},
|
|
140
|
+
settings: emptySettingsUI(),
|
|
118
141
|
snippets,
|
|
119
142
|
tabGroupMap: {},
|
|
120
143
|
tabs: [],
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
workspaceActivity: {},
|
|
145
|
+
workspaceDivergence: {},
|
|
123
146
|
}
|
|
124
147
|
}
|
|
125
148
|
|
|
126
149
|
export function appReducer(state: AppState, action: AppAction): AppState {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
150
|
+
const projectState = reduceProjectState(state, action)
|
|
151
|
+
if (projectState) return projectState
|
|
129
152
|
|
|
130
153
|
const tabState = reduceTabState(state, action)
|
|
131
154
|
if (tabState) return tabState
|
|
@@ -148,6 +171,9 @@ export function appReducer(state: AppState, action: AppAction): AppState {
|
|
|
148
171
|
const multiRepoState = reduceMultiRepoState(state, action)
|
|
149
172
|
if (multiRepoState) return multiRepoState
|
|
150
173
|
|
|
174
|
+
const settingsState = reduceSettingsState(state, action)
|
|
175
|
+
if (settingsState) return settingsState
|
|
176
|
+
|
|
151
177
|
switch (action.type) {
|
|
152
178
|
case 'set-snippets':
|
|
153
179
|
return { ...state, snippets: action.snippets }
|