-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add clear-all-zooms action for the editor timeline #957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ interface UseTimelineEditorRuntimeParams { | |
| onZoomSuggested?: (span: Span, focus: ZoomFocus) => void; | ||
| onZoomSpanChange: (id: string, span: Span) => void; | ||
| onZoomDelete: (id: string) => void; | ||
| onClearAllZooms?: () => void; | ||
| selectedZoomId: string | null; | ||
| onSelectZoom: (id: string | null) => void; | ||
| trimRegions: TrimRegion[]; | ||
|
|
@@ -87,6 +88,7 @@ export function useTimelineEditorRuntime({ | |
| onZoomSuggested, | ||
| onZoomSpanChange, | ||
| onZoomDelete, | ||
| onClearAllZooms, | ||
| selectedZoomId, | ||
| onSelectZoom, | ||
| trimRegions, | ||
|
|
@@ -260,6 +262,10 @@ export function useTimelineEditorRuntime({ | |
| [videoDuration, totalMs, currentTimeMs, defaultRegionDurationMs, onAnnotationAdded], | ||
| ); | ||
|
|
||
| const handleClearAllZooms = useCallback(() => { | ||
| onClearAllZooms?.(); | ||
| }, [onClearAllZooms]); | ||
|
Comment on lines
+265
to
+267
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
selection_file="$(fd -t f 'useTimelineSelection\.ts$' src | head -n 1)"
[[ -n "$selection_file" ]]
ast-grep outline "$selection_file" --items all
rg -n -C 5 'selectAllBlocksActive|setSelectAllBlocksActive|zoomRegions|clearSelectedBlocks|resolveDeleteSelectionTarget' \
"$selection_file" src/components/video-editor/timelineRepository: webadderallorg/Recordly Length of output: 50379 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- runtime handler and returned selection wiring ---'
sed -n '230,310p' src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts
rg -n -C 8 'handleClearAllZooms|activateSelectAllZooms|deleteSelectedZoom|selectAllBlocksActive|onClearAllZooms|onDelete' src/components/video-editor/timeline/hooks src/components/video-editor/timeline/components
printf '%s\n' '--- selection implementation ---'
sed -n '75,155p' src/components/video-editor/timeline/hooks/useTimelineSelection.ts
sed -n '205,245p' src/components/video-editor/timeline/hooks/useTimelineSelection.tsRepository: webadderallorg/Recordly Length of output: 50379 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '230,310p' src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts
rg -n -C 8 'handleClearAllZooms|activateSelectAllZooms|deleteSelectedZoom|selectAllBlocksActive|onClearAllZooms|onDelete' src/components/video-editor/timeline/hooks src/components/video-editor/timeline/components
sed -n '75,155p' src/components/video-editor/timeline/hooks/useTimelineSelection.ts
sed -n '205,245p' src/components/video-editor/timeline/hooks/useTimelineSelection.tsRepository: webadderallorg/Recordly Length of output: 50379 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,180p' src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.ts
rg -n -C 5 'onClearAllZooms=|onClearAllZooms:|clearAllZooms|setZoomRegions|setZooms' src/components srcRepository: webadderallorg/Recordly Length of output: 50379 Reset When 🤖 Prompt for AI Agents |
||
|
|
||
| useTimelineKeyboardShortcuts({ | ||
| isMac, | ||
| keyShortcuts, | ||
|
|
@@ -276,6 +282,7 @@ export function useTimelineEditorRuntime({ | |
| selectAllBlocksActive, | ||
| addKeyframe, | ||
| handleAddZoom, | ||
| handleClearAllZooms, | ||
| handleSplitClip, | ||
| handleAddAnnotation: () => handleAddAnnotation(), | ||
| deleteSelectedKeyframe, | ||
|
|
@@ -292,6 +299,7 @@ export function useTimelineEditorRuntime({ | |
| () => ({ | ||
| addZoom: handleAddZoom, | ||
| suggestZooms: handleSuggestZooms, | ||
| clearAllZooms: handleClearAllZooms, | ||
| splitClip: handleSplitClip, | ||
| addAnnotation: handleAddAnnotation, | ||
| addAudio: handleAddAudio, | ||
|
|
@@ -301,6 +309,7 @@ export function useTimelineEditorRuntime({ | |
| handleAddAnnotation, | ||
| handleAddAudio, | ||
| handleAddZoom, | ||
| handleClearAllZooms, | ||
| handleSuggestZooms, | ||
| handleSplitClip, | ||
| keyframes, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,11 @@ export const FIXED_SHORTCUTS: FixedShortcut[] = [ | |
| display: "Del / ⌫", | ||
| bindings: [{ key: "delete" }, { key: "backspace" }], | ||
| }, | ||
| { | ||
| label: "Clear All Zooms", | ||
| display: "Ctrl + Shift + ⌫", | ||
| bindings: [{ key: "backspace", ctrl: true, shift: true }], | ||
| }, | ||
|
Comment on lines
+40
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Use platform-aware labels for the new shortcut. The binding maps
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| { label: "Pan Timeline", display: "Shift + Scroll", bindings: [] }, | ||
| { label: "Zoom Timeline", display: "Ctrl + Scroll", bindings: [] }, | ||
| ]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep the settings footer visible when unselected zooms remain.
After the user deletes the selected zoom,
handleZoomDeleteleavesactiveEffectSectionas"zoom"and setsselectedZoomIdtonull. The parent footer is then hidden, sohasZoomRegionscan be true while this Clear All Zooms button is not rendered. Keep the footer visible whenactiveEffectSection === "zoom" && hasZoomRegions, or render this button outside that footer.🤖 Prompt for AI Agents