fix: remove stale worktree layout cleanup
This commit is contained in:
@@ -34,7 +34,6 @@ function createTestStore() {
|
||||
unifiedTabsByWorktree: {},
|
||||
groupsByWorktree: {},
|
||||
activeGroupIdByWorktree: {},
|
||||
layoutByWorktree: {},
|
||||
openFiles: [],
|
||||
editorDrafts: {},
|
||||
markdownViewMode: {},
|
||||
@@ -272,10 +271,6 @@ describe('removeWorktree state cleanup', () => {
|
||||
activeGroupIdByWorktree: {
|
||||
'repo1::/path/wt1': 'group-1',
|
||||
'repo1::/path/wt2': 'group-2'
|
||||
},
|
||||
layoutByWorktree: {
|
||||
'repo1::/path/wt1': { type: 'leaf', groupId: 'group-1' },
|
||||
'repo1::/path/wt2': { type: 'leaf', groupId: 'group-2' }
|
||||
}
|
||||
} as unknown as Partial<AppState>)
|
||||
|
||||
@@ -293,9 +288,6 @@ describe('removeWorktree state cleanup', () => {
|
||||
expect(store.getState().activeGroupIdByWorktree).toEqual({
|
||||
'repo1::/path/wt2': 'group-2'
|
||||
})
|
||||
expect(store.getState().layoutByWorktree).toEqual({
|
||||
'repo1::/path/wt2': { type: 'leaf', groupId: 'group-2' }
|
||||
})
|
||||
})
|
||||
|
||||
it('cleans up git caches for the removed worktree', async () => {
|
||||
|
||||
@@ -153,8 +153,6 @@ export const createWorktreeSlice: StateCreator<AppState, [], [], WorktreeSlice>
|
||||
delete nextGroupsByWorktree[worktreeId]
|
||||
const nextActiveGroupIdByWorktree = { ...s.activeGroupIdByWorktree }
|
||||
delete nextActiveGroupIdByWorktree[worktreeId]
|
||||
const nextLayoutByWorktree = { ...s.layoutByWorktree }
|
||||
delete nextLayoutByWorktree[worktreeId]
|
||||
// Why: git status / compare caches are keyed by worktree and stop being
|
||||
// refreshed once the worktree is deleted. Remove them here so deleted
|
||||
// worktrees cannot retain stale conflict badges, branch diffs, or compare
|
||||
@@ -222,7 +220,6 @@ export const createWorktreeSlice: StateCreator<AppState, [], [], WorktreeSlice>
|
||||
unifiedTabsByWorktree: nextUnifiedTabsByWorktree,
|
||||
groupsByWorktree: nextGroupsByWorktree,
|
||||
activeGroupIdByWorktree: nextActiveGroupIdByWorktree,
|
||||
layoutByWorktree: nextLayoutByWorktree,
|
||||
editorDrafts: nextEditorDrafts,
|
||||
markdownViewMode: nextMarkdownViewMode,
|
||||
expandedDirs: nextExpandedDirs,
|
||||
|
||||
Reference in New Issue
Block a user