From bd3d62d3d578e30bb76af456de8b0df56ebd86ca Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Thu, 12 Nov 2026 23:54:23 -0800 Subject: [PATCH] refactor: organize workspace cleanup by concrete owners (#41887) --- config/flaky-test-pattern-baseline.txt | 2 +- config/react-compiler-bailout-baseline.txt | 6 +- .../scripts/ci/sharding/ci-shard-timings.json | 26 ++++---- .../protected-copy-keys.mjs | 4 ++ .../WorkspaceCleanupDialog.tsx | 34 +++++------ ...se-workspace-cleanup-browse-state.test.tsx | 2 +- .../use-workspace-cleanup-browse-state.ts | 2 +- .../use-workspace-cleanup-facet-rows.ts | 16 ++--- .../use-workspace-cleanup-ignore.ts | 4 +- .../workspace-cleanup-active-facets.ts | 2 +- ...workspace-cleanup-applied-filter-chips.tsx | 4 +- .../workspace-cleanup-browse-toolbar.tsx | 4 +- .../workspace-cleanup-facet-controls.tsx | 0 .../workspace-cleanup-facet-labels.ts | 4 +- .../workspace-cleanup-facet-panel-model.ts | 6 +- .../workspace-cleanup-filter-bar.tsx | 2 +- .../workspace-cleanup-git-review-facets.tsx | 6 +- .../workspace-cleanup-lifecycle-facets.tsx | 2 +- .../workspace-cleanup-selection-model.ts | 0 .../workspace-cleanup-sort-header.tsx | 4 +- ...se-workspace-cleanup-git-evidence.test.tsx | 36 +---------- .../use-workspace-cleanup-git-evidence.ts | 6 +- .../workspace-cleanup-git-evidence.ts | 6 +- .../workspace-cleanup-host-index.test.ts} | 6 +- .../workspace-cleanup-host-indexes.ts} | 12 ++-- .../workspace-cleanup-review-lookup.ts} | 45 +++----------- .../use-workspace-cleanup-row-order.test.ts | 2 +- .../use-workspace-cleanup-row-order.ts | 2 +- .../workspace-cleanup-candidate-labels.ts | 6 +- .../workspace-cleanup-candidate-list.tsx | 0 .../workspace-cleanup-candidate-row-data.ts | 5 +- ...orkspace-cleanup-candidate-row-details.tsx | 4 +- ...rkspace-cleanup-candidate-row-trailing.tsx | 4 +- ...orkspace-cleanup-candidate-row.fixture.tsx | 12 ++-- .../workspace-cleanup-candidate-row.tsx | 8 +-- .../workspace-cleanup-flat-list.test.tsx | 4 +- .../workspace-cleanup-host-label.ts | 9 +-- .../workspace-cleanup-metadata-chip.tsx | 0 .../workspace-cleanup-relative-time.ts | 1 + .../workspace-cleanup-review-labels.ts} | 4 +- .../workspace-cleanup-row-list.tsx | 12 ++-- .../workspace-cleanup-status-pill.tsx | 0 ...anupDialog.stale-while-revalidate.test.tsx | 12 ++-- .../use-workspace-cleanup-dialog-lifecycle.ts | 4 +- ...orkspace-cleanup-dialog-header.fixture.tsx | 12 ++-- .../workspace-cleanup-dialog-header.tsx | 2 +- .../workspace-cleanup-dialog-notices.tsx | 2 +- .../workspace-cleanup-freshness.tsx | 4 +- ...orkspace-cleanup-candidate-filter-sort.ts} | 42 +++++++++---- ...e-cleanup-candidate-state.test-fixture.ts} | 10 ++-- .../workspace-cleanup-facet-matchers.ts | 2 +- .../workspace-cleanup-facet-row-caches.ts | 12 ++-- .../workspace-cleanup-facet-sort.test.ts | 2 +- .../workspace-cleanup-facet-sort.ts | 4 +- .../workspace-cleanup-facet.test.fixture.ts | 14 ++--- .../{ => query}/workspace-cleanup-facets.ts | 23 ++++---- .../workspace-cleanup-query.test.ts | 2 +- .../{ => query}/workspace-cleanup-query.ts | 4 +- .../use-workspace-cleanup-agent-stop-gate.ts | 4 +- .../workspace-cleanup-agent-stop-approval.ts | 2 +- .../workspace-cleanup-confirm-stop-agents.tsx | 10 ++-- .../workspace-cleanup-ancestor-skips.ts | 6 +- ...background-removal-late-settlement.test.ts | 2 +- ...rkspace-cleanup-background-removal.test.ts | 59 +------------------ .../workspace-cleanup-background-removal.ts | 5 +- ...pace-cleanup-post-batch-late-settlement.ts | 4 +- ...rkspace-cleanup-removal-settlement.test.ts | 2 +- .../workspace-cleanup-removal-settlement.ts | 4 +- ...e-cleanup-removal-timeout-recovery.test.ts | 2 +- .../workspace-cleanup-removal-toasts.ts | 2 +- ...eanup-skipped-ancestor-reclassification.ts | 2 +- ...kspace-cleanup-removal.agent-stop.test.tsx | 10 ++-- .../use-workspace-cleanup-removal.ts | 8 +-- ...se-workspace-cleanup-unverified-removal.ts | 8 +-- .../workspace-cleanup-confirm-remove.tsx | 24 ++++---- .../workspace-cleanup-deletion-phases.ts | 8 +-- ...orkspace-cleanup-forget-locally-button.tsx | 4 +- ...rkspace-cleanup-removal-candidates.test.ts | 4 +- .../workspace-cleanup-removal-candidates.ts | 6 +- .../workspace-cleanup-snapshot-prune-batch.ts | 4 +- .../use-workspace-cleanup-scan-lifecycle.ts | 0 .../workspace-cleanup-scan-notice.ts | 2 +- 82 files changed, 278 insertions(+), 369 deletions(-) rename src/renderer/src/components/workspace-cleanup/{ => browse}/use-workspace-cleanup-browse-state.test.tsx (97%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/use-workspace-cleanup-browse-state.ts (97%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/use-workspace-cleanup-facet-rows.ts (94%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/use-workspace-cleanup-ignore.ts (93%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-active-facets.ts (96%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-applied-filter-chips.tsx (97%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-browse-toolbar.tsx (94%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-facet-controls.tsx (100%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-facet-labels.ts (97%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-facet-panel-model.ts (81%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-filter-bar.tsx (99%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-git-review-facets.tsx (96%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-lifecycle-facets.tsx (98%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-selection-model.ts (100%) rename src/renderer/src/components/workspace-cleanup/{ => browse}/workspace-cleanup-sort-header.tsx (97%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-evidence}/use-workspace-cleanup-git-evidence.test.tsx (74%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-evidence}/use-workspace-cleanup-git-evidence.ts (97%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-evidence}/workspace-cleanup-git-evidence.ts (94%) rename src/renderer/src/components/workspace-cleanup/{workspace-cleanup-facet-filter.test.ts => candidate-evidence/workspace-cleanup-host-index.test.ts} (90%) rename src/renderer/src/components/workspace-cleanup/{workspace-cleanup-host-identity.ts => candidate-evidence/workspace-cleanup-host-indexes.ts} (88%) rename src/renderer/src/components/workspace-cleanup/{workspace-cleanup-presentation.ts => candidate-evidence/workspace-cleanup-review-lookup.ts} (79%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/use-workspace-cleanup-row-order.test.ts (90%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/use-workspace-cleanup-row-order.ts (96%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-labels.ts (95%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-list.tsx (100%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-row-data.ts (97%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-row-details.tsx (95%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-row-trailing.tsx (97%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-row.fixture.tsx (95%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-candidate-row.tsx (97%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-flat-list.test.tsx (94%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-host-label.ts (70%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-metadata-chip.tsx (100%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-relative-time.ts (97%) rename src/renderer/src/components/workspace-cleanup/{workspace-cleanup-row-labels.ts => candidate-list/workspace-cleanup-review-labels.ts} (72%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-row-list.tsx (92%) rename src/renderer/src/components/workspace-cleanup/{ => candidate-list}/workspace-cleanup-status-pill.tsx (100%) rename src/renderer/src/components/workspace-cleanup/{ => dialog}/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx (95%) rename src/renderer/src/components/workspace-cleanup/{ => dialog}/use-workspace-cleanup-dialog-lifecycle.ts (94%) rename src/renderer/src/components/workspace-cleanup/{ => dialog}/workspace-cleanup-dialog-header.fixture.tsx (84%) rename src/renderer/src/components/workspace-cleanup/{ => dialog}/workspace-cleanup-dialog-header.tsx (95%) rename src/renderer/src/components/workspace-cleanup/{ => dialog}/workspace-cleanup-dialog-notices.tsx (96%) rename src/renderer/src/components/workspace-cleanup/{ => dialog}/workspace-cleanup-freshness.tsx (90%) rename src/renderer/src/components/workspace-cleanup/{workspace-cleanup-filter-sort.ts => query/workspace-cleanup-candidate-filter-sort.ts} (86%) rename src/renderer/src/components/workspace-cleanup/{workspace-cleanup-presentation-fixtures.ts => query/workspace-cleanup-candidate-state.test-fixture.ts} (86%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-facet-matchers.ts (98%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-facet-row-caches.ts (90%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-facet-sort.test.ts (87%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-facet-sort.ts (96%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-facet.test.fixture.ts (86%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-facets.ts (90%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-query.test.ts (93%) rename src/renderer/src/components/workspace-cleanup/{ => query}/workspace-cleanup-query.ts (96%) rename src/renderer/src/components/workspace-cleanup/{ => removal/agent-consent}/use-workspace-cleanup-agent-stop-gate.ts (94%) rename src/renderer/src/components/workspace-cleanup/{ => removal/agent-consent}/workspace-cleanup-agent-stop-approval.ts (84%) rename src/renderer/src/components/workspace-cleanup/{ => removal/agent-consent}/workspace-cleanup-confirm-stop-agents.tsx (91%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-ancestor-skips.ts (87%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-background-removal-late-settlement.test.ts (98%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-background-removal.test.ts (68%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-background-removal.ts (98%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-post-batch-late-settlement.ts (98%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-removal-settlement.test.ts (95%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-removal-settlement.ts (96%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-removal-timeout-recovery.test.ts (99%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-removal-toasts.ts (92%) rename src/renderer/src/components/workspace-cleanup/{ => removal/settlement}/workspace-cleanup-skipped-ancestor-reclassification.ts (95%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/use-workspace-cleanup-removal.agent-stop.test.tsx (92%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/use-workspace-cleanup-removal.ts (97%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/use-workspace-cleanup-unverified-removal.ts (93%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/workspace-cleanup-confirm-remove.tsx (91%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/workspace-cleanup-deletion-phases.ts (84%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/workspace-cleanup-forget-locally-button.tsx (88%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/workspace-cleanup-removal-candidates.test.ts (82%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/workspace-cleanup-removal-candidates.ts (80%) rename src/renderer/src/components/workspace-cleanup/{ => removal}/workspace-cleanup-snapshot-prune-batch.ts (81%) rename src/renderer/src/components/workspace-cleanup/{ => scanning}/use-workspace-cleanup-scan-lifecycle.ts (100%) rename src/renderer/src/components/workspace-cleanup/{ => scanning}/workspace-cleanup-scan-notice.ts (96%) diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index c647a955b37..7ccccd20106 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -526,7 +526,7 @@ 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-alt-screen-host-chain.test.ts 1 test-no-wall-clock:src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx -2 test-no-wall-clock:src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.agent-stop.test.tsx +2 test-no-wall-clock:src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.agent-stop.test.tsx 1 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.behavior.test.tsx 2 test-no-wall-clock:src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts 1 test-no-wall-clock:src/renderer/src/lib/workspace/activation/worktree-activation-emptied-workspace-reseed.test.ts diff --git a/config/react-compiler-bailout-baseline.txt b/config/react-compiler-bailout-baseline.txt index 43049616dfa..a0db79c5703 100644 --- a/config/react-compiler-bailout-baseline.txt +++ b/config/react-compiler-bailout-baseline.txt @@ -668,9 +668,9 @@ 1 src/renderer/src/components/use-terminal-window-lifecycle.ts 1 src/renderer/src/components/use-terminal-workspace-foundation.ts 1 src/renderer/src/components/virtualized-list.tsx -1 src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-facet-rows.ts -2 src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.ts -1 src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-list.tsx +1 src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-facet-rows.ts +2 src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.ts +1 src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-list.tsx 2 src/renderer/src/components/workspace-emoji/useWorkspaceEmojiShortcodeInput.ts 1 src/renderer/src/components/worktree-jump/use-worktree-jump-palette-list-entries.ts 1 src/renderer/src/components/worktree-jump/use-worktree-jump-palette-local-state.ts diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index dd6da1357fc..ae79c365b7d 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -5388,19 +5388,19 @@ "src/renderer/src/components/use-terminal-window-lifecycle.frame-flush.test.tsx": 2164, "src/renderer/src/components/virtualized-list.test.tsx": 446, "src/renderer/src/components/window-close-request-coordinator.test.ts": 361, - "src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx": 3269, - "src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.test.tsx": 248, - "src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.test.tsx": 539, - "src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.agent-stop.test.tsx": 2285, - "src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.test.ts": 242, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal-late-settlement.test.ts": 1880, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.test.ts": 283, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-filter.test.ts": 341, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.test.ts": 264, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-flat-list.test.tsx": 2594, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.test.ts": 206, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.test.ts": 203, - "src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-timeout-recovery.test.ts": 1817, + "src/renderer/src/components/workspace-cleanup/dialog/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx": 3269, + "src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.test.tsx": 248, + "src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.test.tsx": 539, + "src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.agent-stop.test.tsx": 2285, + "src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.test.ts": 242, + "src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal-late-settlement.test.ts": 1880, + "src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.test.ts": 283, + "src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-index.test.ts": 341, + "src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.test.ts": 264, + "src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-flat-list.test.tsx": 2594, + "src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.test.ts": 206, + "src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.test.ts": 203, + "src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-timeout-recovery.test.ts": 1817, "src/renderer/src/components/workspace-emoji/WorkspaceEmojiPickerButton.test.tsx": 1086, "src/renderer/src/components/workspace-emoji/WorkspaceEmojiPickerPanel.test.tsx": 763, "src/renderer/src/components/workspace-emoji/useWorkspaceEmojiShortcodeInput.test.tsx": 365, diff --git a/config/scripts/localization/catalog-validation/protected-copy-keys.mjs b/config/scripts/localization/catalog-validation/protected-copy-keys.mjs index 1bedc742604..fb2df9b9f2e 100644 --- a/config/scripts/localization/catalog-validation/protected-copy-keys.mjs +++ b/config/scripts/localization/catalog-validation/protected-copy-keys.mjs @@ -25,6 +25,7 @@ const DESTRUCTIVE_CONTROL_RE = /variant=["']destructive["']|variant:\s*["']destr const CONFIRMATION_DIALOG_RE = /<(?:Alert)?Dialog(?:Content|Footer)\b/ const NATIVE_MESSAGE_BOX_RE = /\bshowMessageBox(?:Sync)?\(/ const PROTECTED_COPY_PRAGMA_RE = /^\s*\/\/ @protected-copy\b/m +const PROTECTED_COPY_FILE_SCOPE_RE = /^\s*\/\/ @protected-copy scope=file\s*$/m const RELATIVE_IMPORT_RE = /(?:^|\n)\s*(?:import|export)\s[^'"]*?from\s+['"](\.\/[^'"]+)['"]/g const PLURAL_SUFFIX_RE = /_(?:zero|one|two|few|many|other)$/ const RESOLVE_EXTENSIONS = ['', '.ts', '.tsx', '/index.ts', '/index.tsx'] @@ -75,6 +76,9 @@ export function collectProtectedCopyKeys(sources, englishPaths) { const marked = [...sources.keys()].filter((file) => protectedCopyMarker(sources.get(file))) const files = new Set(marked) for (const file of marked) { + if (PROTECTED_COPY_FILE_SCOPE_RE.test(sources.get(file))) { + continue + } for (const imported of siblingImports(file, sources.get(file))) { if (sources.has(imported)) { files.add(imported) diff --git a/src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.tsx b/src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.tsx index 37e3c636400..c85a5d82b04 100644 --- a/src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.tsx +++ b/src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.tsx @@ -15,37 +15,37 @@ import { getWorkspaceCleanupCandidateIdentity, resolveWorkspaceCleanupRemovalHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' -import { WorkspaceCleanupBrowseToolbar } from './workspace-cleanup-browse-toolbar' -import { WorkspaceCleanupConfirmRemove } from './workspace-cleanup-confirm-remove' -import { WorkspaceCleanupConfirmStopAgents } from './workspace-cleanup-confirm-stop-agents' -import { WorkspaceCleanupDialogHeader } from './workspace-cleanup-dialog-header' +import { WorkspaceCleanupBrowseToolbar } from './browse/workspace-cleanup-browse-toolbar' +import { WorkspaceCleanupConfirmRemove } from './removal/workspace-cleanup-confirm-remove' +import { WorkspaceCleanupConfirmStopAgents } from './removal/agent-consent/workspace-cleanup-confirm-stop-agents' +import { WorkspaceCleanupDialogHeader } from './dialog/workspace-cleanup-dialog-header' import { getWorkspaceCleanupDeletionPhaseByIdentity, selectWorkspaceCleanupDeletionPhases -} from './workspace-cleanup-deletion-phases' +} from './removal/workspace-cleanup-deletion-phases' import { WorkspaceCleanupInitialScanBanner, WorkspaceCleanupNotice, WorkspaceCleanupSkeletonRows -} from './workspace-cleanup-dialog-notices' -import { WorkspaceCleanupRowList } from './workspace-cleanup-row-list' -import { formatWorkspaceCleanupScanNotice } from './workspace-cleanup-scan-notice' -import { applyWorkspaceCleanupGitEvidence } from './workspace-cleanup-git-evidence' -import { useWorkspaceCleanupBrowseState } from './use-workspace-cleanup-browse-state' +} from './dialog/workspace-cleanup-dialog-notices' +import { WorkspaceCleanupRowList } from './candidate-list/workspace-cleanup-row-list' +import { formatWorkspaceCleanupScanNotice } from './scanning/workspace-cleanup-scan-notice' +import { applyWorkspaceCleanupGitEvidence } from './candidate-evidence/workspace-cleanup-git-evidence' +import { useWorkspaceCleanupBrowseState } from './browse/use-workspace-cleanup-browse-state' import { useWorkspaceCleanupDialogLifecycle, type WorkspaceCleanupDialogLifecycle -} from './use-workspace-cleanup-dialog-lifecycle' -import { useWorkspaceCleanupFacetRows } from './use-workspace-cleanup-facet-rows' -import { useWorkspaceCleanupGitEvidence } from './use-workspace-cleanup-git-evidence' -import { useWorkspaceCleanupIgnore } from './use-workspace-cleanup-ignore' -import { useWorkspaceCleanupRowOrder } from './use-workspace-cleanup-row-order' -import { openWorkspaceCleanupForgetLocally } from './workspace-cleanup-forget-locally-button' +} from './dialog/use-workspace-cleanup-dialog-lifecycle' +import { useWorkspaceCleanupFacetRows } from './browse/use-workspace-cleanup-facet-rows' +import { useWorkspaceCleanupGitEvidence } from './candidate-evidence/use-workspace-cleanup-git-evidence' +import { useWorkspaceCleanupIgnore } from './browse/use-workspace-cleanup-ignore' +import { useWorkspaceCleanupRowOrder } from './candidate-list/use-workspace-cleanup-row-order' +import { openWorkspaceCleanupForgetLocally } from './removal/workspace-cleanup-forget-locally-button' import { formatVanishedSelectionNotice, formatWithheldSelectionNotice, toggleSetMember -} from './workspace-cleanup-selection-model' +} from './browse/workspace-cleanup-selection-model' export default function WorkspaceCleanupDialog(): React.JSX.Element | null { const lifecycle = useWorkspaceCleanupDialogLifecycle() diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.test.tsx b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.test.tsx similarity index 97% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.test.tsx rename to src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.test.tsx index 179294c47e8..f60b6674fac 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.test.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.test.tsx @@ -8,7 +8,7 @@ import { createWorkspaceCleanupBrowseSlice, resetWorkspaceCleanupBrowsePersistTimer } from '@/store/slices/workspace-cleanup/workspace-cleanup-browse' -import { createDefaultWorkspaceCleanupBrowseState } from '../../../../shared/workspace-cleanup/workspace-cleanup-browse-state' +import { createDefaultWorkspaceCleanupBrowseState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-browse-state' import { useWorkspaceCleanupBrowseState, diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.ts b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.ts similarity index 97% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.ts rename to src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.ts index b03a3ae5aba..f472fb79b36 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-browse-state.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-browse-state.ts @@ -5,7 +5,7 @@ import { type WorkspaceCleanupFilterState, type WorkspaceCleanupSortField, type WorkspaceCleanupSortState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' export type WorkspaceCleanupBrowseController = { filters: WorkspaceCleanupFilterState diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-facet-rows.ts b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-facet-rows.ts similarity index 94% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-facet-rows.ts rename to src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-facet-rows.ts index f8f276e3a63..af2ab760638 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-facet-rows.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-facet-rows.ts @@ -3,25 +3,25 @@ import { useShallow } from 'zustand/react/shallow' import { useAppStore } from '@/store/index' import { getLiveAgentStatusByWorktreeId } from '@/lib/workspace/activity/worktree-activity-state' import { translateWorkspaceBoardStatusLabel } from '@/components/sidebar/workspace-board-status-label' -import type { HostedReviewProvider } from '../../../../shared/source-control/hosted-review/hosted-review-contracts' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { HostedReviewProvider } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFilterState, WorkspaceCleanupSortState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' import { countWorkspaceCleanupMeasuredRows, type WorkspaceCleanupFacets -} from './workspace-cleanup-facets' +} from '../query/workspace-cleanup-facets' import { countWorkspaceCleanupFacetMatches, filterWorkspaceCleanupFacets, runWorkspaceCleanupQuery -} from './workspace-cleanup-query' +} from '../query/workspace-cleanup-query' import { buildWorkspaceCleanupReviewLookup, type WorkspaceCleanupReviewInfo -} from './workspace-cleanup-presentation' +} from '../candidate-evidence/workspace-cleanup-review-lookup' import type { WorkspaceCleanupFacetCounts, WorkspaceCleanupFacetOptions @@ -30,13 +30,13 @@ import { buildWorkspaceCleanupSizeIndex, buildWorkspaceCleanupWorktreeIndex, countWorkspaceCleanupCandidateIds -} from './workspace-cleanup-host-identity' +} from '../candidate-evidence/workspace-cleanup-host-indexes' import { computeWorkspaceCleanupFacetList, computeWorkspaceCleanupReviewInfoIndex, createWorkspaceCleanupFacetListCache, createWorkspaceCleanupReviewInfoCache -} from './workspace-cleanup-facet-row-caches' +} from '../query/workspace-cleanup-facet-row-caches' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-ignore.ts b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-ignore.ts similarity index 93% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-ignore.ts rename to src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-ignore.ts index 5f722425bc0..e3e5ebb2453 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-ignore.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/use-workspace-cleanup-ignore.ts @@ -3,8 +3,8 @@ import { toast } from 'sonner' import { useMountedRef } from '@/hooks/useMountedRef' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { getWorkspaceCleanupCandidateIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { getWorkspaceCleanupCandidateIdentity } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' function describeError(err: unknown): string { return err instanceof Error ? err.message : String(err) diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-active-facets.ts b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-active-facets.ts similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-active-facets.ts rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-active-facets.ts index e47342749d4..17d208a4597 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-active-facets.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-active-facets.ts @@ -1,7 +1,7 @@ import { createDefaultWorkspaceCleanupFilterState, type WorkspaceCleanupFilterState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' export type WorkspaceCleanupFacetGroupKey = keyof Omit diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-applied-filter-chips.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-applied-filter-chips.tsx similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-applied-filter-chips.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-applied-filter-chips.tsx index 570a1afd4c2..3aa9f2c4b1f 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-applied-filter-chips.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-applied-filter-chips.tsx @@ -8,8 +8,8 @@ import { toMegabytes } from './workspace-cleanup-facet-panel-model' import { type WorkspaceCleanupAppliedFilter, listAppliedWorkspaceCleanupFilters -} from '../../../../shared/workspace-cleanup/workspace-cleanup-applied-filters' -import type { WorkspaceCleanupFilterState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-applied-filters' +import type { WorkspaceCleanupFilterState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' // Show narrowing filters outside the panel; derive labels per render so language changes cannot reuse stale translations. // Why not memoized: the labels are translated at build time, so caching them on diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-browse-toolbar.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-browse-toolbar.tsx similarity index 94% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-browse-toolbar.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-browse-toolbar.tsx index ac57bca8e42..2dcb266c757 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-browse-toolbar.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-browse-toolbar.tsx @@ -3,10 +3,10 @@ import { useTranslate } from '@/i18n/use-translate' import type { WorkspaceCleanupBrowseController } from './use-workspace-cleanup-browse-state' import type { WorkspaceCleanupFacetRows } from './use-workspace-cleanup-facet-rows' import { listActiveWorkspaceCleanupFacetGroups } from './workspace-cleanup-active-facets' -import { WorkspaceCleanupEmptyState } from './workspace-cleanup-dialog-notices' +import { WorkspaceCleanupEmptyState } from '../dialog/workspace-cleanup-dialog-notices' import { WorkspaceCleanupFilterBar } from './workspace-cleanup-filter-bar' import { WorkspaceCleanupSortHeader } from './workspace-cleanup-sort-header' -import type { WorkspaceSpaceScanProgress } from '../../../../shared/workspace-disk-space/workspace-space-types' +import type { WorkspaceSpaceScanProgress } from '../../../../../shared/workspace-disk-space/workspace-space-types' export function WorkspaceCleanupBrowseToolbar({ browse, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-controls.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-controls.tsx similarity index 100% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-controls.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-controls.tsx diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-labels.ts b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-labels.ts similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-labels.ts rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-labels.ts index 39e1003e940..1f20a1cf523 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-labels.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-labels.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import type { HostedReviewProvider } from '../../../../shared/source-control/hosted-review/hosted-review-contracts' +import type { HostedReviewProvider } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' import type { WorkspaceCleanupAgentState, WorkspaceCleanupBlockerMode, @@ -11,7 +11,7 @@ import type { WorkspaceCleanupSortField, WorkspaceCleanupTicketSource, WorkspaceCleanupTriState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' export function getWorkspaceCleanupSortFieldLabel( field: WorkspaceCleanupSortField, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-panel-model.ts b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts similarity index 81% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-panel-model.ts rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts index 8f5c965348a..981c08f94cd 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-panel-model.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts @@ -1,6 +1,6 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { HostedReviewProvider } from '../../../../shared/source-control/hosted-review/hosted-review-contracts' -import type { WorkspaceCleanupFilterState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { HostedReviewProvider } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' +import type { WorkspaceCleanupFilterState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' export type WorkspaceCleanupFacetCounts = Record< keyof Omit, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-filter-bar.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-filter-bar.tsx similarity index 99% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-filter-bar.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-filter-bar.tsx index 5e780d175d2..c908d9729d2 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-filter-bar.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-filter-bar.tsx @@ -11,7 +11,7 @@ import { useAppliedWorkspaceCleanupFilters, WorkspaceCleanupAppliedFilterChips } from './workspace-cleanup-applied-filter-chips' -import type { WorkspaceCleanupAppliedFilter } from '../../../../shared/workspace-cleanup/workspace-cleanup-applied-filters' +import type { WorkspaceCleanupAppliedFilter } from '../../../../../shared/workspace-cleanup/workspace-cleanup-applied-filters' import { WorkspaceCleanupGitReviewFacets } from './workspace-cleanup-git-review-facets' import { WorkspaceCleanupLifecycleFacets } from './workspace-cleanup-lifecycle-facets' import type { WorkspaceCleanupFacetGroupProps } from './workspace-cleanup-facet-panel-model' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-git-review-facets.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-git-review-facets.tsx similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-git-review-facets.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-git-review-facets.tsx index 2c003374b20..460dd1c39d1 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-git-review-facets.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-git-review-facets.tsx @@ -1,6 +1,6 @@ import React from 'react' import { useTranslate } from '@/i18n/use-translate' -import { getTranslatedExecutionHostLabel } from '../sidebar/execution-host-label' +import { getTranslatedExecutionHostLabel } from '../../sidebar/execution-host-label' import { WORKSPACE_CLEANUP_BLOCKER_MODE_VALUES, WORKSPACE_CLEANUP_BLOCKER_VALUES, @@ -9,8 +9,8 @@ import { WORKSPACE_CLEANUP_REVIEW_STATE_VALUES, WORKSPACE_CLEANUP_TICKET_SOURCE_VALUES, WORKSPACE_CLEANUP_TRI_STATE_VALUES -} from '../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' -import { getWorkspaceCleanupBlockerLabel } from './workspace-cleanup-candidate-labels' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' +import { getWorkspaceCleanupBlockerLabel } from '../candidate-list/workspace-cleanup-candidate-labels' import { FacetChoice, FacetNumberField, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-lifecycle-facets.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-lifecycle-facets.tsx similarity index 98% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-lifecycle-facets.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-lifecycle-facets.tsx index 46ea05b3b34..a697ed5fda0 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-lifecycle-facets.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-lifecycle-facets.tsx @@ -5,7 +5,7 @@ import { WORKSPACE_CLEANUP_IDLE_SIGNAL_VALUES, WORKSPACE_CLEANUP_PRESENCE_VALUES, WORKSPACE_CLEANUP_TRI_STATE_VALUES -} from '../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' import { FacetCheckbox, FacetChoice, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-selection-model.ts b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-selection-model.ts similarity index 100% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-selection-model.ts rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-selection-model.ts diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-sort-header.tsx b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-sort-header.tsx similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-sort-header.tsx rename to src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-sort-header.tsx index efc37758bfc..f96cea3f1b4 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-sort-header.tsx +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-sort-header.tsx @@ -10,11 +10,11 @@ import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { useTranslate } from '@/i18n/use-translate' -import { WORKSPACE_CLEANUP_SORT_FIELD_VALUES } from '../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' +import { WORKSPACE_CLEANUP_SORT_FIELD_VALUES } from '../../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' import type { WorkspaceCleanupSortField, WorkspaceCleanupSortState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' import { getWorkspaceCleanupSortFieldLabel } from './workspace-cleanup-facet-labels' export function WorkspaceCleanupSortHeader({ diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.test.tsx b/src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.test.tsx similarity index 74% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.test.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.test.tsx index 2dd8f9e4245..8119080701f 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.test.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.test.tsx @@ -5,8 +5,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { WorkspaceCleanupScanProgress, WorkspaceCleanupScanResult -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { makeFacetCandidate } from './workspace-cleanup-facet.test.fixture' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { makeFacetCandidate } from '../query/workspace-cleanup-facet.test.fixture' import { useWorkspaceCleanupGitEvidence } from './use-workspace-cleanup-git-evidence' const holders = vi.hoisted(() => ({ cancelScan: vi.fn(), scan: vi.fn() })) @@ -102,38 +102,6 @@ describe('useWorkspaceCleanupGitEvidence', () => { expect(view.result.current.pendingWorktreeIds.size).toBe(5) }) - it('chunks dispatches at the shared target batch limit so no queued id is dropped', async () => { - const first = Array.from({ length: 300 }, (_, i) => deferredCandidate(`a${i}`)) - const grown = [...first, ...Array.from({ length: 600 }, (_, i) => deferredCandidate(`b${i}`))] - const view = renderHook( - ({ candidates }: { candidates: ReturnType[] }) => - useWorkspaceCleanupGitEvidence({ enabled: true, candidates, scannedAt: 1 }), - { initialProps: { candidates: first } } - ) - - await waitFor(() => expect(holders.scan).toHaveBeenCalledTimes(1)) - expect(pending[0]?.worktreeIds).toHaveLength(300) - - view.rerender({ candidates: grown }) - await waitFor(() => expect(view.result.current.totalCount).toBe(900)) - expect(holders.scan).toHaveBeenCalledTimes(1) - - await act(async () => { - pending[0]?.resolve({ scannedAt: 1, candidates: [], errors: [] }) - }) - await waitFor(() => expect(holders.scan).toHaveBeenCalledTimes(2)) - expect(pending[1]?.worktreeIds).toHaveLength(500) - - await act(async () => { - pending[1]?.resolve({ scannedAt: 1, candidates: [], errors: [] }) - }) - await waitFor(() => expect(holders.scan).toHaveBeenCalledTimes(3)) - expect(pending[2]?.worktreeIds).toHaveLength(100) - - const dispatched = pending.flatMap((request) => request.worktreeIds) - expect(new Set(dispatched).size).toBe(900) - }) - it('restarts evidence collection when the settled scan snapshot changes', async () => { const candidates = [deferredCandidate('a')] const view = renderHook( diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.ts similarity index 97% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.ts rename to src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.ts index 9ae4bf5f83b..48f23a84f26 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-git-evidence.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/use-workspace-cleanup-git-evidence.ts @@ -1,13 +1,13 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' import { useMountedRef } from '@/hooks/useMountedRef' -import { getWorkspaceCleanupCandidateIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { getWorkspaceCleanupCandidateIdentity } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { selectWorkspaceCleanupGitEvidenceTargets } from './workspace-cleanup-git-evidence' import { type WorkspaceCleanupCandidate, WORKSPACE_CLEANUP_TARGET_BATCH_LIMIT as WORKSPACE_CLEANUP_GIT_EVIDENCE_MAX_TARGETS -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { createNonSecureContextUuid as createBrowserUuid } from '../../../../shared/non-secure-context-uuid' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/non-secure-context-uuid' import { useAppStore } from '@/store' import { cancelWorkspaceCleanupHostScan, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-git-evidence.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-git-evidence.ts similarity index 94% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-git-evidence.ts rename to src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-git-evidence.ts index 554dd2fc5da..e16d5f460e7 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-git-evidence.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-git-evidence.ts @@ -3,13 +3,13 @@ import { type WorkspaceCleanupCandidate, type WorkspaceCleanupReason, WORKSPACE_CLEANUP_TARGET_BATCH_LIMIT as WORKSPACE_CLEANUP_GIT_EVIDENCE_MAX_TARGETS -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { getWorkspaceCleanupCandidateIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { getWorkspaceCleanupCandidateIdentity } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import type { WorkspaceCleanupFilterState, WorkspaceCleanupSortField, WorkspaceCleanupSortState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' /** Broad scans may defer Git reads; resolve unknown rows on demand before trusting Git-based filtering or sorting. */ export function hasWorkspaceCleanupGitEvidence(candidate: WorkspaceCleanupCandidate): boolean { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-filter.test.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-index.test.ts similarity index 90% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-filter.test.ts rename to src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-index.test.ts index 106770fc7f2..c10fe076afc 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-filter.test.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-index.test.ts @@ -2,9 +2,9 @@ import { describe, expect, it } from 'vitest' import { buildWorkspaceCleanupSizeIndex, buildWorkspaceCleanupWorktreeIndex -} from './workspace-cleanup-host-identity' -import { getWorkspaceCleanupHostIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' -import { makeFacetCandidate } from './workspace-cleanup-facet.test.fixture' +} from './workspace-cleanup-host-indexes' +import { getWorkspaceCleanupHostIdentity } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { makeFacetCandidate } from '../query/workspace-cleanup-facet.test.fixture' describe('facet building', () => { it('keeps same-id worktrees and sizes isolated by host', () => { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-host-identity.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts similarity index 88% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-host-identity.ts rename to src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts index 96857c55a99..15a56730e3e 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-host-identity.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts @@ -2,15 +2,15 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' -import type { Repo } from '../../../../shared/repo-types' -import type { Worktree } from '../../../../shared/worktree/types' +} from '../../../../../shared/execution-host' +import type { Repo } from '../../../../../shared/repo-types' +import type { Worktree } from '../../../../../shared/worktree/types' import type { WorkspaceSpaceWorktree, WorkspaceSpaceWorktreeMeasurement -} from '../../../../shared/workspace-disk-space/workspace-space-types' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { getWorkspaceCleanupHostIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-disk-space/workspace-space-types' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { getWorkspaceCleanupHostIdentity } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' /** Structural subset of `Worktree` kept in sync with the persisted source. */ export type WorkspaceCleanupWorktreeFacts = Pick & diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts similarity index 79% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation.ts rename to src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts index ac913c7e51d..9f9bc6e9fd3 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts @@ -1,40 +1,21 @@ +// @protected-copy scope=file import { getHostedReviewCacheKey } from '@/store/slices/hosted-review/hosted-review-cache-identity' import type { AppState } from '@/store/types' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host' import type { HostedReviewInfo, HostedReviewProvider -} from '../../../../shared/source-control/hosted-review/hosted-review-contracts' -import type { Repo } from '../../../../shared/repo-types' -import type { Worktree } from '../../../../shared/worktree/types' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { isGitHubPRSuppressed } from '../../../../shared/worktree/github-pr-suppression' -import './workspace-cleanup-host-identity' -import { getWorkspaceCleanupCandidateHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' +import type { Repo } from '../../../../../shared/repo-types' +import type { Worktree } from '../../../../../shared/worktree/types' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { isGitHubPRSuppressed } from '../../../../../shared/worktree/github-pr-suppression' +import './workspace-cleanup-host-indexes' +import { getWorkspaceCleanupCandidateHostId } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' -export type WorkspaceCleanupSortKey = 'activity' | 'name' | 'repo' | 'review' | 'git' -export type WorkspaceCleanupSortDirection = 'asc' | 'desc' -export type WorkspaceCleanupTimeFilter = 'all' | '30d' | '90d' | 'archived' -export type WorkspaceCleanupReviewFilter = - | 'all' - | 'no-review' - | 'has-review' - | 'open-review' - | 'closed-review' -export type WorkspaceCleanupGitFilter = 'all' | 'clean' | 'dirty' | 'unpushed' | 'unknown' -export type WorkspaceCleanupContextFilter = 'all' | 'has-context' | 'no-context' - -export type WorkspaceCleanupFilters = { - query: string - time: WorkspaceCleanupTimeFilter - review: WorkspaceCleanupReviewFilter - git: WorkspaceCleanupGitFilter - context: WorkspaceCleanupContextFilter -} - export type WorkspaceCleanupReviewInfo = { hasReview: boolean label: string | null @@ -53,14 +34,6 @@ export type WorkspaceCleanupReviewLookup = { worktreesByRepoAndId: ReadonlyMap } -export { - filterWorkspaceCleanupCandidates, - getWorkspaceCleanupGitState, - getWorkspaceCleanupSearchText, - hasWorkspaceCleanupLocalContext, - sortWorkspaceCleanupCandidates -} from './workspace-cleanup-filter-sort' - export function getWorkspaceCleanupReviewInfo( candidate: WorkspaceCleanupCandidate, state: WorkspaceCleanupRendererStateInputs, diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.test.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.test.ts similarity index 90% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.test.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.test.ts index aa2c8d9ce9b..773c8fafc05 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.test.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.test.ts @@ -3,7 +3,7 @@ import { renderHook } from '@testing-library/react' import { describe, expect, it } from 'vitest' import { useWorkspaceCleanupRowOrder } from './use-workspace-cleanup-row-order' -import type { WorkspaceCleanupSortState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import type { WorkspaceCleanupSortState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' type Row = { worktreeId: string } diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.ts similarity index 96% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.ts index 9331744a6af..af35a80bfd1 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-row-order.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/use-workspace-cleanup-row-order.ts @@ -1,5 +1,5 @@ import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react' -import type { WorkspaceCleanupSortState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import type { WorkspaceCleanupSortState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' type OrderedRow = { worktreeId: string } diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-labels.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-labels.ts similarity index 95% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-labels.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-labels.ts index cda2061e688..70c1fe1b97a 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-labels.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-labels.ts @@ -1,8 +1,8 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import type { WorkspaceCleanupBlocker } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import type { WorkspaceCleanupGitState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' -import type { WorktreeAtRiskLocalFiles } from '../../../../shared/worktree/at-risk-local-files' +import type { WorkspaceCleanupBlocker } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupGitState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import type { WorktreeAtRiskLocalFiles } from '../../../../../shared/worktree/at-risk-local-files' import { formatAtRiskLocalFileNames } from '@/lib/workspace/display/at-risk-local-files-label' type ContextDetailKind = 'terminal' | 'editor' | 'browser' | 'diff' | 'agent' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-list.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-list.tsx similarity index 100% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-list.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-list.tsx diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-data.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-data.ts similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-data.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-data.ts index a28ff7532bd..31f86c98056 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-data.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-data.ts @@ -1,11 +1,12 @@ +// @protected-copy scope=file import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' import { isWorkspaceCleanupHeadLanded, type WorkspaceCleanupBlocker, type WorkspaceCleanupCandidate -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { getWorkspaceCleanupGitState } from './workspace-cleanup-presentation' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { getWorkspaceCleanupGitState } from '../query/workspace-cleanup-candidate-filter-sort' import { formatUnpushedCommitCount, formatWorkspaceCleanupContextDetail, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-details.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-details.tsx similarity index 95% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-details.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-details.tsx index ca2459094ee..f16dc97d6c7 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-details.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-details.tsx @@ -2,9 +2,9 @@ import React from 'react' import { cn } from '@/lib/class-names' import { useTranslate, type Translate } from '@/i18n/use-translate' import { CopyButton } from '@/components/right-sidebar/checks-panel/comments/comment-controls' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { formatGitStatus } from './workspace-cleanup-candidate-row-data' -import { getWorkspaceCleanupGitState } from './workspace-cleanup-presentation' +import { getWorkspaceCleanupGitState } from '../query/workspace-cleanup-candidate-filter-sort' type CandidateRowDetailsProps = { /** Non-git flags; git safety already reads in the Git line. */ diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-trailing.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-trailing.tsx similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-trailing.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-trailing.tsx index afb5b0d6867..40fabef505d 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row-trailing.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row-trailing.tsx @@ -4,8 +4,8 @@ import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/class-names' import { useTranslate } from '@/i18n/use-translate' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { WorkspaceCleanupForgetLocallyButton } from './workspace-cleanup-forget-locally-button' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { WorkspaceCleanupForgetLocallyButton } from '../removal/workspace-cleanup-forget-locally-button' import { getWorkspaceCleanupCandidateAccessibleName } from './workspace-cleanup-host-label' type CandidateRowTrailingProps = { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row.fixture.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx similarity index 95% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row.fixture.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx index f2c63a7f0aa..2c74e9b76d6 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row.fixture.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx @@ -1,11 +1,11 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' -import { REPO_COLORS } from '../../../../shared/repo-badge-color' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { Repo } from '../../../../shared/repo-types' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import { defineFixture } from '../../../component-fixtures/component-fixture' +import { REPO_COLORS } from '../../../../../shared/repo-badge-color' +import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { Repo } from '../../../../../shared/repo-types' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { CandidateRow, type WorkspaceCleanupDeletionPhase } from './workspace-cleanup-candidate-row' -import type { WorkspaceCleanupReviewInfo } from './workspace-cleanup-presentation' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' const NOW = 1_700_000_000_000 const LOCAL: ExecutionHostId = 'local' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.tsx similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.tsx index 449c85aa33c..f7e6a1b93a1 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-candidate-row.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.tsx @@ -17,8 +17,8 @@ import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' import { canQueueWorkspaceCleanupCandidate, type WorkspaceCleanupCandidate -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import type { WorkspaceCleanupReviewInfo } from './workspace-cleanup-presentation' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' import { CandidateRowDetails } from './workspace-cleanup-candidate-row-details' import { formatBranchSafetyDetails, @@ -39,13 +39,13 @@ import { } from './workspace-cleanup-metadata-chip' import { RepoIconGlyph } from '@/components/repo/repo-icon' import { resolveRepoHeaderColor } from '@/components/sidebar/worktree-list/rows/project-header-color' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../shared/repo-types' import { CandidateRowTrailing } from './workspace-cleanup-candidate-row-trailing' import { getWorkspaceCleanupCandidateAccessibleName, getWorkspaceCleanupCandidateHostLabel } from './workspace-cleanup-host-label' -import { getReviewTooltip } from './workspace-cleanup-row-labels' +import { getReviewTooltip } from './workspace-cleanup-review-labels' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' export type WorkspaceCleanupDeletionPhase = 'deleting' | 'queued' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-flat-list.test.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-flat-list.test.tsx similarity index 94% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-flat-list.test.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-flat-list.test.tsx index e0fe0e3ad1b..b5f2c6b64af 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-flat-list.test.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-flat-list.test.tsx @@ -5,9 +5,9 @@ import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { CandidateRow } from './workspace-cleanup-candidate-row' import { WorkspaceCleanupCandidateList } from './workspace-cleanup-candidate-list' -import { makeNamedFacets } from './workspace-cleanup-facet.test.fixture' +import { makeNamedFacets } from '../query/workspace-cleanup-facet.test.fixture' -import type { WorkspaceCleanupFacets } from './workspace-cleanup-facets' +import type { WorkspaceCleanupFacets } from '../query/workspace-cleanup-facets' vi.mock('@/components/ui/tooltip', () => ({ Tooltip: ({ children }: { children: ReactNode }) => <>{children}, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-host-label.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-host-label.ts similarity index 70% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-host-label.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-host-label.ts index 2684a7ef620..9680306f2f3 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-host-label.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-host-label.ts @@ -1,9 +1,10 @@ +// @protected-copy scope=file import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import { getTranslatedExecutionHostLabel } from '../sidebar/execution-host-label' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import './workspace-cleanup-host-identity' -import { resolveWorkspaceCleanupRemovalHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { getTranslatedExecutionHostLabel } from '../../sidebar/execution-host-label' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import '../candidate-evidence/workspace-cleanup-host-indexes' +import { resolveWorkspaceCleanupRemovalHostId } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' export function getWorkspaceCleanupCandidateHostLabel( candidate: WorkspaceCleanupCandidate, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-metadata-chip.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-metadata-chip.tsx similarity index 100% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-metadata-chip.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-metadata-chip.tsx diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-relative-time.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-relative-time.ts similarity index 97% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-relative-time.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-relative-time.ts index 744d344fcf0..f0ba48672ac 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-relative-time.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-relative-time.ts @@ -1,3 +1,4 @@ +// @protected-copy scope=file import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-row-labels.ts b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-review-labels.ts similarity index 72% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-row-labels.ts rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-review-labels.ts index 13bd980ab7f..f24a2565b59 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-row-labels.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-review-labels.ts @@ -1,5 +1,5 @@ -import type { WorkspaceCleanupReviewInfo } from './workspace-cleanup-presentation' -import { getWorkspaceCleanupReviewStateLabel } from './workspace-cleanup-facet-labels' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' +import { getWorkspaceCleanupReviewStateLabel } from '../browse/workspace-cleanup-facet-labels' export function getReviewTooltip(reviewInfo: WorkspaceCleanupReviewInfo): string { return [reviewInfo.label, getReviewStateSrText(reviewInfo)].filter(Boolean).join(' · ') diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-row-list.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-row-list.tsx similarity index 92% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-row-list.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-row-list.tsx index a8637aaf135..93b5aaec867 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-row-list.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-row-list.tsx @@ -1,19 +1,19 @@ import React, { useMemo } from 'react' import { useAppStore } from '@/store' import { useTranslate } from '@/i18n/use-translate' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { formatBytes } from '../../../../shared/format-bytes' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { formatBytes } from '../../../../../shared/format-bytes' import { CandidateRow, type WorkspaceCleanupDeletionPhase } from './workspace-cleanup-candidate-row' import { WorkspaceCleanupCandidateList } from './workspace-cleanup-candidate-list' -import { WorkspaceCleanupEmptyState } from './workspace-cleanup-dialog-notices' -import type { WorkspaceCleanupFacets } from './workspace-cleanup-facets' +import { WorkspaceCleanupEmptyState } from '../dialog/workspace-cleanup-dialog-notices' +import type { WorkspaceCleanupFacets } from '../query/workspace-cleanup-facets' import { formatWorkspaceCleanupRelativeTime } from './workspace-cleanup-relative-time' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { findWorkspaceCleanupCandidateRepo, groupWorkspaceCleanupReposById -} from './workspace-cleanup-presentation' -import { getWorkspaceCleanupCandidateHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../candidate-evidence/workspace-cleanup-review-lookup' +import { getWorkspaceCleanupCandidateHostId } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' export type WorkspaceCleanupRowListState = { rows: readonly WorkspaceCleanupFacets[] diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-status-pill.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-status-pill.tsx similarity index 100% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-status-pill.tsx rename to src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-status-pill.tsx diff --git a/src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx b/src/renderer/src/components/workspace-cleanup/dialog/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx similarity index 95% rename from src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx rename to src/renderer/src/components/workspace-cleanup/dialog/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx index e754f53cc3d..b8bd91fbbf0 100644 --- a/src/renderer/src/components/workspace-cleanup/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx +++ b/src/renderer/src/components/workspace-cleanup/dialog/WorkspaceCleanupDialog.stale-while-revalidate.test.tsx @@ -7,15 +7,15 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { WorkspaceCleanupScanProgress, WorkspaceCleanupScanResult -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import type { WorkspaceCleanupBrowseState } from '../../../../shared/workspace-cleanup/workspace-cleanup-browse-state' -import { createTestStore, seedStore } from '../../store/testing/app-store-test-fixture' -import { resetWorkspaceCleanupBrowsePersistTimer } from '../../store/slices/workspace-cleanup/workspace-cleanup-browse' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupBrowseState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-browse-state' +import { createTestStore, seedStore } from '../../../store/testing/app-store-test-fixture' +import { resetWorkspaceCleanupBrowsePersistTimer } from '../../../store/slices/workspace-cleanup/workspace-cleanup-browse' import { NOW, makeCandidate -} from '../../store/slices/workspace-cleanup/workspace-cleanup-slice-test-harness' -import WorkspaceCleanupDialog from './WorkspaceCleanupDialog' +} from '../../../store/slices/workspace-cleanup/workspace-cleanup-slice-test-harness' +import WorkspaceCleanupDialog from '../WorkspaceCleanupDialog' const holders = vi.hoisted(() => ({ store: null as unknown as { (selector: (s: unknown) => unknown): unknown } & { diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-dialog-lifecycle.ts b/src/renderer/src/components/workspace-cleanup/dialog/use-workspace-cleanup-dialog-lifecycle.ts similarity index 94% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-dialog-lifecycle.ts rename to src/renderer/src/components/workspace-cleanup/dialog/use-workspace-cleanup-dialog-lifecycle.ts index 275054105b8..1b0dd087592 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-dialog-lifecycle.ts +++ b/src/renderer/src/components/workspace-cleanup/dialog/use-workspace-cleanup-dialog-lifecycle.ts @@ -3,8 +3,8 @@ import { useAppStore } from '@/store' import { useWorkspaceCleanupRemoval, type WorkspaceCleanupRemovalController -} from './use-workspace-cleanup-removal' -import { useWorkspaceCleanupScanLifecycle } from './use-workspace-cleanup-scan-lifecycle' +} from '../removal/use-workspace-cleanup-removal' +import { useWorkspaceCleanupScanLifecycle } from '../scanning/use-workspace-cleanup-scan-lifecycle' const WORKSPACE_CLEANUP_CLOSE_LINGER_MS = 300 diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-header.fixture.tsx b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-header.fixture.tsx similarity index 84% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-header.fixture.tsx rename to src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-header.fixture.tsx index 4d07c9a8864..74d873c8fcf 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-header.fixture.tsx +++ b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-header.fixture.tsx @@ -1,14 +1,14 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' +import { defineFixture } from '../../../component-fixtures/component-fixture' import { Dialog } from '@/components/ui/dialog' -import type { WorkspaceCleanupScanProgress } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupScanProgress } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { createDefaultWorkspaceCleanupFilterState, DEFAULT_WORKSPACE_CLEANUP_SORT -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' import { WorkspaceCleanupDialogHeader } from './workspace-cleanup-dialog-header' -import { WorkspaceCleanupFilterBar } from './workspace-cleanup-filter-bar' -import type { WorkspaceCleanupFacetCounts } from './workspace-cleanup-facet-panel-model' -import { WorkspaceCleanupSortHeader } from './workspace-cleanup-sort-header' +import { WorkspaceCleanupFilterBar } from '../browse/workspace-cleanup-filter-bar' +import type { WorkspaceCleanupFacetCounts } from '../browse/workspace-cleanup-facet-panel-model' +import { WorkspaceCleanupSortHeader } from '../browse/workspace-cleanup-sort-header' const NOW = Date.now() const COUNTS: WorkspaceCleanupFacetCounts = { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-header.tsx b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-header.tsx similarity index 95% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-header.tsx rename to src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-header.tsx index 4006be96ab9..47a895eb5ab 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-header.tsx +++ b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-header.tsx @@ -5,7 +5,7 @@ import { DialogHeader, DialogTitle } from '@/components/ui/dialog' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/class-names' import { useTranslate } from '@/i18n/use-translate' -import type { WorkspaceCleanupScanProgress } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupScanProgress } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { WorkspaceCleanupFreshness } from './workspace-cleanup-freshness' export function WorkspaceCleanupDialogHeader({ diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-notices.tsx b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-notices.tsx similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-notices.tsx rename to src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-notices.tsx index e882e802677..eec4f02fade 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-dialog-notices.tsx +++ b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-dialog-notices.tsx @@ -2,7 +2,7 @@ import React from 'react' import { AlertTriangle, Loader2 } from 'lucide-react' import { Button } from '@/components/ui/button' import { useTranslate } from '@/i18n/use-translate' -import type { WorkspaceCleanupScanProgress } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupScanProgress } from '../../../../../shared/workspace-cleanup/workspace-cleanup' export function WorkspaceCleanupInitialScanBanner({ progress diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-freshness.tsx b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-freshness.tsx similarity index 90% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-freshness.tsx rename to src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-freshness.tsx index ce91e427a7e..82c9f0b74fd 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-freshness.tsx +++ b/src/renderer/src/components/workspace-cleanup/dialog/workspace-cleanup-freshness.tsx @@ -3,8 +3,8 @@ import { useNow } from '@/hooks/use-now' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' -import type { WorkspaceCleanupScanProgress } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { formatWorkspaceCleanupRelativeTime } from './workspace-cleanup-relative-time' +import type { WorkspaceCleanupScanProgress } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { formatWorkspaceCleanupRelativeTime } from '../candidate-list/workspace-cleanup-relative-time' /** Show the displayed snapshot’s age while a nonblocking rescan indicator streams updates. */ export function WorkspaceCleanupFreshness({ diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-filter-sort.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-candidate-filter-sort.ts similarity index 86% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-filter-sort.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-candidate-filter-sort.ts index ce286db125c..29ffbefb0ad 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-filter-sort.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-candidate-filter-sort.ts @@ -2,19 +2,35 @@ import { compareDisplayName } from '@/lib/workspace/display/worktree-display-nam import { isWorkspaceCleanupHeadLanded, type WorkspaceCleanupCandidate -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import type { WorkspaceCleanupGitState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' -import { getWorkspaceCleanupGitChipLabel } from './workspace-cleanup-candidate-labels' -import type { - WorkspaceCleanupContextFilter, - WorkspaceCleanupFilters, - WorkspaceCleanupGitFilter, - WorkspaceCleanupReviewFilter, - WorkspaceCleanupReviewInfo, - WorkspaceCleanupSortDirection, - WorkspaceCleanupSortKey, - WorkspaceCleanupTimeFilter -} from './workspace-cleanup-presentation' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupGitState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import { getWorkspaceCleanupGitChipLabel } from '../candidate-list/workspace-cleanup-candidate-labels' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' + +export type WorkspaceCleanupSortKey = 'activity' | 'name' | 'repo' | 'review' | 'git' + +export type WorkspaceCleanupSortDirection = 'asc' | 'desc' + +export type WorkspaceCleanupTimeFilter = 'all' | '30d' | '90d' | 'archived' + +export type WorkspaceCleanupReviewFilter = + | 'all' + | 'no-review' + | 'has-review' + | 'open-review' + | 'closed-review' + +export type WorkspaceCleanupGitFilter = 'all' | 'clean' | 'dirty' | 'unpushed' | 'unknown' + +export type WorkspaceCleanupContextFilter = 'all' | 'has-context' | 'no-context' + +export type WorkspaceCleanupFilters = { + query: string + time: WorkspaceCleanupTimeFilter + review: WorkspaceCleanupReviewFilter + git: WorkspaceCleanupGitFilter + context: WorkspaceCleanupContextFilter +} const DAY_MS = 24 * 60 * 60 * 1000 diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation-fixtures.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-candidate-state.test-fixture.ts similarity index 86% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation-fixtures.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-candidate-state.test-fixture.ts index ea4920b9d8f..ac7da037f0c 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-presentation-fixtures.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-candidate-state.test-fixture.ts @@ -1,10 +1,10 @@ import type { AppState } from '@/store/types' import { translate } from '@/i18n/i18n' -import type { HostedReviewInfo } from '../../../../shared/source-control/hosted-review/hosted-review-contracts' -import type { Repo } from '../../../../shared/repo-types' -import type { Worktree } from '../../../../shared/worktree/types' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import type { WorkspaceCleanupFilters } from './workspace-cleanup-presentation' +import type { HostedReviewInfo } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' +import type { Repo } from '../../../../../shared/repo-types' +import type { Worktree } from '../../../../../shared/worktree/types' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupFilters } from './workspace-cleanup-candidate-filter-sort' export const NOW = 1_700_000_000_000 diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-matchers.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-matchers.ts similarity index 98% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-matchers.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-matchers.ts index e72201979ed..2fa45937bf2 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-matchers.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-matchers.ts @@ -12,7 +12,7 @@ import type { WorkspaceCleanupStatusFilter, WorkspaceCleanupTicketFilter, WorkspaceCleanupTriState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' export const WORKSPACE_CLEANUP_DAY_MS = 24 * 60 * 60 * 1000 diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-row-caches.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-row-caches.ts similarity index 90% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-row-caches.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-row-caches.ts index 071deff9599..093d150b951 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-row-caches.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-row-caches.ts @@ -1,6 +1,6 @@ -import type { LiveAgentWorktreeStatus } from '../../../../shared/sidebar-list/workspace-activity-facts' -import type { WorkspaceStatusDefinition } from '../../../../shared/worktree/types' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { LiveAgentWorktreeStatus } from '../../../../../shared/sidebar-list/workspace-activity-facts' +import type { WorkspaceStatusDefinition } from '../../../../../shared/worktree/types' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { buildWorkspaceCleanupFacets, type WorkspaceCleanupFacetSources, @@ -11,13 +11,13 @@ import { type WorkspaceCleanupRendererStateInputs, type WorkspaceCleanupReviewInfo, type WorkspaceCleanupReviewLookup -} from './workspace-cleanup-presentation' -import './workspace-cleanup-host-identity' +} from '../candidate-evidence/workspace-cleanup-review-lookup' +import '../candidate-evidence/workspace-cleanup-host-indexes' import { getWorkspaceCleanupCandidateHostId, getWorkspaceCleanupCandidateIdentity, getWorkspaceCleanupHostIdentity -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { getWorktreeVisitTimestamp } from '@/lib/workspace/activation/worktree-visit-recency' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.test.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.test.ts similarity index 87% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.test.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.test.ts index 273ea4380ba..30d335b3083 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.test.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { makeNamedFacets } from './workspace-cleanup-facet.test.fixture' import { sortWorkspaceCleanupFacets } from './workspace-cleanup-facet-sort' -import type { WorkspaceCleanupSortField } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import type { WorkspaceCleanupSortField } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' function names( rows: ReturnType[], diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.ts similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.ts index 3b4910fca64..0071f121bfc 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet-sort.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet-sort.ts @@ -4,11 +4,11 @@ import { getWorkspaceCleanupBlockerSeverity, getWorkspaceCleanupGitRank, getWorkspaceCleanupReviewRank -} from '../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-facet-rankings' import type { WorkspaceCleanupSortField, WorkspaceCleanupSortState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' /** Missing signals sort last in either direction; flipping reverses only rows with evidence. */ const ABSENT_LAST_FIELDS: ReadonlySet = new Set([ diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet.test.fixture.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet.test.fixture.ts similarity index 86% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet.test.fixture.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet.test.fixture.ts index 21a567c6f37..ba6c9e85fa1 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facet.test.fixture.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facet.test.fixture.ts @@ -1,14 +1,14 @@ -import type { LiveAgentWorktreeStatus } from '../../../../shared/sidebar-list/workspace-activity-facts' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { cloneDefaultWorkspaceStatuses } from '../../../../shared/workspace-statuses' -import { getWorkspaceCleanupCandidateIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import type { LiveAgentWorktreeStatus } from '../../../../../shared/sidebar-list/workspace-activity-facts' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { cloneDefaultWorkspaceStatuses } from '../../../../../shared/workspace-statuses' +import { getWorkspaceCleanupCandidateIdentity } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { buildWorkspaceCleanupFacets, type WorkspaceCleanupFacetSources, - type WorkspaceCleanupFacets, - type WorkspaceCleanupWorktreeFacts + type WorkspaceCleanupFacets } from './workspace-cleanup-facets' -import type { WorkspaceCleanupReviewInfo } from './workspace-cleanup-presentation' +import type { WorkspaceCleanupWorktreeFacts } from '../candidate-evidence/workspace-cleanup-host-indexes' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' export const FACET_NOW = 1_700_000_000_000 export const DAY = 24 * 60 * 60 * 1000 diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facets.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts similarity index 90% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-facets.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts index c809dca9e69..a6f059eee7a 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-facets.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts @@ -1,32 +1,31 @@ -import type { LiveAgentWorktreeStatus } from '../../../../shared/sidebar-list/workspace-activity-facts' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { WorkspaceStatusDefinition } from '../../../../shared/worktree/types' +import type { LiveAgentWorktreeStatus } from '../../../../../shared/sidebar-list/workspace-activity-facts' +import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { WorkspaceStatusDefinition } from '../../../../../shared/worktree/types' import { getWorkspaceCleanupCandidateIdentity, getWorkspaceCleanupCandidateHostId, getWorkspaceCleanupHostIdentity -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' -import { getWorkspaceStatus } from '../../../../shared/workspace-statuses' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { getWorkspaceStatus } from '../../../../../shared/workspace-statuses' import { canQueueWorkspaceCleanupCandidate, WORKSPACE_CLEANUP_BULK_SELECT_EXCLUSIONS, type WorkspaceCleanupBlocker, type WorkspaceCleanupCandidate -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { getWorkspaceCleanupGitState } from './workspace-cleanup-filter-sort' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { getWorkspaceCleanupGitState } from './workspace-cleanup-candidate-filter-sort' import type { WorkspaceCleanupAgentState, WorkspaceCleanupGitState, WorkspaceCleanupReviewState, WorkspaceCleanupTicketSource -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' -import type { WorkspaceCleanupReviewInfo } from './workspace-cleanup-presentation' -import type { WorkspaceCleanupWorktreeFacts } from './workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' +import type { WorkspaceCleanupWorktreeFacts } from '../candidate-evidence/workspace-cleanup-host-indexes' import { getWorktreeVisitTimestamp } from '@/lib/workspace/activation/worktree-visit-recency' -import { getWorkspaceCleanupGitChipLabel } from './workspace-cleanup-candidate-labels' +import { getWorkspaceCleanupGitChipLabel } from '../candidate-list/workspace-cleanup-candidate-labels' import type { Translate } from '@/i18n/use-translate' -export type { WorkspaceCleanupWorktreeFacts } from './workspace-cleanup-host-identity' export type WorkspaceCleanupFacetSources = { worktreeById?: ReadonlyMap diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-query.test.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-query.test.ts similarity index 93% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-query.test.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-query.test.ts index fad0636825e..0fa5250fab8 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-query.test.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-query.test.ts @@ -1,5 +1,5 @@ import { expect, it } from 'vitest' -import { createDefaultWorkspaceCleanupFilterState } from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +import { createDefaultWorkspaceCleanupFilterState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' import { makeFacetCandidate } from './workspace-cleanup-facet.test.fixture' import { queryWorkspaceCleanupCandidates } from './workspace-cleanup-query' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-query.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-query.ts similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-query.ts rename to src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-query.ts index b1cdc9f8b82..4f29a6fb6a8 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-query.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-query.ts @@ -1,4 +1,4 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { buildWorkspaceCleanupFacetList, type WorkspaceCleanupFacetSources, @@ -20,7 +20,7 @@ import { sortWorkspaceCleanupFacets } from './workspace-cleanup-facet-sort' import type { WorkspaceCleanupFilterState, WorkspaceCleanupSortState -} from '../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' export type WorkspaceCleanupQuery = { filters: WorkspaceCleanupFilterState diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-agent-stop-gate.ts b/src/renderer/src/components/workspace-cleanup/removal/agent-consent/use-workspace-cleanup-agent-stop-gate.ts similarity index 94% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-agent-stop-gate.ts rename to src/renderer/src/components/workspace-cleanup/removal/agent-consent/use-workspace-cleanup-agent-stop-gate.ts index e90e2a0318d..e08754f6a42 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-agent-stop-gate.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/agent-consent/use-workspace-cleanup-agent-stop-gate.ts @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react' import { useAppStore } from '@/store' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { getWorkspaceCleanupCandidateIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' +import { getWorkspaceCleanupCandidateIdentity } from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { getWorkspaceCleanupAgentEvidence } from '@/store/slices/workspace-cleanup/workspace-cleanup-agent-evidence' import { withWorkspaceCleanupAgentStopApproval } from './workspace-cleanup-agent-stop-approval' diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-agent-stop-approval.ts b/src/renderer/src/components/workspace-cleanup/removal/agent-consent/workspace-cleanup-agent-stop-approval.ts similarity index 84% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-agent-stop-approval.ts rename to src/renderer/src/components/workspace-cleanup/removal/agent-consent/workspace-cleanup-agent-stop-approval.ts index ef87323cc90..ff388dfe663 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-agent-stop-approval.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/agent-consent/workspace-cleanup-agent-stop-approval.ts @@ -1,4 +1,4 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' /** Stamp explicit agent-stop consent; scan live-agent labels alone are not approval and must be rewritten before final dispatch. */ export function withWorkspaceCleanupAgentStopApproval( diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-stop-agents.tsx b/src/renderer/src/components/workspace-cleanup/removal/agent-consent/workspace-cleanup-confirm-stop-agents.tsx similarity index 91% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-stop-agents.tsx rename to src/renderer/src/components/workspace-cleanup/removal/agent-consent/workspace-cleanup-confirm-stop-agents.tsx index e54a36c8a36..84971ab0c1a 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-stop-agents.tsx +++ b/src/renderer/src/components/workspace-cleanup/removal/agent-consent/workspace-cleanup-confirm-stop-agents.tsx @@ -5,14 +5,14 @@ import { DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/co import { ScrollArea } from '@/components/ui/scroll-area' import { cn } from '@/lib/class-names' import { useTranslate } from '@/i18n/use-translate' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import './workspace-cleanup-host-identity' -import { getWorkspaceCleanupCandidateIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' +import '../../candidate-evidence/workspace-cleanup-host-indexes' +import { getWorkspaceCleanupCandidateIdentity } from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { getWorkspaceCleanupCandidateAccessibleName, getWorkspaceCleanupCandidateHostLabel -} from './workspace-cleanup-host-label' -import { WorkspaceCleanupMetadataChip } from './workspace-cleanup-metadata-chip' +} from '../../candidate-list/workspace-cleanup-host-label' +import { WorkspaceCleanupMetadataChip } from '../../candidate-list/workspace-cleanup-metadata-chip' export function WorkspaceCleanupConfirmStopAgents({ candidates, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-ancestor-skips.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-ancestor-skips.ts similarity index 87% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-ancestor-skips.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-ancestor-skips.ts index d68b0135857..fca1bcb04b1 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-ancestor-skips.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-ancestor-skips.ts @@ -1,11 +1,11 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' import { isPathInsideOrEqual, normalizeRuntimePathForComparison -} from '../../../../shared/cross-platform-path' +} from '../../../../../../shared/cross-platform-path' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { translate } from '@/i18n/i18n' -import { getWorkspaceCleanupCandidateHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { getWorkspaceCleanupCandidateHostId } from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' // Ancestor skips remain provisional while blockers remove; authoritative settlement hardens or lifts them. export type SkippedWorkspaceCleanupAncestor = { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal-late-settlement.test.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal-late-settlement.test.ts similarity index 98% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal-late-settlement.test.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal-late-settlement.test.ts index a56f2ecca6c..ac94dda238a 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal-late-settlement.test.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal-late-settlement.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { toast } from 'sonner' import type { WorkspaceCleanupRemoveResult } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { startWorkspaceCleanupBackgroundRemoval } from './workspace-cleanup-background-removal' -import { makeCandidate } from './workspace-cleanup-presentation-fixtures' +import { makeCandidate } from '../../query/workspace-cleanup-candidate-state.test-fixture' vi.mock('sonner', () => ({ toast: { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.test.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.test.ts similarity index 68% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.test.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.test.ts index 0a48889c8f9..f0503c2ebf5 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.test.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.test.ts @@ -1,7 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { startWorkspaceCleanupBackgroundRemoval } from './workspace-cleanup-background-removal' -import { makeCandidate } from './workspace-cleanup-presentation-fixtures' -import { getWorkspaceCleanupHostIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { makeCandidate } from '../../query/workspace-cleanup-candidate-state.test-fixture' vi.mock('sonner', () => ({ toast: { @@ -11,7 +10,7 @@ vi.mock('sonner', () => ({ } })) -vi.mock('../sidebar/workspace-actions/deletion/preserved-branch-batch-toast', () => ({ +vi.mock('../../../sidebar/workspace-actions/deletion/preserved-branch-batch-toast', () => ({ showPreservedBranchBatchToast: vi.fn() })) @@ -149,58 +148,4 @@ describe('startWorkspaceCleanupBackgroundRemoval', () => { ] }) }) - - it('does not skip a paired-runtime ancestor after another runtime child fails', async () => { - const failedChild = makeCandidate({ - worktreeId: 'repo-1::/repo/parent/child', - displayName: 'child', - branch: 'child', - path: '/repo/parent/child', - executionHostId: 'runtime:hub-a' - }) - const unrelatedParent = makeCandidate({ - worktreeId: 'repo-2::/repo/parent', - repoId: 'repo-2', - repoName: 'Repo 2', - displayName: 'parent', - branch: 'parent', - path: '/repo/parent', - executionHostId: 'runtime:hub-b' - }) - const removeCandidates = vi - .fn() - .mockResolvedValueOnce({ - removedIds: [], - removedIdentities: [], - failures: [ - { - worktreeId: failedChild.worktreeId, - executionHostId: failedChild.executionHostId, - displayName: failedChild.displayName, - message: 'busy' - } - ] - }) - .mockResolvedValueOnce({ - removedIds: [unrelatedParent.worktreeId], - removedIdentities: [ - getWorkspaceCleanupHostIdentity('runtime:hub-b', unrelatedParent.worktreeId) - ], - failures: [] - }) - - startWorkspaceCleanupBackgroundRemoval({ - candidates: [unrelatedParent, failedChild], - removeCandidates, - onProgress: vi.fn() - }) - await settleBackgroundRemoval() - - expect(removeCandidates).toHaveBeenNthCalledWith(1, [failedChild.worktreeId], { - approvedCandidates: [failedChild] - }) - expect(removeCandidates).toHaveBeenNthCalledWith(2, [unrelatedParent.worktreeId], { - approvedCandidates: [unrelatedParent] - }) - }) }) diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.ts similarity index 98% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.ts index b48d13f0f60..9f93749d1c3 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-background-removal.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-background-removal.ts @@ -1,12 +1,13 @@ +// @protected-copy scope=file import { toast } from 'sonner' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFailure, WorkspaceCleanupRemoveOptions, WorkspaceCleanupRemoveResult } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { translate } from '@/i18n/i18n' -import { getWorkspaceCleanupCandidateHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { getWorkspaceCleanupCandidateHostId } from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { getSkippedAncestorMessage, isStrictWorkspaceCleanupDescendant, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-post-batch-late-settlement.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-post-batch-late-settlement.ts similarity index 98% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-post-batch-late-settlement.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-post-batch-late-settlement.ts index 40358d976d2..5d7b23cd21b 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-post-batch-late-settlement.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-post-batch-late-settlement.ts @@ -1,4 +1,4 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFailure, WorkspaceCleanupRemoveOptions, @@ -20,7 +20,7 @@ import { reclassifySkippedWorkspaceCleanupAncestors } from './workspace-cleanup- import { getWorkspaceCleanupCandidateHostId, getWorkspaceCleanupCandidateIdentity -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' type WorkspaceCleanupRemoveCandidates = ( worktreeIds: readonly string[], diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.test.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.test.ts similarity index 95% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.test.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.test.ts index ccb408520ce..57d428bd218 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.test.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.test.ts @@ -3,7 +3,7 @@ import { trackWorkspaceCleanupLateSettlement, type WorkspaceCleanupRemovalSettlement } from './workspace-cleanup-removal-settlement' -import { makeCandidate } from './workspace-cleanup-presentation-fixtures' +import { makeCandidate } from '../../query/workspace-cleanup-candidate-state.test-fixture' describe('workspace cleanup late settlement tracking', () => { it('detaches the batch callback and reports with a compact candidate identity', async () => { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.ts similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.ts index 6d0b6ba0f63..c21be75a769 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-settlement.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-settlement.ts @@ -1,10 +1,10 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFailure, WorkspaceCleanupRemoveResult } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { translate } from '@/i18n/i18n' -import { getWorkspaceCleanupCandidateHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { getWorkspaceCleanupCandidateHostId } from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' export type WorkspaceCleanupRemovalSettlement = | { status: 'fulfilled'; result: WorkspaceCleanupRemoveResult } diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-timeout-recovery.test.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-timeout-recovery.test.ts similarity index 99% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-timeout-recovery.test.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-timeout-recovery.test.ts index 4814a0cc9ea..7ef7ddb0974 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-timeout-recovery.test.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-timeout-recovery.test.ts @@ -4,7 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { toast } from 'sonner' import type { WorkspaceCleanupRemoveResult } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { startWorkspaceCleanupBackgroundRemoval } from './workspace-cleanup-background-removal' -import { makeCandidate } from './workspace-cleanup-presentation-fixtures' +import { makeCandidate } from '../../query/workspace-cleanup-candidate-state.test-fixture' vi.mock('sonner', () => ({ toast: { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-toasts.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-toasts.ts similarity index 92% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-toasts.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-toasts.ts index d14959c3b22..80c034b39ad 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-toasts.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-removal-toasts.ts @@ -4,7 +4,7 @@ import type { WorkspaceCleanupRemoveResult } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { translate } from '@/i18n/i18n' -import { showPreservedBranchBatchToast } from '../sidebar/workspace-actions/deletion/preserved-branch-batch-toast' +import { showPreservedBranchBatchToast } from '../../../sidebar/workspace-actions/deletion/preserved-branch-batch-toast' export function showWorkspaceCleanupRemovalResultToasts( result: WorkspaceCleanupRemoveResult, diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-skipped-ancestor-reclassification.ts b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-skipped-ancestor-reclassification.ts similarity index 95% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-skipped-ancestor-reclassification.ts rename to src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-skipped-ancestor-reclassification.ts index b562ab5ba62..aeccb981752 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-skipped-ancestor-reclassification.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/settlement/workspace-cleanup-skipped-ancestor-reclassification.ts @@ -1,4 +1,4 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { getSkippedAncestorMessage, diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.agent-stop.test.tsx b/src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.agent-stop.test.tsx similarity index 92% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.agent-stop.test.tsx rename to src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.agent-stop.test.tsx index 50603970058..3af8765d9a3 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.agent-stop.test.tsx +++ b/src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.agent-stop.test.tsx @@ -2,9 +2,9 @@ import { act, renderHook } from '@testing-library/react' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { AgentStatusEntry } from '../../../../shared/agent-status/contracts/agent-status-types' -import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' +import { makePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupRemoveOptions, WorkspaceCleanupRemoveResult @@ -16,9 +16,9 @@ vi.mock('sonner', () => ({ import { useAppStore } from '@/store' import { makeTab } from '@/store/terminals/terminal-tab.test-fixture' -import { makeCandidate } from './workspace-cleanup-presentation-fixtures' +import { makeCandidate } from '../query/workspace-cleanup-candidate-state.test-fixture' import { useWorkspaceCleanupRemoval } from './use-workspace-cleanup-removal' -import { useWorkspaceCleanupDialogLifecycle } from './use-workspace-cleanup-dialog-lifecycle' +import { useWorkspaceCleanupDialogLifecycle } from '../dialog/use-workspace-cleanup-dialog-lifecycle' const initialState = useAppStore.getInitialState() const LEAF_ID = '11111111-1111-4111-8111-111111111111' diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.ts b/src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.ts similarity index 97% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.ts rename to src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.ts index 20b34f2dbe5..86982ab67f3 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-removal.ts @@ -1,25 +1,25 @@ import { useCallback, useRef, useState } from 'react' import { useAppStore } from '@/store' import { useMountedRef } from '@/hooks/useMountedRef' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { getWorkspaceCleanupCandidateIdentity, getWorkspaceCleanupHostIdentity, resolveWorkspaceCleanupRemovalHostId -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { getWorktreeDeleteStateKey } from '@/store/slices/worktrees/teardown/worktree-delete-state' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' import { startWorkspaceCleanupBackgroundRemoval, type WorkspaceCleanupRemovalProgress -} from './workspace-cleanup-background-removal' +} from './settlement/workspace-cleanup-background-removal' import { filterWorkspaceCleanupRemovalCandidates } from './workspace-cleanup-removal-candidates' import { createWorkspaceCleanupSnapshotPruneBatch } from './workspace-cleanup-snapshot-prune-batch' import { useWorkspaceCleanupUnverifiedRemoval } from './use-workspace-cleanup-unverified-removal' import { useWorkspaceCleanupAgentStopGate, type WorkspaceCleanupAgentStopRequest -} from './use-workspace-cleanup-agent-stop-gate' +} from './agent-consent/use-workspace-cleanup-agent-stop-gate' export type WorkspaceCleanupRemovalController = { confirming: boolean diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-unverified-removal.ts b/src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-unverified-removal.ts similarity index 93% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-unverified-removal.ts rename to src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-unverified-removal.ts index d586c43157c..1505c1d2691 100644 --- a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-unverified-removal.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/use-workspace-cleanup-unverified-removal.ts @@ -1,18 +1,18 @@ import { useCallback, type Dispatch, type SetStateAction } from 'react' import { useMountedRef } from '@/hooks/useMountedRef' import { useAppStore } from '@/store' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import { getWorkspaceCleanupCandidateIdentity, getWorkspaceCleanupHostIdentity, resolveWorkspaceCleanupRemovalHostId -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import type { WorkspaceCleanupFailure, WorkspaceCleanupRemoveResult } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' -import { startWorkspaceCleanupBackgroundRemoval } from './workspace-cleanup-background-removal' -import type { WorkspaceCleanupDeletionPhase } from './workspace-cleanup-candidate-row' +import { startWorkspaceCleanupBackgroundRemoval } from './settlement/workspace-cleanup-background-removal' +import type { WorkspaceCleanupDeletionPhase } from '../candidate-list/workspace-cleanup-candidate-row' import { createWorkspaceCleanupSnapshotPruneBatch } from './workspace-cleanup-snapshot-prune-batch' type UnverifiedRemovalArgs = { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-remove.tsx b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-confirm-remove.tsx similarity index 91% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-remove.tsx rename to src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-confirm-remove.tsx index 2e87a8408d7..9e5d5bfd997 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-confirm-remove.tsx +++ b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-confirm-remove.tsx @@ -10,31 +10,31 @@ import { useTranslate, type Translate } from '@/i18n/use-translate' import { needsWorkspaceCleanupRemovalApproval, type WorkspaceCleanupCandidate -} from '../../../../shared/workspace-cleanup/workspace-cleanup' -import type { WorkspaceCleanupRemovalProgress } from './workspace-cleanup-background-removal' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupRemovalProgress } from './settlement/workspace-cleanup-background-removal' import { getCandidateFactStatuses, formatContextDetailLabels, getDirtyGitLabel, shouldShowGitMetadataChip -} from './workspace-cleanup-candidate-row-data' -import type { WorkspaceCleanupReviewInfo } from './workspace-cleanup-presentation' -import { formatWorkspaceCleanupRelativeTime } from './workspace-cleanup-relative-time' +} from '../candidate-list/workspace-cleanup-candidate-row-data' +import type { WorkspaceCleanupReviewInfo } from '../candidate-evidence/workspace-cleanup-review-lookup' +import { formatWorkspaceCleanupRelativeTime } from '../candidate-list/workspace-cleanup-relative-time' import { getReviewStateTone } from '@/components/github/review-state-presentation' -import { getReviewStateSrText } from './workspace-cleanup-row-labels' -import { StatusPill } from './workspace-cleanup-status-pill' -import { WorkspaceCleanupCandidateList } from './workspace-cleanup-candidate-list' -import './workspace-cleanup-host-identity' +import { getReviewStateSrText } from '../candidate-list/workspace-cleanup-review-labels' +import { StatusPill } from '../candidate-list/workspace-cleanup-status-pill' +import { WorkspaceCleanupCandidateList } from '../candidate-list/workspace-cleanup-candidate-list' +import '../candidate-evidence/workspace-cleanup-host-indexes' import { getWorkspaceCleanupCandidateHostId, getWorkspaceCleanupCandidateIdentity, getWorkspaceCleanupHostIdentity -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { getWorkspaceCleanupCandidateAccessibleName, getWorkspaceCleanupCandidateHostLabel -} from './workspace-cleanup-host-label' -import { WorkspaceCleanupMetadataText } from './workspace-cleanup-metadata-chip' +} from '../candidate-list/workspace-cleanup-host-label' +import { WorkspaceCleanupMetadataText } from '../candidate-list/workspace-cleanup-metadata-chip' const CONFIRM_REMOVE_ROW_ESTIMATE_PX = 76 diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-deletion-phases.ts b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-deletion-phases.ts similarity index 84% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-deletion-phases.ts rename to src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-deletion-phases.ts index 5dd8ba2adb1..fe8b958c619 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-deletion-phases.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-deletion-phases.ts @@ -1,12 +1,12 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorktreeDeleteState } from '@/store/slices/worktrees/teardown/worktree-delete-state-types' import { getWorkspaceCleanupCandidateIdentity, getWorkspaceCleanupIdentityWorktreeId, resolveWorkspaceCleanupRemovalHostId -} from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' -import { composeWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' -import type { WorkspaceCleanupDeletionPhase } from './workspace-cleanup-candidate-row' +} from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { composeWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' +import type { WorkspaceCleanupDeletionPhase } from '../candidate-list/workspace-cleanup-candidate-row' export function getWorkspaceCleanupDeletionPhaseByIdentity( candidates: readonly WorkspaceCleanupCandidate[], diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-forget-locally-button.tsx b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-forget-locally-button.tsx similarity index 88% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-forget-locally-button.tsx rename to src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-forget-locally-button.tsx index 5e1c14fac61..ecffe668775 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-forget-locally-button.tsx +++ b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-forget-locally-button.tsx @@ -2,8 +2,8 @@ import { Trash2 } from 'lucide-react' import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { useTranslate } from '@/i18n/use-translate' -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' -import { resolveWorkspaceCleanupRemovalHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' +import { resolveWorkspaceCleanupRemovalHostId } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { runWorktreeDelete } from '@/components/sidebar/workspace-actions/deletion/delete-worktree-flow' export function openWorkspaceCleanupForgetLocally(candidate: WorkspaceCleanupCandidate): void { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.test.ts b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.test.ts similarity index 82% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.test.ts rename to src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.test.ts index 2731521393d..b086d32fdc3 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.test.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' -import { makeCandidate } from './workspace-cleanup-presentation-fixtures' +import { makeCandidate } from '../query/workspace-cleanup-candidate-state.test-fixture' import { filterWorkspaceCleanupRemovalCandidates } from './workspace-cleanup-removal-candidates' -import { composeWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' +import { composeWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' describe('workspace cleanup removal candidates', () => { it('keeps a same-id sibling on another host removable', () => { diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.ts b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.ts similarity index 80% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.ts rename to src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.ts index 2d40590cffe..a1c81320df4 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-removal-candidates.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-removal-candidates.ts @@ -1,7 +1,7 @@ -import type { WorkspaceCleanupCandidate } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorktreeDeleteState } from '@/store/slices/worktrees/teardown/worktree-delete-state-types' -import { composeWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' -import { resolveWorkspaceCleanupRemovalHostId } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' +import { composeWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' +import { resolveWorkspaceCleanupRemovalHostId } from '../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' type DeletionFlagState = Pick diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-snapshot-prune-batch.ts b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-snapshot-prune-batch.ts similarity index 81% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-snapshot-prune-batch.ts rename to src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-snapshot-prune-batch.ts index dc3fcb2bf30..981567c4886 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-snapshot-prune-batch.ts +++ b/src/renderer/src/components/workspace-cleanup/removal/workspace-cleanup-snapshot-prune-batch.ts @@ -1,5 +1,5 @@ -import type { WorkspaceCleanupBackgroundRemovalArgs } from './workspace-cleanup-background-removal' -import { createNonSecureContextUuid as createBrowserUuid } from '../../../../shared/non-secure-context-uuid' +import type { WorkspaceCleanupBackgroundRemovalArgs } from './settlement/workspace-cleanup-background-removal' +import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/non-secure-context-uuid' export function createWorkspaceCleanupSnapshotPruneBatch(): | WorkspaceCleanupBackgroundRemovalArgs['snapshotPruneBatch'] diff --git a/src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-scan-lifecycle.ts b/src/renderer/src/components/workspace-cleanup/scanning/use-workspace-cleanup-scan-lifecycle.ts similarity index 100% rename from src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-scan-lifecycle.ts rename to src/renderer/src/components/workspace-cleanup/scanning/use-workspace-cleanup-scan-lifecycle.ts diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-scan-notice.ts b/src/renderer/src/components/workspace-cleanup/scanning/workspace-cleanup-scan-notice.ts similarity index 96% rename from src/renderer/src/components/workspace-cleanup/workspace-cleanup-scan-notice.ts rename to src/renderer/src/components/workspace-cleanup/scanning/workspace-cleanup-scan-notice.ts index ae39ae0ed12..3fa5e354afd 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-scan-notice.ts +++ b/src/renderer/src/components/workspace-cleanup/scanning/workspace-cleanup-scan-notice.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import type { WorkspaceCleanupScanError } from '../../../../shared/workspace-cleanup/workspace-cleanup' +import type { WorkspaceCleanupScanError } from '../../../../../shared/workspace-cleanup/workspace-cleanup' function isDisconnectedRemoteScanError(message: string): boolean { return (