Menu bar controller: separators, in-place updates, icon, tooltip, click action - #127
Open
turinglambdaai wants to merge 2 commits into
Open
turinglambdaai wants to merge 2 commits into
turinglambdaai wants to merge 2 commits into
Conversation
SOCK_CLOEXEC is a Linux-only socketpair flag; macOS (the dev-iteration harness for Linux hosts) lacks it, so platform/linux/runtime did not compile outside Linux. Fall back to setting FD_CLOEXEC on both ends right after the pair is created — this thread performs no I/O in between, so no descriptor can leak across an exec in that window. Verified: the BrainFuel GTK4 host now compiles, links, and runs against this runtime on macOS (arm64, libracketcs) with the same sources that CI compiles on Linux.
…ck action Evolves RivetMenuBarController along the lines of #119, keeping the existing install(title:menuItems:) tuple API working: - RivetMenuItem enum (action / separator) with separators rendering as NSMenuItem.separator(); grouping survives into tray menus. - update(items:) rebuilds the menu in place (pause/resume style label swaps no longer reinstall the whole controller); setItem(_:label:) swaps one entry's label without touching the rest. - install(icon:items:) puts a template NSImage in the status bar. - setToolTip(_:) and setClickAction(_:) cover tooltip and the click-without-menu pattern (menu stays reachable via click-and-hold). Covered by RivetSystemTests/MenuBarControllerTests.swift (separator layout, update/replace, setItem label swap, action dispatch).
This branch has not been deployed
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.
Closes #119 (Swift controller half; the backend-side
set-tray-menu!separator gap stays tracked by the issue).Dogfooding from the brainfuel and movebit rewrites hit all three friction points in the issue: flat tuple menus with no separators, whole-controller reinstalls just to swap one label, and title-only status items.
API (backward compatible — the existing
install(title:menuItems:)tuple form keeps working)RivetMenuItem—.action(label:identifier:handler:)/.separatorinstall(title:items:)/install(icon:items:)— template NSImage status itemsupdate(items:)— rebuild the menu in placesetItem(_:label:)— swap one entry's labelsetToolTip(_:),setClickAction(_:)— tooltip and click-without-menu (menu stays on click-and-hold)Verification: new
RivetSystemTests/MenuBarControllerTests.swift(2 tests) covers separator layout, update/replace, single-label swap, and identifier-based action dispatch; both pass locally on arm64.