Skip to content

Commit a90b782

Browse files
Add in-app Privacy Policy link to macOS menu bar popover
1 parent 155671b commit a90b782

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎src/compartment/menubar.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,6 +1880,7 @@ def _app_service():
18801880
# Must match tools/build_macos_app.py: the identity of the real app bundle.
18811881
BUNDLE_ID = "io.github.maxfreedompollard.compartment"
18821882
LAUNCH_AGENT_LABEL = f"{BUNDLE_ID}.menubar"
1883+
PRIVACY_POLICY_URL = "https://maxfreedompollard.github.io/Compartment/privacy"
18831884

18841885

18851886
def _agent_plist() -> Path:
@@ -2730,8 +2731,14 @@ def buildBody(self):
27302731
# there, and sends the user looking for the Unlock control that
27312732
# sentence implies. So does either word before the first read
27322733
# has landed; lock_badge says neither until one is known.
2734+
priv_b = NSButton.buttonWithTitle_target_action_(
2735+
"Privacy", self, "openPrivacy:")
2736+
priv_b.setControlSize_(2) # NSControlSizeMini
2737+
priv_b.setBordered_(False)
2738+
priv_b.setToolTip_("Open Compartment Privacy Policy")
27332739
title = row(label("Compartment", 15, bold=True),
2734-
label(lock_badge(st), 11, secondary=True))
2740+
label(lock_badge(st), 11, secondary=True),
2741+
_spacer(), priv_b)
27352742
views.append(title)
27362743
views.append(label(summarise(st), 11, secondary=True))
27372744
if st["error"]:
@@ -3292,6 +3299,10 @@ def openDashboard_(self, sender):
32923299
if open_dashboard(vault_path) is None:
32933300
_d("the dashboard did not start")
32943301

3302+
def openPrivacy_(self, sender):
3303+
run_in_background(
3304+
lambda: open_in_browser(PRIVACY_POLICY_URL), lambda _: None)
3305+
32953306
def unlockNow_(self, sender):
32963307
if self.pw_field is None:
32973308
return

‎tests/test_menubar.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,3 +690,5 @@ def test_app_sandbox_mcp_snippet_and_authorized_connect(tmp_path, monkeypatch):
690690
assert "[mcp_servers.compartment]" in (
691691
codex_dir / "config.toml").read_text(encoding="utf-8")
692692
assert menubar.integration_status(vault)["codex"] is True
693+
assert menubar.PRIVACY_POLICY_URL == (
694+
"https://maxfreedompollard.github.io/Compartment/privacy")

0 commit comments

Comments
 (0)