Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix: address CodeRabbit review for light mode theme

webadderall01d7efa0858a
diff --git a/src/components/video-editor/AnnotationSettingsPanel.tsx b/src/components/video-editor/AnnotationSettingsPanel.tsx
index a190ba01..a0370a5d 100644
--- a/src/components/video-editor/AnnotationSettingsPanel.tsx
+++ b/src/components/video-editor/AnnotationSettingsPanel.tsx
@@ -506,7 +506,7 @@ export function AnnotationSettingsPanel({
<Button
onClick={() => fileInputRef.current?.click()}
variant="outline"
- className="w-full gap-2 bg-foreground/5 text-foreground border-foreground/10 hover:bg-[#2563EB] hover:text-foreground hover:border-[#2563EB] transition-all py-8"
+ className="w-full gap-2 bg-foreground/5 text-foreground border-foreground/10 hover:bg-[#2563EB] hover:text-white hover:border-[#2563EB] transition-all py-8"
>
<Upload className="w-5 h-5" />
{t("annotations.uploadImage")}
diff --git a/src/components/video-editor/ExportSettingsMenu.tsx b/src/components/video-editor/ExportSettingsMenu.tsx
index ae82de1c..08333bbd 100644
--- a/src/components/video-editor/ExportSettingsMenu.tsx
+++ b/src/components/video-editor/ExportSettingsMenu.tsx
@@ -95,7 +95,7 @@ export function ExportSettingsMenu({
className={cn(
"relative flex-1 overflow-hidden rounded-xl border py-2 text-xs font-medium transition-colors",
isActive
- ? "border-[#2563EB]/50 text-white"
+ ? "border-[#2563EB]/50 text-[#2563EB] dark:text-white"
: "border-foreground/10 bg-foreground/5 text-muted-foreground hover:bg-foreground/10 hover:text-foreground",
)}
>
diff --git a/src/components/video-editor/ExtensionManager.tsx b/src/components/video-editor/ExtensionManager.tsx
index 6038bb5e..38d0e4aa 100644
--- a/src/components/video-editor/ExtensionManager.tsx
+++ b/src/components/video-editor/ExtensionManager.tsx
@@ -613,7 +613,7 @@ function TabSwitcher({
className={cn(
"text-[8px] px-1 rounded-full font-semibold min-w-[14px] text-center leading-[14px]",
isActive
- ? "bg-foreground/20 text-foreground"
+ ? "bg-white/20 text-white"
: "bg-foreground/5 text-muted-foreground",
)}
>
diff --git a/src/components/video-editor/FormatSelector.tsx b/src/components/video-editor/FormatSelector.tsx
index f54ce856..c999eeb3 100644
--- a/src/components/video-editor/FormatSelector.tsx
+++ b/src/components/video-editor/FormatSelector.tsx
@@ -52,7 +52,7 @@ export function FormatSelector({
"relative flex flex-col items-center gap-2 p-4 rounded-xl border transition-all duration-200",
"focus:outline-none focus:ring-2 focus:ring-[#2563EB]/50 focus:ring-offset-2 focus:ring-offset-editor-dialog",
isSelected
- ? "bg-[#2563EB]/10 border-[#2563EB]/50 text-white"
+ ? "bg-[#2563EB]/10 border-[#2563EB]/50 text-[#2563EB] dark:text-white"
: "bg-foreground/5 border-foreground/10 text-muted-foreground hover:bg-foreground/10 hover:border-foreground/20 hover:text-foreground",
disabled && "opacity-50 cursor-not-allowed",
)}
diff --git a/src/components/video-editor/KeyboardShortcutsHelp.tsx b/src/components/video-editor/KeyboardShortcutsHelp.tsx
index f8db05e0..4c99ff57 100644
--- a/src/components/video-editor/KeyboardShortcutsHelp.tsx
+++ b/src/components/video-editor/KeyboardShortcutsHelp.tsx
@@ -45,7 +45,7 @@ export function KeyboardShortcutsHelp() {
{SHORTCUT_ACTIONS.map((action) => (
<div key={action} className="flex items-center justify-between">
<span className="text-muted-foreground">{SHORTCUT_LABELS[action]}</span>
- <kbd className="px-1 py-0.5 bg-white/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
+ <kbd className="px-1 py-0.5 bg-foreground/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
{formatBinding(shortcuts[action], isMac)}
</kbd>
</div>
@@ -56,7 +56,7 @@ export function KeyboardShortcutsHelp() {
<span className="text-muted-foreground">
{t("keyboardShortcuts.panTimeline")}
</span>
- <kbd className="px-1 py-0.5 bg-white/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
+ <kbd className="px-1 py-0.5 bg-foreground/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
{scrollLabels.pan}
</kbd>
</div>
@@ -64,7 +64,7 @@ export function KeyboardShortcutsHelp() {
<span className="text-muted-foreground">
{t("keyboardShortcuts.zoomTimeline")}
</span>
- <kbd className="px-1 py-0.5 bg-white/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
+ <kbd className="px-1 py-0.5 bg-foreground/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
{scrollLabels.zoom}
</kbd>
</div>
@@ -72,7 +72,7 @@ export function KeyboardShortcutsHelp() {
<span className="text-muted-foreground">
{t("keyboardShortcuts.cycleAnnotations")}
</span>
- <kbd className="px-1 py-0.5 bg-white/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
+ <kbd className="px-1 py-0.5 bg-foreground/5 border border-foreground/10 rounded text-[#2563EB] font-mono">
{t("keyboardShortcuts.tab")}
</kbd>
</div>
diff --git a/src/components/video-editor/PlaybackControls.tsx b/src/components/video-editor/PlaybackControls.tsx
index 3636994c..82558a7a 100644
--- a/src/components/video-editor/PlaybackControls.tsx
+++ b/src/components/video-editor/PlaybackControls.tsx
@@ -41,7 +41,7 @@ export default function PlaybackControls({
const progress = duration > 0 ? (currentTime / duration) * 100 : 0;
return (
- <div className="flex items-center gap-2 px-1.5 pr-3 py-0.5 rounded-full bg-black/75 backdrop-blur-md border border-foreground/10 transition-colors duration-300 hover:bg-black/80 hover:border-white/20">
+ <div className="flex items-center gap-2 px-1.5 pr-3 py-0.5 rounded-full bg-black/75 backdrop-blur-md border border-white/10 transition-colors duration-300 hover:bg-black/80 hover:border-white/20">
<Button
onClick={onTogglePlayPause}
size="icon"
diff --git a/src/components/video-editor/ProjectBrowserDialog.tsx b/src/components/video-editor/ProjectBrowserDialog.tsx
index 60ad69ab..e9e034fd 100644
--- a/src/components/video-editor/ProjectBrowserDialog.tsx
+++ b/src/components/video-editor/ProjectBrowserDialog.tsx
@@ -200,7 +200,7 @@ export default function ProjectBrowserDialog({
draggable={false}
/>
) : (
- <div className="flex h-full w-full items-center justify-center bg-[linear-gradient(180deg,_rgba(37,99,235,0.22),_rgba(13,17,23,0.92))] text-[10px] font-medium text-muted-foreground">
+ <div className="flex h-full w-full items-center justify-center bg-[linear-gradient(180deg,_rgba(37,99,235,0.22),_rgba(13,17,23,0.92))] text-[10px] font-medium text-white/60">
No preview yet
</div>
)}
@@ -271,7 +271,7 @@ export default function ProjectBrowserDialog({
draggable={false}
/>
) : (
- <div className="flex h-full w-full items-center justify-center bg-[linear-gradient(180deg,_rgba(37,99,235,0.22),_rgba(13,17,23,0.92))] text-[10px] font-medium text-muted-foreground">
+ <div className="flex h-full w-full items-center justify-center bg-[linear-gradient(180deg,_rgba(37,99,235,0.22),_rgba(13,17,23,0.92))] text-[10px] font-medium text-white/60">
No preview yet
</div>
)}
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index d1a52321..1de3ebc1 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -662,7 +662,7 @@ function CursorStylePreview({
if (style === "dot") {
return (
- <span className="h-[14px] w-[14px] rounded-full border-[2.5px] border-foreground bg-white shadow-[0_8px_12px_rgba(15,23,42,0.16)]" />
+ <span className="h-[14px] w-[14px] rounded-full border-[2.5px] border-neutral-800 bg-white shadow-[0_8px_12px_rgba(15,23,42,0.16)]" />
);
}
@@ -1461,7 +1461,7 @@ export function SettingsPanel({
className={cn(
"relative z-10",
isActive
- ? "text-foreground"
+ ? "text-white"
: "text-muted-foreground hover:text-foreground",
)}
>
@@ -1494,7 +1494,7 @@ export function SettingsPanel({
<Button
onClick={() => fileInputRef.current?.click()}
variant="outline"
- className="w-full gap-2 bg-foreground/5 text-foreground border-foreground/10 hover:bg-[#2563EB] hover:text-foreground hover:border-[#2563EB] transition-all h-7 text-[10px]"
+ className="w-full gap-2 bg-foreground/5 text-foreground border-foreground/10 hover:bg-[#2563EB] hover:text-white hover:border-[#2563EB] transition-all h-7 text-[10px]"
>
<Upload className="w-3 h-3" />
{tSettings("background.uploadCustom")}
@@ -1523,7 +1523,7 @@ export function SettingsPanel({
}
className="absolute top-0.5 right-0.5 w-3 h-3 bg-red-500/90 hover:bg-red-500 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-10"
>
- <X className="w-2 h-2 text-foreground" />
+ <X className="w-2 h-2 text-white" />
</button>
),
});
@@ -1552,7 +1552,7 @@ export function SettingsPanel({
<Button
onClick={handleVideoUpload}
variant="outline"
- className="w-full gap-2 bg-foreground/5 text-foreground border-foreground/10 hover:bg-[#2563EB] hover:text-foreground hover:border-[#2563EB] transition-all h-7 text-[10px]"
+ className="w-full gap-2 bg-foreground/5 text-foreground border-foreground/10 hover:bg-[#2563EB] hover:text-white hover:border-[#2563EB] transition-all h-7 text-[10px]"
>
<Upload className="w-3 h-3" />
{tSettings("background.uploadCustomVideo", "Upload Video")}
@@ -1583,7 +1583,7 @@ export function SettingsPanel({
}
className="absolute top-0.5 right-0.5 w-3 h-3 bg-red-500/90 hover:bg-red-500 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-10"
>
- <X className="w-2 h-2 text-foreground" />
+ <X className="w-2 h-2 text-white" />
</button>
),
},
diff --git a/src/components/video-editor/TutorialHelp.tsx b/src/components/video-editor/TutorialHelp.tsx
index a0bd12a3..002707f0 100644
--- a/src/components/video-editor/TutorialHelp.tsx
+++ b/src/components/video-editor/TutorialHelp.tsx
@@ -80,7 +80,7 @@ export function FeedbackDialog() {
<MessageSquareMore className="h-3.5 w-3.5" />
</Button>
</DialogTrigger>
- <DialogContent className="max-w-lg bg-editor-dialog border-foreground/10 [&>button]:text-muted-foreground [[&>button:hover]:text-white>button:hover]:text-foreground">
+ <DialogContent className="max-w-lg bg-editor-dialog border-foreground/10 [&>button]:text-muted-foreground [&>button:hover]:text-foreground">
<DialogHeader>
<DialogTitle className="text-xl font-semibold text-foreground flex items-center gap-2">
<MessageSquareMore className="h-5 w-5 text-[#2563EB]" /> {t("feedback.title", "Feedback & contact")}
@@ -174,7 +174,7 @@ export function KeyboardShortcutsDialog({
{triggerLabel ? <span className="font-medium">{triggerLabel}</span> : null}
</Button>
</DialogTrigger>
- <DialogContent className="max-w-lg bg-editor-dialog border-foreground/10 [&>button]:text-muted-foreground [[&>button:hover]:text-white>button:hover]:text-foreground">
+ <DialogContent className="max-w-lg bg-editor-dialog border-foreground/10 [&>button]:text-muted-foreground [&>button:hover]:text-foreground">
<DialogHeader>
<DialogTitle className="text-xl font-semibold text-foreground flex items-center gap-2">
<Keyboard className="h-5 w-5 text-[#2563EB]" /> {t("keyboardShortcuts.title")}
@@ -188,7 +188,7 @@ export function KeyboardShortcutsDialog({
{SHORTCUT_ACTIONS.map((action) => (
<div key={action} className="flex items-center justify-between gap-3 rounded-lg border border-foreground/5 bg-foreground/5 px-3 py-2.5">
<span className="text-muted-foreground">{SHORTCUT_LABELS[action]}</span>
- <kbd className="rounded border border-foreground/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">
+ <kbd className="rounded border border-foreground/10 bg-foreground/10 px-2 py-1 font-mono text-[#2563EB]">
{formatBinding(shortcuts[action], isMac)}
</kbd>
</div>
@@ -196,19 +196,19 @@ export function KeyboardShortcutsDialog({
<div className="grid grid-cols-1 gap-2 pt-2 sm:grid-cols-3">
<div className="rounded-lg border border-foreground/5 bg-foreground/5 px-3 py-2.5">
<p className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70">{t("keyboardShortcuts.panTimeline")}</p>
- <kbd className="mt-2 inline-flex rounded border border-foreground/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">
+ <kbd className="mt-2 inline-flex rounded border border-foreground/10 bg-foreground/10 px-2 py-1 font-mono text-[#2563EB]">
{scrollLabels.pan}
</kbd>
</div>
<div className="rounded-lg border border-foreground/5 bg-foreground/5 px-3 py-2.5">
<p className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70">{t("keyboardShortcuts.zoomTimeline")}</p>
- <kbd className="mt-2 inline-flex rounded border border-foreground/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">
+ <kbd className="mt-2 inline-flex rounded border border-foreground/10 bg-foreground/10 px-2 py-1 font-mono text-[#2563EB]">
{scrollLabels.zoom}
</kbd>
</div>
<div className="rounded-lg border border-foreground/5 bg-foreground/5 px-3 py-2.5">
<p className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70">{t("keyboardShortcuts.cycleAnnotations")}</p>
- <kbd className="mt-2 inline-flex rounded border border-foreground/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">
+ <kbd className="mt-2 inline-flex rounded border border-foreground/10 bg-foreground/10 px-2 py-1 font-mono text-[#2563EB]">
{t("keyboardShortcuts.tab")}
</kbd>
</div>
@@ -246,7 +246,7 @@ export function TutorialHelp() {
<span className="font-medium">{t("tutorial.howTrimmingWorks")}</span>
</Button>
</DialogTrigger>
- <DialogContent className="max-w-2xl bg-editor-dialog border-foreground/10 [&>button]:text-muted-foreground [[&>button:hover]:text-white>button:hover]:text-foreground">
+ <DialogContent className="max-w-2xl bg-editor-dialog border-foreground/10 [&>button]:text-muted-foreground [&>button:hover]:text-foreground">
<DialogHeader>
<DialogTitle className="text-xl font-semibold text-foreground flex items-center gap-2">
<Scissors className="w-5 h-5 text-[#ef4444]" /> {t("tutorial.title")}
diff --git a/src/components/video-editor/timeline/TimelineEditor.tsx b/src/components/video-editor/timeline/TimelineEditor.tsx
index 202eb41a..4de75b54 100644
--- a/src/components/video-editor/timeline/TimelineEditor.tsx
+++ b/src/components/video-editor/timeline/TimelineEditor.tsx
@@ -401,7 +401,7 @@ function PlaybackCursor({
<div className="w-3 h-3 mx-auto mt-[2px] bg-[#2563EB] rotate-45 rounded-sm shadow-lg border border-foreground/20" />
</div>
{isDragging && (
- <div className="absolute -top-6 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded bg-black/80 text-[10px] text-foreground/90 font-medium tabular-nums whitespace-nowrap border border-foreground/10 shadow-lg pointer-events-none">
+ <div className="absolute -top-6 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded bg-black/80 text-[10px] text-white/90 font-medium tabular-nums whitespace-nowrap border border-foreground/10 shadow-lg pointer-events-none">
{formatPlayheadTime(clampedTime)}
</div>
)}
@@ -2003,7 +2003,7 @@ const TimelineEditor = forwardRef<TimelineEditorHandle, TimelineEditorProps>(
)
}
onKeyDown={handleCustomAspectRatioKeyDown}
- className="w-12 h-7 rounded border border-white/15 bg-black/20 px-1.5 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#2563EB]"
+ className="w-12 h-7 rounded border border-foreground/10 bg-foreground/5 px-1.5 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#2563EB]"
aria-label="Custom aspect width"
/>
<span className="text-muted-foreground/70">:</span>
@@ -2017,7 +2017,7 @@ const TimelineEditor = forwardRef<TimelineEditorHandle, TimelineEditorProps>(
)
}
onKeyDown={handleCustomAspectRatioKeyDown}
- className="w-12 h-7 rounded border border-white/15 bg-black/20 px-1.5 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#2563EB]"
+ className="w-12 h-7 rounded border border-foreground/10 bg-foreground/5 px-1.5 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#2563EB]"
aria-label="Custom aspect height"
/>
<Button
diff --git a/src/contexts/ThemeContext.tsx b/src/contexts/ThemeContext.tsx
new file mode 100644
index 00000000..616a4be7
--- /dev/null
+++ b/src/contexts/ThemeContext.tsx
@@ -0,0 +1,109 @@
+import { createContext, useCallback, useContext, useEffect, useState } from "react";
+
+export type ThemePreference = "light" | "dark" | "system";
+export type ResolvedTheme = "light" | "dark";
+
+interface ThemeContextValue {
+ /** The user's preference: light, dark, or system */
+ preference: ThemePreference;
+ /** The resolved theme applied to the DOM */
+ theme: ResolvedTheme;
+ setPreference: (pref: ThemePreference) => void;
+ toggleTheme: () => void;
+}
+
+const THEME_STORAGE_KEY = "recordly.theme";
+
+const ThemeContext = createContext<ThemeContextValue | null>(null);
+
+function getStoredPreference(): ThemePreference {
+ try {
+ const stored = globalThis.localStorage?.getItem(THEME_STORAGE_KEY);
+ if (stored === "light" || stored === "dark" || stored === "system") {
+ return stored;
+ }
+ } catch {
+ // Ignore storage errors
+ }
+ return "dark";
+}
+
+function resolveTheme(pref: ThemePreference): ResolvedTheme {
+ if (pref === "system") {
+ return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches
+ ? "dark"
+ : "light";
+ }
+ return pref;
+}
+
+function applyThemeToDOM(theme: ResolvedTheme) {
+ const root = document.documentElement;
+ if (theme === "dark") {
+ root.classList.add("dark");
+ } else {
+ root.classList.remove("dark");
+ }
+}
+
+export function ThemeProvider({ children }: { children: React.ReactNode }) {
+ const [preference, setPreferenceState] = useState<ThemePreference>(() => {
+ const stored = getStoredPreference();
+ applyThemeToDOM(resolveTheme(stored));
+ return stored;
+ });
+
+ const [resolved, setResolved] = useState<ResolvedTheme>(() =>
+ resolveTheme(preference),
+ );
+
+ const setPreference = useCallback((pref: ThemePreference) => {
+ setPreferenceState(pref);
+ const r = resolveTheme(pref);
+ setResolved(r);
+ applyThemeToDOM(r);
+ try {
+ globalThis.localStorage?.setItem(THEME_STORAGE_KEY, pref);
+ } catch {
+ // Ignore storage errors
+ }
+ }, []);
+
+ const toggleTheme = useCallback(() => {
+ setPreference(resolved === "dark" ? "light" : "dark");
+ }, [resolved, setPreference]);
+
+ // Listen for system theme changes when preference is "system"
+ useEffect(() => {
+ if (preference !== "system") return;
+ const mq = globalThis.matchMedia?.("(prefers-color-scheme: dark)");
+ if (!mq) return;
+ const handler = () => {
+ const r = resolveTheme("system");
+ setResolved(r);
+ applyThemeToDOM(r);
+ };
+ mq.addEventListener("change", handler);
+ return () => mq.removeEventListener("change", handler);
+ }, [preference]);
+
+ useEffect(() => {
+ applyThemeToDOM(resolved);
+ }, [resolved]);
+
+ return (
+ <ThemeContext.Provider
+ value={{ preference, theme: resolved, setPreference, toggleTheme }}
+ >
+ {children}
+ </ThemeContext.Provider>
+ );
+}
+
+export function useTheme(): ThemeContextValue {
+ const context = useContext(ThemeContext);
+ if (!context) {
+ throw new Error("useTheme must be used within a ThemeProvider");
+ }
+ return context;
+}
diff --git a/src/index.css b/src/index.css
index 123167f2..2ce5d50e 100644
--- a/src/index.css
+++ b/src/index.css
@@ -59,9 +59,9 @@
--editor-surface-alt: 0 0% 95%;
--editor-dialog: 0 0% 100%;
--editor-dialog-alt: 0 0% 98%;
- --editor-timeline: 240 6% 7%;
- --editor-row: 240 4% 10%;
- --editor-subrow: 240 7% 15%;
+ --editor-timeline: 220 13% 91%;
+ --editor-row: 220 13% 88%;
+ --editor-subrow: 220 13% 85%;
/* Slider track colors — light mode */
--slider-track: 0 0% 0% / 0.12;