Skip to content

Remove from list: a repository header's menu and Ctrl Shift Backspace in the switcher - #2

Merged
kylekz merged 4 commits into
kylekz:mainfrom
Method-es:feat/remove-known-repo
Oct 29, 2026
Merged

kylekz merged 4 commits into
kylekz:mainfrom
Method-es:feat/remove-known-repo

Conversation

@Method-es

Copy link
Copy Markdown

Summary

The switcher lists every folder ever opened (known_repos.json) and has no way to drop one. This adds Remove from list:

  • A right-click on a repository's header, or its ⋯ (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.
  • The repository leaves the switcher and known_repos.json. Nothing in it changes: its .git/dv reviews show again once it's opened again. The selection moves to the next repository's first row.
  • The open review's repository can't be removed: its item is disabled with "Its review is open", and the key does nothing. The source picker lists its targets.
  • Esc closes 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: RemoveRepo action, header menu state (RepoMenu), SwitcherEvent::Remove, handled by the shell. The switcher gets the open review's origin to refuse it.
  • Specs: DESIGN §4.1 (switcher) and §5 (keyboard map), PLAN §11 (Reviews).
  • Automation: state.switcher.menu ({repo, removable}), targets switcher/repo/<repo>/more and switcher/menu/remove; documented in tests/e2e/README.md.

Testing

  • New: 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, Esc closing the menu first). Both checked to fail with the removal or the binding broken.
  • New e2e switcher_remove_repo, with screenshots of the menu and of the disabled item.
  • On macOS (Apple silicon): clippy clean in all three shapes, cargo test --workspace passes, e2e passes, except review_chrome, shell_layout and review_workflow_a, which hit "no frame within 10s" at their resize steps here on main too. Tried by hand.

Not run: script/check --linux / --linux-gui and 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 onto main after #1 lands, or #1 onto this.

… 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.
@kylekz

kylekz commented Oct 29, 2026

Copy link
Copy Markdown
Owner

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?

@Method-es

Copy link
Copy Markdown
Author

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

kylekz and others added 3 commits October 30, 2026 02:24
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>
@kylekz

kylekz commented Oct 29, 2026

Copy link
Copy Markdown
Owner

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!

@kylekz
kylekz merged commit a137982 into kylekz:main Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants