Skip to content

feat(app): Tauri commands open_data_dir / check_for_updates / restart_app (#176 sub-task 3)#206

Merged
Dewinator merged 2 commits into
agent/tauri-shell-scaffoldfrom
agent/tauri-commands-stacked
May 3, 2026
Merged

feat(app): Tauri commands open_data_dir / check_for_updates / restart_app (#176 sub-task 3)#206
Dewinator merged 2 commits into
agent/tauri-shell-scaffoldfrom
agent/tauri-commands-stacked

Conversation

@Dewinator

Copy link
Copy Markdown
Owner

Summary

Implements ticket 3 of docs/native-tauri-shell-spike.md "Suggested follow-up issues" — the four primitives the dashboard webview cannot do via plain HTTP (decision 2 of the spike).

Stacked on #203 (the Tauri scaffold). Will auto-retarget to main once #203 lands.

Commands

All four are #[tauri::command] — invokable from the webview via invoke() AND wired into the tray menu:

Command What Used by
open_data_dir() Opens AppLocalData/mycelium/ in Finder / Explorer / xdg-open Tray menu + dashboard about-page (future)
check_for_updates() Emits updates:check-requested event; returns hint string. Body replaced by tauri-plugin-updater in sub-task 4 — signature stable Tray menu + update banner (future)
restart_app() app.restart(); sidecar killed via existing ExitRequested handler, respawned by setup() Tray menu + after-update flow (future)
get_app_version() Returns package_info().version — saves the dashboard one HTTP endpoint About-page (future)

Tray menu

Grows from 2 → 4 items: Show / Hide windowOpen data dirCheck for updatesQuit. Tray-body click still toggles window visibility.

Capabilities

Adds core:event:allow-emit for the updates:check-requested event. (Tauri 2.11 has no separate restart-permission; core:default covers it.)

Validation

$ cd app/src-tauri && cargo check
   Compiling mycelium-app v0.1.0 (...)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.78s

No Node-side changes.

Test plan

  • cd app/src-tauri && cargo check — green
  • (Optional) cargo tauri dev — tray menu shows 4 items; clicking "Open data dir" opens Finder at ~/Library/Application Support/mycelium/

Related

🤖 Generated with Claude Code

…_app + version (#176 sub-task 3)

Implements ticket 3 of `docs/native-tauri-shell-spike.md` "Suggested follow-up
issues" — the four invokable surface primitives the dashboard webview cannot
do via plain HTTP (decision 2 of the spike).

Commands (all #[tauri::command], invoke()-able from the webview AND wired
into the tray menu):

- `open_data_dir()` — opens the resolved AppLocalData/mycelium/ in
  Finder (macOS), Explorer (Windows), or xdg-open (Linux). Reuses the
  ResolvedDataDir state cached in setup() so no path resolution per call.
- `check_for_updates()` — emits an `updates:check-requested` event for
  now and returns a "not-yet-wired" string. Sub-task 4 (`tauri-plugin-
  updater`) replaces the body without changing the signature, so the
  dashboard banner can already wire its onClick to this command today.
- `restart_app()` — calls `app.restart()`. The existing
  RunEvent::ExitRequested handler kills the sidecar; setup() respawns it
  on the next boot.
- `get_app_version()` — returns `package_info().version` so the dashboard
  doesn't need a /version HTTP endpoint just for the about-screen.

Tray menu grows from 2 → 4 items: Show / Hide window, Open data dir,
Check for updates, Quit. Tray-body click still toggles window visibility.

Capability set: adds `core:event:allow-emit` for the
updates:check-requested event. (Tauri 2.11 has no separate restart
permission — `core:default` covers it.)

Validation: `cargo check` green on rustc 1.95.0, Tauri 2.11.0,
tauri-plugin-shell 2.3.5. No Node-side changes.

Stacked on #203 (Tauri scaffold) — auto-retargets to main once #203 lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Dewinator Dewinator merged commit 02be484 into agent/tauri-shell-scaffold May 3, 2026
Dewinator added a commit that referenced this pull request May 4, 2026
…sks 1/2/3-most/4/5/7-core landed

The 09024a2 (tick 103) snapshot is two days stale: 9 of the 9 PRs in its
"recommended merge order" have merged, plus #197/#198/#201/#202/#203/#204/
#205/#206/#207 landed in the same window. Refresh the doc that "is the
canonical entry point for the native-app initiative" so a fresh reader
does not get a 79-tick-old picture.

Concrete changes:
- Phase line: "spike phase complete · gated on PR-queue drain" →
  "implementation underway · sub-tasks 1, 2, 3 (most), 4, 5, 7 (core)
  landed; 5 PRs open, ~26 h Reed-lag since #202#207".
- End-state installer list: ".dmg / .msi / .AppImage" → ".pkg / .msi /
  .AppImage", with the 2026-05-04 epic-body decision (.pkg, not .dmg)
  cited.
- Sub-task table: legend (✅ landed, 🔄 PR open, ⏳ spike-only) plus
  per-row PR status reflecting the current main:
  - Row 1 picks up #204 (79-migration walk as CI gate).
  - Row 3 picks up #202, #203, #206, #207 as landed and #208#211 as
    open. Row was "_none yet_".
  - Row 4 / 5 reframed as "inherent" (PGlite is one WASM binary;
    node-llama-cpp ships per-platform bindings).
  - Row 7 picks up #205 (Docker → PGlite migration helpers core).
- New "DbClient sub-story" subsection: 22 services touch Supabase
  directly on main; 2 in flight (Skills, SwarmPin); 20 remain after
  the open stack lands. Pattern: one service per PR.
- "Recommended merge order — open PR queue (9 deep)" section replaced
  with "Open PR queue (5 deep, all CLEAN+MERGEABLE)" — the 9 it
  documented have all merged.
- "Post-drain implementation gate" → "Post-stack implementation gate":
  parallel tracks (DbClient long-tail of 20 services + the sub-tasks
  6/8/9 release-pipeline triangle on tauri-plugin-updater per #207).

Doc-only, zero risk, direct-to-main per the standing rule for this
file shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dewinator added a commit that referenced this pull request May 5, 2026
… 6 status

The "Aktiver Code-Bestand" inventory was one merge-wave behind the
canonical native-app-track.md (refreshed in d0fc6ec on 2026-05-04):

- #206 (Tauri commands open_data_dir / check_for_updates / restart_app
  + tray menu) — landed, but missing from CLAUDE.md.
- #207 (tauri-plugin-updater wired to GitHub Releases latest.json) —
  landed, but missing from CLAUDE.md, AND sub-task 6 was still listed
  as fully verbleibend even though the consumer-side updater is live.

Empirical reality on main today:
- Sub-tasks 1, 2, 3 (scaffold + commands), 4, 5, 6 (updater-plugin
  app-side), 7 (core) are implemented.
- Sub-task 6 verbleibend collapses to its CI half — publishing
  latest.json + signed installers — which is paired with sub-task 8
  per docs/native-app-track.md row 6 ("⏳ spike landed, CI release
  pipeline pending").
- Sub-task 3 closes fully once #208 (sidecar bundling) merges.

Doc-only, zero risk, direct-to-main per the standing rule for this
file shape (precedent: d0fc6ec, ec8a088, f9acd10, 1962f9d).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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