Skip to content

fix(desktop): name the moves and lead with the palette's keys in Keyboard Shortcuts - #372

Merged
bketelsen merged 1 commit into
mainfrom
irulan/frostmail-keyboard-shortcuts-dialog-t311-pev266tctl3ek3e2
Nov 23, 2026
Merged

bketelsen merged 1 commit into
mainfrom
irulan/frostmail-keyboard-shortcuts-dialog-t311-pev266tctl3ek3e2

Conversation

@frostyard-machines

Copy link
Copy Markdown
Contributor

Summary

Two defects of the desktop app's Keyboard Shortcuts dialog (showShortcuts, which shows frostui.ShortcutsBody(w.table.Shortcuts())):

  • The moves' names (Keyboard Shortcuts dialog: 6 entries show raw command ids, and the list does not fit or scroll #356, first part). The moves (commands with keys and no palette name) took their command id as the title, so the dialog showed pageDown, pageUp, escape, nextPane, previousPane and open. commands.Table now names every move with MoveTitle, and Space is Toggle Completion in Tasks (docs/specs/pim-ui.md, Tasks behavior). The names are in docs/specs/ui.md's Keyboard map, in a new table.
  • The palette's keys (Keyboard Shortcuts dialog: the command palette's keys (Ctrl+Shift+P, Ctrl+K) are not listed #359). With frostui v0.10.0 the shell already puts its palette command in the window's table. It goes in frostui's View group, though, which is the dialog's last group: in a 1280×800 window the row lay at y 1125 with height 0, below "Raw Source…" (y 720), the last row shown. The window now adds the palette's command as its own (syncTable), with Group App, so "Command Palette, Ctrl+K" and "Command Palette, Ctrl+Shift+P" are the dialog's first two lines. The command and its keys come from Palette.Command() unchanged; only the group changes. The table keeps an app's own command, so the shell's provide leaves it as it is.

Fixes #359
Refs #356

What waits for frostui: the second part of #356 is that the dialog does not fit or scroll on a 1280×800 screen. That is frostui's Info dialog: frostyard/frostui#51 (merged as 807d0a4) makes Info bodies scroll, but no frostui tag contains it yet (the newest is v0.10.0, the version this repository requires). #356 stays open until a frostui release contains it and go.mod is bumped to it. Until then, the Edit, Go to and View groups still sit below the dialog's foot.

Risk tier

Risk tier: 2 — a behaviour change in the desktop app's UI: the dialog's names and the order of its entries. No key binding changes. The PR touches no path of .github/risk-paths.json (internal/desktop/commands/, internal/desktop/mainwin/{modules.go,mainwin_test.go,shortcuts_internal_test.go}, docs/specs/ui.md).

Docs housekeeping

  • docs/specs/ui.md, Keyboard map: what the dialog lists, the palette's keys at its head, and the names of the moves.

Verification

  • make check green (host), with BASE=origin/main; golangci-lint: 0 issues (Linux and Windows).
  • go test -race ./internal/desktop/commands/ ./internal/desktop/mainwin/ green.
  • make ci's nsl targets (ui-check, the desktop builds) did not run in this session; CI runs them. No file under app/ changes.
  • Revert test: with internal/desktop/commands/palette.go and internal/desktop/mainwin/modules.go reverted and the tests kept, all 3 new tests fail.
    Command: git stash push internal/desktop/commands/palette.go internal/desktop/mainwin/modules.go && go test ./internal/desktop/commands/ ./internal/desktop/mainwin/ -run 'TestEveryShortcutHasATitle|TestShortcutsListThePaletteFirst|TestShortcutsDialogShowsThePaletteKeys' -count=1

The tests:

  • TestEveryShortcutHasATitle (commands): in every module, no entry of the shortcuts list has an empty title or a command id as its title, and the 6 entries of Keyboard Shortcuts dialog: 6 entries show raw command ids, and the list does not fit or scroll #356 and Tasks' Space have their names.
  • TestShortcutsListThePaletteFirst (mainwin, internal): the window's list starts with Command Palette, Ctrl K and Ctrl Shift P, in the App group, and lists no other Command Palette entry.
  • TestShortcutsDialogShowsThePaletteKeys (mainwin): opens the dialog the user's way (Ctrl+Shift+P, "keyboard", Enter) in a 1280×800 window. The Command Palette row must have a height and end inside the window.

Revert output (abridged; the first test reports every raw id in each of the 4 modules):

--- FAIL: TestEveryShortcutHasATitle (0.00s)
    commands_test.go:231: mail: raw command title "pageDown" for keys ["Space"]
    commands_test.go:231: mail: raw command title "escape" for keys ["Esc"]
    commands_test.go:231: mail: raw command title "nextPane" for keys ["Tab"]
    commands_test.go:231: mail: raw command title "open" for keys ["Enter"]
    ...
    commands_test.go:254: mail: keys ["Space"] have title "pageDown"; want "Page Down"
    commands_test.go:254: mail: keys ["Shift" "Space"] have title "pageUp"; want "Page Up"
    commands_test.go:254: mail: keys ["Esc"] have title "escape"; want "Cancel"
    commands_test.go:254: mail: keys ["Tab"] have title "nextPane"; want "Next Pane"
    commands_test.go:254: mail: keys ["Shift" "Tab"] have title "previousPane"; want "Previous Pane"
    commands_test.go:254: mail: keys ["Enter"] have title "open"; want "Open"
    commands_test.go:254: tasks: keys ["Space"] have title "pageDown"; want "Toggle Completion"
FAIL	github.com/frostyard/frostmail/internal/desktop/commands	0.005s
--- FAIL: TestShortcutsListThePaletteFirst (0.05s)
    shortcuts_internal_test.go:30: shortcut 0 = {Group:App Title:New Message Keys:[Ctrl N]}; want {Group:App Title:Command Palette Keys:[Ctrl K]}
    shortcuts_internal_test.go:30: shortcut 1 = {Group:App Title:Get Mail Keys:[Ctrl Shift N]}; want {Group:App Title:Command Palette Keys:[Ctrl Shift P]}
--- FAIL: TestShortcutsDialogShowsThePaletteKeys (0.10s)
    mainwin_test.go:439: Command Palette is outside the window: {X:410 Y:1125 W:0 H:0}
FAIL	github.com/frostyard/frostmail/internal/desktop/mainwin	0.153s

…oard Shortcuts

The Keyboard Shortcuts dialog showed the moves by their command ids
(pageDown, escape, nextPane, ...). Each move now has a name, from
docs/specs/ui.md's Keyboard map; Space is Toggle Completion in Tasks.

The palette's keys were in the list, in frostui's View group, the last
one, below the foot of the dialog, which cannot scroll in frostui
v0.10.0. The window now adds the palette's command as its own, in the
App group, so Ctrl+K and Ctrl+Shift+P head the dialog. Its keys are
unchanged.

Fixes #359
Refs #356
@github-actions github-actions Bot added the level:L3 Skim label Nov 23, 2026
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 23, 2026
@bketelsen
bketelsen merged commit df0c008 into main Nov 23, 2026
13 checks passed
@bketelsen
bketelsen deleted the irulan/frostmail-keyboard-shortcuts-dialog-t311-pev266tctl3ek3e2 branch November 23, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L3 Skim ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard Shortcuts dialog: the command palette's keys (Ctrl+Shift+P, Ctrl+K) are not listed

2 participants