use std::path::Path; use std::sync::Arc; use std::sync::atomic::Ordering; use askama::Template; use axum::extract::State; use axum::response::Html; use tracing::{info, warn}; use time::{Date, OffsetDateTime, format_description::well_known::Rfc3339}; use crate::PipelineState; use crate::analyze::{ ANALYSIS_INPUT_FILE, DOCUMENT_FILE, auto_trigger, recovery as analyze_recovery, }; use crate::auth::AuthenticatedWebUser; use crate::case_id::{CaseId, CaseIdPath}; use crate::config::Config; use crate::error::AppError; use crate::events::EventSender; use crate::routes::case_actions::read_document; use crate::routes::web::{RecordingView, scan_recordings}; use crate::transcribe::recovery as transcribe_recovery; struct UserCaseView { case_id: String, most_recent: String, /// HH:MM of the most recent recording in UTC — no-JS fallback. /// Browser script replaces the displayed text with the browser-local /// equivalent via the parallel `recorded_at_iso` field. time_hms_utc: String, /// Full RFC3339 UTC timestamp of the most recent recording. Fed into /// the HTML `