Skip to content

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

refactor(editor): drop the write-only showTrimWaveform setting

Etienne Lescot19ae62e3e346
diff --git a/src/components/video-editor/editorDefaults.ts b/src/components/video-editor/editorDefaults.ts
index eaff15c14..a74acd020 100644
--- a/src/components/video-editor/editorDefaults.ts
+++ b/src/components/video-editor/editorDefaults.ts
@@ -35,13 +35,11 @@ export const DEFAULT_EDITOR_APPEARANCE_SETTINGS: {
showBlur: boolean;
motionBlurAmount: number;
borderRadius: number;
- showTrimWaveform: boolean;
} = {
shadowIntensity: 0,
showBlur: false,
motionBlurAmount: 0,
borderRadius: 0,
- showTrimWaveform: true,
};
export const DEFAULT_EDITOR_LAYOUT_SETTINGS: {
diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.ts
index dbb1fc937..627402844 100644
--- a/src/components/video-editor/projectPersistence.ts
+++ b/src/components/video-editor/projectPersistence.ts
@@ -70,7 +70,6 @@ export interface ProjectEditorState {
wallpaper: string;
shadowIntensity: number;
showBlur: boolean;
- showTrimWaveform: boolean;
motionBlurAmount: number;
borderRadius: number;
padding: number;
@@ -484,10 +483,6 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Pro
typeof editor.showBlur === "boolean"
? editor.showBlur
: DEFAULT_EDITOR_APPEARANCE_SETTINGS.showBlur,
- showTrimWaveform:
- typeof editor.showTrimWaveform === "boolean"
- ? editor.showTrimWaveform
- : DEFAULT_EDITOR_APPEARANCE_SETTINGS.showTrimWaveform,
motionBlurAmount: isFiniteNumber(editor.motionBlurAmount)
? clamp(editor.motionBlurAmount, 0, 1)
: typeof (editor as { motionBlurEnabled?: unknown }).motionBlurEnabled === "boolean"
diff --git a/src/hooks/useEditorHistory.ts b/src/hooks/useEditorHistory.ts
index 2b105e175..ce8c9e9c7 100644
--- a/src/hooks/useEditorHistory.ts
+++ b/src/hooks/useEditorHistory.ts
@@ -40,7 +40,6 @@ export interface EditorState {
wallpaper: string;
shadowIntensity: number;
showBlur: boolean;
- showTrimWaveform: boolean;
motionBlurAmount: number;
borderRadius: number;
padding: number;
@@ -65,7 +64,6 @@ export const INITIAL_EDITOR_STATE: EditorState = {
wallpaper: DEFAULT_EDITOR_LAYOUT_SETTINGS.wallpaper,
shadowIntensity: DEFAULT_EDITOR_APPEARANCE_SETTINGS.shadowIntensity,
showBlur: DEFAULT_EDITOR_APPEARANCE_SETTINGS.showBlur,
- showTrimWaveform: DEFAULT_EDITOR_APPEARANCE_SETTINGS.showTrimWaveform,
motionBlurAmount: DEFAULT_EDITOR_APPEARANCE_SETTINGS.motionBlurAmount,
borderRadius: DEFAULT_EDITOR_APPEARANCE_SETTINGS.borderRadius,
padding: DEFAULT_EDITOR_LAYOUT_SETTINGS.padding,
diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.json
index 80cbe3653..b2c0a67cb 100644
--- a/src/i18n/locales/ar/settings.json
+++ b/src/i18n/locales/ar/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "اللغة"
},
- "timeline": {
- "title": "المخطط الزمني",
- "waveform": "عرض الموجة الصوتية على مسار القطع",
- "help": "خيارات عرض المخطط الزمني، مثل إظهار الموجة الصوتية على مسار القص."
- },
"facets": {
"captions": "الترجمة",
"transcript": "النص"
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index 49acd3a99..172d3658b 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Language"
},
- "timeline": {
- "title": "Timeline",
- "waveform": "Show Audio Waveform on Trim Track",
- "help": "Timeline display options, like showing the audio waveform on the trim track."
- },
"facets": {
"captions": "Captions",
"transcript": "Transcript"
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index 2c2937495..fa9ecbdee 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Idioma"
},
- "timeline": {
- "title": "Línea de tiempo",
- "waveform": "Mostrar forma de onda en pista de recorte",
- "help": "Opciones de visualización de la línea de tiempo, como mostrar la forma de onda en la pista de recorte."
- },
"facets": {
"captions": "Subtítulos",
"transcript": "Transcripción"
diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.json
index b3b47083e..34e167664 100644
--- a/src/i18n/locales/fr/settings.json
+++ b/src/i18n/locales/fr/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Langue"
},
- "timeline": {
- "title": "Montage",
- "waveform": "Afficher la forme d'onde sur la piste de découpe",
- "help": "Options d'affichage de la timeline, comme la forme d'onde audio sur la piste de découpe."
- },
"facets": {
"captions": "Sous-titres",
"transcript": "Transcription"
diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.json
index 7d48d6087..5ba1f263e 100644
--- a/src/i18n/locales/it/settings.json
+++ b/src/i18n/locales/it/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Lingua"
},
- "timeline": {
- "title": "Timeline",
- "waveform": "Mostra la forma d'onda sulla traccia di ritaglio",
- "help": "Opzioni di visualizzazione della timeline, come mostrare la forma d'onda audio sulla traccia di taglio."
- },
"facets": {
"captions": "Sottotitoli",
"transcript": "Trascrizione"
diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json
index ca22dc146..9c92a3c04 100644
--- a/src/i18n/locales/ja-JP/settings.json
+++ b/src/i18n/locales/ja-JP/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "言語"
},
- "timeline": {
- "title": "タイムライン",
- "waveform": "トリムトラックにオーディオ波形を表示",
- "help": "タイムラインの表示オプション(トリムトラックに音声波形を表示するなど)。"
- },
"facets": {
"captions": "字幕",
"transcript": "文字起こし"
diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.json
index 176884cec..2ccaffbf6 100644
--- a/src/i18n/locales/ko-KR/settings.json
+++ b/src/i18n/locales/ko-KR/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "언어"
},
- "timeline": {
- "title": "타임라인",
- "waveform": "트림 트랙에 오디오 파형 표시",
- "help": "타임라인 표시 옵션(예: 트림 트랙에 오디오 파형 표시)."
- },
"facets": {
"captions": "자막",
"transcript": "대본"
diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.json
index 79fbedb38..d33935dc4 100644
--- a/src/i18n/locales/pt-BR/settings.json
+++ b/src/i18n/locales/pt-BR/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Idioma"
},
- "timeline": {
- "title": "Linha do Tempo",
- "waveform": "Mostrar Forma de Onda de Áudio na Faixa de Corte",
- "help": "Opções de exibição da linha do tempo, como mostrar a forma de onda de áudio na trilha de corte."
- },
"facets": {
"captions": "Legendas",
"transcript": "Transcrição"
diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.json
index a987a2c98..5363f9907 100644
--- a/src/i18n/locales/ru/settings.json
+++ b/src/i18n/locales/ru/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Язык"
},
- "timeline": {
- "title": "Шкала времени",
- "waveform": "Показывать форму волны на треке обрезки",
- "help": "Параметры отображения таймлайна, например показ звуковой волны на дорожке обрезки."
- },
"facets": {
"captions": "Субтитры",
"transcript": "Транскрипт"
diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.json
index 3cd10664a..36b7fbade 100644
--- a/src/i18n/locales/tr/settings.json
+++ b/src/i18n/locales/tr/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Dil"
},
- "timeline": {
- "title": "Zaman Tüneli",
- "waveform": "Kırpma Parçasında Ses Dalgasını Göster",
- "help": "Zaman çizelgesi görüntüleme seçenekleri; örneğin kırpma parçasında ses dalga formunu göstermek."
- },
"facets": {
"captions": "Altyazılar",
"transcript": "Metin Dökümü"
diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.json
index 56ccba317..a7fc09974 100644
--- a/src/i18n/locales/vi/settings.json
+++ b/src/i18n/locales/vi/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "Ngôn ngữ"
},
- "timeline": {
- "title": "Dòng thời gian",
- "waveform": "Hiển thị dạng sóng âm thanh trên rãnh cắt",
- "help": "Tùy chọn hiển thị dòng thời gian, chẳng hạn hiện dạng sóng âm thanh trên rãnh cắt."
- },
"facets": {
"captions": "Phụ đề",
"transcript": "Bản ghi lời thoại"
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 14f939696..d1d152bd0 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -241,11 +241,6 @@
"language": {
"title": "语言"
},
- "timeline": {
- "title": "时间轴",
- "waveform": "在剪辑轨道上显示音频波形",
- "help": "时间轴显示选项,例如在修剪轨道上显示音频波形。"
- },
"facets": {
"captions": "字幕",
"transcript": "转录文本"
diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json
index 2e44c0192..a2e949cbd 100644
--- a/src/i18n/locales/zh-TW/settings.json
+++ b/src/i18n/locales/zh-TW/settings.json
@@ -242,11 +242,6 @@
"language": {
"title": "語言"
},
- "timeline": {
- "title": "時間軸",
- "waveform": "在剪輯軌道上顯示音訊波形",
- "help": "時間軸顯示選項,例如在修剪軌道上顯示音訊波形。"
- },
"facets": {
"captions": "字幕",
"transcript": "逐字稿"
diff --git a/src/lib/ai-edition/document/migrate.test.ts b/src/lib/ai-edition/document/migrate.test.ts
index 02884beb1..2b801de15 100644
--- a/src/lib/ai-edition/document/migrate.test.ts
+++ b/src/lib/ai-edition/document/migrate.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, it } from "vitest";
import type { EditorProjectData } from "@/components/video-editor/projectPersistence";
+import { getEditorSettings } from "@/lib/ai-edition/store/editorSettings";
import { migrateAxcutDocumentToProjectData, migrateProjectDataToAxcutDocument } from "./migrate";
function makeV2Project(overrides: Partial<EditorProjectData> = {}): EditorProjectData {
@@ -10,7 +11,6 @@ function makeV2Project(overrides: Partial<EditorProjectData> = {}): EditorProjec
wallpaper: "/wallpapers/wallpaper1.jpg",
shadowIntensity: 0,
showBlur: false,
- showTrimWaveform: true,
motionBlurAmount: 0,
borderRadius: 0,
padding: 50,
@@ -170,6 +170,22 @@ describe("migrateProjectDataToAxcutDocument", () => {
});
});
+ it("keeps migrating a project saved with the retired showTrimWaveform key", () => {
+ const v2 = makeV2Project();
+ // Projects saved before the setting was removed still carry it.
+ const stored = {
+ ...v2,
+ editor: { ...v2.editor, showTrimWaveform: false },
+ } as EditorProjectData;
+ const doc = migrateProjectDataToAxcutDocument(stored);
+ // legacyEditorSchema is a passthrough object, so the retired key rides
+ // along inertly rather than failing the parse — and nothing reads it.
+ expect(doc.legacyEditor).toMatchObject({ showTrimWaveform: false });
+ expect(getEditorSettings(doc)).toEqual(
+ getEditorSettings(migrateProjectDataToAxcutDocument(v2)),
+ );
+ });
+
it("handles missing media by creating an empty document", () => {
const doc = migrateProjectDataToAxcutDocument({
version: 2,
diff --git a/src/lib/ai-edition/document/migrate.ts b/src/lib/ai-edition/document/migrate.ts
index c1be6efe5..d8ee6e40d 100644
--- a/src/lib/ai-edition/document/migrate.ts
+++ b/src/lib/ai-edition/document/migrate.ts
@@ -267,7 +267,6 @@ export function migrateAxcutDocumentToProjectData(input: AxcutDocument): EditorP
wallpaper: "",
shadowIntensity: 0,
showBlur: false,
- showTrimWaveform: true,
motionBlurAmount: 0,
borderRadius: 0,
padding: 50,
diff --git a/src/lib/ai-edition/store/editorSettings.test.ts b/src/lib/ai-edition/store/editorSettings.test.ts
index 0f72d7e93..f7af90df9 100644
--- a/src/lib/ai-edition/store/editorSettings.test.ts
+++ b/src/lib/ai-edition/store/editorSettings.test.ts
@@ -28,7 +28,6 @@ describe("getEditorSettings", () => {
expect(snap.aspectRatio).toBe("16:9");
expect(snap.shadowIntensity).toBe(0);
expect(snap.showBlur).toBe(false);
- expect(snap.showTrimWaveform).toBe(true);
expect(snap.webcamLayoutPreset).toBe(DEFAULT_WEBCAM_LAYOUT_PRESET);
expect(snap.webcamMaskShape).toBe(DEFAULT_WEBCAM_MASK_SHAPE);
expect(snap.cursor.size).toBe(DEFAULT_CURSOR_SIZE);
diff --git a/src/lib/ai-edition/store/editorSettings.ts b/src/lib/ai-edition/store/editorSettings.ts
index b4fa74c54..131505b5a 100644
--- a/src/lib/ai-edition/store/editorSettings.ts
+++ b/src/lib/ai-edition/store/editorSettings.ts
@@ -43,7 +43,6 @@ export interface EditorSettingsSnapshot {
aspectRatio: AspectRatio;
shadowIntensity: number;
showBlur: boolean;
- showTrimWaveform: boolean;
motionBlurAmount: number;
borderRadius: number;
padding: number;
@@ -65,7 +64,6 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettingsSnapshot = {
aspectRatio: "16:9",
shadowIntensity: 0,
showBlur: false,
- showTrimWaveform: true,
motionBlurAmount: 0,
borderRadius: 0,
padding: 50,
@@ -93,7 +91,6 @@ interface LegacyShape {
aspectRatio?: AspectRatio;
shadowIntensity?: number;
showBlur?: boolean;
- showTrimWaveform?: boolean;
motionBlurAmount?: number;
borderRadius?: number;
padding?: number;
@@ -145,7 +142,6 @@ export function getEditorSettings(doc: AxcutDocument | null | undefined): Editor
aspectRatio: legacy?.aspectRatio ?? DEFAULT_EDITOR_SETTINGS.aspectRatio,
shadowIntensity: num(legacy?.shadowIntensity, DEFAULT_EDITOR_SETTINGS.shadowIntensity),
showBlur: bool(legacy?.showBlur, DEFAULT_EDITOR_SETTINGS.showBlur),
- showTrimWaveform: bool(legacy?.showTrimWaveform, DEFAULT_EDITOR_SETTINGS.showTrimWaveform),
motionBlurAmount: num(legacy?.motionBlurAmount, DEFAULT_EDITOR_SETTINGS.motionBlurAmount),
borderRadius: num(legacy?.borderRadius, DEFAULT_EDITOR_SETTINGS.borderRadius),
padding: num(legacy?.padding, DEFAULT_EDITOR_SETTINGS.padding),
@@ -170,7 +166,6 @@ export interface EditorSettingsPatch {
aspectRatio?: AspectRatio;
shadowIntensity?: number;
showBlur?: boolean;
- showTrimWaveform?: boolean;
motionBlurAmount?: number;
borderRadius?: number;
padding?: number;