Skip to content

Group the tray menu into submenus and summarise workers - #1198

Merged
geodro merged 2 commits into
mainfrom
refactor/tray-menu
Jul 27, 2026
Merged

Group the tray menu into submenus and summarise workers#1198
geodro merged 2 commits into
mainfrom
refactor/tray-menu

Conversation

@geodro

@geodro geodro commented Jul 27, 2026

Copy link
Copy Markdown
Member

The tray menu built its services and PHP sections twice over, each with a fixed pool of menu items, parallel arrays mirroring the rendered state, a mutex, and click handlers that worked out what to run by reading those mirrors. The dot a service was drawn with and the command a click sent were decided in different places, and anything past the pool size vanished without a word.

Both sections now build rows that carry their own title and command, and one generic list type owns the pool, the redraw and the dispatch. A row's action cannot drift from its label, and overflow is reported on the last slot instead of dropped.

With the lists behind that, both move into submenus and the global toggles into a settings submenu. On a machine with the full stack installed the top level goes from roughly thirty five rows to twelve, with the running service count and the current PHP default readable on the parent rows.

The status block gains a worker line. Per-site workers are invisible in the tray today because the menu filters them out of the services list, and their number grows with sites, so this is a count rather than another list. A worker stopped because its site is paused or idle-suspended is not a fault, so the red state comes from the worker health endpoint rather than from comparing running against declared, and the line hides itself when there is nothing running and nothing broken.

Closes #1197

The services and PHP sections each carried their own fixed pool of menu items, a set of parallel arrays mirroring the rendered state, a mutex, and a bank of click handlers that re-derived what to run from those mirrors. The dot a service was drawn with and the command a click sent were decided in two different places. Both sections now build rows that carry their own title and command, so one generic list type owns the pool, the redraw and the dispatch, and what a row does can no longer disagree with what it says.

Entries past the pool size used to vanish without a trace. The last slot now reports how many are not shown.

Both lists move into submenus, which takes the top level from around thirty five rows to twelve on a machine with the full stack installed, and the parent rows carry the running service count and the current PHP default so the summary reads without opening anything. The global toggles move into a settings submenu for the same reason.

The status block gains a line summarising the per-site workers, which are invisible in the tray today because the menu filters them out of the services list. Their number grows with the number of sites, so it stays a count rather than another list. A stopped worker is normal on a paused or idle-suspended site, so the warning comes from the worker health endpoint rather than from arithmetic on the running total, and the line hides itself when nothing is running and nothing is broken.
@geodro
geodro requested a review from a team as a code owner July 27, 2026 16:01
@geodro
geodro merged commit 0a09d86 into main Jul 27, 2026
3 checks passed
@geodro
geodro deleted the refactor/tray-menu branch July 27, 2026 16:07
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.

Rework the tray menu: group the lists into submenus and summarise workers

1 participant