docs(06-01): complete desktop Tauri scaffold plan
This commit is contained in:
@@ -0,0 +1,160 @@
|
||||
---
|
||||
phase: 06-desktop-client-ci-cd
|
||||
plan: 01
|
||||
subsystem: desktop
|
||||
tags: [tauri, rust, webview, desktop-wrapper, tauri-plugin-store, oklch]
|
||||
|
||||
requires:
|
||||
- phase: 01-foundation-portal-shell
|
||||
provides: OKLCH design tokens for consistent dark mode styling
|
||||
provides:
|
||||
- "apps/desktop Tauri 2.x project as @tessera/desktop in pnpm workspace"
|
||||
- "Rust entry point with tauri-plugin-store and server URL navigation"
|
||||
- "First-run setup page (setup.html) with URL validation and persistence"
|
||||
- "Capabilities config with core:default and store:default permissions"
|
||||
affects: [06-02-desktop-native-polish]
|
||||
|
||||
tech-stack:
|
||||
added: [tauri@2.11.3, "@tauri-apps/cli@2.11.3", "@tauri-apps/api@2.11.1", "@tauri-apps/plugin-store@2.4.3", tauri-plugin-store@2, rust@1.96.0]
|
||||
patterns: [tauri-url-loading-wrapper, first-run-setup-page, tauri-plugin-store-persistence]
|
||||
|
||||
key-files:
|
||||
created:
|
||||
- apps/desktop/package.json
|
||||
- apps/desktop/src-tauri/Cargo.toml
|
||||
- apps/desktop/src-tauri/tauri.conf.json
|
||||
- apps/desktop/src-tauri/build.rs
|
||||
- apps/desktop/src-tauri/src/main.rs
|
||||
- apps/desktop/src-tauri/src/lib.rs
|
||||
- apps/desktop/src-tauri/capabilities/default.json
|
||||
- apps/desktop/src/setup.html
|
||||
- apps/desktop/src-tauri/icons/icon.png
|
||||
- apps/desktop/src-tauri/icons/icon.ico
|
||||
- apps/desktop/src-tauri/icons/128x128.png
|
||||
modified:
|
||||
- .gitignore
|
||||
- pnpm-lock.yaml
|
||||
|
||||
key-decisions:
|
||||
- "StoreExt trait import required for app.store() in Tauri 2.x (not auto-imported)"
|
||||
- "Placeholder icons (gold 32x32 PNG/ICO) for build compatibility until proper branding in 06-02"
|
||||
- "CSP allows connect-src * for configurable server URL (D-02 requirement)"
|
||||
- "HTTP warning on non-localhost (T-06-01 mitigation) but allowed for internal LAN"
|
||||
- "frontendDist set to ../src (local setup page directory) not a hardcoded URL"
|
||||
|
||||
patterns-established:
|
||||
- "Tauri URL-loading wrapper: frontendDist points to local page, navigate() redirects to server"
|
||||
- "First-run setup: validate URL constructor, persist to store, navigate on save"
|
||||
- "Cargo target/ added to root .gitignore for Rust build artifacts"
|
||||
|
||||
requirements-completed: [DESK-01, DESK-02]
|
||||
|
||||
duration: 5min
|
||||
completed: 2026-06-25
|
||||
---
|
||||
|
||||
# Phase 06 Plan 01: Desktop Tauri Scaffold Summary
|
||||
|
||||
**Tauri 2.x desktop wrapper scaffolded as @tessera/desktop with URL-loading shell and first-run server URL configuration page**
|
||||
|
||||
## Performance
|
||||
|
||||
- **Duration:** 5 min
|
||||
- **Started:** 2026-06-25T08:08:44Z
|
||||
- **Completed:** 2026-06-25T08:14:41Z
|
||||
- **Tasks:** 2 (of 3; Task 1 checkpoint completed by user)
|
||||
- **Files modified:** 13
|
||||
|
||||
## Accomplishments
|
||||
|
||||
- Scaffolded apps/desktop as a Tauri 2.x project registered in the pnpm workspace as @tessera/desktop
|
||||
- Implemented Rust entry point (lib.rs) that reads stored server_url and navigates WebView on startup
|
||||
- Created first-run setup page with URL validation (URL constructor), HTTP warning for non-localhost, persistence via tauri-plugin-store, and German UI strings
|
||||
- Configured tauri.conf.json with local frontendDist (no bundled frontend), 1280x800 centered window, and permissive CSP for configurable server
|
||||
|
||||
## Task Commits
|
||||
|
||||
Each task was committed atomically:
|
||||
|
||||
1. **Task 1: Install Tauri toolchain prerequisites** - completed by user (checkpoint)
|
||||
2. **Task 2: Scaffold apps/desktop Tauri project** - `48e3a69` (feat)
|
||||
3. **Task 3: First-run setup page** - `d944aaa` (feat)
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
- `apps/desktop/package.json` - @tessera/desktop package with Tauri CLI and plugin-store dependencies
|
||||
- `apps/desktop/src-tauri/Cargo.toml` - Rust crate with tauri, tauri-plugin-store, serde dependencies
|
||||
- `apps/desktop/src-tauri/tauri.conf.json` - Window config, frontendDist=../src, CSP, bundle targets
|
||||
- `apps/desktop/src-tauri/build.rs` - Standard tauri_build::build() entry
|
||||
- `apps/desktop/src-tauri/src/main.rs` - Binary entry calling lib::run()
|
||||
- `apps/desktop/src-tauri/src/lib.rs` - Plugin registration, store read, navigate-to-server-URL logic
|
||||
- `apps/desktop/src-tauri/capabilities/default.json` - core:default + store:default permissions
|
||||
- `apps/desktop/src/setup.html` - First-run server URL form with validation and persistence
|
||||
- `apps/desktop/src-tauri/icons/icon.png` - Placeholder 32x32 gold icon
|
||||
- `apps/desktop/src-tauri/icons/icon.ico` - Placeholder 32x32 gold icon (Windows)
|
||||
- `apps/desktop/src-tauri/icons/128x128.png` - Placeholder 128x128 gold icon
|
||||
- `.gitignore` - Added target/ for Cargo build artifacts
|
||||
- `pnpm-lock.yaml` - Updated with @tessera/desktop dependencies
|
||||
|
||||
## Decisions Made
|
||||
|
||||
- **StoreExt trait import:** Tauri 2.x requires explicit `use tauri_plugin_store::StoreExt` for `app.store()` method -- not auto-imported via Manager trait
|
||||
- **Placeholder icons:** Generated minimal gold PNG/ICO files matching primary OKLCH color so cargo check and tauri build pass; proper branding icons planned for 06-02
|
||||
- **CSP connect-src wildcard:** Required by D-02 (configurable server URL) -- cannot lock to single domain
|
||||
- **HTTP allowed with warning:** Non-HTTPS non-localhost URLs show a warning but are permitted for internal LAN servers (T-06-01 mitigation)
|
||||
|
||||
## Deviations from Plan
|
||||
|
||||
### Auto-fixed Issues
|
||||
|
||||
**1. [Rule 3 - Blocking] Added StoreExt trait import**
|
||||
- **Found during:** Task 2 (cargo check)
|
||||
- **Issue:** `app.store()` method requires `tauri_plugin_store::StoreExt` trait in scope
|
||||
- **Fix:** Added `use tauri_plugin_store::StoreExt;` to lib.rs
|
||||
- **Files modified:** apps/desktop/src-tauri/src/lib.rs
|
||||
- **Verification:** cargo check passes
|
||||
- **Committed in:** 48e3a69
|
||||
|
||||
**2. [Rule 3 - Blocking] Generated placeholder icons for build compatibility**
|
||||
- **Found during:** Task 2 (cargo check failed: "failed to open icon")
|
||||
- **Issue:** tauri.conf.json references icons/icon.png and icons/icon.ico which did not exist
|
||||
- **Fix:** Generated minimal 32x32 and 128x128 PNG + 32x32 ICO placeholder icons
|
||||
- **Files modified:** apps/desktop/src-tauri/icons/icon.png, icon.ico, 128x128.png
|
||||
- **Verification:** cargo check passes without icon errors
|
||||
- **Committed in:** 48e3a69
|
||||
|
||||
**3. [Rule 2 - Missing Critical] Added Cargo target/ to .gitignore**
|
||||
- **Found during:** Task 2 (post cargo check, target/ dir created)
|
||||
- **Issue:** Cargo build artifacts not in .gitignore, would be committed accidentally
|
||||
- **Fix:** Added `target/` line to root .gitignore
|
||||
- **Files modified:** .gitignore
|
||||
- **Verification:** git status does not show target/ as untracked
|
||||
- **Committed in:** 48e3a69
|
||||
|
||||
---
|
||||
|
||||
**Total deviations:** 3 auto-fixed (1 missing critical, 2 blocking)
|
||||
**Impact on plan:** All auto-fixes necessary for build correctness. No scope creep.
|
||||
|
||||
## Issues Encountered
|
||||
|
||||
- Rust toolchain was not in PATH despite checkpoint completion status -- rustup was present but env not sourced. Resolved by running `curl rustup installer` which detected existing settings and installed stable 1.96.0.
|
||||
|
||||
## User Setup Required
|
||||
|
||||
None - no external service configuration required.
|
||||
|
||||
## Next Phase Readiness
|
||||
|
||||
- apps/desktop is ready for 06-02 (native polish: tray icon, close-to-tray, window state, autostart, notifications)
|
||||
- Placeholder icons must be replaced with proper Tessera branding in 06-02
|
||||
- tauri-plugin-notification, tauri-plugin-autostart, tauri-plugin-window-state to be added in 06-02
|
||||
- Capabilities default.json to be extended with additional plugin permissions in 06-02
|
||||
|
||||
## Self-Check: PASSED
|
||||
|
||||
All 11 created files verified present on disk. Both task commits (48e3a69, d944aaa) confirmed in git log.
|
||||
|
||||
---
|
||||
*Phase: 06-desktop-client-ci-cd*
|
||||
*Completed: 2026-06-25*
|
||||
Reference in New Issue
Block a user