Group the tray menu into submenus and summarise workers - #1198
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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