Repository navigation
feat(explorer): scope file trees to sparse checkout directories - #18750
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds configurable file-explorer roots for sparse worktrees. Root choices persist per worktree and migrate from existing state. The selected root scopes tree projection, loading, reveals, drag and drop, imports, and file creation. Directory errors preserve cached children and expose retry controls. Worktree rename, removal, transfer, and repository cleanup update the new state map. Host capability checks prevent unsupported environments from receiving the new field. Tests cover persistence, migration, scoped behavior, errors, hydration, and host compatibility. Merge Risk: 🟡 Moderate · up to The explorer-root picker scopes file operations to the selected directory, but a stale native file-drop event can still write files into a previously selected root after changing scope. Error-state coverage also remains incomplete, so this should be resolved before merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 321ee7dd-eae4-4bba-9aaf-f4ee9881c130
📥 Commits
Reviewing files that changed from the base of the PR and between 86cd327 and d25296948b507f86212161c9d9449a2e42aa4ce2.
📒 Files selected for processing (60)
src/main/orca-profiles/profile-project-source-removal.tssrc/main/orca-profiles/profile-project-transfer-worktree-ids.tssrc/main/persistence-ui-state.test.tssrc/main/persistence/applying-settings/ui-state-read.tssrc/main/persistence/applying-settings/ui-state-update.tssrc/main/persistence/loading-store/normalize-loaded-ui-state.tssrc/main/persistence/loading-store/repo-lifecycle-operations.tssrc/main/persistence/tracking-repos/worktree-identity-migration.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/ui-state-schema-parity-checks.tssrc/renderer/src/app-shell/use-persisted-ui-writer.tssrc/renderer/src/components/right-sidebar/FileExplorer.tsxsrc/renderer/src/components/right-sidebar/FileExplorerBackgroundMenu.tsxsrc/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.tsxsrc/renderer/src/components/right-sidebar/FileExplorerRootSelect.tsxsrc/renderer/src/components/right-sidebar/FileExplorerRow.tsxsrc/renderer/src/components/right-sidebar/FileExplorerToolbar.tsxsrc/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsxsrc/renderer/src/components/right-sidebar/file-explorer-display-root.test.tssrc/renderer/src/components/right-sidebar/file-explorer-display-root.tssrc/renderer/src/components/right-sidebar/file-explorer-expanded-dirs-refresh.tssrc/renderer/src/components/right-sidebar/file-explorer-name-filter-projection.tssrc/renderer/src/components/right-sidebar/file-explorer-types.tssrc/renderer/src/components/right-sidebar/use-file-explorer-background-menu.tssrc/renderer/src/components/right-sidebar/use-file-explorer-row-scrolling.tssrc/renderer/src/components/right-sidebar/use-file-explorer-scope-transition.tssrc/renderer/src/components/right-sidebar/use-file-explorer-tree-load-effects.tssrc/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.tssrc/renderer/src/components/right-sidebar/useFileExplorerAutoReveal.tssrc/renderer/src/components/right-sidebar/useFileExplorerDragDrop.tssrc/renderer/src/components/right-sidebar/useFileExplorerImport.tssrc/renderer/src/components/right-sidebar/useFileExplorerInlineInput.tssrc/renderer/src/components/right-sidebar/useFileExplorerReveal.scoped-root.test.tsxsrc/renderer/src/components/right-sidebar/useFileExplorerReveal.tssrc/renderer/src/components/right-sidebar/useFileExplorerTree.scoped-root.test.tsxsrc/renderer/src/components/right-sidebar/useFileExplorerTree.tssrc/renderer/src/components/right-sidebar/useFileExplorerVisibleRowProjection.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/persisted-ui-write-baseline.test.tssrc/renderer/src/store/slices/persisted-ui-write-baseline.tssrc/renderer/src/store/slices/ui-hydration-view-layout.test.tssrc/renderer/src/store/slices/ui/ui-slice-contract-preferences.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-actions.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.tssrc/renderer/src/store/slices/ui/ui-slice-preference-actions.tssrc/renderer/src/store/slices/worktrees-slice-test-harness.tssrc/renderer/src/store/slices/worktrees/session/worktree-identity-rename-state.tssrc/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.tssrc/renderer/src/store/slices/worktrees/teardown/worktree-purge-state.tssrc/renderer/src/web/preload-api/web-ui-api.tssrc/renderer/src/web/preload-api/web-ui-explorer-root.test.tssrc/shared/constants.tssrc/shared/file-explorer-display-root.test.tssrc/shared/file-explorer-display-root.tssrc/shared/persisted-ui-state-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — a scoped display root for sparse-checkout worktrees, plus the persistence, migration, error-handling, and old-host compatibility it requires.
- Per-worktree display-root preference — new persisted
explorerDisplayRootByWorktreerecord and a one-shot_explorerDisplayRootMigratedmigration that seeds existing sparse worktrees withFull repo rootwhile newly created ones default to their first sparse directory. - Display-root derivation and threading —
file-explorer-display-roothelpers compute options/path/depth, and the scoped path is threaded through the tree load, row/name-filter projections, reveal, auto-reveal, drag/drop, inline input, and background menu, withdisplayDepthOffsetremoving the leading ancestor indentation. - Dir-cache read-error handling — a new
DirCache.errorfield distinguishes unreadable from empty, preserves prior children on failed refreshes, and surfaces a Retry action. - Scope-transition hygiene — selection, inline input, reveal timers, and scroll reset when the display root changes.
- Persistence/RPC plumbing — hydration sanitizers, preference actions, teardown/purge cleanup, identity migration, schema parity, and a
FileExplorerRootSelectpicker plus i18n. - Old-host compatibility — the web client capability-negotiates
explorerDisplayRootByWorktreeso hosts that predate the field never receive an unknownui.setkey.
Verified the depth math is consistent across reveal, the scoped-root load effect, and refresh; that worktreeMeta[].sparseDirectories is a persisted source for the migration; and that the web merge path preserves the field. No behavioral issues found.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.errors.test.tsx (1)
36-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExecute
FileExplorerTreeStatusin this test.
visit(emptyPane(error))only inspects the child element and its props. It does not execute the component at Line 26. Therole="status"assertion comes from the parent retry element, so the test still passes ifif (error !== null)reverts toif (error). Render or invokeFileExplorerTreeStatuswitherror: ''and assert that it returns the error-message branch.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 894ee9ad-41fe-497b-b7d5-31ee68b83f98
📥 Commits
Reviewing files that changed from the base of the PR and between d25296948b507f86212161c9d9449a2e42aa4ce2 and fb8cdd3db9c806328d5d939c7a45213d0ba6962b.
📒 Files selected for processing (9)
src/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.errors.test.tsxsrc/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.tsxsrc/renderer/src/components/right-sidebar/FileExplorerTreeStatus.tsxsrc/renderer/src/components/right-sidebar/file-explorer-display-root.tssrc/renderer/src/components/right-sidebar/file-explorer-expanded-dirs-refresh.tssrc/renderer/src/components/right-sidebar/useFileExplorerTree.scoped-root.test.tsxsrc/renderer/src/web/preload-api/web-explorer-root-sync.tssrc/renderer/src/web/preload-api/web-ui-api.tssrc/renderer/src/web/preload-api/web-ui-explorer-root.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/renderer/src/components/right-sidebar/file-explorer-display-root.ts
- src/renderer/src/components/right-sidebar/useFileExplorerTree.scoped-root.test.tsx
- src/renderer/src/components/right-sidebar/file-explorer-expanded-dirs-refresh.ts
- src/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the follow-up commit addressing reviewer feedback on the sparse explorer root feature.
- Scoped-root error handling —
FileExplorerFilesTreePanenow derives its root cache from the display root and treatsnullas "no error", so a clean scoped directory no longer surfaces the stale full-root read error.FileExplorerTreeStatus,loadDir, andrefreshFileExplorerExpandedDirsswitch from truthiness to explicit!== null/!== undefined, preserving empty-string errors and cached children on failed reads. - Localized full-root label — the "Full repo root" option label now runs through
translatewithfileExplorer.root.*keys added to all six locales. - Web explorer-root replay — the web client's capability negotiation is extracted into
createWebExplorerRootSync, which queues unacknowledged roots per environment in browser storage and replays them (with newer-value protection) once a host advertises the field.
Verified the null/undefined error sentinels are consistent across the pane, FileExplorerTreeStatus, loadDir, and refreshFileExplorerExpandedDirs, and traced the replay/acknowledge state machine against its seven test cases, including host-swap and concurrent-write races. No behavioral issues found.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
@coderabbitai Please recheck docstring coverage on 1688c3f7e4. Added concise contract documentation for the changed functions; the local TypeScript AST audit finds JSDoc on all 61 identified changed named functions. Production changes in this commit are comments only. The focused persistence tests and changed-code quality gate pass. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 003a4eb3-d7ba-4541-8bb6-965e9e09e06b
📥 Commits
Reviewing files that changed from the base of the PR and between 86cd327 and 1688c3f7e45f2d5ae39ec38a6203a0efedadf0f1.
📒 Files selected for processing (63)
src/main/orca-profiles/profile-project-source-removal.tssrc/main/orca-profiles/profile-project-transfer-worktree-ids.tssrc/main/persistence-ui-state.test.tssrc/main/persistence/applying-settings/ui-state-read.tssrc/main/persistence/applying-settings/ui-state-update.tssrc/main/persistence/loading-store/normalize-loaded-ui-state.tssrc/main/persistence/loading-store/repo-lifecycle-operations.tssrc/main/persistence/tracking-repos/worktree-identity-migration.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/ui-state-schema-parity-checks.tssrc/renderer/src/app-shell/use-persisted-ui-writer.tssrc/renderer/src/components/right-sidebar/FileExplorer.tsxsrc/renderer/src/components/right-sidebar/FileExplorerBackgroundMenu.tsxsrc/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.errors.test.tsxsrc/renderer/src/components/right-sidebar/FileExplorerFilesTreePane.tsxsrc/renderer/src/components/right-sidebar/FileExplorerRootSelect.tsxsrc/renderer/src/components/right-sidebar/FileExplorerRow.tsxsrc/renderer/src/components/right-sidebar/FileExplorerToolbar.tsxsrc/renderer/src/components/right-sidebar/FileExplorerTreeStatus.tsxsrc/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsxsrc/renderer/src/components/right-sidebar/file-explorer-display-root.test.tssrc/renderer/src/components/right-sidebar/file-explorer-display-root.tssrc/renderer/src/components/right-sidebar/file-explorer-expanded-dirs-refresh.tssrc/renderer/src/components/right-sidebar/file-explorer-name-filter-projection.tssrc/renderer/src/components/right-sidebar/file-explorer-types.tssrc/renderer/src/components/right-sidebar/use-file-explorer-background-menu.tssrc/renderer/src/components/right-sidebar/use-file-explorer-row-scrolling.tssrc/renderer/src/components/right-sidebar/use-file-explorer-scope-transition.tssrc/renderer/src/components/right-sidebar/use-file-explorer-tree-load-effects.tssrc/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.tssrc/renderer/src/components/right-sidebar/useFileExplorerAutoReveal.tssrc/renderer/src/components/right-sidebar/useFileExplorerDragDrop.tssrc/renderer/src/components/right-sidebar/useFileExplorerImport.tssrc/renderer/src/components/right-sidebar/useFileExplorerInlineInput.tssrc/renderer/src/components/right-sidebar/useFileExplorerReveal.scoped-root.test.tsxsrc/renderer/src/components/right-sidebar/useFileExplorerReveal.tssrc/renderer/src/components/right-sidebar/useFileExplorerTree.scoped-root.test.tsxsrc/renderer/src/components/right-sidebar/useFileExplorerTree.tssrc/renderer/src/components/right-sidebar/useFileExplorerVisibleRowProjection.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/persisted-ui-write-baseline.test.tssrc/renderer/src/store/slices/persisted-ui-write-baseline.tssrc/renderer/src/store/slices/ui-hydration-view-layout.test.tssrc/renderer/src/store/slices/ui/ui-slice-contract-preferences.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-actions.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.tssrc/renderer/src/store/slices/ui/ui-slice-preference-actions.tssrc/renderer/src/store/slices/worktrees-slice-test-harness.tssrc/renderer/src/store/slices/worktrees/session/worktree-identity-rename-state.tssrc/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.tssrc/renderer/src/store/slices/worktrees/teardown/worktree-purge-state.tssrc/renderer/src/web/preload-api/web-explorer-root-sync.tssrc/renderer/src/web/preload-api/web-ui-api.tssrc/renderer/src/web/preload-api/web-ui-explorer-root.test.tssrc/shared/constants.tssrc/shared/file-explorer-display-root.test.tssrc/shared/file-explorer-display-root.tssrc/shared/persisted-ui-state-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
commit="1688c3f7e4"
git rev-parse --verify "${commit}^{commit}"
printf '\n--- Changed files ---\n'
git diff-tree --no-commit-id --name-status -r "$commit"
printf '\n--- Production TypeScript diff (function and JSDoc context) ---\n'
git diff --unified=8 "${commit}^" "$commit" -- \
':(exclude)**/*.test.ts' \
':(exclude)**/*.test.tsx' \
':(exclude)**/*.spec.ts' \
':(exclude)**/*.spec.tsx' \
'*.ts' '*.tsx'
printf '\n--- Changed production TypeScript files ---\n'
git diff-tree --no-commit-id --name-only -r "$commit" -- '*.ts' '*.tsx' \
| grep -Ev '(\.test|\.spec)\.(ts|tsx)$' || trueLength of output: 50718 🏁 Script executed: #!/bin/bash
set -euo pipefail
commit="1688c3f7e4"
python3 - "$commit" <<'PY'
import re
import subprocess
import sys
commit = sys.argv[1]
diff = subprocess.check_output(
["git", "diff", "--unified=0", f"{commit}^", commit, "--", "*.ts", "*.tsx"],
text=True,
)
current_file = None
entries = []
lines = diff.splitlines()
i = 0
while i < len(lines):
line = lines[i]
if line.startswith("+++ b/"):
current_file = line[6:]
if line.startswith("+/**"):
block = [line[1:]]
i += 1
while i < len(lines):
candidate = lines[i]
if candidate.startswith("+"):
block.append(candidate[1:])
if candidate[1:].strip().endswith("*/"):
i += 1
break
else:
break
i += 1
following = []
while i < len(lines) and len(following) < 12:
candidate = lines[i]
if candidate.startswith("+") and not candidate.startswith("+++"):
following.append(candidate[1:].strip())
elif candidate.startswith("@@") or candidate.startswith("diff --git"):
break
i += 1
text = " ".join(following)
match = re.search(
r"(?:export\s+)?(?:async\s+)?function\s+([A-Za-z_$][\w$]*)|"
r"([A-Za-z_$][\w$]*)\s*:\s*(?:async\s*)?\([^)]*\)\s*=>|"
r"(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?\([^)]*\)\s*=>|"
r"([A-Za-z_$][\w$]*)\s*\([^)]*\)\s*(?::[^=]+)?=>",
text,
)
name = next((group for group in match.groups() if group), None) if match else None
entries.append((current_file, name, " ".join(block)))
continue
i += 1
production = [entry for entry in entries if not re.search(r"\.(test|spec)\.[tj]sx?$", entry[0] or "")]
tests = [entry for entry in entries if entry not in production]
unmatched = [entry for entry in entries if entry[1] is None]
print(f"Added JSDoc blocks: {len(entries)}")
print(f"Production JSDoc blocks: {len(production)}")
print(f"Test JSDoc blocks: {len(tests)}")
print(f"Unmatched blocks: {len(unmatched)}")
print("\n--- JSDoc declaration associations ---")
for path, name, _ in entries:
print(f"{path}: {name or 'UNMATCHED'}")
if unmatched:
print("\n--- Unmatched block text ---")
for path, _, block in unmatched:
print(f"{path}: {block}")
PYLength of output: 13125 🏁 Script executed: #!/bin/bash
set -euo pipefail
commit="1688c3f7e4"
python3 - "$commit" <<'PY'
import re
import subprocess
import sys
commit = sys.argv[1]
diff = subprocess.check_output(
["git", "diff", "--unified=0", f"{commit}^", commit, "--", "*.ts", "*.tsx"],
text=True,
)
locations = []
path = None
for line in diff.splitlines():
if line.startswith("+++ b/"):
path = line[6:]
continue
if line.startswith("@@"):
# Example: @@ -12,0 +13 @@
match = re.search(r"\+(\d+)(?:,(\d+))?", line)
new_line = int(match.group(1)) if match else None
continue
if path is None or "new_line" not in locals() or new_line is None:
continue
if line.startswith("+") and not line.startswith("+++"):
if line[1:].lstrip().startswith("/**"):
locations.append((path, new_line))
new_line += 1
elif line.startswith(" "):
new_line += 1
declaration = re.compile(
r"^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\b|"
r"^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>|"
r"^([A-Za-z_$][\w$]*)\s*:\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>"
)
unmatched = []
matched = []
for path, start in locations:
source = subprocess.check_output(["git", "show", f"{commit}:{path}"], text=True).splitlines()
index = start - 1
# Skip the complete JSDoc block.
while index < len(source):
if "*/" in source[index]:
index += 1
break
index += 1
# Skip blank lines only. A JSDoc must directly document the next declaration.
while index < len(source) and not source[index].strip():
index += 1
next_line = source[index].strip() if index < len(source) else ""
match = declaration.match(next_line)
if match:
matched.append((path, start, next(group for group in match.groups() if group)))
else:
unmatched.append((path, start, next_line))
print(f"Added production JSDoc blocks: {len(locations)}")
print(f"Blocks followed by a named function declaration: {len(matched)}")
print(f"Blocks not matched by the declaration heuristic: {len(unmatched)}")
print("\n--- Verified associations ---")
for path, line, name in matched:
print(f"{path}: Line {line} -> {name}")
if unmatched:
print("\n--- Requires manual review ---")
for path, line, next_line in unmatched:
print(f"{path}: Line {line} -> {next_line}")
PYLength of output: 8191
I found 52 added production JSDoc blocks. All 52 directly document a named function or method. The audit matched 48 declarations automatically. I manually verified the remaining four valid declarations:
The commit-level diff contains 52 added JSDoc blocks, not 61. This does not conflict with the reported 61-function audit because functions documented in earlier commits are not new JSDoc additions in this comments-only commit. No docstring coverage finding remains. You are interacting with an AI system. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the delta since the prior Pullfrog review (commit fb8cdd3).
- Malformed-marker persistence fix —
normalizeLoadedUiStatenow gatesmarkNeedsSave()onparsed.ui?._explorerDisplayRootMigrated !== trueinstead of truthiness, so a truthy-but-malformed marker (1,'true',{}) can no longer re-run the one-shot migration on every load without ever persisting the seeded display roots. - Regression test — a new
it.eachtest drivesnormalizeLoadedUiStateacross every marker shape (undefined/false/null/1/'true'/{}/true), asserting the migration result is persisted exactly when the marker is not booleantrue, plus reload idempotency.
Verified the new test fails under the previous truthiness check (the 1/'true'/{} cases) and passes with the strict check, and that the fix aligns markNeedsSave with the existing === true gate already used by migrateExplorerDisplayRoots.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/right-sidebar/useFileExplorerImport.ts (1)
113-117: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReject a stale native drop before importing it.
After a scope change commits, the callback can still receive the old
destinationDir. The focused test does this with/repo/appafter/repo/apicommits. Lines 113-117 suppress selection only afterimportExternalPathsToRuntimewrites the file andrefreshDirrefreshes the old directory.Validate
destinationDiragainstdisplayRootRef.currentbefore the import. Keep the check inside thetryblock sofinallyclears the native drag state. Add assertions that the second drop does not call import or refresh.Proposed fix
void (async () => { try { + if ( + getRelativePathInsideRoot(destinationDir, displayRootRef.current) === null + ) { + return + } + const operationGuard = captureFileExplorerOperationGuard(wtId, operationOwnerRef.current)await waitFor(() => expect(clearDrag).toHaveBeenCalledTimes(2)) expect(selected).not.toHaveBeenCalled() + expect(mocks.importPaths).toHaveBeenCalledTimes(1) + expect(refresh).toHaveBeenCalledTimes(1) expect(mocks.subscribe).toHaveBeenCalledTimes(1)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 79bcd9ca-19d0-45e0-a728-8cf8956b0a02
📥 Commits
Reviewing files that changed from the base of the PR and between 28792eadd256f79a92eec47f4b6e5dbc01d3d262 and 59e7c6e1bba9a3dfce54bb2871351f584d87c0c8.
📒 Files selected for processing (2)
src/renderer/src/components/right-sidebar/useFileExplorerImport.committed-scope.test.tsxsrc/renderer/src/components/right-sidebar/useFileExplorerImport.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the delta since the prior Pullfrog review (commit 28792ea).
- Native-drop committed-scope fix —
useFileExplorerImportnow assigns its latest-value refs inside auseLayoutEffectinstead of during render, so a native file drop fired during a suspended scope transition observes only the committed workspace state rather than torn, uncommitted refs. - Scoped-selection guard — the import pipeline only reveals the first imported file when its destination still lies inside the current display root, preventing a reveal of a file that is now outside the scoped tree after a concurrent root switch.
- Regression test — a new
useFileExplorerImport.committed-scope.test.tsxdrives astartTransition+Suspensesuspend and asserts the drop uses the old committed scope during suspension and the new scope after commit.
Verified the useLayoutEffect move is the correct pattern for React 18 concurrent rendering (render-phase ref assignment tears under suspension, and the test fails if the change is reverted), and that getRelativePathInsideRoot(destPath, displayRoot) returning null correctly suppresses selection when the imported file falls outside the committed display root. No behavioral issues found.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
e8a604a to
51a0c59
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the delta since the prior Pullfrog review: the fix(explorer): reject stale drops and satisfy quality gates commit (rebased content-identical onto newer main).
- Stale native-drop rejection —
useFileExplorerImportnow returns early when the drop'sdestinationDirfalls outside the committed display root, so a drop that raced a scope switch is no longer imported into the previously-scoped directory. The guard sits inside thetry, sofinallystill clears the native drag state. - Regression coverage —
useFileExplorerImport.committed-scope.test.tsxaddsimportPaths/refreshcall-count assertions on the second (stale) drop; the test fails without the guard. - Real error-branch render test —
FileExplorerFilesTreePane.errors.test.tsxrendersFileExplorerTreeStatuswitherror=""viarenderToStaticMarkupand asserts the failure message rather than the empty-directory message. - Quality-gate cleanup —
as never/as unknown as Virtualizertest casts replaced with typed fixtures and line-scopedSAFETYdisables;components/uiprimitive restyling removed fromFileExplorerRootSelect.
Verified the guard cannot reject legitimate drops: the pane background and rows carry data-native-file-drop-dir values inside the display root, getExplorerDisplayRootPath never returns null while worktreePath is set, and the handler already bails when it is not. No behavioral issues in the delta; prior reviews have no open threads.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Implemented the sparse explorer navigation follow-up.
This keeps the existing tree and file-operation paths. A grouped “All sparse folders” view remains a follow-up rather than introducing new grouping and drop-target behavior here. Actual rendered comparisonsOriginal PR at The scenario uses real temporary files and seeded sparse-directory metadata. It drives the picker and Back button through the UI and explicit reveal through the normal store action. This validates explorer navigation, not Git sparse-checkout creation. One sparse folder — focused by default in both builds, now with an explicit viewing label. Multiple sparse folders — the default now exposes sibling packages and repository files. Outside-file reveal — the updated view offers a return action. Return action, search scope, dark theme, and ordinary workspaceAfter clicking Back to apps/web Content-search scope Explicit package choice in dark mode Ordinary workspace without a sparse picker Validation
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the delta since the prior Pullfrog review: commit b42884a9 (fix(explorer): preserve context when navigating sparse folders), which adds a "return to previous scope" affordance after an outside-file reveal and tightens the default-root rule for multi-directory sparse worktrees.
- Multi-directory default —
resolveExplorerDisplayRootChoicenow focuses the sole sparse directory only when exactly one exists (options.length === 2); worktrees with two or more sparse directories default to the repository root. The JSDoc andfile-explorer-display-root.test.tswere updated to match. - Scope return affordance — a new
useFileExplorerRootNavigationhook records a per-worktree return target when a reveal falls outside the display root, andreturnRootonly resolves while the current choice is the full root and the recorded worktree still matches (so a worktree switch cannot surface a stale target).useFileExplorerRevealnow calls an injectedonRevealOutsideRootcallback instead of writing the store directly, and a newFileExplorerScopeNoticerenders the "Back to {{path}}" button plus a search-scope note in the Contents view. - Picker label — the full-root option and trigger read "Repository root" / "Viewing: …", with
viewing/back/searchScopekeys added to all six locales. - Proof spec — a new
tests/e2e/sparse-explorer-proof.spec.tsexercises the single- and multi-directory defaults, scoping via the picker, the outside-file reveal and return, the content-search scope note, and the ordinary-workspace fallback.
I verified that getRevealAncestorDirs(displayRootPath, file) returns null for a file outside the display root, so the outside-scope case is handled by the onRevealOutsideRoot branch and never feeds the selection effect with bogus ancestors, and that the scope-transition useLayoutEffect runs before the reveal useEffect (so the reset cannot clobber the reveal selection). Ran the focused vitest suites for the changed hooks/helpers — all pass.
ℹ️ PR description no longer matches the default-root rule
The PR body states that "Only newly created sparse worktrees default to their first sparse directory," but after this commit that is only true for single-directory sparse worktrees — a new worktree with two or more sparse directories now opens at the repository root. Worth updating the description so the recorded intent matches the shipped behavior (or confirming the multi-directory default is the intended final rule).
Technical details
# Multi-directory sparse worktrees default to the repository root
## Affected sites
- `src/renderer/src/components/right-sidebar/file-explorer-display-root.ts` — `resolveExplorerDisplayRootChoice` returns `options[1].value` only when `options?.length === 2`; otherwise `FILE_EXPLORER_FULL_ROOT`.
- PR description ("What Changed" bullet: "Only newly created sparse worktrees default to their first sparse directory").
## Required outcome
- The description reflects that auto-focus applies only to a sole sparse directory, or the default is changed so multi-directory worktrees also auto-focus.
## Open questions for the human
- Is the repository-root default for multi-directory sparse worktrees intentional, and should the description be updated?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
One new localization-gate failure would block the merge; see the inline comment.
Reviewed changes — the delta since the prior pullfrog review: commit 6f794218 (feat(sparse): unify preset editing and clarify checkout scope).
- Shared preset editor — the composer picker and repository settings now render one
SparsePresetEditorDialogwrappingSparseCheckoutPresetDraftForm, replacing the two separate inline editors; the composer closes its popover before opening the dialog and restores focus to the trigger on close. - Shared name validator —
validateSparsePresetNamemoved intosparse-preset-draft.tswith translated messages and named duplicate-name interpolation, and both surfaces call it (the name input'smaxLengthwas dropped so the length error is reachable). Textareacodevariant — the directories field is rebuilt on avariant="code"textarea inside a scrollable form body with a pinned Save/Cancel footer.- Checkout-scope clarity —
FileExplorerScopeNoticenow renders for any sparse worktree, adding an “omitted files are not searched” note and a “view changes do not change checked-out files” banner. - i18n and proof —
sparsePreset.*keys added to all six locales, plus a newtests/e2e/sparse-preset-proof.spec.ts; the explorer proof spec now builds a real sparse checkout.
ℹ️ Nitpicks
FileExplorer.tsx:282—sparse={!!activeWorktree?.isSparse}is alwaystrue, since the notice is only mounted underactiveWorktree?.isSparse; thesparse ? … : nullbranches inFileExplorerScopeNoticeare therefore dead. Dropping the prop and rendering the notice unconditionally would be simpler.SparsePresetSettingsSection.tsx:186— on a failed save the same message is rendered twice withrole="alert"(the section'svisibleErrorbanner at line 174 and the dialog form'soperationError), so assistive tech announces it twice. Consider suppressing the section banner while the draft dialog is open.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
One new must-address issue: while a sparse preset draft is open, pressing Enter on the agent picker still creates the workspace, bypassing the "save or cancel the preset" block. Details inline.
Reviewed changes — the delta since the prior pullfrog review: commit 199c060 (fix(sparse): edit presets inline without stacking dialogs).
- Replaced the stacked preset dialog with a shared inline
SparsePresetInlineEditorrendered as a labelledregion, used by both the composer picker and repository settings. - Added composer
sparseEditingstate that disables the footer Create button, shows a save-or-cancel note, and marks the composer root withdata-sparse-preset-editing; the modal's Escape and Cmd/Ctrl+Enter handlers now respect an open editor. - Reworked the shared form on the
Textareacodevariant with a sticky footer, collapsible checkout help, a localized name placeholder, accessible directory status, and settings focus restoration. - Added
sparsePreset.details/finishEditingand catalog sync across all six locales, and updated the sparse-preset e2e proof to the inline editor.
ℹ️ Nitpicks
NewWorkspaceComposerAdvancedSection.tsx:152— collapsing Advanced while a preset draft is open hides andinerts the editor while Create stays disabled; recovery requires re-expanding and cancelling. Consider disabling the Advanced toggle while editing.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ Reviewed the new commits; no new issues found. The localization-coverage gate flagged in an earlier review is unchanged (
SparseCheckoutPresetDraftForm.tsx:94still holds a raw placeholder literal), so this PR is not mergeable yet and stays unapproved.
Reviewed changes — the delta since the prior pullfrog review: commit 55d7cd76 (fix(sparse): polish inline editing and explorer scope).
- Closed the preset-editing create bypass — the agent section now receives
createDisabled={props.createDisabled || sparseEditing}andadvancedLocked, the footer is hidden while a draft is open, and the project section is a disabledfieldset; the prior "plain Enter on the agent picker creates the workspace" finding is fixed. - Extracted the preset chooser —
SparsePresetChoosernow owns preset search, the "Full checkout" default, per-preset edit, and the New preset action, withCommandItemgaining aselection="palette"variant. - Relocated the explorer scope row — the root picker moved from the toolbar into
FileExplorerScopeNotice, which gains an Info popover, a search-scope note, and the "Back to" row; the name filter prompt now names the viewed folder. - Scoped explorer copy and retry —
FileExplorerTreeStatusdistinguishes an empty/failed folder from an empty/failed workspace, and the pane derives only the display root's error with a Retry that refreshes that directory. - Inline settings editing —
SparsePresetSettingsSectionedits in place, blocks competing New/Edit/Delete while a draft is open, suppresses its duplicate error banner, adds a load retry, and restores focus to the edited row. - i18n and proof — new keys in all six locales plus extended explorer/preset proof specs.
Verified locally: tc:web passes, 46 focused vitest tests pass, and the catalog/runtime-catalog/extraction localization checks pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta.
Reviewed changes — the delta since the prior pullfrog review: commit c93a2eb (fix(sparse): attach chooser and keep long-list actions visible).
- Chooser attached to its trigger — the preset popover drops its own max-height/scroll and passes
sideOffset={0}, so the surface sits flush against the "Checkout preset" trigger instead of floating with a gap. - Results-only scrolling —
SparsePresetChooserbounds itself and makes the result listmin-h-0 flex-1, pinning the search field and the New preset footer; the New preset action can no longer scroll out of reach with a long preset list. - Popover wheel shim opt-in —
PopoverContentgains awheelScrollmarker that routes wheel events to the nearest scrollable descendant (the result list) through the existing shim, since Radix's dialog scroll-lock swallows them. - Proof coverage — the preset proof now asserts trigger/edge alignment, Enter selection with focus return, wheel scrolling with 25 presets, and filtering to the last preset.
Verified locally: tc:web, check:dead-classes, and check:code-quality:changed (0 findings across 89 changed files) all pass, and the focused preset suites pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — one layout suggestion inline.
Reviewed changes — the delta since the prior pullfrog review: commit 9f35189 (refine(sparse): use compact explorer breadcrumb navigation), which reworks the sparse explorer root picker into a breadcrumb row.
- Breadcrumb root picker —
FileExplorerRootSelectreplaces the RadixSelectwith a<nav>: an icon button returns to the repository root, and aDropdownMenuradio group picks among the sparse directories. - Return action folded into the scope row —
FileExplorerScopeNoticenow renders the "Back to {{path}}" control as an icon button inline with the picker and the Info popover, instead of a second full-width row. - Test/proof updates — the scope-notice unit test and
sparse-explorer-proof.spec.tsswitch fromcombobox/optionqueries tobutton/menuitemradioand add an Escape plus a root-then-repick retry.
Every new visible string still routes through translate, and the menu now inherits WebkitAppRegion: 'no-drag' from the dropdown primitive, so the previous explicit no-drag class is no longer needed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| type="button" | ||
| variant="ghost" | ||
| size="xs" | ||
| className="min-w-0" |
There was a problem hiding this comment.
The trigger lost the width constraint the old SelectTrigger had (min-w-0 flex-1), and the base Button carries shrink-0. With no flex-1/max-w-*, the button sizes to its content, so truncate on the label never engages and a long sparse directory path overflows the scope row instead of ellipsizing.
Technical details
# Constrain the breadcrumb trigger so long paths truncate
## Affected sites
- `src/renderer/src/components/right-sidebar/FileExplorerRootSelect.tsx:61-71` — the trigger `Button` has only `min-w-0`, while `buttonVariants` is `inline-flex shrink-0`; nothing caps the width, so the label expands the button past the scope row.
- `src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx:88` — the codebase's equivalent dropdown trigger constrains the same shape with `max-w-48` on the `Button` plus `<span className="truncate">`.
## Required outcome
- A long selected folder path ellipsizes within the available scope-row width at the 220px sidebar minimum and does not overlap the Info button.
## Suggested approach (optional)
- Give the trigger a width cap the base `shrink-0` cannot defeat — e.g. `className="min-w-0 max-w-full"`, or a bounded cap as in the native-chat picker; the inner `<span className="truncate">` then elides.| className="min-w-0" | |
| className="min-w-0 max-w-full" |
|
| explorerDisplayRootByWorktree: removeRepoWorktreeRecord( | ||
| state.ui.explorerDisplayRootByWorktree, | ||
| repoId | ||
| ), |
There was a problem hiding this comment.
Comments Outside DiffThese findings could not be posted inline.
|
There was a problem hiding this comment.
ℹ️ No critical issues — a few minor suggestions inline.
Reviewed changes — the delta since the prior pullfrog review: commit fe1edf2 (fix(sparse): add path suggestions and seal editor footer).
- Searchable folder suggestions — a new
SparseDirectoryPickerpopover lists directories drawn from existing presets (filtered against the draft's current selection) and appends the picked path to the directories field. - Editor footer sealed — the shared preset form gains bottom padding and an opaque sticky Save/Cancel footer with a soft top shadow, and Save swaps to an inline spinner while keeping its label.
- Scroll on open —
SparsePresetInlineEditorscrolls itself to center on mount. - i18n —
sparsePreset.addPath/findPath/noPathMatchesadded to all six catalogs.
ℹ️ Nitpicks
SparseDirectoryPickerhas no unit or e2e coverage — the sparse-preset proof spec still exercises only the textarea path.- The three new picker strings carry the English value in the
es/fr/ja/ko/zhcatalogs; the catalog gate accepts English fallbacks, but the PR body states copy was added in all six languages.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const addDirectory = (directory: string): void => { | ||
| const next = [...(parsedDirectories?.directories ?? []), directory] | ||
| onDraftChange({ ...draft, directoriesText: next.join('\n') }) |
There was a problem hiding this comment.
The picker stays enabled while the directories field is invalid, and addDirectory rebuilds the text from parsedDirectories.directories, which is [] for any parse error (hasAbsoluteEntry, or ./parent segment). Clicking a suggestion then silently replaces the whole field — including any valid lines the user typed next to the bad one — with just the picked folder. Appending to the raw directoriesText (or disabling the picker while directoryError is set) avoids dropping entries.
Technical details
# Adding a suggested folder discards existing typed directories
## Affected sites
- `src/renderer/src/components/sparse/SparseCheckoutPresetDraftForm.tsx:54-56` — `addDirectory` uses `parsedDirectories?.directories ?? []` as the base, then `next.join('\n')`.
- `src/renderer/src/lib/sparse-preset-draft.ts:29-56` — both error branches (`hasAbsoluteEntry`, and `.`/parent segment) return `directories: []`, so every typed line is dropped, not just the invalid one.
- `src/renderer/src/components/sparse/SparseDirectoryPicker.tsx:33` — the trigger is only gated on `submitting`, so it is clickable during the error state.
## Required outcome
- Adding a suggested folder never discards directories the user has already typed.
## Suggested approach (optional)
- Append to the current `directoriesText` lines (deduped) instead of rebuilding from `parsedDirectories.directories`, or keep the picker disabled while `directoryError` is non-null.| disabled, | ||
| onAdd | ||
| }: SparseDirectoryPickerProps): React.JSX.Element | null { | ||
| const available = suggestions.filter((path) => !selected.includes(path)) |
There was a problem hiding this comment.
suggestions is a flatMap across every preset and isn't deduped, so two presets sharing a directory produce duplicate key/CommandItem rows (React duplicate-key warning and two identical entries). Dedupe before filtering, e.g. [...new Set(suggestions)].
| </div> | ||
| <SparsePresetInlineEditor | ||
| {...props} | ||
| directorySuggestions={directorySuggestions} |
There was a problem hiding this comment.
directorySuggestions is accepted here but never supplied — SparsePresetSettingsSection is the only caller of SparsePresetDraftEditor and doesn't pass it, so the picker never renders in settings and this forwarded prop is dead. Either give the settings caller the repo's preset directories too, or drop the prop from the wrapper.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes — the delta since the prior pullfrog review: commit 663dc188 (fix(sparse): keep path picker visible and stop footer overlap).
- Picker stays visible —
SparseDirectoryPickernow renders whenever any saved path suggestion exists, instead of hiding itself once every suggestion is already selected. - Footer de-stickied — the preset form's action area switches from
sticky bottom-0(with a top shadow) torelative, removing the sticky bar's overlap over scrolled content.
Verified pnpm tc:web and the SparseCheckoutPresetDraftForm / SparsePresetChooser suites still pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| onAdd | ||
| }: SparseDirectoryPickerProps): React.JSX.Element | null { | ||
| const available = suggestions.filter((path) => !selected.includes(path)) | ||
| if (!suggestions.length) { |
There was a problem hiding this comment.
Now that the picker renders whenever suggestions is non-empty, the available.length === 0 case falls through to CommandEmpty, so opening "Add a folder" when every suggestion is already selected shows "No folders found." That reads as the add feature failing rather than "all folders already added". Consider a distinct empty-state message for that case (or list the already-selected paths as disabled/checked items).
There was a problem hiding this comment.
Important
One must-address issue: the rewritten Directories field leaves tests/e2e/sparse-preset-proof.spec.ts targeting a control that no longer exists, and the field's label no longer labels anything. That spec is selected by the changed-e2e lane, so it will fail CI.
Reviewed changes — the delta since the prior pullfrog review: commit b497bab (refine(sparse): make Directories a combobox with a chip list).
- Directories as a combobox plus chip list — the preset form drops its directories textarea for a
SparseDirectoryPickerpopover and a newSparseSelectedDirectoryList; add/remove rewritedirectoriesTextfrom the normalized lines, so a preset with unparseable saved paths keeps its chips and no longer silently drops other entries on add. - Typed-path entry —
SparseDirectoryPickernow accepts free-form text or a multi-line paste (parseSparseDirectoryEntryInput), rendering either an "Add<path>" row or the parse error, alongside the existing live folder browser;addSparseDirectoryEntriesappends deduped. - i18n and unit coverage —
findOrTypePath/addTypedPath/noDirectories/removePathwere added across all six catalogs, the form test was updated to the chips UI, andpnpm run verify:localization-coveragenow passes (resolving the prior blocker).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const preparedAtRead = latestPrepared.get(environmentId) | ||
| // Replay survives hydration and browser reloads, even if the diff baseline became clean. | ||
| await callRuntimeResult('ui.set', { explorerDisplayRootByWorktree: roots }, 15_000) | ||
| acknowledge(environmentId, roots) | ||
| const newerPrepared = latestPrepared.get(environmentId) | ||
| ui.explorerDisplayRootByWorktree = | ||
| newerPrepared && newerPrepared !== preparedAtRead | ||
| ? newerPrepared | ||
| : (pending()[environmentId] ?? roots) |
There was a problem hiding this comment.
Older choice overwrites newer choice
If a pending explorer-root choice is replayed after a host upgrade, a newer choice can be saved and acknowledged while that replay is still in flight. If the older replay finishes last, it overwrites the newer choice on the host. The newer choice has already been removed from the queue, so a later load restores the old choice even though the UI showed the new one.
There was a problem hiding this comment.
ℹ️ No new issues in this commit — the proof-spec rewrite and the copy cleanup both look right. Left unapproved only because two earlier threads on untouched files (
FileExplorerRootSelecttrigger width,SparseDirectoryPickeradded-row drill-down) are still open.
Reviewed changes — the delta since the prior pullfrog review: commit d059fa4 (refine(sparse): drop the directory count and preset scope blurb).
- Preset proof spec moved to the combobox/chip UI — an
addDirectoryhelper opens the "Add a folder" picker, types a repo-relative path, clicks the literal row, and asserts the resulting chip; validation now asserts the parse error and the absence of a literal row, and edit mode checks the two saved chips. This clears thechanged-e2efailure flagged againstb497bab. - Form copy cleanup — the directories count/status line and the preset-scope blurb were removed, with
singleDirectory/directoryCount/futureHelpdropped from all six catalogs (no remaining code references).
Verified pnpm tc:web and the catalog, extraction, and coverage localization gates pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The only new commit adds an accessible name to the preset folder picker plus a regression test; it stays unapproved only because two earlier minor threads on untouched files remain open.
Reviewed changes — the delta since the prior pullfrog review: commit 5b1fe78 (fix(sparse): name the directory picker for assistive tech).
- Picker combobox named — the
role="combobox"trigger inSparseDirectoryPickernow carriesaria-labelequal to its visible "Add a folder" text. That role takes no name from content, so the control was previously unnamed and the existinggetByRole('combobox', { name: 'Add a folder' })steps insparse-preset-proof.spec.ts(theaddDirectoryhelper and the validation row) could not resolve. - Legacy-preset regression test — a new case renders a preset saved before the chip editor and asserts each stored directory still renders a
Remove …chip, Save stays enabled, and rendering does not mutate the draft (guarding thenormalizeSparseDirectoryLines-backed chip list).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The picker only ever suggested paths copied from other saved presets, so it vanished for the first preset and never appeared in settings at all. It now reads the repository through fs.readDir: breadcrumb navigation, drill-in per folder, already-added rows marked, bounded to the popover's available height. Also drops the reserved space left over from the old sticky footer.
The newline textarea is replaced by the folder picker itself: one combobox that browses the repository and also accepts free-form typing, with the chosen folders listed as removable chips below it. Typed input is validated and split on newlines at commit time, so a bad path is refused in the popover instead of failing the whole field, and a multi-line paste still adds every entry.
Both restated what the chip list already shows. The inline region now carries only a validation error when there is one, and the e2e proof drives the combobox instead of the removed textarea.
role="combobox" takes no accessible name from its contents, so the trigger was announced unnamed despite its visible label. Adds the explicit label and a regression test that a preset saved before the chip editor opens with every directory intact.
5b1fe78 to
5148074
Compare








ELI5
Sparse workspaces open the explorer at a useful starting folder while keeping the repository reachable. Presets are edited inline, with room for directory paths and recoverable errors.
What Changed
Why
The old popover constrained editing, and separate settings validation could drift. A shared inline editor gives paths enough room while keeping the current workflow visible. Breadcrumb navigation reduces explorer chrome, and retaining the repository hierarchy for multiple folders preserves root files and clear create/drop destinations.
Linked Issue
Fixes #19227. Incorporates validation feedback from #19205 (mors119). Related: #254, #1131, #1290, #1316, #9921, #9922, #10537, #10547, #4174, #17859, #18050, #17932, #15866, #18352, #18389, #3443, #3446, #3572, #7564, #9139.
Visual Proof
Final UI screenshots only, captured from hidden Electron renderers on macOS. The breadcrumb detail is cropped; the remaining captures show the actual app window.
Explorer breadcrumb and return navigation
Inline preset editing
Final narrow layouts, preset search, scrolling, settings, and content search
220px explorer sidebar
800 × 640 dark editor
Preset search by directory
25 presets: results scroll while search and New remain visible
Settings edit in place
Content search across both selected folders
Testing
ORCA_BACKGROUND_LAUNCH=1.Explorer proof uses real temporary Git checkouts with seeded directory metadata for deterministic navigation. Save-failure and delayed-save cases are injected; the 25-preset case seeds additional renderer-store entries.
Not exercised: Linux, Windows, live SSH disconnect/reconnect, native drops, or mixed-version remote clients. Full repository test/lint suites were not run.
Review
Preserved absolute file identities, repository-relative Git paths, async mount/focus guards, host routing, and sparse-detection performance fixes. These UI changes introduce no Git polling, remote wire fields, or existing-checkout mutations.
Agent skill upstream boundary
Notes
The research report indexes 282 unique matches from fully paginated repository searches for “sparse” and “sparse-checkout,” including unrelated uses, and records feedback dispositions.
Remaining separate work: editing paths in an existing checkout, a flattened multi-root view, persisted disconnected-SSH sparse attribution, and exact-name search issue #22628.
Checklist
Directory entry: browse the repository, or type any path · d059fa4a84da
The newline textarea is replaced by the picker itself. Opening Add a folder browses the repository over the existing
fs.readDirIPC, so it works for local, WSL, and SSH-backed repos; a breadcrumb and per-row chevron navigate into subfolders, and already-added folders are marked. Typing anything the browser does not list offers+ Add <path>, always repo-root-relative. Chosen folders land as removable chips.Typed paths are validated and split on newlines at commit time, so a multi-line paste still adds every entry and a bad path is refused in the popover instead of failing the whole field.
Narrow dark editor and settings pane
Earlier suggestion-based picker
The first version of this control only suggested paths copied from other saved presets, so it rendered nothing for a repository's first preset and never appeared in settings at all. Browsing the repository replaces it.
Existing users
No migration is required. Presets are stored as
directories: string[]and are read unchanged by the chip list; existing sparse worktrees carry their ownisSparse/sparseDirectoriesand are not touched. The main process already rejected absolute paths and..segments at save, so no stored preset can contain a path the new field would refuse. Covered by a regression test that opens a preset saved before this editor and asserts every directory survives.