Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

refine(editor): reposition Add audio and make Delete track span

Benjamin Freeman3b6a1cca2faa
diff --git a/src/components/ai-edition/RightPanes.tsx b/src/components/ai-edition/RightPanes.tsx
index 00367d43d..31effb9fb 100644
--- a/src/components/ai-edition/RightPanes.tsx
+++ b/src/components/ai-edition/RightPanes.tsx
@@ -2354,7 +2354,8 @@ export function AudioTrackPane({ tl }: { tl: TimelineApi }) {
// Match the region panes' danger-outlined delete button (see SelectionPane).
const deleteBtnStyle: CSSProperties = {
- display: "inline-flex",
+ display: "flex",
+ width: "100%",
alignItems: "center",
justifyContent: "center",
gap: 7,
diff --git a/src/components/ai-edition/v4/V4Timeline.tsx b/src/components/ai-edition/v4/V4Timeline.tsx
index b945c7dcf..9fcfbf48e 100644
--- a/src/components/ai-edition/v4/V4Timeline.tsx
+++ b/src/components/ai-edition/v4/V4Timeline.tsx
@@ -15,6 +15,7 @@ import {
ZoomIn,
} from "lucide-react";
import {
+ Fragment,
memo,
type PointerEvent as ReactPointerEvent,
useCallback,
@@ -1534,34 +1535,38 @@ export function V4Timeline({
</div>
</PopoverContent>
</Popover>
- <button
- type="button"
- className={styles.tlToolBtn}
- title={ts("audioTrack.add")}
- aria-label={ts("audioTrack.add")}
- onClick={() => void handleAddAudio()}
- >
- <Music size={15} />
- </button>
<span className={styles.tlToolSep} aria-hidden />
{tools.map((tool) => (
- <button
- type="button"
- key={tool.id}
- className={styles.tlToolBtn}
- title={tool.label}
- aria-label={tool.label}
- onClick={() => {
- // Read at CLICK time: a render-time value would be one zoom
- // notch stale when the user zooms and immediately creates.
- const dur = newRegionDurationSec();
- if (tool.id === "speed") void tl.addSpeed(dur);
- if (tool.id === "comment") void tl.addAnnotation(dur);
- if (tool.id === "cut") void tl.addTrim(dur);
- }}
- >
- {tool.icon}
- </button>
+ <Fragment key={tool.id}>
+ <button
+ type="button"
+ className={styles.tlToolBtn}
+ title={tool.label}
+ aria-label={tool.label}
+ onClick={() => {
+ // Read at CLICK time: a render-time value would be one zoom
+ // notch stale when the user zooms and immediately creates.
+ const dur = newRegionDurationSec();
+ if (tool.id === "speed") void tl.addSpeed(dur);
+ if (tool.id === "comment") void tl.addAnnotation(dur);
+ if (tool.id === "cut") void tl.addTrim(dur);
+ }}
+ >
+ {tool.icon}
+ </button>
+ {/* Add audio sits right after Add annotation (issue #350). */}
+ {tool.id === "comment" ? (
+ <button
+ type="button"
+ className={styles.tlToolBtn}
+ title={ts("audioTrack.add")}
+ aria-label={ts("audioTrack.add")}
+ onClick={() => void handleAddAudio()}
+ >
+ <Music size={15} />
+ </button>
+ ) : null}
+ </Fragment>
))}
<button
type="button"
diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.json
index 7fd43c328..25beaec51 100644
--- a/src/i18n/locales/ar/settings.json
+++ b/src/i18n/locales/ar/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index d000776a9..fda9fb853 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -85,7 +85,7 @@
"defaultLabel": "Audio track",
"help": "Volume for this imported audio track. It mixes over the recording in the preview and the export. Drag the track on the timeline to move or trim it.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
},
"effects": {
"title": "Composition",
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index f9990d4ce..1ee68eeae 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.json
index 1f977ceaf..169dbb28f 100644
--- a/src/i18n/locales/fr/settings.json
+++ b/src/i18n/locales/fr/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.json
index ac59a30e7..29fbeed47 100644
--- a/src/i18n/locales/it/settings.json
+++ b/src/i18n/locales/it/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json
index 4ebf04a29..32b5338f6 100644
--- a/src/i18n/locales/ja-JP/settings.json
+++ b/src/i18n/locales/ja-JP/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.json
index 88cd20e14..4b521a107 100644
--- a/src/i18n/locales/ko-KR/settings.json
+++ b/src/i18n/locales/ko-KR/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.json
index 400146a55..c7abe3e8a 100644
--- a/src/i18n/locales/pt-BR/settings.json
+++ b/src/i18n/locales/pt-BR/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.json
index f7c1500a9..4e8549493 100644
--- a/src/i18n/locales/ru/settings.json
+++ b/src/i18n/locales/ru/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.json
index 0a0292ac4..962b33abb 100644
--- a/src/i18n/locales/tr/settings.json
+++ b/src/i18n/locales/tr/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.json
index 6391bee1b..3c71e50b6 100644
--- a/src/i18n/locales/vi/settings.json
+++ b/src/i18n/locales/vi/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 622f17f2f..ed7f5e585 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -333,6 +333,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}
diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json
index b1b5729b2..5269c76bf 100644
--- a/src/i18n/locales/zh-TW/settings.json
+++ b/src/i18n/locales/zh-TW/settings.json
@@ -334,6 +334,6 @@
"defaultLabel": "Audio track",
"help": "Volume, position, and mute for this imported audio track. It mixes over the recording in the preview and the export.",
"volume": "Volume",
- "remove": "Remove track"
+ "remove": "Delete track"
}
}