Skip to content

Commit ef3e306

Browse files
committed
feat(desktop): add timeline slider to crop modal with video preview
Add a timeline slider to the crop modal that allows users to scrub through video frames when selecting crop regions. The implementation includes: - Timeline slider below crop preview for frame-accurate navigation - Video element with screenshot fallback using crossfade transition - Preload strategy: metadata on editor mount, full video on Crop button hover - Loading indicator whilst video loads - Multi-segment timeline support with correct segment switching The video preview replaces the static screenshot when loaded, providing real-time visual feedback during crop adjustments. Technical details: - Video positioned absolute with object-contain to prevent layout shift - Screenshot remains relative to maintain container dimensions - localTime calculation fixed to correctly convert timescale units --- Additional improvements since a1d2ac0: - fix(general_settings): remove unconditional reset of enable_new_recording_flow The flag was being reset to false on every app start, making the setting unusable. Users can now toggle between old and new recording flow in settings. - chore: remove debug telemetry fetch calls from App.tsx, (window-chrome).tsx, and setup.tsx. Deleted all #region agent log blocks and hardcoded local ingest endpoint calls. - chore: remove debug console.log statements from context.ts and Suspense fallbacks - fix(ui-solid): correct IconLucideLoader2 import path to use kebab-case (loader-2.jsx instead of loader2.jsx) - fix(crop-modal): correct localTime calculation in currentSegment memo Changed from `seg.start + (time - elapsed) * seg.timescale` to `seg.start / seg.timescale + (time - elapsed)` for proper time conversion
1 parent 13b2c30 commit ef3e306

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/desktop/src/routes/editor/context.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
batch,
1313
createEffect,
1414
createResource,
15+
createRoot,
1516
createSignal,
1617
on,
1718
onCleanup,
@@ -771,8 +772,10 @@ export const [EditorInstanceContextProvider, useEditorInstanceContext] =
771772

772773
setCanvasControls(controls);
773774

774-
createEffect(() => {
775-
setIsWorkerReady(workerReady());
775+
createRoot(() => {
776+
createEffect(() => {
777+
setIsWorkerReady(workerReady());
778+
});
776779
});
777780

778781
ws.addEventListener("open", () => {

apps/desktop/src/routes/editor/cropVideoPreloader.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export function preloadCropVideoMetadata(videoPath: string) {
1212
preloadedVideo.preload = "metadata";
1313
preloadedVideo.src = convertFileSrc(videoPath);
1414
preloadedVideo.muted = true;
15+
preloadedVideo.onerror = () => {
16+
preloadState = "idle";
17+
currentVideoPath = null;
18+
preloadedVideo = null;
19+
};
1520
preloadedVideo.load();
1621
preloadState = "metadata";
1722
}

0 commit comments

Comments
 (0)