Repository navigation
Remove from list: a repository header's menu and Ctrl Shift Backspace in the switcher - #2
Conversation
… in the switcher
A right-click on a repository's header in the switcher, or its ⋯ under the pointer,
opens a menu with Remove from list; Ctrl Shift Backspace does the same for the selected
row's repository, from the filter field too. The repository leaves the switcher and
known_repos.json (Reviews::remove_repo: its row and any refresh go), nothing in it
changing, and the selection moves to the next repository's first row. The open review's
repository can't be removed: its item is disabled ("Its review is open") and the key
does nothing. Esc closes the menu first. DESIGN §4.1 and §5, PLAN §11; state.switcher
menu, switcher/repo/<repo>/more and switcher/menu/remove; switcher_remove_repo.
|
i'd already added this myself a few hours beforehand but forgot to push until just now: c826242 i'm cool with rebasing this so it merges both pieces, do you have a preference for the keybind, since there's no rebinding of anything yet? |
I just tried to follow your existing conventions, and used Ctrl/Apply Shift Backspace; updated in the design here: https://github.com/Method-es/diff/blob/7be315931d36e0bff64f1992404b7ef629c5cf5e/docs/DESIGN.md - not fussed though, I found I used the gui/Mouse in practice; added the keybind as it's your convention, and I like to keep things consistent |
main gained its own repo removal (a hover x on the header and Shift Delete). This branch's version replaces it: the header's menu with Remove from list, the guard that the open review's repo can't be removed, the footer hint and Ctrl Shift Backspace. main's remove_repo, its x button, its keymap entry, its DESIGN text and its switcher_remove scenario go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scenario built the expected paths as `${data_dir}/repos/<name>`,
which matches on macOS and Linux but not on Windows, where dv reports
`…\repos\<name>`. It saves each seeded repo's path, as the other
scenarios do, and compares with that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main now has the branch picker. Both stay, with this branch's removal (the header's menu and Ctrl Shift Backspace) in place of the hover x that came with it. Removal is the repositories' list's only: the branch picker's header has no menu, and the key removes nothing there, since the header is the repository the picker compares in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
i left in your keybind and the right click/... menu rather than the on-hover button i had. i've mostly been using gui/mouse too. thanks! |
Summary
The switcher lists every folder ever opened (
known_repos.json) and has no way to drop one. This adds Remove from list:⋯(shown under the pointer), opens a menu in the comments row menu's style with Remove from list.Ctrl Shift Backspace(⌘⇧⌫on macOS) does the same for the selected row's repository, from the filter field too. The field deletes text with Backspace's other forms, and the key is bound ahead of it, as ↑/↓ are.known_repos.json. Nothing in it changes: its.git/dvreviews show again once it's opened again. The selection moves to the next repository's first row.Esccloses the menu before the switcher. The footer shows "remove" while the selected row's repository can be removed.How
Reviews::remove_repo: forgets the repo (KnownReposFile::remove, which existed unused), drops its row and any refresh in flight, and saves. A refresh that lands afterwards finds no row and is dropped.switcher:RemoveRepoaction, header menu state (RepoMenu),SwitcherEvent::Remove, handled by the shell. The switcher gets the open review's origin to refuse it.Reviews).state.switcher.menu({repo, removable}), targetsswitcher/repo/<repo>/moreandswitcher/menu/remove; documented intests/e2e/README.md.Testing
a_removed_repo_leaves_the_list_and_the_file_keeping_its_reviews(row, file, a late refresh, re-adding brings its review back);a_repo_is_removed_by_key_or_menu_but_not_the_open_reviews(the key from the focused filter field, the menu, the open review's repo refused, selection moving on,Escclosing the menu first). Both checked to fail with the removal or the binding broken.switcher_remove_repo, with screenshots of the menu and of the disabled item.cargo test --workspacepasses, e2e passes, exceptreview_chrome,shell_layoutandreview_workflow_a, which hit "no frame within 10s" at their resize steps here onmaintoo. Tried by hand.Not run:
script/check --linux/--linux-guiand the Windows gates.Relation to #1
Independent of #1 (the branch picker) and based on
main. Both touch the switcher (items.rs,mod.rs,render.rs, automation state, DESIGN §4.1, the e2e README), so whichever merges second will conflict. I've resolved the same merge already (the branch picker's header has no menu, and the key does nothing in it) and can rebase this one ontomainafter #1 lands, or #1 onto this.