Repository navigation
Conversation
The Overview's Attached Folders card could attach a folder but never take one away: detaching lived only in the Settings tab, behind an X that shows on hover. Each folder row on the Overview now ends with an X, always in sight and quiet until pointed at. Both Xs open the same in-app dialog, in the style of Delete track: the folder's full path, Cancel and Detach. A worktree also offers "Also delete this checkout", unchecked by default, and says its branch and commits stay. This replaces the native confirm() boxes, where a worktree could not be kept attached: Cancel there meant "detach but keep the checkout". The existing follow-up for a checkout with uncommitted changes is unchanged.
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.
Summary
Each row of the Attached Folders card on a project's Overview now ends with an X that detaches the folder, after a confirmation dialog.
Why
The Overview card has an Attach button but no way to take a folder away again. Detaching lives only in the Settings tab, behind an X that appears on hover, so from the Overview it looks as if a folder, once attached, can never be removed.
The Settings X also asked through native
confirm()boxes. For a worktree the only question was "Also remove the checkout?", where Cancel meant "detach, but keep the checkout": there was no way to back out and keep the folder attached.What it does
in place,worktree · branch) stays between the name and the X.<folder>from<project>?, the folder's full path (wrapped, not cut, since the name is at the end), Cancel and Detach;<branch>and its commits stay." Checking it turns the button into Detach and delete;Implementation notes
public/projects-view.js:.ws-frow-xbutton, wired inrenderSideCardsto the existingdetachFolderFlow;confirmDetachFolder(project, folder), which resolves{ removeWorktree }ornull;detachFolderFlowasks it instead of callingconfirm(). The calls todetachProjectFolderare the same as before:{}for a plain folder,{ removeWorktree }for a worktree, and the forced retry for a dirty checkout.public/style.css: the Overview X stays visible (the other.ws-frowghost buttons stay hover-only), keeps the row height, and the dialog path wraps.Testing
test/project-detach-folder.test.js. It loads the realdetachFolderFlowfromprojects-view.jsin avmcontext, with the dialog stubbed, and checks that:main'sprojects-view.js, all 5 tests fail.npm test: the only failures are the twoincremental columns upgrade a version-4/12 database…tests, which fail the same way on currentmainon my machine. (Two Git tests also fail with a globalcolor.ui = always, as onmain; they pass withcolor.ui=never.)electron .with an isolatedSWITCHBOARD_DATA_DIR), in a project with a plain folder and a worktree, from the Overview: