Repository navigation
feat(container-indicator): add Apple container status panel plugin - #483
Conversation
Adds the Container Indicator plugin: a panel-only widget card that lists Apple container service containers and virtual machines with status, image, CPU, memory, and storage details plus start, stop, and restart controls, alongside service-level start and stop buttons. The empty state reports an unstarted service instead of an empty list. Container rows read CPU and memory from list and storage from image list; machine rows read CPU, memory, and disk from machine list and their image from machine inspect. An image reference shortens to its last path segment only when the column is too narrow, and hover help still reveals the full path. All three row lines share one text size, so hierarchy comes from primary and secondary colors. Localization covers the 12 supported locales, focused plugin tests cover the command probe, lifecycle sequences, formatting, and card-only panel scope, and both READMEs' monitoring rows and the generated website plugin data include the new plugin.
|
@ggbond268 PTAL |
|
Thanks for adding this! I reviewed
The existing 15 tests and 229 script checks pass. I verified the refresh issues with controlled command responses and the missing error message with light/dark rendering. Focused coverage for failed reads and refresh ordering/cancellation would help protect these fixes. Happy to take another look after the update. Thanks! |
…reshes Addresses the three review findings on the panel card. Failed container and machine list reads no longer look like empty lists. Each list now starts from the previous snapshot's entries, and a failed read records why instead of discarding it. The card keeps showing the last successful entries under a warning line naming the reason, and only falls back to the empty message when the list is genuinely empty. A failed image list leaves the storage sizes already on screen rather than clearing them. Refreshes no longer overlap or publish out of order. One refresh task is tracked per controller and carries a generation number; a newer request cancels the older one and every publish checks that it is still current, so a stale "running" result cannot overwrite a newer "stopped" state. Starting or stopping a service invalidates any check that began before the operation for the same reason. Cancellation now reaches the CLI instead of only dropping its result. The command runner wraps the child process in a task cancellation handler, so hiding the panel or deactivating the plugin terminates the running `container` process group and fails the pending call with CancellationError. Operation and check failures are rendered in the card. The host does not display `lastErrorMessage`, so the widget now shows it directly and keeps it visible across the follow-up refresh. Three focused tests cover a failed list read keeping its previous entries, a superseded refresh discarding its results, and hiding the panel cancelling the running status command. Localization adds the three read-failure keys across all 12 locales.
|
Thanks for the careful review — all three are fixed in 1. Failed queries looked like empty listsEach list now starts from the previous snapshot's entries instead of A failed 2. Refreshes could overlap and publish outdated results
3. Operation errors were invisible in the cardThe card renders CoverageThree focused tests were added (18/18 total):
The probe gained a hold/release gate so these interleave deterministically instead of depending on timing — the superseded refresh is held mid-command while a newer one publishes, then released to prove its result is discarded.
|
Problem and result
People using Apple's
containerCLI had to switch to Terminal to check the service, list containers and virtual machines, or start, stop, and restart them. The new Apple Container Status plugin keeps that in one menu bar panel card: service-level start/stop, and per-row status, image, CPU, memory, and storage with start, stop, and restart controls. When the service is not running the card reports服务未启动instead of an empty list.Changes
Plugins/ContainerIndicator/plugin:container-indicator, panel capabilitywidgetonly (no settings page, no actions),minHostVersion2.0.1,pluginKitVersion7.containerCLI probes: service status,listfor container CPU/memory,image list --format jsonfor image storage,machine listfor machine CPU/memory/disk, andmachine inspectfor the machine image. Failures keep the last known snapshot and render as an explicit unavailable state.perform(sequences:), stopping at the first failure.plugin.json(Apple Container状态, old容器状态kept as a synonym).changes/unreleased/container-indicator-plugin.mdadded; website plugin data regenerated.Verification
make test TEST_FILTER=ContainerIndicatorPluginTests— 15/15 pass, covering command probe parsing, restart sequence, image/storage resolution, byte formatting, image label shortening, and card-only panel scope.make script-tests— 229 checks OK (includes minimum-host inventory and changelog rules).make validate-changelog— OK.containerv1.5.0 data (2 containers, 2 machines).UI evidence
New panel card surface. Verified manually in the running Debug build in light and dark appearance, including service start/stop, container and machine rows, and hover help on image names. Screenshots of the open panel popover follow in a comment — the card is only visible while the menu bar panel is open.
Checklist