Skip to content

Color menubar status dots by domain state - #31

Merged
sangdth merged 4 commits into
masterfrom
fix/menubar-status-dot-2111
Nov 21, 2026
Merged

sangdth merged 4 commits into
masterfrom
fix/menubar-status-dot-2111

Conversation

@sangdth

@sangdth sangdth commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Shrink the status dot in the macOS menu bar to 50% of the menu font size (statusDotScale) and center it vertically with a baseline offset.
  • Color the dot per state: lime for ok/on, .systemRed for error, .secondaryLabelColor for down/off.
  • Add makeStatusMenuTitle to apply the dot styling through attributedTitle on both the Services items and every domain row, leaving label text unstyled so it keeps the native NSMenu color and hover inversion.
  • Unify badges in formatLsDomainRow and formatServiceTitle: ● for ok/on/error, ○ otherwise; error domains now show , error in the parenthetical instead of a ! badge.
  • Normalize off handling by deriving an effectiveStatus from enabled before building the row text.
  • Extend the Swift self-tests to cover dot size, baseline offset, per-state colors, label color inheritance, and the reworked row/service titles.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo test --locked — 136 unit tests passed, including menubar::tests::swift_self_tests; 2 hermetic E2E tests passed; destructive e2e_system test remains #[ignore].
  • Live GUI check of the menubar not run: the installed Homebrew lodo-menubar binary takes precedence over a locally compiled menubar.swift, so the new dot rendering needs a brew unlink lodo run or a direct swiftc build to look at on screen.

- Render menu dots as attributed titles: lime for ok/on, red for error, secondary label for off/down
- Shrink dots to 50% of menu font and center them on the text baseline
- Show filled dot plus ", error" suffix for domains in the error state
- Darken the lime status dot in Light Mode to hold contrast against bright menus
- Append "(error)" to service titles so a failing dnsmasq or Caddy is visible without the tooltip
- Route service rows and domain dots through one loop and a shared effectiveStatus helper
- Service rows use a custom view so a click flips the service and keeps the menu open
- Status dot and tooltip update optimistically, then reconcile with a fresh refresh
- Discard ls snapshots that started before a pending toggle so the dot never reverts
- reuse existing menu rows so toggling a service updates its dot without rebuilding the menu
- roll the row back to its previous state when `lodo service` fails
- track pending mutations per service instead of a single counter
- expose service rows as menuItem accessibility elements
- keep hover tracking active during menu drag and widen rows for longer titles
@sangdth
sangdth merged commit 133e6a7 into master Nov 21, 2026
2 checks passed
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.

1 participant