-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: add setting to disable Motion Animation #1030
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
9aba9ae
2a6c0c0
76f0e73
48ba5be
0234901
8251011
dbc5dfb
c763ed2
0a5611e
ccdd645
9f72200
fd69dd0
7e2c558
7294ddc
fb78b06
9b2d86f
ed5e586
29cd9c5
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 |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { Switch } from "@/components/ui/switch"; | ||
| import { useScopedT } from "@/contexts/I18nContext"; | ||
| import { useEffect, useState, type ReactElement } from "react"; | ||
| import { | ||
| loadEditorPreferences, | ||
| saveEditorPreferences, | ||
| } from "../../video-editor/editorPreferences"; | ||
| import { useLaunchPopoverCoordinator } from "./LaunchPopoverCoordinator"; | ||
| import { HudPopover } from "./PopoverScaffold"; | ||
| import styles from "../LaunchWindow.module.css"; | ||
|
|
||
| const POPOVER_ID = "more"; | ||
|
|
||
| export function MorePopover({ trigger }: { trigger: ReactElement }) { | ||
| const t = useScopedT("launch"); | ||
| const { isOpen, requestOpen, requestClose } = useLaunchPopoverCoordinator(); | ||
| const open = isOpen(POPOVER_ID); | ||
| const [motionAnimationEnabled, setMotionAnimationEnabled] = useState(true); | ||
|
|
||
| useEffect(() => { | ||
| if (!open) { | ||
| return; | ||
| } | ||
| setMotionAnimationEnabled(loadEditorPreferences().motionAnimationEnabled); | ||
| }, [open]); | ||
|
|
||
| const handleMotionAnimationChange = (enabled: boolean) => { | ||
| setMotionAnimationEnabled(enabled); | ||
| saveEditorPreferences({ motionAnimationEnabled: enabled }); | ||
|
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: set -eu
printf '%s\n' '--- changed files ---'
git diff --name-only 18884285b11b3603fc4ccede89add40e0e4a9bd6 29cd9c56235b1d652fdcf20ec3c9ac4cfcbbd116
printf '%s\n' '--- MorePopover ---'
cat -n src/components/launch/popovers/MorePopover.tsx
printf '%s\n' '--- relevant symbols ---'
rg -n -S --glob '!node_modules' 'useAppearanceState|saveEditorPreferences|motionAnimationEnabled|editor preferences|EditorPreferences|appearance' srcRepository: webadderallorg/Recordly Length of output: 41622 🏁 Script executed: set -eu
printf '%s\n' '--- editorPreferences ---'
cat -n src/components/video-editor/editorPreferences.ts
printf '%s\n' '--- useAppearanceState ---'
cat -n src/components/video-editor/state/useAppearanceState.ts
printf '%s\n' '--- preference persistence ---'
cat -n src/components/video-editor/presets/useEditorPreferencesPersistence.ts
printf '%s\n' '--- VideoEditor initialization ---'
sed -n '1,120p' src/components/video-editor/VideoEditor.tsx
printf '%s\n' '--- LaunchWindow ---'
cat -n src/components/launch/LaunchWindow.tsx
printf '%s\n' '--- notification/storage references ---'
rg -n -S --glob '!node_modules' 'storage|localStorage|sessionStorage|BroadcastChannel|postMessage|CustomEvent|addEventListener|dispatchEvent|editorPreferences' src/components/launch src/components/video-editor src/contextsRepository: webadderallorg/Recordly Length of output: 42041 🏁 Script executed: set -eu
printf '%s\n' '--- editor preference load/save ---'
sed -n '427,520p' src/components/video-editor/editorPreferences.ts
printf '%s\n' '--- app settings implementation ---'
rg -n -S --glob '!node_modules' 'function loadAppSetting|const loadAppSetting|export .*loadAppSetting|function saveAppSetting|const saveAppSetting|export .*saveAppSetting' src
printf '%s\n' '--- LaunchWindow imports and lifecycle ---'
sed -n '1,230p' src/components/launch/LaunchWindow.tsx
printf '%s\n' '--- editor dashboard/window bindings ---'
rg -n -S --glob '!node_modules' 'LaunchWindow|showProjectDashboard|open.*window|BrowserWindow|window.open|VideoEditor|recordly.open-dashboard' src electron . 2>/dev/null | head -240
printf '%s\n' '--- editor preference listeners ---'
rg -n -S --glob '!node_modules' 'EDITOR_PREFERENCES_STORAGE_KEY|motionAnimationEnabled|recordly\.editor\.preferences|storage.*event|event.*storage|editor-preferences|preferences-changed' srcRepository: webadderallorg/Recordly Length of output: 37081 🏁 Script executed: set -eu
printf '%s\n' '--- appSettings ---'
cat -n src/lib/appSettings.ts
printf '%s\n' '--- settings IPC ---'
cat -n electron/ipc/register/settings.ts
printf '%s\n' '--- window creation/load ranges ---'
sed -n '466,540p' electron/windows.ts
sed -n '830,990p' electron/windows.ts
printf '%s\n' '--- appearance state full relevant range ---'
sed -n '1,155p' src/components/video-editor/state/useAppearanceState.ts
printf '%s\n' '--- editor entry ---'
cat -n src/components/video-editor/EditorWindow.tsxRepository: webadderallorg/Recordly Length of output: 22871 Synchronize launch preference changes with the open editor. The launch HUD and editor run in separate windows. Saving Add a preference-change notification and update the editor with 🤖 Prompt for AI Agents |
||
| }; | ||
|
|
||
| return ( | ||
| <HudPopover | ||
| open={open} | ||
| onOpenChange={(nextOpen) => { | ||
| if (!nextOpen) { | ||
| requestClose(POPOVER_ID); | ||
| return; | ||
| } | ||
| requestOpen(POPOVER_ID); | ||
| }} | ||
| trigger={trigger} | ||
| align="start" | ||
| > | ||
| <div className={styles.ddLabel}>{t("recording.more")}</div> | ||
| <div className="flex items-center justify-between gap-3 px-3 py-2"> | ||
| <div className="min-w-0"> | ||
| <div className="text-sm text-[var(--launch-text)]"> | ||
| {t("recording.motionAnimation")} | ||
| </div> | ||
| <div className="mt-0.5 text-xs text-[var(--launch-text-muted)]"> | ||
| {t("recording.motionAnimationDescription")} | ||
| </div> | ||
| </div> | ||
| <Switch | ||
| aria-label={ | ||
| motionAnimationEnabled | ||
| ? t("recording.motionAnimationOn") | ||
| : t("recording.motionAnimationOff") | ||
| } | ||
| checked={motionAnimationEnabled} | ||
| onCheckedChange={handleMotionAnimationChange} | ||
| /> | ||
| </div> | ||
| </HudPopover> | ||
| ); | ||
| } | ||
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.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: webadderallorg/Recordly
Length of output: 3733
🏁 Script executed:
Repository: webadderallorg/Recordly
Length of output: 22836
Update the switch only after persistence succeeds.
handleMotionAnimationChangeupdatesmotionAnimationEnabledbeforesaveEditorPreferences. The storage helpers return failure statuses, butsaveEditorPreferencesignores them and returnsvoid. A failed effective write can therefore leave the switch showing an unstored value. Reopening the popover can restore the previous value.Return a success status based on the value that
loadEditorPreferenceswill read, update the switch only after success, and show an error when persistence fails. Account for partial writes because app settings take precedence overlocalStorage. These storage calls are synchronous, so this ordering is feasible without asynchronous coordination.🤖 Prompt for AI Agents