Define the menu as data instead of four scripts #4

Closed
opened 2026-08-16 22:10:09 +01:00 by joshquinlan · 2 comments
Owner

donbox-menu-theme, -wallpaper, -settings and -power are four
scripts, four tables and four bindings for one idea.

Omarchy's shape: one tree, hierarchy implied by dotted ids, three
guard expressions per row (when hides, checked ticks, disabled dims
and ticks), all guards batched into a single evaluation per open so
the menu never blocks. Routes replace script paths, so a binding
becomes 'donbox menu style.theme'.

The chooser, the IPC and the previews already exist in donbox-pick.
What is missing is the tree, the guards and the routes.

donbox-menu-theme, -wallpaper, -settings and -power are four scripts, four tables and four bindings for one idea. Omarchy's shape: one tree, hierarchy implied by dotted ids, three guard expressions per row (when hides, checked ticks, disabled dims and ticks), all guards batched into a single evaluation per open so the menu never blocks. Routes replace script paths, so a binding becomes 'donbox menu style.theme'. The chooser, the IPC and the previews already exist in donbox-pick. What is missing is the tree, the guards and the routes.
Author
Owner

Engine landed in ccd4e0c, and the power menu with it.

menu.json is the tree, dotted ids give the hierarchy, and the
chooser renders it, so there is no second menu implementation to
keep in step. SUPER+ALT+SPACE opens the root; SUPER+ESCAPE still
says donbox menu power and now resolves to the tree rather than
to a script, with no binding change.

Guards: when hides, checked ticks, both evaluated in one shell
for the whole menu. disabled is not there and cannot be until
the chooser gains a row that may be looked at but not chosen.

Still open, and why this stays open:

  • Theme, accent, wallpaper and settings are rows in the tree,
    but each still runs its own script. Those four scripts are the
    ones the ticket wanted collapsed, and folding their innards in
    means the settings rows (which file to edit, what to reload
    afterwards) become tree data too. That is the next slice.
  • Rows are static. Omarchy's providers, where a submenu's rows
    come from a command at open time, would cover the theme and
    wallpaper lists and is what makes that collapse possible.

Verified on screen with the real chooser, and the suite covers
the root listing, both guards, an action running, and a
confirmation both refused and accepted.

Engine landed in ccd4e0c, and the power menu with it. menu.json is the tree, dotted ids give the hierarchy, and the chooser renders it, so there is no second menu implementation to keep in step. SUPER+ALT+SPACE opens the root; SUPER+ESCAPE still says donbox menu power and now resolves to the tree rather than to a script, with no binding change. Guards: when hides, checked ticks, both evaluated in one shell for the whole menu. disabled is not there and cannot be until the chooser gains a row that may be looked at but not chosen. Still open, and why this stays open: - Theme, accent, wallpaper and settings are rows in the tree, but each still runs its own script. Those four scripts are the ones the ticket wanted collapsed, and folding their innards in means the settings rows (which file to edit, what to reload afterwards) become tree data too. That is the next slice. - Rows are static. Omarchy's providers, where a submenu's rows come from a command at open time, would cover the theme and wallpaper lists and is what makes that collapse possible. Verified on screen with the real chooser, and the suite covers the root listing, both guards, an action running, and a confirmation both refused and accepted.
Author
Owner

Finished in a3a7424.

Providers were the missing half: an item names a command, the
command's rows are the menu, and what is chosen fills {} in the
item's template. The flags are data too, so a theme keeps its
live preview, an accent keeps its preview and its revert on
dismissal, and wallpapers keep their grid.

Row building moved into donbox theme rows, where the themes are,
rather than parsing this command's own listings back in.

Settings rows carry a file, a command to prepare one that does
not exist yet, and a command to run if it changed. donbox
settings edit is the only behaviour left and is the same for
every row.

donbox-menu-theme, -wallpaper, -settings and -power are all
gone. Eleven tests cover the tree: root listing, both guards, an
action, confirmation refused and accepted, provider rows, the
template, and the cancel template.

Still not there, and it needs the chooser rather than the menu:
disabled, a row shown but not selectable. Everything else the
ticket asked for is in.

Finished in a3a7424. Providers were the missing half: an item names a command, the command's rows are the menu, and what is chosen fills {} in the item's template. The flags are data too, so a theme keeps its live preview, an accent keeps its preview and its revert on dismissal, and wallpapers keep their grid. Row building moved into donbox theme rows, where the themes are, rather than parsing this command's own listings back in. Settings rows carry a file, a command to prepare one that does not exist yet, and a command to run if it changed. donbox settings edit is the only behaviour left and is the same for every row. donbox-menu-theme, -wallpaper, -settings and -power are all gone. Eleven tests cover the tree: root listing, both guards, an action, confirmation refused and accepted, provider rows, the template, and the cancel template. Still not there, and it needs the chooser rather than the menu: disabled, a row shown but not selectable. Everything else the ticket asked for is in.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshquinlan/dotfiles#4
No description provided.