Files
Sprimo/docs/TAURI_FRONTEND_DESIGN.md
2026-02-13 09:57:08 +08:00

62 lines
1.8 KiB
Markdown

# Tauri 2.0 Frontend Design (Bevy Alternative)
Date: 2026-02-12
## Goal
Add a Tauri 2.0 frontend path as an alternative to Bevy while keeping the existing Bevy
implementation and API behavior.
## New Components
- `crates/sprimo-runtime-core`
- shared runtime bootstrap for config/snapshot/API/channel setup
- shared command-to-snapshot/config application
- `crates/sprimo-tauri`
- Tauri 2.0 desktop shell
- command consumer loop bound to runtime core
- invoke command `current_state` for UI state
- `frontend/tauri-ui`
- React + Vite UI shell for status/control surface
## Selected Crates
Rust:
- `tauri`
- `tauri-build`
- `tauri-plugin-log`
- `tauri-plugin-global-shortcut`
- existing internal crates:
- `sprimo-runtime-core`
- `sprimo-platform`
- `sprimo-protocol`
Frontend:
- `react`
- `react-dom`
- `vite`
- `typescript`
- `@tauri-apps/api`
## Current State
- Tauri binary crate is scaffolded and starts runtime core + API server.
- Runtime core receives API commands and updates shared snapshot/config state.
- Tauri backend exposes:
- `current_state` command (structured snapshot DTO)
- `load_active_sprite_pack` command (manifest + atlas as base64 data URL)
- `runtime:snapshot` event after command application.
- React/Vite frontend now renders sprite atlas frames with PixiJS and updates animation/scale
from runtime snapshot events.
- Bevy frontend remains intact.
- Runtime QA workflow is defined in `docs/TAURI_RUNTIME_TESTING.md`.
## Remaining Work
1. Move Bevy runtime flow to consume `sprimo-runtime-core` as primary state authority.
2. Add tray/menu parity and window behavior parity with Bevy path.
3. Extend packaging scripts to include `sprimo-tauri` artifact path.
4. Add frontend parity acceptance tests (Bevy vs Tauri state transitions).