diff --git a/docs/implementation-status.md b/docs/implementation-status.md index 2a89f30..279dd1f 100644 --- a/docs/implementation-status.md +++ b/docs/implementation-status.md @@ -30,7 +30,7 @@ - A backend worker loop now refreshes game detection and drains auto-clip integrations while the desktop app is running, independent of the currently selected UI view. - Local clip library can add, filter, remove, update upload state, write a tab-separated manifest, and persist clip metadata in SQLite. - Versioned local settings are saved to `settings.json`; replay buffer length and mic toggle are wired from the UI to Rust. -- Storage layer creates the planned folders, sanitizes clip paths, keeps placeholder helpers for tests/demo paths, and cleans oldest temporary files under a size limit. +- Storage layer creates the planned folders, sanitizes clip paths, provides test clip builders for unit coverage, and cleans oldest temporary files under a size limit. - Upload adapters perform live HTTP uploads for Catbox, Litterbox, and custom multipart endpoints; Lustful remains blocked behind unknown API details. - The UI Upload button currently performs an explicit Catbox upload for the selected clip and saves the returned URL. - Vite TypeScript UI builds and has interactive Library, Recording, Auto Clip, Uploads, and Settings views. diff --git a/src/library.rs b/src/library.rs index af91a88..ea578db 100644 --- a/src/library.rs +++ b/src/library.rs @@ -168,13 +168,13 @@ pub fn trim_duration(start: Duration, end: Duration) -> Option { #[cfg(test)] mod tests { use super::*; - use crate::storage::{build_placeholder_clip, LibraryPaths}; + use crate::storage::{build_test_clip, LibraryPaths}; #[test] fn filters_by_game_and_tag() { let paths = LibraryPaths::new("root"); let mut library = ClipLibrary::new(); - let mut clip = build_placeholder_clip( + let mut clip = build_test_clip( &paths, "clip", "session", @@ -197,7 +197,7 @@ mod tests { fn manifest_contains_clip_rows() { let paths = LibraryPaths::new("root"); let mut library = ClipLibrary::new(); - library.add_clip(build_placeholder_clip( + library.add_clip(build_test_clip( &paths, "clip", "session", diff --git a/src/storage.rs b/src/storage.rs index 0011e7c..4a80066 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -46,7 +46,7 @@ pub fn clip_path( .join(format!("{}.mp4", sanitize_path_component(clip_id))) } -pub fn build_placeholder_clip( +pub fn build_test_clip( paths: &LibraryPaths, clip_id: &str, session_id: &str, diff --git a/ui/src/main.ts b/ui/src/main.ts index 945d70f..691404a 100644 --- a/ui/src/main.ts +++ b/ui/src/main.ts @@ -126,8 +126,8 @@ let tauriInvoke: ((command: string, args?: Record) => Promis const state: AppState = { activeView: "Library", - recordingState: "Buffering", - detectedGame: "Counter-Strike 2", + recordingState: "WaitingForGame", + detectedGame: "Waiting for game", replayBufferSeconds: 60, systemAudioEnabled: true, sessionRecording: false, @@ -147,57 +147,8 @@ const state: AppState = { customUploadEndpoint: "", customUploadResponsePath: "url", gsiConfigStatus: "", - selectedClipId: "clip-1", - clips: [ - { - id: "clip-1", - title: "Dust II clutch", - game: "Counter-Strike 2", - event: "Kill", - source: "Auto Event", - duration: "0:18", - createdAt: "Today 12:08", - uploadState: "Local only", - path: "", - thumbnailPath: null, - videoUrl: null, - thumbnailUrl: null, - tags: ["clutch", "kill"], - colorClass: "kill", - }, - { - id: "clip-2", - title: "Baron steal", - game: "League of Legends", - event: "Objective", - source: "Auto Event", - duration: "0:22", - createdAt: "Today 11:44", - uploadState: "Queued", - path: "", - thumbnailPath: null, - videoUrl: null, - thumbnailUrl: null, - tags: ["objective"], - colorClass: "objective", - }, - { - id: "clip-3", - title: "Manual save", - game: "Dota 2", - event: "Manual", - source: "Manual Hotkey", - duration: "1:00", - createdAt: "Yesterday 22:15", - uploadState: "Uploaded", - path: "", - thumbnailPath: null, - videoUrl: null, - thumbnailUrl: null, - tags: ["teamfight"], - colorClass: "manual", - }, - ], + selectedClipId: "", + clips: [], autoEvents: [ { id: "cs2-kill", game: "Counter-Strike 2", event: "Kill", enabled: true }, { id: "cs2-round", game: "Counter-Strike 2", event: "Round win", enabled: true }, @@ -267,7 +218,7 @@ function renderRecordingBar() { `; } -function renderActiveView(selectedClip: Clip) { +function renderActiveView(selectedClip: Clip | undefined) { switch (state.activeView) { case "Recording": return renderRecordingView(); @@ -366,7 +317,7 @@ function renderClipDetails(clip: Clip | undefined) {

${clip.title}

${clip.game} · ${clip.event} · ${clip.createdAt} · ${clip.uploadState}

${clip.tags.map((tag) => `${tag}`).join("")}
-

${clip.path || "Demo clip; no local file yet"}

+

${clip.path || "Clip file unavailable"}