Files
Lumotia/src-tauri/src/commands/meeting.rs
Claude 89c63891fa chore: rebrand from Kon/Corbie to Magnotia
Replace all instances of the legacy product names "Kon" and "Corbie" with
"Magnotia" across user-facing copy, code identifiers, package names, bundle
ids, file paths, and documentation. Preserves the unrelated "konsole" (KDE
terminal) reference and the parent CORBEL company name.

- Renames 10 Rust crates (kon-* → magnotia-*) and the tauri binary
- Updates package.json, tauri.conf.json (productName + identifier)
- Renames CSS classes (kon-rh-* → magnotia-rh-*) and animations
- Renames brand and roadmap docs
- Regenerates Cargo.lock and package-lock.json

Verified: svelte-check passes; pure-rust crates compile under new names.
2026-04-30 13:06:55 +00:00

51 lines
1.4 KiB
Rust

//! Meeting auto-capture — the single-signal variant.
//!
//! The frontend polls `detect_meeting_processes` on an interval with the
//! user's app patterns. On a positive hit it surfaces a non-modal toast
//! that reminds the user to start recording with their hotkey. We do not
//! start recording from this signal — the user decides.
use std::sync::Mutex;
use magnotia_core::process_watch::{self, ProcessLister};
/// Tauri-managed state for the meeting poller. Holds a long-lived
/// `ProcessLister` so each poll refreshes the existing `sysinfo::System`
/// in place instead of allocating a fresh one — the previous implementation
/// rebuilt the process table from scratch every 15 s.
pub struct MeetingState {
lister: Mutex<ProcessLister>,
}
impl MeetingState {
pub fn new() -> Self {
Self {
lister: Mutex::new(ProcessLister::new()),
}
}
}
impl Default for MeetingState {
fn default() -> Self {
Self::new()
}
}
#[tauri::command]
pub fn detect_meeting_processes(
state: tauri::State<'_, MeetingState>,
patterns: Vec<String>,
) -> Result<Vec<String>, String> {
if patterns.is_empty() {
return Ok(Vec::new());
}
let processes = {
let mut lister = state
.lister
.lock()
.map_err(|e| format!("MeetingState lister poisoned: {e}"))?;
lister.snapshot()
};
Ok(process_watch::match_meeting_patterns(&processes, &patterns))
}