mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-27 07:58:01 +01:00
Closes #5. Adds the product History pane: bounded search over retained entries, raw-versus-final inspection with processing and latency detail, copy, paste again, per-entry deletion, clear-all with an armed confirm, and a retention cycler (Off / 24 hours / 7 days / 30 days / Forever) persisted in settings and applied live to the store. Paste again travels over a bounded queue carried by the shared History handle; the recognition loop drains it into the ordered paste owner as a new History paste kind, so re-pastes never touch the last dictation. The app hides itself first so insertion lands in the previously focused application. A deterministic preview target (history) covers the pane.
64 lines
1.4 KiB
Rust
64 lines
1.4 KiB
Rust
use std::sync::mpsc::SyncSender;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
|
|
#[serde(rename_all = "kebab-case")]
|
|
pub enum DeveloperHudState {
|
|
Reset,
|
|
Recording,
|
|
Transcribing,
|
|
Processing,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
|
|
#[serde(rename_all = "kebab-case")]
|
|
pub enum DeveloperPane {
|
|
Settings,
|
|
Modes,
|
|
VoiceAction,
|
|
Replacements,
|
|
History,
|
|
HudLab,
|
|
Commands,
|
|
Meetings,
|
|
Activity,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
#[serde(tag = "command", rename_all = "kebab-case")]
|
|
pub enum DeveloperCommand {
|
|
Status,
|
|
Hud { state: DeveloperHudState },
|
|
ShowPane { pane: DeveloperPane },
|
|
SetCommandsEnabled { enabled: bool },
|
|
}
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
#[serde(tag = "status", rename_all = "kebab-case")]
|
|
pub enum DeveloperReply {
|
|
Ok,
|
|
State {
|
|
window_open: bool,
|
|
pane: Option<DeveloperPane>,
|
|
commands_enabled: bool,
|
|
},
|
|
Error {
|
|
code: String,
|
|
message: String,
|
|
},
|
|
}
|
|
|
|
pub struct DeveloperCall {
|
|
pub command: DeveloperCommand,
|
|
pub reply: SyncSender<DeveloperReply>,
|
|
}
|
|
|
|
impl DeveloperReply {
|
|
pub fn error(code: impl Into<String>, message: impl Into<String>) -> Self {
|
|
Self::Error {
|
|
code: code.into(),
|
|
message: message.into(),
|
|
}
|
|
}
|
|
}
|