Skip to content

fix: add missing keymap bindings for delete branch on github panel - #28

Merged
jongio merged 1 commit into
mainfrom
fix/delete-branch-keys
Mar 21, 2026
Merged

jongio merged 1 commit into
mainfrom
fix/delete-branch-keys

Conversation

@jongio

@jongio jongio commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Problem

The delete branch feature (and other CRUD operations) did not work on the github panel because the keymap schemes only defined CRUD bindings for the gitinfo context — not the github context. Pressing x to delete a branch on the github pane bypassed the keymap dispatcher entirely, falling through to the raw key handler.

Additionally, the branches panel advertised d as the delete key in its help text, but the keymap standard across all panels is x.

Changes

Keymap schemes (default.toml, vim.toml, classic.toml):

  • Added full CRUD bindings (n, x, e, F2, o, y) for context = "github", matching the existing gitinfo bindings.

Branches panel (branches.go):

  • Updated KeyBindings() help text from d to x to match the keymap standard.
  • handleKey now accepts both x (standard) and d (legacy) for delete.

Tests:

  • TestGitHubPanelDeleteDispatch: verifies x dispatches item_delete in the github context across all 3 schemes.
  • TestDeleteBranch_XKeyTriggersDelete / TestDeleteBranch_DKeyTriggersDelete: verifies both keys trigger delete confirmation on the branches panel.
  • Extended TestCRUDBindingsExistInAllSchemes and TestCRUDContextOverridesVimSearchNext to cover the github context.

Testing

  • go build ./... — clean
  • go test ./... -count=1 — all packages pass
  • mage install — deployed successfully

The github panel context was missing CRUD keybindings (item_delete,
item_create, item_edit) in all three keymap schemes (default, vim,
classic). Only item_open and item_copy were bound. This meant pressing
'x' to delete a branch on the github pane did not route through the
keymap dispatcher.

Also fixed the branches panel to accept 'x' (standard) in addition to
'd' (legacy) for delete, and updated the help text to show 'x'.

Added tests verifying dispatch for the github context and direct
keypress delete on the branches panel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jongio
jongio merged commit c2e74fd into main Mar 21, 2026
2 checks passed
@jongio
jongio deleted the fix/delete-branch-keys branch March 21, 2026 22:08
jongio added a commit that referenced this pull request May 16, 2026
Squash merge of swarm/2026-05-15 branch resolving 55 GitHub issues.

Closes #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #40, #41, #42, #43, #44, #45, #46, #47, #48, #49, #50, #51, #52, #53, #54, #55, #56, #57, #58

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant