From 1f7e5c4b0721845a026c72b5775657bb2876e7fb Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:54:19 +0100 Subject: [PATCH] fix: Top bar labels in eidtor --- apps/desktop/src/routes/editor/Header.tsx | 71 +++++++---------------- 1 file changed, 21 insertions(+), 50 deletions(-) diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx index dae7df9b75..5f25c6d078 100644 --- a/apps/desktop/src/routes/editor/Header.tsx +++ b/apps/desktop/src/routes/editor/Header.tsx @@ -62,6 +62,12 @@ export function Header() { }); onCleanup(() => unlistenTitlebar?.()); + const clearTimelineSelection = () => { + if (!editorState.timeline.selection) return false; + setEditorState("timeline", "selection", null); + return true; + }; + return (
} { - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + clearTimelineSelection(); if (!(await ask("Are you sure you want to delete this recording?"))) return; await commands.editorDeleteProject(); }} - tooltipText={ - editorState.timeline.selection - ? "Close selection" - : "Delete recording" - } + tooltipText="Delete recording" leftIcon={} /> { - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + clearTimelineSelection(); console.log({ path: `${editorInstance.path}/` }); revealItemInDir(`${editorInstance.path}/`); }} - tooltipText={ - editorState.timeline.selection - ? "Close selection" - : "Open recording bundle" - } + tooltipText="Open recording bundle" leftIcon={} /> @@ -116,27 +108,17 @@ export function Header() {
{ - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + if (clearTimelineSelection()) return; }} - tooltipText={ - editorState.timeline.selection ? "Close selection" : "Captions" - } + tooltipText="Captions" leftIcon={} comingSoon={!editorState.timeline.selection} /> { - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + if (clearTimelineSelection()) return; }} - tooltipText={ - editorState.timeline.selection ? "Close selection" : "Performance" - } + tooltipText="Performance" leftIcon={} comingSoon={!editorState.timeline.selection} /> @@ -158,34 +140,26 @@ export function Header() { > { - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + clearTimelineSelection(); + if (!projectHistory.canUndo()) return; projectHistory.undo(); }} disabled={ !projectHistory.canUndo() && !editorState.timeline.selection } - tooltipText={ - editorState.timeline.selection ? "Close selection" : "Undo" - } + tooltipText="Undo" leftIcon={} /> { - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + clearTimelineSelection(); + if (!projectHistory.canRedo()) return; projectHistory.redo(); }} disabled={ !projectHistory.canRedo() && !editorState.timeline.selection } - tooltipText={ - editorState.timeline.selection ? "Close selection" : "Redo" - } + tooltipText="Redo" leftIcon={} />
@@ -196,10 +170,7 @@ export function Header() { variant="dark" class="flex gap-1.5 justify-center h-[40px] w-full max-w-[100px]" onClick={() => { - if (editorState.timeline.selection) { - setEditorState("timeline", "selection", null); - return; - } + clearTimelineSelection(); trackEvent("export_button_clicked"); if (exportState.type === "done") setExportState({ type: "idle" });