Skip to content

feat(todos): route fast-access through ui.menu.handler#1167

Open
seflue wants to merge 1 commit into
nvim-orgmode:masterfrom
seflue:feat/fast-access-menu-handler
Open

feat(todos): route fast-access through ui.menu.handler#1167
seflue wants to merge 1 commit into
nvim-orgmode:masterfrom
seflue:feat/fast-access-menu-handler

Conversation

@seflue

@seflue seflue commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The fast-access prompt writes its keys straight to the message area with nvim_echo, and there is no hook a UI plugin can use to take it over. This routes it through ui.menu.handler when one is configured, the same path the agenda menu already uses, so a plugin like org-modern.nvim can render it. Each keyword becomes a menu option keyed by its shortcut, plus a space option to clear it. With no handler set the prompt keeps the existing nvim_echo output, so the default look does not change.

The menu data keeps the structure so a handler can use it: keywords are grouped by sequence (groups, a list of option lists), each option carries its highlight group (hl), and the menu has a stable kind (todo_fast_access) to branch on. items stays as the flat view for handlers that ignore grouping, and the built-in echo menu is unchanged.

A matching org-modern change renders these groups as a colored matrix (commit on my fork).

A handler must return the result of the selected action, since fast-access uses it to get the chosen keyword back. Menus whose actions only have side effects never needed this, so a handler that does not return will silently no-op here until it adds the return.

The fast-access TODO prompt echoed its keys straight to the
message area, so UI plugins could not theme or relocate it.
With noice or snacks notifier it times out before you can read
it.

It now goes through ui.menu.handler when one is set, the same
path the agenda menu uses; without a handler the echo output is
unchanged. The menu data keeps the keyword sequences grouped and
carries each keyword's highlight group, and exposes a stable
kind, so a handler can render the cycles in their own colors.
items stays as the flat view for handlers that ignore grouping.
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