drop the dead code and close the gaps in the verification gate
This commit is contained in:
@@ -719,9 +719,7 @@ fn detect_pipe_framerate(monitor: Monitor) -> u32 {
|
||||
monitor_refresh_rate(monitor)
|
||||
}
|
||||
|
||||
/// Find the monitor containing the given screen point using the Win32 API.
|
||||
/// Falls back to the primary monitor if no monitor is found.
|
||||
/// Resolve the monitor containing the given screen point, falling back to the
|
||||
/// Find the monitor containing the given screen point, falling back to the
|
||||
/// primary monitor on failure.
|
||||
fn monitor_at_point(x: i32, y: i32) -> Result<Monitor> {
|
||||
use windows::Win32::Foundation::POINT;
|
||||
|
||||
@@ -635,8 +635,7 @@ fn gif_shrink_factor(mode: GifBudgetMode, ratio: f64) -> f64 {
|
||||
GifBudgetMode::Balanced => {
|
||||
// Split the required reduction between resolution and fps so we
|
||||
// reduce both proportionally rather than halving resolution alone.
|
||||
let half = 0.5_f64;
|
||||
(ratio * (1.0 - half) + ratio.sqrt() * half).clamp(0.1, 1.0)
|
||||
(ratio * 0.5 + ratio.sqrt() * 0.5).clamp(0.1, 1.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,14 +875,14 @@ fn stop_capture(state: State<'_, AppState>) -> Result<RecordedClip, String> {
|
||||
for ap in &ss.audio_segments {
|
||||
drop(std::fs::remove_file(ap));
|
||||
}
|
||||
} else if video_concat != final_path {
|
||||
} else {
|
||||
// No audio to mux. `video_concat` is either the one segment or the
|
||||
// concat output, and `final_path` is always recording.mp4, so it always
|
||||
// needs moving into place.
|
||||
std::fs::rename(&video_concat, &final_path)
|
||||
.or_else(|_| std::fs::copy(&video_concat, &final_path).map(|_| ()))
|
||||
.map_err(|e| format!("finalizing: {e:#}"))?;
|
||||
drop(std::fs::remove_file(&video_concat));
|
||||
} else {
|
||||
// No audio and a single segment: the concat output already sits at
|
||||
// final_path, so there is nothing left to move.
|
||||
}
|
||||
|
||||
let clip = RecordedClip {
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
min={minTargetMB(clip.duration_secs)}
|
||||
max={maxTargetMB(clip.duration_secs)}
|
||||
step="0.1"
|
||||
aria-label="target size"
|
||||
bind:value={targetMB}
|
||||
onchange={onPreview}
|
||||
/>
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
min={2}
|
||||
max={256}
|
||||
step={1}
|
||||
aria-label="colors"
|
||||
bind:value={colors}
|
||||
onchange={onChange}
|
||||
/>
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
let audioWarning: string | null = $state(null)
|
||||
let retryingAudio: boolean = $state(false)
|
||||
let useFrame: boolean = $state(false)
|
||||
let previewTimer: number | null = null
|
||||
let thumbCache: Map<string, string[]> = $state(new Map())
|
||||
let showDiscardConfirm: boolean = $state(false)
|
||||
let aspectLock: number | null = $state(null)
|
||||
@@ -350,7 +349,6 @@
|
||||
thumbnails = []; deletedFrames = new Set()
|
||||
thumbCache = new Map()
|
||||
previewPath = null; resetTrimPreview()
|
||||
if (previewTimer !== null) { clearTimeout(previewTimer); previewTimer = null }
|
||||
elapsed = 0; phase = "idle"
|
||||
if (config) {
|
||||
format = config.export.default_format
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
} else {
|
||||
stopTimer()
|
||||
}
|
||||
if (e.payload.phase === "idle") { elapsed = 0; phase = "idle" }
|
||||
if (e.payload.phase === "idle") elapsed = 0
|
||||
phase = e.payload.phase
|
||||
}
|
||||
).then(fn => cleanup.push(fn))
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
place-items: center;
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
.preview-box.empty { aspect-ratio: 16 / 9; }
|
||||
.preview-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
<button
|
||||
class="tab"
|
||||
class:active={activeTab === t.id}
|
||||
aria-current={activeTab === t.id ? "true" : undefined}
|
||||
onclick={() => activeTab = t.id}
|
||||
>{t.label}</button>
|
||||
{/each}
|
||||
|
||||
@@ -6,12 +6,10 @@
|
||||
clip,
|
||||
trimStart = $bindable(),
|
||||
trimEnd = $bindable(),
|
||||
onAfterChange = () => {},
|
||||
}: {
|
||||
clip: { temp_path: string; duration_secs: number; width: number; height: number }
|
||||
trimStart: number
|
||||
trimEnd: number
|
||||
onAfterChange?: () => void
|
||||
} = $props()
|
||||
|
||||
let trackEl: HTMLDivElement | null = $state(null)
|
||||
@@ -60,7 +58,6 @@
|
||||
el.releasePointerCapture(e.pointerId)
|
||||
trimPreviewState.dragging = null
|
||||
trimPreviewState.path = null
|
||||
onAfterChange()
|
||||
}
|
||||
|
||||
function onTrackClick(e: PointerEvent) {
|
||||
@@ -73,7 +70,6 @@
|
||||
} else {
|
||||
trimEnd = Math.max(secs, trimStart + 0.1)
|
||||
}
|
||||
onAfterChange()
|
||||
}
|
||||
|
||||
let trimmedDuration = $derived(Math.max(0.1, trimEnd - trimStart))
|
||||
|
||||
@@ -62,6 +62,9 @@ if (-not (Test-Path (Join-Path $root 'node_modules'))) {
|
||||
Push-Location $root
|
||||
try {
|
||||
$null = Invoke-Step 'svelte-check (frontend types)' { npm run check }
|
||||
# Type checking does not exercise Rollup, so a broken entry or import still
|
||||
# needs the real build to be caught.
|
||||
$null = Invoke-Step 'vite build' { npm run build }
|
||||
if ($failures.Count -eq 0) { $null = Invoke-Step 'cargo check' { cargo check --manifest-path src-tauri/Cargo.toml } }
|
||||
# -D warnings matters: clippy exits 0 when it only has warnings, so without
|
||||
# this the gate passes on a warning-laden build.
|
||||
|
||||
Reference in New Issue
Block a user