Mac: finding commands in the Mac preset #138

open cmc opened this on 2026-11-22 05:05 UTC · feature · milestone 4 Commands and editing speed

Discussion

cmc 2026-11-22 05:05 UTC

For people who don't come from Emacs: how the palette, the menu bar, the toolbar, key hints and the echo area present themselves in the Mac preset, and whether a new user can tell where to look for a function.

  • A default key for Complete at Point in the Mac preset, which has none.
  • Command palette: with an empty query, list the commands used most recently; when ranking matches, prefer commands used often.

To be settled with the design review (#97). Includes #144.

Platforms: Mac.

cmc 2026-11-22 07:52 UTC

Recommendation from the design review, docs/review-2026-11-22-design.md:

What is there now. The palette opens with ⇧⌘P from File ▸ Command Palette… in every preset (OrgstarApp.swift:474-475); the Mac preset itself binds neither app.palette nor editor.complete (Sources/OrgCore/Keymap/PresetMac.swift, no occurrence of either). With an empty query the palette lists every command alphabetically (Keys.swift:196-202), with the preset's keys at the right. It ranks by fuzzy score alone and cannot be driven with the arrow keys (U3). The which-key panel appears 600 ms after a prefix key (Keys.swift:23-35, :113-118); every Mac preset binding is a single chord, so in that preset it never appears. The registry has 319 command titles (Sources/OrgApp/CommandTitles.swift); the menu bar shows the org. commands in one flat menu and about 35 hand-written items, so most app. commands (attach, encryption, nodes and daily notes, refile, archive, table import and export, plot) are in the palette only. The toolbar has one button. The first-run sheet does not mention any of this.

Recommendation:

  1. Complete at Point: ⌃Space in the Mac preset. ⌃Space is what other Mac editors use. macOS assigns it to switching input sources, which takes effect only when the user has more than one, so also bind ⌥Esc, the system text completion key. Update the Mac column in docs/manual/guide/03-keys.org:782.
  2. Palette: recents, then frequency (the content of #144). With an empty query show "Recent", the last ten commands run from any source, then the rest alphabetically. When ranking matches, add a bounded bonus for use count (for example min(uses, 20) scaled to at most the word-start bonus of 8 in Sources/OrgApp/FileTree.swift:82-90), so a frequent command wins a tie and never beats a clearly better match. Store counts per command identifier in UserDefaults, not in config.toml.
  3. Palette: selection and names. Arrow keys and ⌃N/⌃P move a highlighted row and Return runs it (U3). Remove chords from titles and resolve the "Act at Point" pair (U4). Show a one-line description under the highlighted row where the registry has one.
  4. Mac keys by default when there is nothing to import. The welcome sheet's picker defaults to Emacs; default it to Mac unless ~/.emacs.d, ~/.config/emacs or ~/.config/doom exists. Add one line under the picker in every preset: "⇧⌘P finds any command. The Org menu lists them with their keys."
  5. The menu bar is the map. Group the Org menu into submenus (U7), so a newcomer can read what the app does. Add the palette-only families as submenus of File and Org (Attachments, Encryption, Notes). Add Help ▸ orgstar Manual and Help ▸ Keys (U8); the system's Help search then finds every menu command by name, which the flat menu already allows but nobody discovers.
  6. Toolbar: Capture, Agenda, Commands, inspector, customisable (U6). The Commands button gives the palette a visible entry for people who do not read menus.
  7. Echo area. In the Mac preset it never shows key hints, so its job is results: keep errors until the next key (U9), and after a command run from the palette or a menu, show its key once ("Schedule: ⌃⌘S") so the preset teaches itself.
  8. Settings ▸ Editing in the preset's terms (U15).

Items 1 to 3 are small and independent. Item 4 changes a default for new installations only.

Three findings in #222 (usability) are marked as part of this issue: the palette's selection and names, first run without Emacs, and the toolbar, Org menu and Help.