diff --git a/src-tauri/src/capture.rs b/src-tauri/src/capture.rs index 240b3a3..36ca5f8 100644 --- a/src-tauri/src/capture.rs +++ b/src-tauri/src/capture.rs @@ -529,19 +529,13 @@ fn finish_capture( Ok(output.to_string_lossy().to_string()) } -/// Route a finished capture per the Capture-after setting. The card is allowed to -/// fail silently: a screenshot that saved is more important than an overlay that -/// could not be built, and the file is already on disk and copied by then. +/// Show the result card for a finished capture. The card is allowed to fail +/// silently: a screenshot that saved is more important than an overlay that could +/// not be built, and the file is already on disk and copied by then. The editor is +/// the fallback so a capture is never left with no way to act on it. fn hand_off(app: &AppHandle, output: &Path) { - match settings::load(app).capture_after { - settings::CaptureAfter::Editor => { - let _ = editor::show_editor(app, output); - } - settings::CaptureAfter::Card => { - if result_card::show(app, output).is_err() { - let _ = editor::show_editor(app, output); - } - } + if result_card::show(app, output).is_err() { + let _ = editor::show_editor(app, output); } } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index eda3d68..9055a9f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -422,7 +422,6 @@ pub fn run() { settings::set_autostart, settings::check_output_access, settings::set_language, - settings::set_capture_after, settings::set_update_check_enabled, settings::set_setup_reviewed, settings::get_wedge_orders, diff --git a/src-tauri/src/recording.rs b/src-tauri/src/recording.rs index 30c78da..3bc9f76 100644 --- a/src-tauri/src/recording.rs +++ b/src-tauri/src/recording.rs @@ -402,15 +402,11 @@ pub fn stop(app: &AppHandle, state: &AppState) -> Result, output: session.output.to_string_lossy().to_string(), started_at: session.started_at, }; - match crate::settings::load(app).capture_after { - crate::settings::CaptureAfter::Editor => { - editor::show_recording_editor(app, &info)?; - } - crate::settings::CaptureAfter::Card => { - if crate::result_card::show(app, Path::new(&info.output)).is_err() { - editor::show_recording_editor(app, &info)?; - } - } + // The card carries the recording's own Copy / Pin / Edit / Send buttons; the + // editor is the fallback so a finished recording is never left with no way to + // act on it. + if crate::result_card::show(app, Path::new(&info.output)).is_err() { + editor::show_recording_editor(app, &info)?; } crate::history::publish_result( app, diff --git a/src-tauri/src/settings.rs b/src-tauri/src/settings.rs index 6bb8ef0..f356154 100644 --- a/src-tauri/src/settings.rs +++ b/src-tauri/src/settings.rs @@ -25,16 +25,6 @@ pub struct SwitchUpdate { pub autostart: Option, } -/// What happens the instant a capture is saved. The card keeps the shot out of the -/// way but one click from Copy / Pin / Edit / Send; the editor opens it directly. -#[derive(Debug, Clone, Copy, Default, Deserialize, PartialEq, Eq, Serialize)] -#[serde(rename_all = "lowercase")] -pub enum CaptureAfter { - #[default] - Card, - Editor, -} - #[derive(Debug, Clone, Copy, Default, Deserialize, PartialEq, Eq, Serialize)] #[serde(rename_all = "lowercase")] pub enum FileOutputMode { @@ -59,8 +49,6 @@ pub struct AppSettings { pub autostart: bool, /// UI language, "" until the user picks one. Unset follows the system. pub language: String, - /// Card or editor, chosen right after a screenshot or recording is written. - pub capture_after: CaptureAfter, /// Ask the git release branch for a newer build once a day. pub update_check_enabled: bool, /// Last startup probe as a unix day, so the daily check survives restarts. @@ -86,7 +74,6 @@ impl Default for AppSettings { share_enabled: true, autostart: false, language: String::new(), - capture_after: CaptureAfter::default(), update_check_enabled: true, last_update_check_day: 0, wedge_orders: HashMap::new(), @@ -107,7 +94,6 @@ pub struct SettingsSnapshot { pub share_enabled: bool, pub autostart: bool, pub language: String, - pub capture_after: CaptureAfter, pub update_check_enabled: bool, pub update_feed_url: String, pub wedge_orders: HashMap>, @@ -299,7 +285,6 @@ pub fn snapshot(app: &AppHandle) -> Result { // Report what the OS actually has registered, not what we last wrote. autostart: crate::autostart::is_enabled(), language: settings.language.clone(), - capture_after: settings.capture_after, update_check_enabled: settings.update_check_enabled, update_feed_url: crate::update::manifest_url(), wedge_orders: settings.wedge_orders.clone(), @@ -380,22 +365,6 @@ pub fn update_check_due(app: &AppHandle, interval: std::time::Duration) -> bool elapsed_days >= (interval.as_secs() / 86_400).max(1) as i64 } -#[tauri::command] -pub async fn set_capture_after( - app: AppHandle, - after: CaptureAfter, -) -> Result { - tauri::async_runtime::spawn_blocking(move || { - update_settings(&app, |settings| { - settings.capture_after = after; - Ok(()) - })?; - snapshot(&app) - }) - .await - .map_err(|error| error.to_string())? -} - /// Close the guided first-run flow. The checks themselves are re-runnable from /// Settings, so dismissing the flow loses nothing. #[tauri::command] diff --git a/src/components/MainWindow.tsx b/src/components/MainWindow.tsx index 2113c40..2c12c29 100644 --- a/src/components/MainWindow.tsx +++ b/src/components/MainWindow.tsx @@ -22,6 +22,7 @@ import { FileOutput, LoaderCircle, Maximize, + MoveRight, Pin, Presentation, RefreshCw, @@ -37,7 +38,14 @@ import { Wrench, X, } from "lucide-react"; -import { useEffect, useMemo, useRef, useState, type CSSProperties } from "react"; +import { + useEffect, + useMemo, + useRef, + useState, + type CSSProperties, + type DragEvent, +} from "react"; import { getInitialLang, publishLang, useI18n } from "../i18n"; import { api } from "../lib/api"; import { hitTestDropTarget, toWindowPoint } from "../lib/dropTargets"; @@ -75,7 +83,6 @@ const FALLBACK_SETTINGS: AppSettings = { dragEnabled: true, shareEnabled: true, autostart: false, - captureAfter: "card", defaultFileOutputDir: "~/Downloads/Shift", defaultScreenshotDir: "~/Pictures/Shift", defaultRecordingDir: "~/Movies/Shift", @@ -154,13 +161,13 @@ function RecentThumb({ item }: { item: RecentItem }) { return ( {item.kind === "image" ? ( - + ) : item.kind === "video" ? ( - + ) : item.kind === "text" ? ( - + ) : ( - + )} ); @@ -198,12 +205,12 @@ function OutputLocation({ ) : null}
- + {path}
@@ -717,7 +794,7 @@ export function MainWindow() { void spring("record", () => api.startCapture("recording").then(() => undefined)) } > - {busy === "record" ? : } + {busy === "record" ? : } {t("record")} {IS_MAC ? "⌥⇧3" : "Alt+Shift+3"} @@ -726,7 +803,7 @@ export function MainWindow() { title={t("settings")} onClick={() => setSettingsOpen((value) => !value)} > - +
@@ -779,7 +856,13 @@ export function MainWindow() { })}

{dragging ? t("homeDropRelease") : t("homeDropTitle")}

-
+ {/* While any drag is in flight all three buttons show as candidates, so the + aim is visible before the pointer reaches one. */} +
@@ -804,9 +887,9 @@ export function MainWindow() { onClick={() => void spring("tools", () => chooseFiles("tools"))} > {busy === "tools" ? ( - + ) : ( - + )} {t("fileTools")} @@ -817,16 +900,20 @@ export function MainWindow() { }} onClick={() => void spring("ocr", chooseOcr)} > - {busy === "ocr" ? : } + {busy === "ocr" ? : } {t("ocr")}
+

+ + {t("homeDropHint")} +