Files
doctate/clients/desktop/src/state.rs
T
Brummel 0c66fc6010 refactor: rename to common/, clients/desktop, clients/wearos
Move three directories into their target topology:
- doctate-common/ -> common/
- client-desktop/ -> clients/desktop/
- watch/wearos/   -> clients/wearos/

Update doctate-common path-dependency in 3 Cargo.toml files
(server, clients/desktop, experiments) and the workspace
members list in the root Cargo.toml. Crate names unchanged
(doctate-server, doctate-common, doctate-desktop).

Workspace still in single-Cargo.lock form; isolation into
standalone workspaces follows in stage 3. All 508 tests pass,
experiments standalone-workspace also resolves the new path.
2026-05-02 11:55:38 +02:00

39 lines
1.1 KiB
Rust

//! UI-visible application state.
//!
//! The state machine here only reflects **user intent** — "ready to
//! record", "recording in progress", "config error, please fix".
//! Background activity (upload queue, poll cycle, finalize flush) lives
//! in a separate observable layer — see
//! `doctate_client_core::footer_status`.
use std::time::Instant;
use uuid::Uuid;
#[derive(Debug)]
pub enum AppState {
/// No valid config on disk — show settings panel.
NotConfigured,
/// Ready for a new recording. No ephemeral context.
Idle,
/// ffmpeg is actively capturing audio.
Recording {
case_id: Uuid,
recorded_at: String,
started_at: Instant,
},
/// Terminal error; user must dismiss or fix config.
Error { message: String },
}
impl AppState {
pub fn label(&self) -> &'static str {
match self {
Self::NotConfigured => "Konfiguration fehlt",
Self::Idle => "Bereit",
Self::Recording { .. } => "Aufnahme läuft",
Self::Error { .. } => "Fehler",
}
}
}