Skip to content

feat(tauri): add the tray Profile submenu (pin a profile)#28

Merged
statik merged 1 commit into
claude/tauri-migration-self-update-74d57gfrom
claude/step-16-profile-submenu
Jun 21, 2026
Merged

feat(tauri): add the tray Profile submenu (pin a profile)#28
statik merged 1 commit into
claude/tauri-migration-self-update-74d57gfrom
claude/step-16-profile-submenu

Conversation

@statik

@statik statik commented Jun 21, 2026

Copy link
Copy Markdown
Member

Replicates the Go tray's Profile menu in the Tauri tray, completing the tray menu (Profile / Re-home / Check for Updates… / Quit).

What it does

  • Adds a Profile submenu: Auto (match any) plus one checkbox per profile id.
  • The checkmark starts on the persisted selection — Auto when none, and falls back to Auto when the pinned id no longer names a loaded profile (port of the Go checkedProfile).
  • Selecting an entry:
    • persists the id via SelectionStore (selection.json),
    • re-points the LockManager (set_active, which re-polls immediately so the lock reflects the choice),
    • moves the checkmark to the chosen entry.
  • backend.rs now consumes lock_manager / selection / profile_ids / active, so the placeholder #[allow(dead_code)] on Backend is removed.

Tests

  • Ports the Go checkedProfile unit tests (empty → Auto, known → checked, unknown → Auto).

Verification (Linux, full Tauri toolchain installed locally)

  • cargo clippy --all-targets -- -D warnings (src-tauri) ✅
  • cargo test (src-tauri) ✅ — 3 checked_profile tests pass
  • cargo fmt --check (src-tauri) ✅
  • cargo test --workspace ✅ — 71 core + 5 os tests unaffected

Behavior on real menu-bar/tray hardware (the checkmark visually moving, lock re-pinning) is covered by the macOS/Windows testing-handoff issues.

🤖 Generated with Claude Code


Generated by Claude Code

Replicate the Go tray's Profile menu in the Tauri tray:

- A "Profile" submenu with "Auto (match any)" plus one checkbox per profile
  id; the checkmark starts on the persisted selection (Auto when none or the
  pinned id no longer names a loaded profile).
- Selecting an entry persists the id via SelectionStore, re-points the
  LockManager (which re-polls immediately so the lock reflects the choice),
  and moves the checkmark to the chosen entry.
- Port the Go `checkedProfile` helper verbatim, with its unit tests.

backend.rs now consumes lock_manager/selection/profile_ids/active, so drop
the placeholder #[allow(dead_code)] on Backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8X1NxFiaLGJzwUD5wgRTv
@statik
statik marked this pull request as ready for review June 21, 2026 15:40
@statik
statik merged commit 7757da7 into claude/tauri-migration-self-update-74d57g Jun 21, 2026
6 checks passed
@statik
statik deleted the claude/step-16-profile-submenu branch June 21, 2026 15:40
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.

2 participants