Define the menu as data instead of four scripts #4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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:
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.
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.
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.