Add Settings Gateway pane for local VocaGateway - #252
Open
jatinkrmalik wants to merge 9 commits into
Open
Conversation
Ship an MVP Settings → Gateway tab that starts and stops a local vocagateway binary, probes health, and shows a Pair phone QR once the pairing URL is non-loopback. Docker stays a fallback CTA only.
✅ Deploy Preview for voca-mac canceled.
|
Define GatewayRuntimeStatus, share one process manager, reject loopback QR URLs consistently, and show Pair phone in the menu bar when status is Pairable or Ready.
Rename the local Gateway controller to GatewayEmbedController with a shared singleton for Settings and the menu bar. Decode pairing payload as object or string, reject loopback QR URLs, open ~/.config/vocagateway for logs, and surface Pair phone from the tray when Pairable.
jatinkrmalik
marked this pull request as ready for review
September 6, 2026 00:29
|
| Filename | Overview |
|---|---|
| Sources/VocaMac/Services/GatewayEmbedController.swift | Adds Gateway discovery, lifecycle control, health checks, pairing retrieval, and an escalating termination path that preserves ownership of a surviving child. |
| Sources/VocaMac/App/VocaMacApp.swift | Extends SettingsWindowManager with durable page-selection and pairing-presentation requests. |
| Sources/VocaMac/Views/GatewaySettingsTab.swift | Adds the Gateway status, process controls, pairing workflow, fallback guidance, and QR sheet. |
| Sources/VocaMac/Views/SettingsView.swift | Integrates the Gateway pane and applies durable settings-page requests. |
| Sources/VocaMac/Views/MenuBarView.swift | Adds Gateway status refresh and durable Pair phone navigation from the menu bar. |
| Sources/VocaMac/Models/GatewayPairing.swift | Adds pairing response decoding, payload generation, and loopback/public URL validation. |
Sequence Diagram
sequenceDiagram
participant Menu as Menu Bar
participant Manager as SettingsWindowManager
participant Settings as SettingsView
participant Gateway as GatewaySettingsTab
participant Controller as GatewayEmbedController
Menu->>Manager: open(page: gateway, showPairing: true)
Manager->>Settings: publish requestedPage
Settings->>Gateway: render Gateway pane
Gateway->>Controller: refreshStatus()
Controller-->>Gateway: Pairable or Ready
Gateway->>Manager: consume pending pairing
Gateway-->>Menu: present pairing QR sheet
Reviews (5): Last reviewed commit: "Wait for exit after SIGINT and escalate ..." | Re-trigger Greptile
On start timeout, terminate the child process so Stop is not required to clear a stranded gateway. Open Settings Pair phone through durable page and pairing flags instead of delayed notifications.
Do not clear the durable pairing flag when the Gateway pane appears before status refresh. Retry after refresh and when status becomes pairable.
Member
Author
|
Re-open to re-trigger CI (App CI did not start on last pushes). |
jatinkrmalik
marked this pull request as draft
September 6, 2026 00:53
jatinkrmalik
marked this pull request as ready for review
September 6, 2026 00:53
Resolve MenuBarView conflict. Keep Pair phone durable open and main menu bar changes.
If refreshStatus finds the process retained but not live after a pairing error, tear it down so Stop is not stuck disabled and Start cannot spawn a second child.
…e Gateway Process reference.
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.
Summary
Adds a Settings → Gateway pane so VocaMac can start and stop a local native
vocagateway, show status through Pairable/Ready, and present a Pair phone QR once the pairing URL is not loopback.vocagatewayvia/usr/bin/whichor common install locations, spawn/stop our child only, health-check127.0.0.1:8765)/v1/admin/pairingpayloadclient-side for{v,url,token}(payload may be an object or JSON string)VOCAGATEWAY_PUBLIC_URLwhen VocaMac starts Gateway)~/.config/vocagateway(does not treat VocaMac Application Support as the Gateway log source of truth)Test plan
vocagatewayon PATH, Start brings status to Pairable or Ready; Open WebUI works~/.config/vocagateway, not VocaMac Application Support logs