Repository navigation
fix(ui): handle saved paths missing from the selected machine (OH-64) - #22
Merged
Merged
Conversation
Check favorites and recents against the selected target through the machine file-browser owner and label the ones it reports as gone. A missing row moves its path into the input instead of committing it. Stop pre-approving directory creation on plain New Session launches, so the daemon reports a missing folder and the app asks before creating it. Replace a non-empty edited path when the Home or account changes on a reused machine ID.
Project the directory-approval question as a cancelled operation in the tracked spawn handler, so a missing folder no longer leaves a failed launch in Inbox. The app clears the failed entry released daemons record. Keep a reviewed missing path out of the launch draft in the popover, where the input closes but the draft stays. Record a recent path only once the session exists, so a declined folder cannot become the default, and still record it when the session outlives a changed launch scope. Check the path New Session picks by itself against the selected target and move to the next existing recent or the machine Home.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Saved paths that no longer exist on the selected machine are now handled explicitly, and a launch no longer creates a missing folder without asking.
probeMachineDirectorylives in the machine file-browser owner and uses the existing list-directory RPC withmaxEntries: 1. It reads past the browse cache and does not write to it.isPathNotFoundErrorMessagemoved to the same owner.approvedNewDirectoryCreation: true. The daemon reports the missing folder through the existingrequestToApproveDirectoryCreationresult and the app asks before creating it, as the machine detail screen already does. Confirming relaunches with the approval, only if the machine, relay, account and path are unchanged. Worktree launches keep the approval because the launch itself materializes that directory.cancelledinstead of thefailedspawn_custody_unresolvedprojection, so a missing folder no longer leaves a false failed launch in Inbox. The app also marks that failed entry seen for released daemons, which still record it; the code names its removal condition.unknownkeeps the path. The wizard now switches machines throughselectMachineso its default gets the same check.Availability that cannot be determined (offline machine, daemon without the RPC, path outside browse roots, target changed mid-request) is
unknownand leaves the row usable. There is no fallback to another machine. The launch check is the backstop for those rows, and for a launch sent before the auto-selected path check answers.Decisions to review
Compatibility
No new capability, RPC or wire field. Source at the commit matching the installed 0.2.17 release honors
approvedNewDirectoryCreation: falseinensureSessionDirectoryandmaxEntriesin the list-directory handler. A daemon that ignoredmaxEntrieswould return a longer listing, which the probe treats the same way. This was checked by reading that source, not by running a released daemon.Validation
RED was observed before implementation for the first batch: 12 new cases failed across the four owner test files for the intended reasons (88 passed). The review fixes had their own RED: the daemon test saw
failed, the popover test saw a draft write, the recents test saw the declined path recorded, the Inbox test saw the failed entry, and the revalidation test had no owner. The worktree approval test is test-only and fails whenisRepoNativeWorktreeLaunch ||is removed.components/sessions/new,components/ui/pathPicker, handoff, voice pickers,machineFileBrowser,actionOperations,settings/machinePath*(138 files)rpcHandlers.actionOperations.spawn,daemon/actionOperations(6 files)yarn --cwd apps/ui typecheck,yarn workspace @happier-dev/cli typechecksession.new.pathPicker.spec.ts,-g "browses and persists"(isolated server and daemon, folder deleted on disk, review dismissed with Escape)All four ran on the committed bytes. Two tests were added in the verification pass, and both had RED observed first. In the recents test, a session created after the launch scope changed was not recorded; the fix moves recording ahead of that early return. In the screen-model test, the auto-selected path stayed on the deleted folder when the revalidation mount was removed.
Not run: the full UI and CLI suites, the other tests in that spec, and the launch confirmation in a browser. The confirmation and Inbox behavior are covered at hook and RPC-handler level with the spawn boundary mocked. The auto-selected check runs against the real path state and file-browser owner with the RPC mocked, both in its owner test and mounted through
useNewSessionScreenModel(that test fails when the mount is removed).Hosted CI (
CI — Tests) on head22a46c2: green on attempt 2. Attempt 1 failed only in the opt-in real tmux testspawnInTmux parses -P/-F output when the client environment has no UTF-8 locale, in itsfinallycleanup (ENOTEMPTYfromrmSyncwhile the spawned script could still write into the temp dir). Its assertions passed, and this PR does not touch tmux, so the failed jobs were rerun once. A Copilot review was requested after the PR was marked ready but did not arrive within 15 minutes; the PR merged without it.Scope and deferrals
ENOENT/ENOTDIRclassification is the existing one, unchanged.Tracks OH-64.