Skip to content

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

feat(editor): New-project starting points, i18n for the right rail, and no more pre-v4 shell

Etienne Lescot1bb1a26baac9
diff --git a/package-lock.json b/package-lock.json
index ee3db7ae3..78b44785c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -38,7 +38,6 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"deepagents": "^1.10.5",
- "dnd-timeline": "^2.4.0",
"emoji-picker-react": "^4.18.0",
"fix-webm-duration": "^1.0.6",
"gif.js": "^0.2.0",
@@ -916,45 +915,6 @@
"url": "https://opencollective.com/webpack"
}
},
- "node_modules/@dnd-kit/accessibility": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz",
- "integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==",
- "license": "MIT",
- "dependencies": {
- "tslib": "^2.0.0"
- },
- "peerDependencies": {
- "react": ">=16.8.0"
- }
- },
- "node_modules/@dnd-kit/core": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
- "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
- "license": "MIT",
- "dependencies": {
- "@dnd-kit/accessibility": "^3.1.1",
- "@dnd-kit/utilities": "^3.2.2",
- "tslib": "^2.0.0"
- },
- "peerDependencies": {
- "react": ">=16.8.0",
- "react-dom": ">=16.8.0"
- }
- },
- "node_modules/@dnd-kit/utilities": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/@dnd-kit/utilities/-/utilities-3.2.2.tgz",
- "integrity": "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==",
- "license": "MIT",
- "dependencies": {
- "tslib": "^2.0.0"
- },
- "peerDependencies": {
- "react": ">=16.8.0"
- }
- },
"node_modules/@electron/asar": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.4.1.tgz",
@@ -6714,17 +6674,6 @@
"node": ">=8"
}
},
- "node_modules/dnd-timeline": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/dnd-timeline/-/dnd-timeline-2.4.0.tgz",
- "integrity": "sha512-f71y55DjT2VDongtnqVd7S6XGmpUT1PkYlooFQZxLHfPVfKsyTtMHsfbXN98k2GkA5Z4h3ibqFjwBIfckE0aEg==",
- "license": "MIT",
- "dependencies": {
- "@dnd-kit/core": "^6.1.0",
- "@dnd-kit/utilities": "^3.2.2",
- "resize-observer-polyfill": "^1.5.1"
- }
- },
"node_modules/dom-accessibility-api": {
"version": "0.5.16",
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
@@ -10457,12 +10406,6 @@
"url": "https://github.com/sponsors/jet2jet"
}
},
- "node_modules/resize-observer-polyfill": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
- "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==",
- "license": "MIT"
- },
"node_modules/resolve": {
"version": "1.22.12",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz",
diff --git a/package.json b/package.json
index e41d29685..c2268af36 100644
--- a/package.json
+++ b/package.json
@@ -87,7 +87,6 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"deepagents": "^1.10.5",
- "dnd-timeline": "^2.4.0",
"emoji-picker-react": "^4.18.0",
"fix-webm-duration": "^1.0.6",
"gif.js": "^0.2.0",
diff --git a/poc-d3d/compositor-view-napi/src/lib.rs b/poc-d3d/compositor-view-napi/src/lib.rs
index a0aa3b2af..5704bbb19 100644
--- a/poc-d3d/compositor-view-napi/src/lib.rs
+++ b/poc-d3d/compositor-view-napi/src/lib.rs
@@ -12,7 +12,7 @@ use napi_derive::napi;
use poc_d3d::compositor::{live_params_from_scene, Compositor};
use poc_d3d::cursor::CursorTrack;
use poc_d3d::d3d::Gpu;
-use poc_d3d::live::LiveView;
+use poc_d3d::live::{LiveView, PausedPreviews};
use poc_d3d::scene::Scene;
use poc_d3d::{config, pipeline};
use std::collections::HashMap;
@@ -267,12 +267,31 @@ fn throttled_progress(
}
}
-/// Active/désactive la composition de toutes les previews vivantes (même process).
-/// Désactivées, leurs threads de rendu cessent de composer/présenter → GPU libéré.
-fn set_all_previews_playing(playing: bool) {
- if let Ok(reg) = registry().lock() {
- for v in reg.values() {
- v.set_playing(playing);
+/// Pauses every live preview of this process for the duration of an export — their render
+/// threads stop composing/presenting, which frees the GPU's 3D engine (measured: preview on
+/// ~72 fps → preview off ~125 fps) — and gives each one back the transport it was found with
+/// when dropped, including on an early `return Err` or a panic.
+///
+/// Restoring the saved state instead of resuming everything is the whole point; see
+/// `PausedPreviews` for the bug the blanket resume caused (a preview left free-running behind
+/// a paused editor, ending up on another clip's scene with the zoom regions filtered out).
+struct PreviewPause(PausedPreviews<i32>);
+
+impl PreviewPause {
+ fn begin() -> Self {
+ // A poisoned registry means some other napi call panicked mid-mutation; the export
+ // itself is still worth running, we just have no previews we can speak for.
+ Self(match registry().lock() {
+ Ok(reg) => PausedPreviews::pause(reg.iter().map(|(id, view)| (*id, view))),
+ Err(_) => PausedPreviews::default(),
+ })
+ }
+}
+
+impl Drop for PreviewPause {
+ fn drop(&mut self) {
+ if let Ok(reg) = registry().lock() {
+ self.0.restore(reg.iter().map(|(id, view)| (*id, view)));
}
}
}
@@ -282,33 +301,28 @@ impl Task for ExportTask {
type JsValue = ExportStats;
fn compute(&mut self) -> Result<Self::Output> {
- // Désactive les previews pendant le rendu pour libérer le moteur 3D du GPU
- // (mesuré : preview active ~72 fps → preview off ~125 fps). Réactivées ensuite,
- // même en cas d'erreur.
- set_all_previews_playing(false);
- let result = (|| {
- let dir = fixture_dir();
- let gpu = Gpu::create(false).map_err(|e| Error::from_reason(format!("{e:#}")))?;
- let comp = Compositor::new(&gpu).map_err(|e| Error::from_reason(format!("{e:#}")))?;
- if let Ok(t) = CursorTrack::load(&format!("{dir}/screen.cursor.json"), 100_000.0, 6.0) {
- comp.set_cursor(t);
- }
- let cfg = config::all().pop().expect("au moins une config"); // C8
- let mut progress = throttled_progress(self.on_progress.take());
- let s = pipeline::run_composited(
- &format!("{dir}/screen.mp4"),
- &format!("{dir}/webcam.mp4"),
- &self.out_path,
- &gpu,
- &comp,
- &cfg,
- &mut progress,
- )
- .map_err(|e| Error::from_reason(format!("{e:#}")))?;
- Ok((s.frames as u32, s.wall_s, s.fps, s.video_duration_s))
- })();
- set_all_previews_playing(true);
- result
+ // Previews paused for the whole render (GPU 3D engine freed) and put back exactly as
+ // found when this guard drops — including on the error paths below.
+ let _previews = PreviewPause::begin();
+ let dir = fixture_dir();
+ let gpu = Gpu::create(false).map_err(|e| Error::from_reason(format!("{e:#}")))?;
+ let comp = Compositor::new(&gpu).map_err(|e| Error::from_reason(format!("{e:#}")))?;
+ if let Ok(t) = CursorTrack::load(&format!("{dir}/screen.cursor.json"), 100_000.0, 6.0) {
+ comp.set_cursor(t);
+ }
+ let cfg = config::all().pop().expect("au moins une config"); // C8
+ let mut progress = throttled_progress(self.on_progress.take());
+ let s = pipeline::run_composited(
+ &format!("{dir}/screen.mp4"),
+ &format!("{dir}/webcam.mp4"),
+ &self.out_path,
+ &gpu,
+ &comp,
+ &cfg,
+ &mut progress,
+ )
+ .map_err(|e| Error::from_reason(format!("{e:#}")))?;
+ Ok((s.frames as u32, s.wall_s, s.fps, s.video_duration_s))
}
fn resolve(&mut self, _env: Env, out: Self::Output) -> Result<Self::JsValue> {
@@ -364,7 +378,8 @@ pub struct ExportParamsInput {
/// `scene_json` (optionnel) = la même scène que la preview live : fond/layout/webcam/curseur —
/// sans elle on ne retomberait QUE sur le layout fixture A↔B, plus du tout ce que l'utilisateur
/// a configuré (le bug corrigé ici). Layout/zoom restent statiques (pas encore de zoom regions
-/// ni de camera-fullscreen animés côté export). Réactive les previews après coup (même en erreur).
+/// ni de camera-fullscreen animés côté export). Rend aux previews le transport qu'elles avaient
+/// (même en erreur) — voir `PreviewPause`.
pub struct ExportMultiTask {
out_path: String,
clips: Vec<pipeline::ClipSource>,
@@ -378,79 +393,76 @@ impl Task for ExportMultiTask {
type JsValue = ExportStats;
fn compute(&mut self) -> Result<Self::Output> {
- set_all_previews_playing(false);
- let result = (|| {
- let gpu = Gpu::create(false).map_err(|e| Error::from_reason(format!("{e:#}")))?;
- let mut cfg = config::all().pop().expect("au moins une config"); // C8
- cfg.zoom = false;
- cfg.layout_anim = false;
- cfg.mblur_n = 1; // layout statique → pas de motion blur de layout (pas de surcoût)
-
- // scène de l'app = même chemin que la preview live : fond, layout, webcam, curseur.
- // JSON absent/invalide → pas de scène (fixture), pareil que si la preview n'en avait
- // jamais reçu — jamais un fallback masquant, juste rien de configuré.
- let scene = self.scene_json.as_deref().and_then(|j| Scene::from_json(j).ok());
- if let Some(scene) = &scene {
- cfg.bg_blur = scene.effects.blur;
- cfg.cursor = scene.cursor.show;
- } else {
- cfg.cursor = false;
- }
+ // See `ExportTask::compute` — same pause-and-restore contract, same guard.
+ let _previews = PreviewPause::begin();
+ let gpu = Gpu::create(false).map_err(|e| Error::from_reason(format!("{e:#}")))?;
+ let mut cfg = config::all().pop().expect("au moins une config"); // C8
+ cfg.zoom = false;
+ cfg.layout_anim = false;
+ cfg.mblur_n = 1; // layout statique → pas de motion blur de layout (pas de surcoût)
+
+ // scène de l'app = même chemin que la preview live : fond, layout, webcam, curseur.
+ // JSON absent/invalide → pas de scène (fixture), pareil que si la preview n'en avait
+ // jamais reçu — jamais un fallback masquant, juste rien de configuré.
+ let scene = self.scene_json.as_deref().and_then(|j| Scene::from_json(j).ok());
+ if let Some(scene) = &scene {
+ cfg.bg_blur = scene.effects.blur;
+ cfg.cursor = scene.cursor.show;
+ } else {
+ cfg.cursor = false;
+ }
- let mut export_params = pipeline::ExportParams::default();
- if let Some(p) = &self.params {
- if let Some(w) = p.width {
- export_params.width = w.max(2) & !1; // pair le plus proche (>=2, NV12)
- }
- if let Some(h) = p.height {
- export_params.height = h.max(2) & !1;
- }
- export_params.fps = p.fps;
- if let Some(codec) = &p.codec {
- export_params.codec = match codec.as_str() {
- "h264" => pipeline::ExportCodec::H264,
- "h265" => pipeline::ExportCodec::H265,
- other => {
- return Err(Error::from_reason(format!(
- "codec d'export \"{other}\" non supporté par le pipeline natif (h264/h265 seulement — pas d'équivalent matériel AMF pour VP9, et le chemin logiciel testé était trop lent pour être utile)"
- )));
- }
- };
- }
+ let mut export_params = pipeline::ExportParams::default();
+ if let Some(p) = &self.params {
+ if let Some(w) = p.width {
+ export_params.width = w.max(2) & !1; // pair le plus proche (>=2, NV12)
}
-
- // Le compositeur rastérise à la taille RÉELLEMENT encodée — d'où sa
- // construction ici, une fois `export_params` résolu.
- //
- // Avant : il composait toujours en 1920×1080 puis `blit_resized` étirait
- // vers la taille d'export. Deux défauts, une seule cause — tout export
- // dépassant 1080p sur un axe était un AGRANDISSEMENT (un 4K portait le
- // quart de l'information), et tout ratio ≠ 16:9 devait passer par une
- // compensation géométrique. En construisant le compositeur à la
- // géométrie de sortie, `blit_resized` devient une identité et les pixels
- // sont rastérisés exactement là où ils seront encodés.
- let comp = Compositor::new_sized(&gpu, export_params.width, export_params.height)
- .map_err(|e| Error::from_reason(format!("{e:#}")))?;
- if let Some(scene) = &scene {
- comp.set_live_params(live_params_from_scene(scene));
+ if let Some(h) = p.height {
+ export_params.height = h.max(2) & !1;
+ }
+ export_params.fps = p.fps;
+ if let Some(codec) = &p.codec {
+ export_params.codec = match codec.as_str() {
+ "h264" => pipeline::ExportCodec::H264,
+ "h265" => pipeline::ExportCodec::H265,
+ other => {
+ return Err(Error::from_reason(format!(
+ "codec d'export \"{other}\" non supporté par le pipeline natif (h264/h265 seulement — pas d'équivalent matériel AMF pour VP9, et le chemin logiciel testé était trop lent pour être utile)"
+ )));
+ }
+ };
}
- comp.set_scene(scene);
-
- let mut progress = throttled_progress(self.on_progress.take());
- let s = pipeline::run_composited_multi(
- &self.clips,
- &self.out_path,
- &gpu,
- &comp,
- &cfg,
- &export_params,
- &mut progress,
- )
+ }
+
+ // Le compositeur rastérise à la taille RÉELLEMENT encodée — d'où sa
+ // construction ici, une fois `export_params` résolu.
+ //
+ // Avant : il composait toujours en 1920×1080 puis `blit_resized` étirait
+ // vers la taille d'export. Deux défauts, une seule cause — tout export
+ // dépassant 1080p sur un axe était un AGRANDISSEMENT (un 4K portait le
+ // quart de l'information), et tout ratio ≠ 16:9 devait passer par une
+ // compensation géométrique. En construisant le compositeur à la
+ // géométrie de sortie, `blit_resized` devient une identité et les pixels
+ // sont rastérisés exactement là où ils seront encodés.
+ let comp = Compositor::new_sized(&gpu, export_params.width, export_params.height)
.map_err(|e| Error::from_reason(format!("{e:#}")))?;
- Ok((s.frames as u32, s.wall_s, s.fps, s.video_duration_s))
- })();
- set_all_previews_playing(true);
- result
+ if let Some(scene) = &scene {
+ comp.set_live_params(live_params_from_scene(scene));
+ }
+ comp.set_scene(scene);
+
+ let mut progress = throttled_progress(self.on_progress.take());
+ let s = pipeline::run_composited_multi(
+ &self.clips,
+ &self.out_path,
+ &gpu,
+ &comp,
+ &cfg,
+ &export_params,
+ &mut progress,
+ )
+ .map_err(|e| Error::from_reason(format!("{e:#}")))?;
+ Ok((s.frames as u32, s.wall_s, s.fps, s.video_duration_s))
}
fn resolve(&mut self, _env: Env, out: Self::Output) -> Result<Self::JsValue> {
diff --git a/poc-d3d/src/live.rs b/poc-d3d/src/live.rs
index 2e066d27c..52d5b6db1 100644
--- a/poc-d3d/src/live.rs
+++ b/poc-d3d/src/live.rs
@@ -607,6 +607,13 @@ impl LiveView {
self.shared.playing.store(playing, Ordering::Relaxed);
}
+ /// Ce que la vue est en train de faire : lecture libre (`true`) ou pause (`false`).
+ /// Lu par l'export, qui met les previews en pause le temps d'encoder et doit pouvoir
+ /// leur rendre CET état plutôt que d'en supposer un (voir `PausedPreviews`).
+ pub fn playing(&self) -> bool {
+ self.shared.playing.load(Ordering::Relaxed)
+ }
+
/// Installe la scène de l'app (JSON `SceneDescription`). Parsé ici (hors thread de rendu) ;
/// appliqué au compositeur au prochain tour via le flag `scene_dirty`. JSON invalide → ignoré.
pub fn set_scene(&self, json: &str) {
@@ -665,6 +672,75 @@ impl Drop for LiveView {
}
}
+/// A preview's transport — free-run or paused — readable AND writable without touching the
+/// GPU. It is the only slice of `LiveView` an export needs: it pauses the previews to free
+/// the 3D engine, then hands the transport back. A trait rather than `LiveView` itself so
+/// that `PausedPreviews` can be tested with no D3D device (see this file's tests).
+pub trait PreviewTransport {
+ fn playing(&self) -> bool;
+ fn set_playing(&self, playing: bool);
+}
+
+impl PreviewTransport for LiveView {
+ fn playing(&self) -> bool {
+ // Fully-qualified on purpose: inside a trait impl, `self.playing()` resolving to the
+ // inherent method is a silent coincidence of method resolution, not a guarantee.
+ LiveView::playing(self)
+ }
+
+ fn set_playing(&self, playing: bool) {
+ LiveView::set_playing(self, playing);
+ }
+}
+
+/// What every preview was doing when an export paused them — enough to give EACH ONE back the
+/// state it was found in, instead of resuming them all.
+///
+/// That distinction is the fix for a visible bug, not a nicety. While editing, the preview is
+/// PAUSED; the renderer only pushes `setPlaying` when the transport actually changes, so
+/// nothing ever came along to re-pause a preview an export had resumed on its own authority.
+/// It went back to free-running for its own account: its playhead left the moment the app
+/// believed was on screen (the zoom then sampled at the wrong source time), and at the first
+/// clip boundary it crossed, it swapped its scene over to ANOTHER clip
+/// (`scene_for_clip`) — after which the zoom regions of the clip actually being displayed were
+/// filtered out of the scene, and no amount of seeking brought them back (the app only pushes
+/// `set_active_clip` when ITS active clip changes, and its own had not changed). Only a window
+/// reload, which recreates the view, repaired it.
+///
+/// `K` is the caller's identity for a view (the napi registry id). Previews created AFTER the
+/// pause are absent from the snapshot and are left strictly alone: their transport belongs to
+/// whoever created them.
+pub struct PausedPreviews<K> {
+ was_playing: Vec<(K, bool)>,
+}
+
+impl<K> Default for PausedPreviews<K> {
+ fn default() -> Self {
+ Self { was_playing: Vec::new() }
+ }
+}
+
+impl<K: Copy + PartialEq> PausedPreviews<K> {
+ /// Pauses every preview and reports what each one was doing.
+ pub fn pause<'a, V: PreviewTransport + 'a>(views: impl IntoIterator<Item = (K, &'a V)>) -> Self {
+ let mut was_playing = Vec::new();
+ for (key, view) in views {
+ was_playing.push((key, view.playing()));
+ view.set_playing(false);
+ }
+ Self { was_playing }
+ }
+
+ /// Gives every preview the snapshot knows about the state it was found in.
+ pub fn restore<'a, V: PreviewTransport + 'a>(&self, views: impl IntoIterator<Item = (K, &'a V)>) {
+ for (key, view) in views {
+ if let Some((_, was_playing)) = self.was_playing.iter().find(|(k, _)| *k == key) {
+ view.set_playing(*was_playing);
+ }
+ }
+ }
+}
+
/// Un préchargement en cours : quel `next_index` (dans `Scene.clips`) il prépare, et le canal
/// par lequel le thread de fond livre le résultat une fois prêt.
type PendingPrefetch = (usize, std::sync::mpsc::Receiver<Result<PrefetchedClip>>);
@@ -1399,6 +1475,88 @@ mod tests {
assert_eq!(webcam_seek_time(0.5, 1.25), 0.0);
}
+ // --- transport handed to an export and back -------------------------------
+ // A real `LiveView` needs a D3D device and a decoder; the transport is the only
+ // part an export touches, so these exercise it through `PreviewTransport` alone.
+
+ /// A preview reduced to its transport flag — no GPU, no render thread.
+ struct FakePreview(std::cell::Cell<bool>);
+
+ impl FakePreview {
+ fn new(playing: bool) -> Self {
+ Self(std::cell::Cell::new(playing))
+ }
+ }
+
+ impl PreviewTransport for FakePreview {
+ fn playing(&self) -> bool {
+ self.0.get()
+ }
+
+ fn set_playing(&self, playing: bool) {
+ self.0.set(playing);
+ }
+ }
+
+ /// The regression this exists for: an export used to resume every preview it had
+ /// paused, so exporting while the editor sat paused left the preview free-running —
+ /// it drifted off the app's playhead and out of the zoom region the inspector still
+ /// showed, and only a window reload brought the zoom back.
+ #[test]
+ fn an_export_leaves_a_paused_preview_paused() {
+ let paused = FakePreview::new(false);
+ let snapshot = PausedPreviews::pause([(7, &paused)]);
+ assert!(!paused.playing(), "the export must free the GPU while it encodes");
+
+ snapshot.restore([(7, &paused)]);
+ assert!(!paused.playing(), "the app never asked for playback — it must still be paused");
+ }
+
+ /// The other half of "as found": a preview that WAS playing gets its playback back,
+ /// which is what the blanket resume happened to get right.
+ #[test]
+ fn an_export_gives_a_playing_preview_its_playback_back() {
+ let playing = FakePreview::new(true);
+ let snapshot = PausedPreviews::pause([(1, &playing)]);
+ assert!(!playing.playing(), "paused for the duration of the encode");
+
+ snapshot.restore([(1, &playing)]);
+ assert!(playing.playing());
+ }
+
+ /// Each preview gets ITS state back, not the majority's.
+ #[test]
+ fn each_preview_is_restored_independently() {
+ let (a, b) = (FakePreview::new(true), FakePreview::new(false));
+ let snapshot = PausedPreviews::pause([(1, &a), (2, &b)]);
+ snapshot.restore([(1, &a), (2, &b)]);
+ assert_eq!((a.playing(), b.playing()), (true, false));
+ }
+
+ /// A preview born mid-export was never paused by it, so the export has no state of
+ /// its own to hand back — forcing one would overwrite what its creator just pushed.
+ #[test]
+ fn a_preview_created_during_an_export_keeps_its_own_transport() {
+ let existing = FakePreview::new(false);
+ let snapshot = PausedPreviews::pause([(1, &existing)]);
+
+ let newborn = FakePreview::new(true);
+ snapshot.restore([(1, &existing), (2, &newborn)]);
+ assert!(newborn.playing(), "untouched: it is not in the snapshot");
+ assert!(!existing.playing());
+ }
+
+ /// A preview destroyed during the export simply isn't there to restore — no panic,
+ /// and the survivors are still handled.
+ #[test]
+ fn a_preview_destroyed_during_an_export_is_skipped() {
+ let (kept, doomed) = (FakePreview::new(true), FakePreview::new(true));
+ let snapshot = PausedPreviews::pause([(1, &kept), (2, &doomed)]);
+ drop(doomed);
+ snapshot.restore([(1, &kept)]);
+ assert!(kept.playing());
+ }
+
// --- taille de rastérisation de la preview ---------------------------
// Ces tests remplacent le filet géométrique qui verrouillait la
// compensation anisotrope : celle-ci n'existe plus (le RT porte la
diff --git a/src/components/ai-edition/AnnotationOverlay.tsx b/src/components/ai-edition/AnnotationOverlay.tsx
index e4c92c833..ffd85b2eb 100644
--- a/src/components/ai-edition/AnnotationOverlay.tsx
+++ b/src/components/ai-edition/AnnotationOverlay.tsx
@@ -8,6 +8,7 @@
import { type CSSProperties, type PointerEvent, useEffect, useRef, useState } from "react";
import { Rnd } from "react-rnd";
+import { useScopedT } from "@/contexts/I18nContext";
import {
getBlurOverlayColor,
getMosaicGridOverlayColor,
@@ -67,6 +68,7 @@ export function AnnotationOverlay({
videoElement,
currentTimeMs,
}: AnnotationOverlayProps) {
+ const te = useScopedT("editor");
const committedX = (annotation.position.x / 100) * containerWidth;
const committedY = (annotation.position.y / 100) * containerHeight;
const committedWidth = (annotation.size.width / 100) * containerWidth;
@@ -325,7 +327,7 @@ export function AnnotationOverlay({
return (
<img
src={annotation.content}
- alt="Annotation"
+ alt={te("annotationOverlay.imageAlt")}
className="w-full h-full object-contain"
draggable={false}
/>
@@ -333,7 +335,7 @@ export function AnnotationOverlay({
}
return (
<div className="w-full h-full flex items-center justify-center text-slate-400 text-sm">
- No image
+ {te("annotationOverlay.noImage")}
</div>
);
@@ -341,7 +343,7 @@ export function AnnotationOverlay({
if (!annotation.figureData) {
return (
<div className="w-full h-full flex items-center justify-center text-slate-400 text-sm">
- No arrow data
+ {te("annotationOverlay.noArrowData")}
</div>
);
}
diff --git a/src/components/ai-edition/Bottombar.tsx b/src/components/ai-edition/Bottombar.tsx
deleted file mode 100644
index e73c16dbc..000000000
--- a/src/components/ai-edition/Bottombar.tsx
+++ /dev/null
@@ -1,521 +0,0 @@
-import {
- ChevronDown,
- FileText,
- MessageSquare,
- Pencil,
- Scissors,
- Timer,
- WandSparkles,
- ZoomIn,
-} from "lucide-react";
-import { useCallback, useEffect, useRef, useState } from "react";
-import { createPortal } from "react-dom";
-import { toast } from "sonner";
-import type { AnnotationRegion } from "@/components/video-editor/types";
-import type { AxcutClip, AxcutDocument } from "@/lib/ai-edition/schema";
-import { useProjectStore } from "@/lib/ai-edition/store/projectStore";
-import { useEditorSettings } from "@/lib/ai-edition/store/useEditorSettings";
-import { useTimeline } from "@/lib/ai-edition/store/useTimeline";
-import { suggestZoomRegions } from "@/lib/ai-edition/store/zoomSuggestions";
-import { locateVirtualPosition } from "@/lib/ai-edition/timeline/virtual-preview";
-import { ASPECT_RATIO_PRESETS, getAspectRatioLabel } from "@/utils/aspectRatioUtils";
-import { EditClipModal } from "./Modals";
-import styles from "./NewEditorShell.module.css";
-import { type Span } from "./RegionTimeline";
-import { TimelinePane } from "./TimelinePane";
-import { TransportBar } from "./TransportBar";
-import type { VideoSource } from "./VirtualPreview";
-
-type RegionKind = "zoom" | "trim" | "annotation" | "speed";
-
-interface RegionHandle {
- kind: RegionKind;
- id: string;
-}
-
-interface BottombarProps {
- clips: AxcutClip[];
- videoSources: VideoSource[];
- currentTimeSec: number;
- onSeek: (timelineSec: number) => void;
- zoomRegions: AxcutDocument["zoomRanges"];
- trimRanges: AxcutDocument["timeline"]["trimRanges"];
- annotationRegions: AnnotationRegion[];
- speedRegions: Array<{ id: string; startMs: number; endMs: number; speed: number }>;
- selection: RegionHandle | null;
- // F2.7 — full shift-click selection set, for multi-select highlighting.
- multiSelection?: RegionHandle[];
- hasDoc: boolean;
- onAddZoom: () => void;
- onAddAnnotation: () => void;
- onAddSpeed: () => void;
- // T15 — receives a setter so the parent's "T" keyboard shortcut can
- // call into our togglePlaceTrim (state lives here, body-class + Esc
- // handler live here). The Scissors button in this component calls
- // togglePlaceTrim directly.
- setTogglePlaceTrim?: (fn: () => void) => void;
- onSelectRegion: (kind: RegionKind, id: string, additive?: boolean) => void;
- onCaptions: () => void;
- // ponytail: the video transport now renders in this header (merged into
- // the same row as the zoom/cut/etc. tools) instead of under the preview
- // canvas — state lives in the parent shell (NewEditorShell), which also
- // owns the video element.
- playing: boolean;
- loop: boolean;
- onTogglePlay: () => void;
- onPrevClip: () => void;
- onNextClip: () => void;
- onToggleLoop: () => void;
- onExpand: () => void;
- // v4 Edit mode renders a floating transport over the stage instead, so the
- // timeline header suppresses its own copy to avoid a duplicate.
- hideTransport?: boolean;
- // v4 Media mode swaps the edit-tool row for the design's "Arrange clips"
- // caption and hides the region lanes (there is nothing to annotate yet).
- timelineVariant?: "edit" | "media";
-}
-
-export function Bottombar({
- clips,
- videoSources,
- currentTimeSec,
- onSeek,
- zoomRegions,
- trimRanges,
- annotationRegions,
- speedRegions,
- selection,
- multiSelection,
- hasDoc,
- onAddZoom,
- onAddAnnotation,
- onAddSpeed,
- setTogglePlaceTrim,
- onSelectRegion,
- onCaptions,
- playing,
- loop,
- onTogglePlay,
- onPrevClip,
- onNextClip,
- onToggleLoop,
- onExpand,
- hideTransport,
- timelineVariant = "edit",
-}: BottombarProps) {
- const isMediaVariant = timelineVariant === "media";
- const { settings, set } = useEditorSettings();
- const tl = useTimeline();
- const [ratioOpen, setRatioOpen] = useState(false);
- const ratioButtonRef = useRef<HTMLButtonElement | null>(null);
- // ponytail: `.bottombar` sets `overflow: hidden` to contain the timeline
- // lanes, which also clips any absolutely-positioned child that escapes
- // its box -- including this menu. Render it through a portal, positioned
- // from the button's live viewport rect, so it paints above everything
- // regardless of ancestor overflow/stacking.
- const [ratioMenuRect, setRatioMenuRect] = useState<{ left: number; bottom: number } | null>(null);
- useEffect(() => {
- if (!ratioOpen) return;
- const button = ratioButtonRef.current;
- if (!button) return;
- const rect = button.getBoundingClientRect();
- setRatioMenuRect({ left: rect.left, bottom: window.innerHeight - rect.top + 4 });
- }, [ratioOpen]);
- const [editClipTarget, setEditClipTarget] = useState<AxcutClip | null>(null);
- const firstClip = clips[0] ?? null;
- // T11 — viewport state lifted from TimelinePane so the navigator strip
- // can drive the same window. pxPerSec stays inside TimelinePane (it
- // depends on the viewport's measured width); Bottombar only owns the
- // logical window + zoom multiplier.
- const [zoom, setZoom] = useState(1);
- const [visibleStartSec, setVisibleStartSec] = useState(0);
- // T15 — Place-skip armed state. The Scissors (Trim) button toggles
- // this; the timeline pane shows the red preview marker and the cursor
- // becomes crosshair. Esc cancels. The preview is pinned to the
- // playhead the moment the mode is armed so the user sees the marker
- // right away (axcut's behavior).
- const [pendingCutPlacement, setPendingCutPlacement] = useState(false);
- const [pendingCutPreviewSec, setPendingCutPreviewSec] = useState<number | null>(null);
- const togglePlaceTrim = useCallback(() => {
- setPendingCutPlacement((active) => {
- if (active) {
- setPendingCutPreviewSec(null);
- return false;
- }
- setPendingCutPreviewSec(currentTimeSec);
- return true;
- });
- }, [currentTimeSec]);
-
- // F2.1 — Magic button: propose zoom regions over sustained speech
- // segments and append them to the document in one save.
- const applyZoomSuggestions = useCallback(async () => {
- const store = useProjectStore.getState();
- const doc = store.document;
- if (!doc) return;
- const suggestions = suggestZoomRegions(doc);
- if (suggestions.length === 0) {
- toast.info("No zoom suggestions found", {
- description: doc.transcripts.length
- ? "No sustained speech segments without an existing zoom."
- : "Transcribe the recording first — suggestions come from the transcript.",
- });
- return;
- }
- try {
- await store.saveDocument({
- ...doc,
- zoomRanges: [...doc.zoomRanges, ...suggestions] as AxcutDocument["zoomRanges"],
- });
- toast.success(
- `Added ${suggestions.length} zoom suggestion${suggestions.length === 1 ? "" : "s"}`,
- );
- } catch (err) {
- toast.error("Could not apply zoom suggestions", {
- description: err instanceof Error ? err.message : String(err),
- });
- }
- }, []);
-
- // T15 — body cursor + Esc-to-cancel while placing a cut. Lives here
- // (not in TimelinePane) because the state lives here.
- useEffect(() => {
- if (!pendingCutPlacement) {
- document.body.classList.remove("timeline-placing-cut");
- return;
- }
- document.body.classList.add("timeline-placing-cut");
- const handleKey = (event: KeyboardEvent) => {
- if (event.key === "Escape") {
- setPendingCutPlacement(false);
- setPendingCutPreviewSec(null);
- }
- };
- window.addEventListener("keydown", handleKey);
- return () => {
- document.body.classList.remove("timeline-placing-cut");
- window.removeEventListener("keydown", handleKey);
- };
- }, [pendingCutPlacement]);
-
- // ponytail: register our toggler with the parent (NewEditorShell)
- // so the "T" keyboard shortcut can call the same function the
- // Scissors button does. Uses an effect so re-renders (togglePlaceTrim
- // identity is stable but the ref it points to may change) always
- // see the latest implementation.
- useEffect(() => {
- setTogglePlaceTrim?.(togglePlaceTrim);
- }, [togglePlaceTrim, setTogglePlaceTrim]);
-
- const sourceDurationSec = Math.max(0.001, ...clips.map((c) => c.timelineEndSec));
- const visibleEndSec = Math.min(visibleStartSec + sourceDurationSec, sourceDurationSec);
- void visibleEndSec; // surfaced to the navigator (now inside TimelinePane)
- const handleRegionSpanChange = (id: string, span: Span) => {
- if (zoomRegions.some((z) => z.id === id)) void tl.updateZoomSpan(id, span.start, span.end);
- else if (speedRegions.some((s) => s.id === id))
- void tl.updateSpeedSpan(id, span.start, span.end);
- else if (trimRanges.some((s) => s.id === id)) {
- // ponytail: skip spans are edited in timeline (virtual) ms via the
- // same lane drag/resize as zoom/speed/annotation, but persisted in
- // source-time seconds (trimRangeSchema) — map back through the
- // clip the span resolves to.
- const startPos = locateVirtualPosition(clips, span.start / 1000);
- const endPos = locateVirtualPosition(clips, span.end / 1000);
- if (startPos && endPos) {
- void tl.updateTrimRange(id, startPos.sourceTimeSec, endPos.sourceTimeSec);
- }
- } else void tl.updateAnnotationSpan(id, span.start, span.end);
- };
- // ponytail: T10 removed the explicit onRemoveRegion prop (region
- // removal happens via the Del/Bksp shortcut wired in NewEditorShell).
- const editClipAsset = editClipTarget
- ? (tl.assets.find((a) => a.id === editClipTarget.assetId) ?? null)
- : null;
- return (
- <footer className={styles.bottombar} aria-label="Timeline and properties">
- <section
- style={{ minWidth: 0, display: "grid", gridTemplateRows: "auto 1fr auto", minHeight: 0 }}
- >
- <header className={styles.timelineHead}>
- {isMediaVariant ? (
- <div style={{ display: "flex", flexDirection: "column", gap: 2 }}>
- <span style={{ fontSize: 12.5, fontWeight: 600, color: "var(--fg-2)" }}>
- Arrange clips
- </span>
- <span style={{ fontSize: 11.5, color: "var(--meta)" }}>
- Drag clips below to reorder or drop new ones in
- </span>
- </div>
- ) : null}
- <div
- className={styles.viewTools}
- role="toolbar"
- aria-label="View tools"
- style={isMediaVariant ? { display: "none" } : undefined}
- >
- <VtBtn label="Add zoom" title="Add zoom (Z)" onClick={onAddZoom} disabled={!hasDoc}>
- <ZoomIn size={17} />
- </VtBtn>
- <VtBtn
- label="Auto focus"
- title="Auto focus on for all zoom"
- on={settings.autoFocusAll}
- onClick={() => {
- void set({ autoFocusAll: !settings.autoFocusAll });
- }}
- >
- <svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="1.75"
- strokeLinecap="round"
- strokeLinejoin="round"
- width={17}
- height={17}
- >
- <path d="M4 8V4h4" />
- <path d="M16 4h4v4" />
- <path d="M4 16v4h4" />
- <path d="M16 20h4v-4" />
- <path d="M6 12c1.5-2.2 3.6-3.4 6-3.4s4.5 1.2 6 3.4c-1.5 2.2-3.6 3.4-6 3.4S7.5 14.2 6 12z" />
- <circle cx="12" cy="12" r="1.6" />
- </svg>
- </VtBtn>
- <VtBtn
- label="Trim"
- title={
- pendingCutPlacement
- ? "Click on the timeline to place a 1s skip (Esc to cancel)"
- : "Arm the place-skip tool (T) — next click drops a 1s skip"
- }
- onClick={togglePlaceTrim}
- disabled={!hasDoc}
- on={pendingCutPlacement}
- >
- <Scissors size={17} />
- </VtBtn>
- <VtBtn
- label="Annotation"
- title="Press A to add annotation"
- onClick={onAddAnnotation}
- disabled={!hasDoc}
- >
- <MessageSquare size={17} />
- </VtBtn>
- <VtBtn
- label="Speed"
- title="Press S to add speed"
- onClick={onAddSpeed}
- disabled={!hasDoc}
- >
- <Timer size={17} />
- </VtBtn>
- <VtBtn label="Captions" title="Auto captions" onClick={onCaptions} disabled={!hasDoc}>
- <FileText size={17} />
- </VtBtn>
- <VtBtn
- label="Magic"
- title="Auto zoom suggestions — propose zooms over sustained speech"
- disabled={!hasDoc}
- onClick={() => void applyZoomSuggestions()}
- >
- <WandSparkles size={17} />
- </VtBtn>
- <div style={{ position: "relative" }}>
- <button
- ref={ratioButtonRef}
- type="button"
- className={styles.ratio}
- onClick={() => setRatioOpen((v) => !v)}
- aria-haspopup="menu"
- aria-expanded={ratioOpen}
- >
- <span>{getAspectRatioLabel(settings.aspectRatio)}</span>
- <ChevronDown size={10} className="caret" />
- </button>
- {ratioOpen && ratioMenuRect
- ? createPortal(
- <div
- role="menu"
- style={{
- position: "fixed",
- left: ratioMenuRect.left,
- bottom: ratioMenuRect.bottom,
- minWidth: 120,
- background: "var(--surface)",
- border: "1px solid var(--border)",
- borderRadius: "var(--r-md)",
- boxShadow: "var(--elev-pop)",
- padding: 4,
- zIndex: 1000,
- }}
- >
- {ASPECT_RATIO_PRESETS.map((r) => (
- <button
- type="button"
- key={r}
- role="menuitem"
- style={menuItemStyle(r === settings.aspectRatio)}
- disabled={!hasDoc}
- onClick={() => {
- void set({ aspectRatio: r });
- setRatioOpen(false);
- }}
- >
- {getAspectRatioLabel(r)}
- </button>
- ))}
- </div>,
- document.body,
- )
- : null}
- </div>
- </div>
- {hideTransport ? null : (
- <TransportBar
- playing={playing}
- loop={loop}
- currentTimeSec={currentTimeSec}
- clips={clips}
- onTogglePlay={onTogglePlay}
- onPrevClip={onPrevClip}
- onNextClip={onNextClip}
- onToggleLoop={onToggleLoop}
- onExpand={onExpand}
- onSeek={onSeek}
- />
- )}
- <div className={styles.hintRow} style={isMediaVariant ? { display: "none" } : undefined}>
- <span className={styles.hint}>
- <span className={styles.kbd}>Scroll</span>
- <span>Pan</span>
- </span>
- <span className={styles.hint}>
- <span className={styles.kbd}>Ctrl</span>
- <span className={styles.kbd}>+ Scroll</span>
- <span>Zoom</span>
- </span>
- <button
- type="button"
- className={styles.vtBtn}
- style={{
- marginLeft: 8,
- height: 28,
- width: "auto",
- padding: "0 10px",
- gap: 6,
- borderRadius: "var(--r-sm)",
- }}
- onClick={() => firstClip && setEditClipTarget(firstClip)}
- disabled={!firstClip}
- title={firstClip ? "Edit the first clip's in/out points" : "Add a clip first"}
- aria-label="Edit clip"
- >
- <Pencil size={14} />
- Edit clip…
- </button>
- </div>
- </header>
- <div className={styles.timelineBody}>
- {/* T10 — clip track + region lanes both live inside
- TimelinePane's .timeline-canvas, so they share the
- translateX(pan) and pxPerSec(zoom). Lanes-in-canvas,
- not lanes-in-a-sibling-column. */}
- <div className="timelinePaneWrap" style={{ flex: 1, minHeight: 0, overflow: "hidden" }}>
- <TimelinePane
- clips={clips}
- assets={tl.assets}
- trimRanges={trimRanges}
- zoomRegions={zoomRegions}
- annotationRegions={annotationRegions}
- speedRegions={speedRegions}
- regionSelection={selection}
- regionMultiSelection={multiSelection}
- currentTimeSec={currentTimeSec}
- selectedClipId={tl.clipSelection}
- onSelectClip={tl.selectClip}
- onSelectRegion={onSelectRegion}
- onSeek={onSeek}
- onInsertAsset={(assetId, index) => void tl.insertClipAt(assetId, index)}
- onMoveClip={(clipId, toIndex) => void tl.moveClip(clipId, toIndex)}
- onEditClip={(clip) => setEditClipTarget(clip)}
- onRemoveClip={(clipId) => void tl.removeClip(clipId)}
- onAddTrim={(assetId, s, e) => void tl.addTrimAt(assetId, s, e)}
- onRegionSpanChange={(id, span) => handleRegionSpanChange(id, span)}
- zoom={zoom}
- visibleStartSec={visibleStartSec}
- setZoom={setZoom}
- setVisibleStartSec={setVisibleStartSec}
- pendingCutPlacement={pendingCutPlacement}
- pendingCutPreviewSec={pendingCutPreviewSec}
- setPendingCutPreviewSec={setPendingCutPreviewSec}
- onCancelPlaceTrim={() => togglePlaceTrim()}
- />
- </div>
- </div>
- </section>
- <EditClipModal
- open={editClipTarget !== null}
- onClose={() => setEditClipTarget(null)}
- clip={editClipTarget}
- assetMeta={
- editClipAsset
- ? { label: editClipAsset.label, durationSec: editClipAsset.durationSec }
- : null
- }
- videoSources={videoSources}
- onApply={(sourceStartSec, sourceEndSec) => {
- if (editClipTarget) {
- void tl.updateClipSourceRange(editClipTarget.id, sourceStartSec, sourceEndSec);
- }
- }}
- />
- </footer>
- );
-}
-
-function VtBtn({
- label,
- title,
- onClick,
- on,
- disabled,
- children,
-}: {
- label: string;
- title: string;
- onClick?: () => void;
- on?: boolean;
- disabled?: boolean;
- children: React.ReactNode;
-}) {
- return (
- <button
- type="button"
- className={`${styles.vtBtn} ${on ? styles.isOn : ""}`}
- aria-label={label}
- aria-pressed={on}
- title={title}
- onClick={onClick}
- disabled={disabled}
- >
- {children}
- </button>
- );
-}
-
-function menuItemStyle(active: boolean): React.CSSProperties {
- return {
- display: "block",
- width: "100%",
- textAlign: "left",
- padding: "6px 10px",
- border: 0,
- background: active ? "var(--accent-wash)" : "transparent",
- color: "var(--fg-2)",
- borderRadius: "var(--r-sm)",
- cursor: "pointer",
- font: "500 12px var(--font-body)",
- };
-}
diff --git a/src/components/ai-edition/Modals.tsx b/src/components/ai-edition/Modals.tsx
index 28d966f5a..b7f74771f 100644
--- a/src/components/ai-edition/Modals.tsx
+++ b/src/components/ai-edition/Modals.tsx
@@ -329,17 +329,18 @@ export function OpenProjectModal({
);
}
-type Template = "blank" | "screen-recording" | "import" | "template";
+/** Where the editor lands once the project exists: the Media or the Rec tab. */
+export type StartingPoint = "import" | "screen-recording";
interface NewProjectModalProps extends BaseModalProps {
- onCreate: (title: string) => void;
+ onCreate: (title: string, startingPoint: StartingPoint) => void;
}
export function NewProjectModal({ open, onClose, onCreate }: NewProjectModalProps) {
const t = useScopedT("editor");
const tc = useScopedT("common");
const [title, setTitle] = useState(t("newProjectDialog.defaultTitle"));
- const [template, setTemplate] = useState<Template>("blank");
+ const [template, setTemplate] = useState<StartingPoint>("import");
return (
<ModalShell
open={open}
@@ -397,20 +398,6 @@ export function NewProjectModal({ open, onClose, onCreate }: NewProjectModalProp
>
<TemplateCell
icon={<FolderPlus size={18} />}
- title={t("newProjectDialog.templates.blankTitle")}
- desc={t("newProjectDialog.templates.blankDesc")}
- active={template === "blank"}
- onClick={() => setTemplate("blank")}
- />
- <TemplateCell
- icon={<Crop size={18} />}
- title={t("newProjectDialog.templates.screenRecordingTitle")}
- desc={t("newProjectDialog.templates.screenRecordingDesc")}
- active={template === "screen-recording"}
- onClick={() => setTemplate("screen-recording")}
- />
- <TemplateCell
- icon={<Plus size={18} />}
title={t("mediaStage.importMedia")}
desc={t("newProjectDialog.templates.importMediaDesc")}
active={template === "import"}
@@ -418,10 +405,10 @@ export function NewProjectModal({ open, onClose, onCreate }: NewProjectModalProp
/>
<TemplateCell
icon={<Crop size={18} />}
- title={t("newProjectDialog.templates.fromTemplateTitle")}
- desc={t("newProjectDialog.templates.fromTemplateDesc")}
- active={template === "template"}
- onClick={() => setTemplate("template")}
+ title={t("newProjectDialog.templates.screenRecordingTitle")}
+ desc={t("newProjectDialog.templates.screenRecordingDesc")}
+ active={template === "screen-recording"}
+ onClick={() => setTemplate("screen-recording")}
/>
</div>
</div>
@@ -446,7 +433,7 @@ export function NewProjectModal({ open, onClose, onCreate }: NewProjectModalProp
type="button"
className={`${styles.btn} ${styles.btnPrimary}`}
onClick={() => {
- onCreate(title.trim() || t("newProjectDialog.defaultTitle"));
+ onCreate(title.trim() || t("newProjectDialog.defaultTitle"), template);
onClose();
}}
>
diff --git a/src/components/ai-edition/NewEditorShell.tsx b/src/components/ai-edition/NewEditorShell.tsx
index 75aa12f1d..eb21e5752 100644
--- a/src/components/ai-edition/NewEditorShell.tsx
+++ b/src/components/ai-edition/NewEditorShell.tsx
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import type { EditorProjectData } from "@/components/video-editor/projectPersistence";
import { toFileUrl } from "@/components/video-editor/projectPersistence";
+import { useScopedT } from "@/contexts/I18nContext";
import { useShortcuts } from "@/contexts/ShortcutsContext";
import { migrateProjectDataToAxcutDocument } from "@/lib/ai-edition/document/migrate";
import {
@@ -25,6 +26,7 @@ import {
EditClipModal,
NewProjectModal,
OpenProjectModal,
+ type StartingPoint,
UnsavedChangesModal,
type UnsavedChoice,
} from "./Modals";
@@ -43,6 +45,7 @@ interface SeekTarget {
}
export function NewEditorShell() {
+ const te = useScopedT("editor");
const document = useProjectStore((s) => s.document);
const projectId = useProjectStore((s) => s.projectId);
const currentTimeSec = useProjectStore((s) => s.currentTimeSec);
@@ -629,10 +632,13 @@ export function NewEditorShell() {
[loadProject],
);
+ // The dialog's starting point picks the tab the fresh project opens on:
+ // "import" → Media (browse/drop assets), "screen-recording" → Rec (capture).
const handleCreateProject = useCallback(
- async (title: string) => {
+ async (title: string, startingPoint: StartingPoint) => {
try {
await createProject(title);
+ setMode(startingPoint === "screen-recording" ? "rec" : "media");
} catch (err) {
toast.error("Could not create project", {
description: err instanceof Error ? err.message : String(err),
@@ -1163,7 +1169,7 @@ export function NewEditorShell() {
<div className={v4.body} style={{ gridTemplateColumns: bodyColumns }}>
{mode === "edit" && chatOpen ? (
<>
- <aside className={v4.agent} aria-label="AI editor">
+ <aside className={v4.agent} aria-label={te("shell.aiEditor")}>
<LeftPanel
active="chat"
assetStatuses={assetStatuses}
@@ -1175,13 +1181,13 @@ export function NewEditorShell() {
style={{ left: chatWidthPx }}
role="separator"
aria-orientation="vertical"
- aria-label="Resize chat panel"
+ aria-label={te("shell.resizeChatPanel")}
onPointerDown={startChatResize}
/>
</>
) : null}
- <section className={v4.stage} aria-label="Preview stage">
+ <section className={v4.stage} aria-label={te("shell.previewStage")}>
{mode === "edit" ? (
<>
<div
@@ -1288,7 +1294,7 @@ export function NewEditorShell() {
className={v4.timelineResizeHandle}
role="separator"
aria-orientation="horizontal"
- aria-label="Resize timeline"
+ aria-label={te("shell.resizeTimeline")}
onPointerDown={startTimelineResize}
/>
) : null}
diff --git a/src/components/ai-edition/NewProjectModal.test.tsx b/src/components/ai-edition/NewProjectModal.test.tsx
new file mode 100644
index 000000000..614479dd6
--- /dev/null
+++ b/src/components/ai-edition/NewProjectModal.test.tsx
@@ -0,0 +1,45 @@
+import "@testing-library/jest-dom";
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import type { ReactElement } from "react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { I18nProvider } from "@/contexts/I18nContext";
+import { NewProjectModal } from "./Modals";
+
+function renderWithI18n(ui: ReactElement) {
+ return render(<I18nProvider>{ui}</I18nProvider>);
+}
+
+describe("NewProjectModal starting points", () => {
+ afterEach(() => {
+ cleanup();
+ vi.clearAllMocks();
+ });
+
+ it("offers only the two wired starting points", () => {
+ renderWithI18n(<NewProjectModal open={true} onClose={() => {}} onCreate={() => {}} />);
+
+ expect(screen.getByText(/import media/i)).toBeInTheDocument();
+ expect(screen.getByText(/screen recording/i)).toBeInTheDocument();
+ expect(screen.queryByText(/blank project/i)).not.toBeInTheDocument();
+ expect(screen.queryByText(/from template/i)).not.toBeInTheDocument();
+ });
+
+ it("creates with the import starting point by default", () => {
+ const onCreate = vi.fn();
+ renderWithI18n(<NewProjectModal open={true} onClose={() => {}} onCreate={onCreate} />);
+
+ fireEvent.click(screen.getByRole("button", { name: /create project/i }));
+
+ expect(onCreate).toHaveBeenCalledWith("Untitled project", "import");
+ });
+
+ it("creates with the screen-recording starting point once that cell is picked", () => {
+ const onCreate = vi.fn();
+ renderWithI18n(<NewProjectModal open={true} onClose={() => {}} onCreate={onCreate} />);
+
+ fireEvent.click(screen.getByText(/screen recording/i));
+ fireEvent.click(screen.getByRole("button", { name: /create project/i }));
+
+ expect(onCreate).toHaveBeenCalledWith("Untitled project", "screen-recording");
+ });
+});
diff --git a/src/components/ai-edition/Preview.tsx b/src/components/ai-edition/Preview.tsx
index 5e1c75642..057be3680 100644
--- a/src/components/ai-edition/Preview.tsx
+++ b/src/components/ai-edition/Preview.tsx
@@ -1,5 +1,6 @@
import { useEffect, useRef, useState } from "react";
import type { CameraFullscreenRegion, ZoomFocus } from "@/components/video-editor/types";
+import { useScopedT } from "@/contexts/I18nContext";
import type {
AxcutAnnotationRegion,
AxcutClip,
@@ -72,6 +73,7 @@ export function Preview({
currentTimeSec,
playing,
}: PreviewProps) {
+ const te = useScopedT("editor");
// ponytail: when the <video> fails to load (e.g. a truncated recording
// from a bad MediaRecorder capture), swap to the empty state so the user
// can import a different file instead of staring at a broken preview.
@@ -89,7 +91,7 @@ export function Preview({
return (
<section
className={styles.previewWrap}
- aria-label="Video preview"
+ aria-label={te("preview.videoPreview")}
data-testid="preview"
data-current-time-sec={currentTimeSec.toFixed(3)}
data-is-playing={playing ? "true" : "false"}
diff --git a/src/components/ai-edition/PreviewCanvas.tsx b/src/components/ai-edition/PreviewCanvas.tsx
index 8e0c0b2ae..b2985ec41 100644
--- a/src/components/ai-edition/PreviewCanvas.tsx
+++ b/src/components/ai-edition/PreviewCanvas.tsx
@@ -31,6 +31,7 @@ import {
type ZoomFocus,
} from "@/components/video-editor/types";
import { computeCameraFullscreenProgress } from "@/components/video-editor/videoPlayback/cameraFullscreenUtils";
+import { useScopedT } from "@/contexts/I18nContext";
import { resolveAspectRatioValue } from "@/lib/ai-edition/document/outputFormat";
import type {
AxcutAnnotationRegion,
@@ -102,6 +103,7 @@ const SCREEN_SOURCE_SIZE = { width: 1920, height: 1080 };
const WEBCAM_SOURCE_SIZE = { width: 960, height: 720 };
export function PreviewCanvas(props: PreviewCanvasProps) {
+ const te = useScopedT("editor");
const { settings, setLive, commit } = useEditorSettings();
const document = useProjectStore((s) => s.document);
const assets = document?.assets ?? [];
@@ -449,7 +451,7 @@ export function PreviewCanvas(props: PreviewCanvasProps) {
touchAction: "none",
}}
onPointerDown={isPipGrab ? handleWebcamPointerDown : undefined}
- aria-label="Webcam preview (drag to reposition)"
+ aria-label={te("preview.webcamPreview")}
>
<WebcamOverlay
clips={props.clips}
diff --git a/src/components/ai-edition/ProviderSettings.tsx b/src/components/ai-edition/ProviderSettings.tsx
index 9b871ef81..5dd4a0ded 100644
--- a/src/components/ai-edition/ProviderSettings.tsx
+++ b/src/components/ai-edition/ProviderSettings.tsx
@@ -33,6 +33,7 @@ import {
} from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import { toast } from "sonner";
+import { useScopedT } from "@/contexts/I18nContext";
import { nativeBridgeClient } from "@/native/client";
import type {
AiEditionDeviceChallenge,
@@ -61,6 +62,7 @@ export function ProviderSettings({
onClose,
onActiveProviderChanged,
}: ProviderSettingsProps) {
+ const te = useScopedT("editor");
const [snapshot, setSnapshot] = useState<AiEditionLlmSnapshot | null>(null);
const [mode, setMode] = useState<Mode>("list");
const [active, setActive] = useState<ProviderDefinition | null>(null);
@@ -77,12 +79,12 @@ export function ProviderSettings({
if (snap.config) setConfig(snap.config);
return snap;
} catch (err) {
- toast.error("Could not load AI settings", {
+ toast.error(te("providerSettings.loadFailed"), {
description: err instanceof Error ? err.message : String(err),
});
throw err;
}
- }, []);
+ }, [te]);
useEffect(() => {
if (!open) return;
@@ -160,7 +162,7 @@ export function ProviderSettings({
await nativeBridgeClient.aiEdition.llmSetConfig(config);
const snap = await refreshSnapshot();
onActiveProviderChanged?.(snap?.config?.provider ?? null);
- toast.success(`${active.label} saved`);
+ toast.success(te("providerSettings.saved", { provider: active.label }));
setMode("list");
setActive(null);
} catch (err) {
@@ -209,12 +211,12 @@ export function ProviderSettings({
if (result.success) {
const snap = await refreshSnapshot();
onActiveProviderChanged?.(snap?.config?.provider ?? null);
- toast.success(`${active.label} connected`);
+ toast.success(te("providerSettings.connected", { provider: active.label }));
setMode("list");
setActive(null);
setChallenge(null);
} else {
- setError(result.error ?? "Device flow failed.");
+ setError(result.error ?? te("providerSettings.deviceFlowFailed"));
}
} catch (err) {
setError(err instanceof Error ? err.message : String(err));
@@ -232,7 +234,7 @@ export function ProviderSettings({
await nativeBridgeClient.aiEdition.llmSetConfig(config);
const snap = await refreshSnapshot();
onActiveProviderChanged?.(snap?.config?.provider ?? null);
- toast.success(`${active.label} connected`);
+ toast.success(te("providerSettings.connected", { provider: active.label }));
setApiKey("");
setMode("list");
setActive(null);
@@ -251,7 +253,7 @@ export function ProviderSettings({
const result = await nativeBridgeClient.aiEdition.llmDisconnect(active.id);
const snap = result.snapshot ?? (await refreshSnapshot());
onActiveProviderChanged?.(snap.config?.provider ?? null);
- toast.success(`${active.label} disconnected`);
+ toast.success(te("providerSettings.disconnected", { provider: active.label }));
} catch (err) {
setError(err instanceof Error ? err.message : String(err));
} finally {
@@ -263,8 +265,8 @@ export function ProviderSettings({
<ModalShell
open={open}
onClose={close}
- title="AI settings"
- subtitle="Choose a provider. Credentials are stored in the OS keychain (safeStorage)."
+ title={te("providerSettings.title")}
+ subtitle={te("providerSettings.subtitle")}
wide
>
{mode === "list" ? (
@@ -311,6 +313,7 @@ function ProviderList({
activeProvider: string | null;
onPick: (def: ProviderDefinition) => void;
}) {
+ const te = useScopedT("editor");
return (
<div className={styles.providerGrid}>
{PROVIDER_DEFINITIONS.map((def) => {
@@ -328,22 +331,22 @@ function ProviderList({
{isConnected ? (
<span className={`${styles.statusPill} ${styles.ready}`}>
<Check size={10} />
- Connected
+ {te("providerSettings.pillConnected")}
</span>
) : authKindPillKind(def.authKind) === "auth" ? (
<span className={`${styles.statusPill} ${styles.auth}`}>
<LogIn size={10} />
- OAuth
+ {te("providerSettings.pillOAuth")}
</span>
) : def.authKind === "pat" ? (
<span className={`${styles.statusPill} ${styles.pat}`}>
<Plug size={10} />
- Token
+ {te("providerSettings.pillToken")}
</span>
) : (
<span className={`${styles.statusPill} ${styles.idle}`}>
<KeyIcon />
- API key
+ {te("providerSettings.pillApiKey")}
</span>
)}
</div>
@@ -418,6 +421,7 @@ function ProviderForm({
onOpenLoginPage: (uri: string) => void;
listProviderModels: (providerId: string) => Promise<{ models: string[]; error?: string }>;
}) {
+ const te = useScopedT("editor");
const showApiKeyField = def.authKind === "api-key" || (def.authKind === "pat" && !isConnected);
const showBaseUrl = def.id === "openai-compatible" || Boolean(def.baseUrl);
const isCodexOrCopilot = def.authKind === "oauth-device";
@@ -469,32 +473,35 @@ function ProviderForm({
className={styles.backBtn}
onClick={onBack}
disabled={busy}
- title="Back"
- aria-label="Back"
+ title={te("providerSettings.back")}
+ aria-label={te("providerSettings.back")}
>
<X size={14} />
- Back
+ {te("providerSettings.back")}
</button>
<h3>{def.label}</h3>
{isConnected ? (
<span className={`${styles.statusPill} ${styles.ready}`}>
<Check size={10} />
- Connected {credentialKind && credentialKind !== "api-key" ? `· ${credentialKind}` : ""}
+ {te("providerSettings.pillConnected")}{" "}
+ {credentialKind && credentialKind !== "api-key" ? `· ${credentialKind}` : ""}
</span>
) : (
- <span className={`${styles.statusPill} ${styles.idle}`}>Not connected</span>
+ <span className={`${styles.statusPill} ${styles.idle}`}>
+ {te("providerSettings.notConnected")}
+ </span>
)}
</div>
<Field
- label="Model"
+ label={te("providerSettings.modelLabel")}
hint={
modelSelectable
- ? "Models from your account, fetched live."
+ ? te("providerSettings.modelHintLive")
: modelsError
- ? `Couldn't fetch live models (${modelsError}); type a model id manually.`
+ ? te("providerSettings.modelHintError", { error: modelsError })
: supportsDynamicModels && isConnected
- ? "Loading live models…"
+ ? te("providerSettings.modelHintLoading")
: undefined
}
>
@@ -511,7 +518,9 @@ function ProviderForm({
>
{!modelOptions.includes(config?.model ?? def.defaultModel) ? (
<option value={config?.model ?? def.defaultModel}>
- {config?.model ?? def.defaultModel} (saved)
+ {te("providerSettings.modelSavedOption", {
+ model: config?.model ?? def.defaultModel,
+ })}
</option>
) : null}
{modelOptions.map((modelSlug) => (
@@ -548,13 +557,16 @@ function ProviderForm({
}}
>
<Loader2 size={10} className="animate-spin" />
- Loading models…
+ {te("providerSettings.loadingModels")}
</span>
) : null}
</Field>
{showBaseUrl ? (
- <Field label="Base URL" hint="Leave blank to use the provider's default.">
+ <Field
+ label={te("providerSettings.baseUrlLabel")}
+ hint={te("providerSettings.baseUrlHint")}
+ >
<input
type="text"
value={config?.baseUrl ?? def.baseUrl ?? ""}
@@ -571,7 +583,7 @@ function ProviderForm({
) : null}
{def.supportsReasoningEffort ? (
- <Field label="Reasoning effort">
+ <Field label={te("providerSettings.reasoningEffortLabel")}>
<select
value={config?.reasoningEffort ?? "none"}
onChange={(e) =>
@@ -593,12 +605,16 @@ function ProviderForm({
{showApiKeyField ? (
<Field
- label={def.authKind === "pat" ? "GitHub personal access token" : "API key"}
+ label={
+ def.authKind === "pat"
+ ? te("providerSettings.patLabel")
+ : te("providerSettings.apiKeyLabel")
+ }
hint={
isConnected
- ? "Stored in safeStorage. Leave blank to keep the existing entry."
+ ? te("providerSettings.apiKeyHintStored")
: def.authKind === "pat"
- ? "Paste a GitHub PAT with `copilot` scope."
+ ? te("providerSettings.patHint")
: undefined
}
>
@@ -613,8 +629,8 @@ function ProviderForm({
) : null}
<Field
- label="Project edits"
- hint="When off, the agent must ask before changing the timeline. Edits are always undoable."
+ label={te("providerSettings.projectEditsLabel")}
+ hint={te("providerSettings.projectEditsHint")}
>
<label
style={{
@@ -637,7 +653,7 @@ function ProviderForm({
})
}
/>
- Allow the agent to edit the project
+ {te("providerSettings.allowAgentEdits")}
</label>
</Field>
@@ -666,7 +682,7 @@ function ProviderForm({
disabled={busy}
>
<Unplug size={14} />
- Disconnect
+ {te("providerSettings.disconnect")}
</button>
) : null}
</div>
@@ -676,7 +692,7 @@ function ProviderForm({
onClick={onBack}
disabled={busy}
>
- Cancel
+ {te("providerSettings.cancel")}
</button>
{isConnected ? (
<button
@@ -686,7 +702,7 @@ function ProviderForm({
disabled={busy || !config}
>
{busy ? <Loader2 size={14} className="animate-spin" /> : <Check size={14} />}
- Save
+ {te("providerSettings.save")}
</button>
) : isCodexOrCopilot ? (
<button
@@ -696,7 +712,7 @@ function ProviderForm({
disabled={busy || !config}
>
{busy ? <Loader2 size={14} className="animate-spin" /> : <LogIn size={14} />}
- {isConnected ? "Reconnect" : "Start login"}
+ {isConnected ? te("providerSettings.reconnect") : te("providerSettings.startLogin")}
</button>
) : def.authKind === "pat" && onPatConnect ? (
<button
@@ -706,7 +722,7 @@ function ProviderForm({
disabled={busy || !apiKey.trim() || !config}
>
{busy ? <Loader2 size={14} className="animate-spin" /> : <Plug size={14} />}
- Connect
+ {te("providerSettings.connect")}
</button>
) : (
<button
@@ -716,7 +732,7 @@ function ProviderForm({
disabled={busy || !apiKey.trim() || !config}
>
{busy ? <Loader2 size={14} className="animate-spin" /> : <Check size={14} />}
- {apiKey.trim() ? "Save & use" : "Save"}
+ {apiKey.trim() ? te("providerSettings.saveAndUse") : te("providerSettings.save")}
</button>
)}
</div>
@@ -735,6 +751,7 @@ function DeviceChallengePanel({
providerLabel: string;
onOpenLoginPage: (uri: string) => void;
}) {
+ const te = useScopedT("editor");
const [copied, setCopied] = useState(false);
const onCopy = async () => {
@@ -759,11 +776,12 @@ function DeviceChallengePanel({
data-testid="device-challenge-panel"
>
<div>
- <strong>{busy ? "Completing sign-in…" : "Browser login pending"}</strong>
- <p>
- Open the {providerLabel} login page and enter this code. We’ll finish connecting
- automatically once you authorize.
- </p>
+ <strong>
+ {busy
+ ? te("providerSettings.completingSignIn")
+ : te("providerSettings.browserLoginPending")}
+ </strong>
+ <p>{te("providerSettings.deviceCodeInstructions", { provider: providerLabel })}</p>
</div>
<div className={styles.authCodeRow}>
<code data-testid="device-user-code">{challenge.userCode}</code>
@@ -771,12 +789,12 @@ function DeviceChallengePanel({
type="button"
className={`${styles.btn} ${styles.btnSecondary}`}
onClick={onCopy}
- title="Copy code"
- aria-label="Copy code"
+ title={te("providerSettings.copyCode")}
+ aria-label={te("providerSettings.copyCode")}
disabled={busy}
>
{copied ? <Check size={14} /> : <Copy size={14} />}
- {copied ? "Copied" : "Copy code"}
+ {copied ? te("providerSettings.copied") : te("providerSettings.copyCode")}
</button>
</div>
<div>
@@ -791,7 +809,7 @@ function DeviceChallengePanel({
}}
>
<ExternalLink size={14} />
- Open login page
+ {te("providerSettings.openLoginPage")}
</a>
</div>
</div>
diff --git a/src/components/ai-edition/RegionTimeline.tsx b/src/components/ai-edition/RegionTimeline.tsx
deleted file mode 100644
index e9283e101..000000000
--- a/src/components/ai-edition/RegionTimeline.tsx
+++ /dev/null
@@ -1,312 +0,0 @@
-import {
- type DragEndEvent,
- type DragMoveEvent,
- type ResizeEndEvent,
- type ResizeMoveEvent,
- type Span,
- TimelineContext,
- useItem,
- useRow,
- useTimelineContext,
-} from "dnd-timeline";
-
-export type { Span };
-
-import { Children, createContext, useCallback, useContext, useState } from "react";
-import { formatMs } from "@/lib/ai-edition/timeline/format";
-import styles from "./NewEditorShell.module.css";
-
-// Zoom/annotation/speed lanes, made draggable + resizable via dnd-timeline
-// (already a dependency — see OpenScreen's old TimelineWrapper.tsx/Item.tsx/
-// Row.tsx on `main` for the reference this ports): clamp-to-bounds +
-// collision-clamp against sibling spans, plus the F2.6 snap-guide and
-// floating drag tooltip during live drag/resize (parity with the clip
-// timeline's T24/T25).
-
-// F2.6 — the span currently being dragged/resized, resolved through the same
-// clamp pipeline as the final drop. The surface renders guides + tooltip.
-const LiveSpanContext = createContext<{ id: string; span: Span } | null>(null);
-
-const MIN_ITEM_DURATION_MS = 100;
-
-interface RegionSpanRef {
- id: string;
- // ponytail: scopes collision to the same lane — zoom and speed rows are
- // independent tracks, so a zoom over a speed range (or vice versa) is fine.
- rowId: string;
- start: number;
- end: number;
-}
-
-function clamp(value: number, min: number, max: number): number {
- return Math.min(max, Math.max(min, value));
-}
-
-interface RegionTimelineProviderProps {
- totalMs: number;
- // Spans that must not overlap each other (zoom, speed). Annotation spans
- // are intentionally excluded — multiple annotations may overlap.
- collidableSpans: RegionSpanRef[];
- onItemSpanChange: (id: string, span: Span) => void;
- children: React.ReactNode;
-}
-
-export function RegionTimelineProvider({
- totalMs,
- collidableSpans,
- onItemSpanChange,
- children,
-}: RegionTimelineProviderProps) {
- const safeTotalMs = Math.max(totalMs, 1);
-
- const clampSpanToBounds = useCallback(
- (span: Span): Span => {
- const rawDuration = Math.max(span.end - span.start, 0);
- const duration = Math.min(Math.max(rawDuration, MIN_ITEM_DURATION_MS), safeTotalMs);
- const start = clamp(span.start, 0, safeTotalMs - duration);
- return { start, end: start + duration };
- },
- [safeTotalMs],
- );
-
- const hasOverlap = useCallback(
- (span: Span, excludeId: string, rowId: string) =>
- collidableSpans.some(
- (r) => r.id !== excludeId && r.rowId === rowId && span.end > r.start && span.start < r.end,
- ),
- [collidableSpans],
- );
-
- const clampToNeighbours = useCallback(
- (span: Span, activeItemId: string, rowId: string): Span => {
- const siblings = collidableSpans.filter((r) => r.id !== activeItemId && r.rowId === rowId);
- let { start, end } = span;
- for (const r of siblings) {
- if (end > r.start && start < r.start) end = r.start;
- if (start < r.end && end > r.end) start = r.end;
- }
- if (end - start < MIN_ITEM_DURATION_MS) {
- if (end + MIN_ITEM_DURATION_MS - (end - start) <= safeTotalMs) {
- end = start + MIN_ITEM_DURATION_MS;
- } else {
- start = end - MIN_ITEM_DURATION_MS;
- }
- }
- return { start: Math.max(0, start), end: Math.min(end, safeTotalMs) };
- },
- [collidableSpans, safeTotalMs],
- );
-
- const resolveSpan = useCallback(
- (rawSpan: Span, activeItemId: string): Span | null => {
- // Resolve the active item's row from the collidable set. Annotations
- // are intentionally not in it, so missing here means "no collision
- // rules apply" (annotations may freely overlap).
- const activeRow = collidableSpans.find((r) => r.id === activeItemId)?.rowId;
- if (!activeRow) return clampSpanToBounds(rawSpan);
- let span = clampSpanToBounds(rawSpan);
- if (hasOverlap(span, activeItemId, activeRow)) {
- span = clampToNeighbours(span, activeItemId, activeRow);
- if (hasOverlap(span, activeItemId, activeRow)) return null;
- }
- return span;
- },
- [clampSpanToBounds, clampToNeighbours, hasOverlap, collidableSpans],
- );
-
- const [liveSpan, setLiveSpan] = useState<{ id: string; span: Span } | null>(null);
-
- const onResizeEnd = useCallback(
- (event: ResizeEndEvent) => {
- setLiveSpan(null);
- const updatedSpan = event.active.data.current.getSpanFromResizeEvent?.(event);
- if (!updatedSpan) return;
- const activeItemId = event.active.id as string;
- const span = resolveSpan(updatedSpan, activeItemId);
- if (span) onItemSpanChange(activeItemId, span);
- },
- [onItemSpanChange, resolveSpan],
- );
-
- const onDragEnd = useCallback(
- (event: DragEndEvent) => {
- setLiveSpan(null);
- if (!event.over) return;
- const updatedSpan = event.active.data.current.getSpanFromDragEvent?.(event);
- if (!updatedSpan) return;
- const activeItemId = event.active.id as string;
- const span = resolveSpan(updatedSpan, activeItemId);
- if (span) onItemSpanChange(activeItemId, span);
- },
- [onItemSpanChange, resolveSpan],
- );
-
- // F2.6 — live feedback while the pointer is still down. The resolved span
- // is what would be committed on release, so the guide/tooltip show the
- // clamped values (not the raw pointer position).
- const onResizeMove = useCallback(
- (event: ResizeMoveEvent) => {
- const updatedSpan = event.active.data.current.getSpanFromResizeEvent?.(event);
- if (!updatedSpan) return;
- const activeItemId = event.active.id as string;
- const span = resolveSpan(updatedSpan, activeItemId);
- if (span) setLiveSpan({ id: activeItemId, span });
- },
- [resolveSpan],
- );
-
- const onDragMove = useCallback(
- (event: DragMoveEvent) => {
- const updatedSpan = event.active.data.current.getSpanFromDragEvent?.(event);
- if (!updatedSpan) return;
- const activeItemId = event.active.id as string;
- const span = resolveSpan(updatedSpan, activeItemId);
- if (span) setLiveSpan({ id: activeItemId, span });
- },
- [resolveSpan],
- );
-
- return (
- <TimelineContext
- range={{ start: 0, end: safeTotalMs }}
- // Range is read-only for the regions surface (zoom/pan live on the clip track).
- onRangeChanged={() => {
- // intentionally empty
- }}
- onResizeMove={onResizeMove}
- onResizeEnd={onResizeEnd}
- onDragMove={onDragMove}
- onDragEnd={onDragEnd}
- onDragCancel={() => setLiveSpan(null)}
- >
- <LiveSpanContext.Provider value={liveSpan}>{children}</LiveSpanContext.Provider>
- </TimelineContext>
- );
-}
-
-export function RegionTimelineSurface({
- pxPerSec,
- totalMs,
- children,
-}: {
- // Lane pill positions come from dnd-timeline in ms, and the library maps
- // 1 px = range / timelineWidth. We set the surface width to totalMs*pxPerSec
- // so dnd-timeline naturally maps 1 ms = pxPerSec/1000 px — same as the
- // timeline ruler ticks — keeping pills aligned with the clip track at any
- // zoom. Lanes do not share the clip track's horizontal-scroll container;
- // at very long timelines (>30s) they sit fully visible while the clip
- // track scrolls. See roadmap P3 for the full shared-scroll follow-up.
- pxPerSec: number;
- totalMs: number;
- children: React.ReactNode;
-}) {
- const { setTimelineRef, style } = useTimelineContext();
- const liveSpan = useContext(LiveSpanContext);
- const msToPx = pxPerSec / 1000;
- return (
- <div
- ref={setTimelineRef}
- style={{
- ...style,
- position: "relative",
- width: (Math.max(totalMs, 1) * pxPerSec) / 1000,
- }}
- className={styles.laneSurface}
- >
- {children}
- {liveSpan ? (
- <>
- <div className={styles.laneSnapGuide} style={{ left: liveSpan.span.start * msToPx }} />
- <div className={styles.laneSnapGuide} style={{ left: liveSpan.span.end * msToPx }} />
- <div className={styles.laneDragTooltip} style={{ left: liveSpan.span.end * msToPx + 6 }}>
- {formatMs(liveSpan.span.start)} – {formatMs(liveSpan.span.end)}
- </div>
- </>
- ) : null}
- </div>
- );
-}
-
-export function RegionRow({
- id,
- empty,
- children,
-}: {
- id: string;
- empty?: string;
- children: React.ReactNode;
-}) {
- const { setNodeRef, rowStyle, rowWrapperStyle } = useRow({ id });
- // v4 design: the lane's watermark label only shows while the lane is empty —
- // once it holds pills, the label is hidden (design skipsLaneLabel etc.).
- const hasChildren = Children.count(children) > 0;
- return (
- <div style={rowWrapperStyle} className={styles.laneTrackRow}>
- {empty && !hasChildren ? <span className={styles.laneEmpty}>{empty}</span> : null}
- <div ref={setNodeRef} style={rowStyle}>
- {children}
- </div>
- </div>
- );
-}
-
-interface RegionItemProps {
- id: string;
- rowId: string;
- span: Span;
- label: string;
- icon: React.ReactNode;
- selected: boolean;
- /** F2.7 — `additive` is true on shift-click (adds to the multi-selection). */
- onSelect: (additive: boolean) => void;
- variant: "zoom" | "annotation" | "speed" | "trim";
-}
-
-export function RegionItem({
- id,
- rowId,
- span,
- label,
- icon,
- selected,
- onSelect,
- variant,
-}: RegionItemProps) {
- const { setNodeRef, listeners, attributes, itemStyle, itemContentStyle } = useItem({
- id,
- span,
- data: { rowId },
- });
- const pillClass =
- variant === "zoom"
- ? styles.zoomPill
- : variant === "speed"
- ? styles.speedPill
- : variant === "trim"
- ? styles.trimPill
- : styles.annotationPill;
- return (
- <div
- ref={setNodeRef}
- style={{ ...itemStyle, height: "100%", minWidth: 12 }}
- {...listeners}
- {...attributes}
- onPointerDownCapture={(event) => onSelect(event.shiftKey)}
- >
- <div style={{ ...itemContentStyle, height: "100%", minWidth: 24 }}>
- <div
- className={selected ? `${pillClass} ${styles.lanePillSelected}` : pillClass}
- // The pill's own CSS is written for absolute left/top-50% placement
- // inside the old static `.laneTrack`; here dnd-timeline's outer
- // divs already own absolute positioning + width, so the pill just
- // fills that box.
- style={{ position: "relative", top: 0, transform: "none", width: "100%", height: "100%" }}
- title={label}
- >
- {icon}
- <span className={styles.pillValue}>{label}</span>
- </div>
- </div>
- </div>
- );
-}
diff --git a/src/components/ai-edition/RightPanelStack.tsx b/src/components/ai-edition/RightPanelStack.tsx
deleted file mode 100644
index 134e14850..000000000
--- a/src/components/ai-edition/RightPanelStack.tsx
+++ /dev/null
@@ -1,786 +0,0 @@
-import {
- Brackets,
- Crop,
- LayoutPanelTop,
- MousePointerClick,
- Palette,
- Sliders,
- Sparkles,
- Trash2,
-} from "lucide-react";
-import { useCallback, useEffect, useState } from "react";
-import { toast } from "sonner";
-import { parseCustomPlaybackSpeedInput } from "@/components/video-editor/customPlaybackSpeed";
-import {
- MAX_NATIVE_PLAYBACK_RATE,
- MAX_PLAYBACK_SPEED,
- MAX_ZOOM_SCALE,
- MIN_ZOOM_SCALE,
- SPEED_OPTIONS,
- ZOOM_DEPTH_SCALES,
- type ZoomDepth,
-} from "@/components/video-editor/types";
-import type {
- AxcutAnnotationRegion,
- AxcutAsset,
- AxcutClip,
- AxcutDocument,
- AxcutTranscript,
- AxcutTrimRange,
-} from "@/lib/ai-edition/schema";
-import { useProjectStore } from "@/lib/ai-edition/store/projectStore";
-import styles from "./NewEditorShell.module.css";
-import {
- BackgroundPane,
- CursorPane,
- LayoutPane,
- type RightPaneId,
- TimelinePaneBody,
- TranscriptPane,
- VideoEffectsPane,
-} from "./RightPanes";
-
-type RegionKind = "zoom" | "trim" | "annotation" | "speed" | "cameraFullscreen";
-
-interface RegionHandle {
- kind: RegionKind;
- id: string;
-}
-
-interface RightPanelStackProps {
- active: RightPaneId;
- onChange: (id: RightPaneId) => void;
- onCrop: () => void;
- transcripts: AxcutTranscript[];
- assets: AxcutAsset[];
- clips: AxcutClip[];
- trimRanges: AxcutTrimRange[];
- busy: boolean;
- currentTimeSec: number;
- onSeek: (sec: number) => void;
- onAddTrimRange: (assetId: string, startSec: number, endSec: number, reason: string) => void;
- onRemoveTrimRange: (trimId: string) => void;
- onTranscribe: () => void;
- canTranscribe: boolean;
- isTranscribing: boolean;
- selection?: RegionHandle | null;
- onClearSelection?: () => void;
- onRemoveSelection?: (kind: RegionKind, id: string) => void;
-}
-
-const RAIL_BUTTONS: Array<{
- id: RightPaneId;
- label: string;
- icon: React.ElementType;
-}> = [
- { id: "background", label: "Background", icon: Palette },
- { id: "effects", label: "Video effects", icon: Sliders },
- { id: "layout", label: "Layout", icon: LayoutPanelTop },
- { id: "cursor", label: "Cursor", icon: MousePointerClick },
- { id: "timeline", label: "Timeline", icon: Brackets },
- { id: "transcript", label: "Transcription", icon: Sparkles },
-];
-
-export function RightPanelStack({
- active,
- onChange,
- onCrop,
- transcripts,
- assets,
- clips,
- trimRanges,
- busy,
- currentTimeSec,
- onSeek,
- onAddTrimRange,
- onRemoveTrimRange,
- onTranscribe,
- canTranscribe,
- isTranscribing,
- selection,
- onClearSelection,
- onRemoveSelection,
-}: RightPanelStackProps) {
- const document = useProjectStore((s) => s.document);
-
- // Region inspector
- if (selection && onClearSelection && onRemoveSelection && document) {
- return (
- <RegionInspector
- document={document}
- selection={selection}
- onClear={onClearSelection}
- onRemove={onRemoveSelection}
- />
- );
- }
-
- return (
- <>
- <div className={`${styles.rightStack}`}>
- {active === "background" ? <BackgroundPane /> : null}
- {active === "transcript" ? (
- <TranscriptPane
- transcripts={transcripts}
- assets={assets}
- clips={clips}
- trimRanges={trimRanges}
- busy={busy}
- currentTimeSec={currentTimeSec}
- onSeek={onSeek}
- onAddTrimRange={onAddTrimRange}
- onRemoveTrimRange={onRemoveTrimRange}
- onTranscribe={onTranscribe}
- canTranscribe={canTranscribe}
- isTranscribing={isTranscribing}
- />
- ) : null}
- {active === "effects" ? <VideoEffectsPane /> : null}
- {active === "layout" ? <LayoutPane /> : null}
- {active === "cursor" ? <CursorPane /> : null}
- {active === "timeline" ? <TimelinePaneBody /> : null}
- </div>
- <aside className={`${styles.rail} ${styles.rightRail}`} aria-label="Right tools">
- {RAIL_BUTTONS.map(({ id, label, icon: Icon }) => (
- <button
- type="button"
- key={id}
- title={label}
- aria-label={label}
- aria-pressed={active === id}
- onClick={() => onChange(id)}
- >
- <Icon size={18} />
- </button>
- ))}
- <span className={styles.sepH} aria-hidden />
- <button type="button" title="Crop video" aria-label="Crop video" onClick={onCrop}>
- <Crop size={18} />
- </button>
- </aside>
- </>
- );
-}
-
-function RegionInspector({
- document,
- selection,
- onClear,
- onRemove,
-}: {
- document: AxcutDocument;
- selection: RegionHandle;
- onClear: () => void;
- onRemove: (kind: RegionKind, id: string) => void;
-}) {
- const setDocument = useProjectStore((s) => s.setDocument);
- const saveDocument = useProjectStore((s) => s.saveDocument);
-
- const region =
- selection.kind === "zoom"
- ? document.zoomRanges.find((z) => z.id === selection.id)
- : selection.kind === "annotation"
- ? document.annotations.find((a) => a.id === selection.id)
- : selection.kind === "speed"
- ? (
- (document.legacyEditor as { speedRegions?: Array<{ id: string; speed: number }> })
- ?.speedRegions ?? []
- ).find((s) => s.id === selection.id)
- : null;
-
- const depthNames = ["1.25×", "1.5×", "1.8×", "2.2×", "3.5×", "5×"];
- const zoomRegion =
- selection.kind === "zoom"
- ? (region as { depth?: ZoomDepth; customScale?: number } | undefined)
- : undefined;
- const zoomDepth = zoomRegion?.depth ?? 3;
- // ponytail: matches main's SettingsPanel `effectiveScale` — a custom slider
- // value overrides the depth preset, so no preset button is highlighted
- // unless the value happens to equal one exactly.
- const effectiveZoomScale = zoomRegion?.customScale ?? ZOOM_DEPTH_SCALES[zoomDepth];
- const currentDepth = depthNames.findIndex(
- (_, i) => ZOOM_DEPTH_SCALES[(i + 1) as ZoomDepth] === effectiveZoomScale,
- );
-
- const speedValue = selection.kind === "speed" ? ((region as { speed?: number })?.speed ?? 1) : 1;
- // ponytail: mirrors main's CustomSpeedInput — the text field shows a draft
- // string, empty whenever the current value exactly matches a preset (so
- // the input looks "unused" while a preset is active), and only commits on
- // blur/Enter after validating range via parseCustomPlaybackSpeedInput.
- const [speedDraft, setSpeedDraft] = useState("");
- useEffect(() => {
- setSpeedDraft(SPEED_OPTIONS.some((o) => o.speed === speedValue) ? "" : String(speedValue));
- }, [speedValue]);
-
- // ponytail: keep rapid text edits in local state and flush on blur so we
- // don't push an undo snapshot per keystroke.
- const annot =
- region && selection.kind === "annotation" ? (region as AxcutAnnotationRegion) : null;
- const annotText = annot?.textContent || annot?.content || "";
- const [textDraft, setTextDraft] = useState(annotText);
- useEffect(() => {
- setTextDraft(annotText);
- }, [annotText]);
- const flushText = useCallback(() => {
- if (!annot) return;
- if (textDraft === (annot.textContent || annot.content || "")) return;
- const next = document.annotations.map((a) =>
- a.id === selection.id ? { ...a, textContent: textDraft, content: textDraft } : a,
- );
- setDocument({ ...document, annotations: next });
- void saveDocument({ ...document, annotations: next });
- }, [annot, textDraft, document, selection.id, setDocument, saveDocument]);
-
- // Shared save path for the inspector's annotation controls (style, figure
- // and blur sub-objects) — one undo snapshot per change.
- const patchAnnotation = useCallback(
- (patch: (a: AxcutAnnotationRegion) => AxcutAnnotationRegion) => {
- const next = document.annotations.map((a) =>
- a.id === selection.id ? patch(a as AxcutAnnotationRegion) : a,
- );
- setDocument({ ...document, annotations: next });
- void saveDocument({ ...document, annotations: next });
- },
- [document, selection.id, setDocument, saveDocument],
- );
-
- // Speed regions live outside the schema (`legacyEditor.speedRegions`, see
- // useTimeline.ts) — same escape hatch pattern, so patch it directly here.
- const patchSpeed = useCallback(
- (speed: number) => {
- const legacy = (document.legacyEditor as Record<string, unknown>) ?? {};
- const prev = ((legacy.speedRegions as unknown[]) ?? []) as Array<{
- id: string;
- startMs: number;
- endMs: number;
- speed: number;
- }>;
- const next = {
- ...document,
- legacyEditor: {
- ...legacy,
- speedRegions: prev.map((s) => (s.id === selection.id ? { ...s, speed } : s)),
- },
- };
- setDocument(next);
- void saveDocument(next);
- },
- [document, selection.id, setDocument, saveDocument],
- );
-
- return (
- <div style={{ display: "grid", gridTemplateRows: "auto 1fr", minHeight: 0 }}>
- <header className={styles.paneHead}>
- <h2>{kindLabel(selection.kind)}</h2>
- <span style={{ marginLeft: "auto", display: "inline-flex", gap: 4 }}>
- <button
- type="button"
- className={styles.iconBtn}
- title="Deselect"
- aria-label="Deselect"
- onClick={onClear}
- >
- ×
- </button>
- </span>
- </header>
- <div className={styles.paneBody}>
- {selection.kind === "zoom" ? (
- <>
- <div
- style={{
- display: "grid",
- gridTemplateColumns: "repeat(3, 1fr)",
- gap: 6,
- marginBottom: 12,
- }}
- >
- {depthNames.map((label, i) => (
- <button
- type="button"
- key={label}
- onClick={() => {
- if (!region) return;
- const next = document.zoomRanges.map((z) =>
- z.id === selection.id
- ? { ...z, depth: (i + 1) as 1 | 2 | 3 | 4 | 5 | 6, customScale: undefined }
- : z,
- ) as AxcutDocument["zoomRanges"];
- // ponytail: single discrete click — go through editor
- // mutation/undo path. Persist immediately to disk.
- setDocument({ ...document, zoomRanges: next });
- void saveDocument({ ...document, zoomRanges: next });
- }}
- style={{
- padding: "6px 8px",
- border: `1px solid ${currentDepth === i ? "var(--accent)" : "var(--border)"}`,
- borderRadius: 8,
- background: currentDepth === i ? "var(--accent-wash)" : "var(--bg)",
- color: "var(--fg-2)",
- font: "500 12px/1 var(--font-mono)",
- cursor: "pointer",
- }}
- >
- {label}
- </button>
- ))}
- </div>
- <Field label={`Scale — ${effectiveZoomScale.toFixed(2)}×`}>
- <input
- type="range"
- min={MIN_ZOOM_SCALE}
- max={MAX_ZOOM_SCALE}
- step={0.01}
- value={effectiveZoomScale}
- onChange={(e) => {
- if (!region) return;
- const scale = Number(e.target.value);
- const next = document.zoomRanges.map((z) =>
- z.id === selection.id ? { ...z, customScale: scale } : z,
- ) as AxcutDocument["zoomRanges"];
- // ponytail: live-only while dragging — mirrors the
- // zoom-focus-overlay drag fix (setDocument, no IPC
- // save, per pixel). Commits on release below.
- setDocument({ ...document, zoomRanges: next });
- }}
- onMouseUp={() => void saveDocument(document)}
- onTouchEnd={() => void saveDocument(document)}
- style={{ width: "100%" }}
- />
- </Field>
- {region ? (
- <div
- style={{
- font: "500 11px/1.4 var(--font-mono)",
- color: "var(--muted)",
- padding: "0 4px",
- }}
- >
- {Math.round((region as { startMs: number }).startMs)}ms —{" "}
- {Math.round((region as { endMs: number }).endMs)}ms
- </div>
- ) : null}
- </>
- ) : selection.kind === "annotation" ? (
- annot ? (
- <>
- <textarea
- value={textDraft}
- onChange={(e) => setTextDraft(e.target.value)}
- onBlur={flushText}
- style={{
- width: "100%",
- minHeight: 80,
- padding: "8px 10px",
- border: "1px solid var(--border)",
- borderRadius: 8,
- background: "var(--bg)",
- color: "var(--fg-2)",
- font: "400 13px/1.5 var(--font-body)",
- outline: "none",
- resize: "vertical",
- }}
- />
- <div
- style={{
- display: "flex",
- justifyContent: "space-between",
- alignItems: "center",
- marginTop: 4,
- marginBottom: 12,
- }}
- >
- <span>{annot.type}</span>
- <span style={{ font: "500 10px/1 var(--font-mono)", color: "var(--muted)" }}>
- {Math.round(annot.startMs)}ms — {Math.round(annot.endMs)}ms
- </span>
- </div>
- <Field label="Text color">
- <input
- type="color"
- value={annot.style?.color ?? "#ffffff"}
- onChange={(e) => {
- const next = document.annotations.map((a) =>
- a.id === selection.id
- ? { ...a, style: { ...a.style, color: e.target.value } }
- : a,
- );
- setDocument({ ...document, annotations: next });
- void saveDocument({ ...document, annotations: next });
- }}
- style={{
- width: "100%",
- height: 32,
- border: "1px solid var(--border)",
- borderRadius: 6,
- background: "var(--bg)",
- }}
- />
- </Field>
- <Field label="Font size">
- <select
- value={String(annot.style?.fontSize ?? 32)}
- onChange={(e) => {
- const next = document.annotations.map((a) =>
- a.id === selection.id
- ? { ...a, style: { ...a.style, fontSize: Number(e.target.value) } }
- : a,
- );
- setDocument({ ...document, annotations: next });
- void saveDocument({ ...document, annotations: next });
- }}
- style={selectStyle()}
- >
- {[12, 14, 16, 18, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 96, 128].map(
- (n) => (
- <option key={n} value={n}>
- {n} px
- </option>
- ),
- )}
- </select>
- </Field>
- <Field label="Animation">
- <select
- value={annot.style?.textAnimation ?? "none"}
- onChange={(e) => {
- const next = document.annotations.map((a) =>
- a.id === selection.id
- ? {
- ...a,
- style: { ...a.style, textAnimation: e.target.value as never },
- }
- : a,
- );
- setDocument({ ...document, annotations: next });
- void saveDocument({ ...document, annotations: next });
- }}
- style={selectStyle()}
- >
- {["none", "fade", "rise", "pop", "slide-left", "typewriter", "pulse"].map((a) => (
- <option key={a} value={a}>
- {a}
- </option>
- ))}
- </select>
- </Field>
- <Field label="Font family">
- <select
- value={annot.style?.fontFamily ?? "Inter"}
- onChange={(e) =>
- patchAnnotation((a) => ({
- ...a,
- style: { ...a.style, fontFamily: e.target.value },
- }))
- }
- style={selectStyle()}
- >
- <option value="Inter">Inter</option>
- <option value="JetBrains Mono">Mono</option>
- <option value="Georgia">Serif</option>
- </select>
- </Field>
- {annot.type === "figure" ? (
- <>
- <Field label="Arrow direction">
- <select
- value={annot.figureData?.arrowDirection ?? "right"}
- onChange={(e) =>
- patchAnnotation((a) => ({
- ...a,
- figureData: {
- arrowDirection: e.target.value as NonNullable<
- AxcutAnnotationRegion["figureData"]
- >["arrowDirection"],
- color: a.figureData?.color ?? "#34B27B",
- strokeWidth: a.figureData?.strokeWidth ?? 4,
- },
- }))
- }
- style={selectStyle()}
- >
- {[
- "up",
- "down",
- "left",
- "right",
- "up-right",
- "up-left",
- "down-right",
- "down-left",
- ].map((d) => (
- <option key={d} value={d}>
- {d}
- </option>
- ))}
- </select>
- </Field>
- <Field label={`Stroke width — ${annot.figureData?.strokeWidth ?? 4}px`}>
- <input
- type="range"
- min={1}
- max={16}
- step={1}
- value={annot.figureData?.strokeWidth ?? 4}
- onChange={(e) =>
- patchAnnotation((a) => ({
- ...a,
- figureData: {
- arrowDirection: a.figureData?.arrowDirection ?? "right",
- color: a.figureData?.color ?? "#34B27B",
- strokeWidth: Number(e.target.value),
- },
- }))
- }
- style={{ width: "100%" }}
- />
- </Field>
- </>
- ) : null}
- {annot.type === "blur" ? (
- <>
- <Field label="Mode">
- <select
- value={annot.blurData?.type ?? "mosaic"}
- onChange={(e) =>
- patchAnnotation((a) => ({
- ...a,
- blurData: {
- type: e.target.value as "blur" | "mosaic",
- shape: a.blurData?.shape ?? "rectangle",
- color: a.blurData?.color ?? "white",
- intensity: a.blurData?.intensity ?? 12,
- blockSize: a.blurData?.blockSize ?? 12,
- },
- }))
- }
- style={selectStyle()}
- >
- <option value="mosaic">Mosaic</option>
- <option value="blur">Blur</option>
- </select>
- </Field>
- {(annot.blurData?.type ?? "mosaic") === "blur" ? (
- <Field label={`Blur radius — ${annot.blurData?.intensity ?? 12}px`}>
- <input
- type="range"
- min={2}
- max={40}
- step={1}
- value={annot.blurData?.intensity ?? 12}
- onChange={(e) =>
- patchAnnotation((a) => ({
- ...a,
- blurData: {
- type: a.blurData?.type ?? "mosaic",
- shape: a.blurData?.shape ?? "rectangle",
- color: a.blurData?.color ?? "white",
- intensity: Number(e.target.value),
- blockSize: a.blurData?.blockSize ?? 12,
- },
- }))
- }
- style={{ width: "100%" }}
- />
- </Field>
- ) : (
- <Field label={`Mosaic size — ${annot.blurData?.blockSize ?? 12}px`}>
- <input
- type="range"
- min={4}
- max={48}
- step={2}
- value={annot.blurData?.blockSize ?? 12}
- onChange={(e) =>
- patchAnnotation((a) => ({
- ...a,
- blurData: {
- type: a.blurData?.type ?? "mosaic",
- shape: a.blurData?.shape ?? "rectangle",
- color: a.blurData?.color ?? "white",
- intensity: a.blurData?.intensity ?? 12,
- blockSize: Number(e.target.value),
- },
- }))
- }
- style={{ width: "100%" }}
- />
- </Field>
- )}
- </>
- ) : null}
- </>
- ) : null
- ) : selection.kind === "trim" ? (
- <div
- style={{ font: "500 12px var(--font-body)", color: "var(--muted)", padding: "0 4px" }}
- >
- Trim region — drag the handles in the timeline to resize. Press Del to remove the cut.
- </div>
- ) : region ? (
- <>
- <div
- style={{
- font: "500 11px/1.4 var(--font-mono)",
- color: "var(--muted)",
- padding: "0 4px",
- marginBottom: 8,
- }}
- >
- {Math.round((region as { startMs: number }).startMs)}ms —{" "}
- {Math.round((region as { endMs: number }).endMs)}ms
- </div>
- <Field label={`Speed — ${speedValue}×`}>
- <div
- style={{
- display: "grid",
- gridTemplateColumns: "repeat(5, 1fr)",
- gap: 6,
- marginBottom: 8,
- }}
- >
- {SPEED_OPTIONS.map((option) => (
- <button
- type="button"
- key={option.label}
- onClick={() => patchSpeed(option.speed)}
- style={{
- padding: "6px 4px",
- border: `1px solid ${speedValue === option.speed ? "var(--accent)" : "var(--border)"}`,
- borderRadius: 8,
- background: speedValue === option.speed ? "var(--accent-wash)" : "var(--bg)",
- color: "var(--fg-2)",
- font: "500 11px/1 var(--font-mono)",
- cursor: "pointer",
- }}
- >
- {option.label}
- </button>
- ))}
- </div>
- <input
- type="text"
- inputMode="decimal"
- placeholder={`${speedValue}×`}
- value={speedDraft}
- onChange={(e) => setSpeedDraft(e.target.value)}
- onBlur={() => {
- const result = parseCustomPlaybackSpeedInput(speedDraft);
- if (result.status === "valid") patchSpeed(result.speed);
- else {
- if (result.status === "too-fast")
- toast.error(`Speed can't exceed ${MAX_PLAYBACK_SPEED}×.`);
- setSpeedDraft(
- SPEED_OPTIONS.some((o) => o.speed === speedValue) ? "" : String(speedValue),
- );
- }
- }}
- onKeyDown={(e) => {
- if (e.key !== "Enter") return;
- const result = parseCustomPlaybackSpeedInput(speedDraft);
- if (result.status === "valid") patchSpeed(result.speed);
- else if (result.status === "too-fast")
- toast.error(`Speed can't exceed ${MAX_PLAYBACK_SPEED}×.`);
- e.currentTarget.blur();
- }}
- style={{ width: "100%" }}
- />
- {speedValue > MAX_NATIVE_PLAYBACK_RATE ? (
- <p
- style={{
- margin: "6px 0 0",
- font: "400 10px/1.4 var(--font-sans)",
- color: "var(--fg-2)",
- }}
- >
- {`Above ${MAX_NATIVE_PLAYBACK_RATE}× the preview plays at ${MAX_NATIVE_PLAYBACK_RATE}×; the export renders the true speed.`}
- </p>
- ) : null}
- </Field>
- </>
- ) : null}
- {selection.kind === "cameraFullscreen" ? (
- <p
- style={{
- margin: "0 0 4px",
- font: "400 12px/1.5 var(--font-sans)",
- color: "var(--fg-2)",
- }}
- >
- While this region plays, the webcam grows to (almost) fill the frame and eases back at
- the end. Drag the region's edges on the timeline to change when it starts and how long
- it lasts.
- </p>
- ) : null}
- <button
- type="button"
- onClick={() => onRemove(selection.kind, selection.id)}
- style={{
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- gap: 6,
- width: "100%",
- marginTop: 16,
- padding: "10px 12px",
- border: "1px solid var(--danger)",
- borderRadius: 8,
- background: "var(--danger-soft)",
- color: "var(--danger)",
- font: "600 13px/1 var(--font-body)",
- cursor: "pointer",
- }}
- >
- <Trash2 size={14} />
- Delete {kindLabel(selection.kind).toLowerCase()}
- </button>
- </div>
- </div>
- );
-}
-
-function kindLabel(kind: RegionKind): string {
- switch (kind) {
- case "zoom":
- return "Zoom region";
- case "trim":
- return "Trim region";
- case "annotation":
- return "Annotation";
- case "speed":
- return "Speed region";
- case "cameraFullscreen":
- return "Full Camera";
- }
-}
-
-function Field({ label, children }: { label: string; children: React.ReactNode }) {
- return (
- <div style={{ marginBottom: 8 }}>
- <div
- style={{
- font: "500 10px/1 var(--font-mono)",
- color: "var(--muted)",
- textTransform: "uppercase",
- letterSpacing: "0.06em",
- marginBottom: 4,
- }}
- >
- {label}
- </div>
- {children}
- </div>
- );
-}
-
-function selectStyle(): React.CSSProperties {
- return {
- width: "100%",
- padding: "6px 8px",
- border: "1px solid var(--border)",
- borderRadius: 6,
- background: "var(--bg)",
- color: "var(--fg-2)",
- font: "500 12px var(--font-body)",
- };
-}
diff --git a/src/components/ai-edition/RightPanes.i18n.test.tsx b/src/components/ai-edition/RightPanes.i18n.test.tsx
new file mode 100644
index 000000000..94c2ebf6a
--- /dev/null
+++ b/src/components/ai-edition/RightPanes.i18n.test.tsx
@@ -0,0 +1,65 @@
+// Guards the right-rail settings panes against untranslated strings creeping
+// back in: every pane used to hardcode its English labels (title, tabs, slider
+// labels, help popover), so switching the app locale left the whole inspector
+// in English. These render each pane under a non-English locale and assert the
+// localized text is what actually reaches the DOM.
+
+import "@testing-library/jest-dom";
+import { cleanup, render, screen } from "@testing-library/react";
+import type { ReactElement } from "react";
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { I18nProvider } from "@/contexts/I18nContext";
+import { LOCALE_STORAGE_KEY } from "@/i18n/config";
+import { BackgroundPane, CursorPane, LayoutPane, VideoEffectsPane } from "./RightPanes";
+
+function renderIn(locale: string, ui: ReactElement) {
+ localStorage.setItem(LOCALE_STORAGE_KEY, locale);
+ return render(<I18nProvider>{ui}</I18nProvider>);
+}
+
+beforeEach(() => {
+ localStorage.clear();
+});
+
+afterEach(() => {
+ cleanup();
+ localStorage.clear();
+});
+
+describe("right-rail panes are localized", () => {
+ it("renders the background pane in French", () => {
+ renderIn("fr", <BackgroundPane />);
+ expect(screen.getByRole("heading", { name: "Arrière-plan" })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Aide" })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Téléverser une image" })).toBeInTheDocument();
+ // wallpaper swatches interpolate their index through the catalog
+ expect(screen.getByRole("button", { name: "Fond 1" })).toBeInTheDocument();
+ });
+
+ it("renders the video-effects pane in Spanish", () => {
+ renderIn("es", <VideoEffectsPane />);
+ expect(screen.getByRole("heading", { name: "Efectos de video" })).toBeInTheDocument();
+ expect(screen.getByText("Desenfoque de movimiento")).toBeInTheDocument();
+ expect(screen.getByText("Sombra")).toBeInTheDocument();
+ });
+
+ it("renders the layout pane in Japanese", () => {
+ renderIn("ja-JP", <LayoutPane />);
+ expect(screen.getByRole("heading", { name: "レイアウト" })).toBeInTheDocument();
+ // the preset <option> labels come from the shared layout.* catalog
+ expect(screen.getByRole("option", { name: "ピクチャーインピクチャ" })).toBeInTheDocument();
+ });
+
+ it("renders the cursor pane in French", () => {
+ renderIn("fr", <CursorPane />);
+ expect(screen.getByRole("heading", { name: "Curseur" })).toBeInTheDocument();
+ expect(screen.getByText("Lissage")).toBeInTheDocument();
+ expect(screen.getByText("Rebond au clic")).toBeInTheDocument();
+ });
+
+ it("falls back to English when the locale is English", () => {
+ renderIn("en", <VideoEffectsPane />);
+ expect(screen.getByRole("heading", { name: "Video Effects" })).toBeInTheDocument();
+ expect(screen.getByText("Blur BG")).toBeInTheDocument();
+ });
+});
diff --git a/src/components/ai-edition/RightPanes.tsx b/src/components/ai-edition/RightPanes.tsx
index 968d92167..9e5bc92ce 100644
--- a/src/components/ai-edition/RightPanes.tsx
+++ b/src/components/ai-edition/RightPanes.tsx
@@ -31,6 +31,7 @@ import {
} from "react";
import defaultCursorPreviewUrl from "@/assets/cursors/Cursor=Default.svg";
import GradientEditor, { type GradientEditorState } from "@/components/ui/gradient-editor";
+import { useScopedT } from "@/contexts/I18nContext";
import type {
AxcutAsset,
AxcutClip,
@@ -70,13 +71,14 @@ export type RightPaneId =
interface PaneProps {
title: string;
icon: ReactNode;
- helpLabel?: string;
// P3.3 — contextual help shown in a popover when the ? button is clicked.
- helpText?: string;
+ helpText: string;
children: ReactNode;
}
-function Pane({ title, icon, helpLabel, helpText, children }: PaneProps) {
+function Pane({ title, icon, helpText, children }: PaneProps) {
+ const ts = useScopedT("settings");
+ const helpLabel = ts("panes.help");
const [helpOpen, setHelpOpen] = useState(false);
return (
<div className={`${styles.pane} ${styles.isActive}`}>
@@ -86,8 +88,8 @@ function Pane({ title, icon, helpLabel, helpText, children }: PaneProps) {
<button
type="button"
className={styles.iconBtn}
- title={helpLabel ?? "Help"}
- aria-label={helpLabel ?? "Help"}
+ title={helpLabel}
+ aria-label={helpLabel}
aria-expanded={helpOpen}
onClick={() => setHelpOpen((v) => !v)}
>
@@ -114,7 +116,7 @@ function Pane({ title, icon, helpLabel, helpText, children }: PaneProps) {
}}
onClick={() => setHelpOpen(false)}
>
- {helpText ?? `Settings for ${title.toLowerCase()}.`}
+ {helpText}
</div>
) : null}
</header>
@@ -174,6 +176,7 @@ const IMAGE_ACCEPT = ".jpg,.jpeg,.png,image/jpeg,image/png";
// paths are restricted to `/wallpapers/...` or the user's own data: URLs from
// the upload custom flow.
export function BackgroundPane() {
+ const ts = useScopedT("settings");
const { settings, set, setLive, commit, hasDocument } = useEditorSettings();
const [tab, setTab] = useState<"image" | "color" | "gradient">("image");
const fileInputRef = useRef<HTMLInputElement | null>(null);
@@ -232,9 +235,9 @@ export function BackgroundPane() {
return (
<Pane
- title="Background"
+ title={ts("background.title")}
icon={<Palette size={14} />}
- helpText="Choose what appears behind the recording: a bundled wallpaper image, a solid color, a gradient, or a custom image from disk."
+ helpText={ts("background.help")}
>
<div className={styles.paneTabs} role="tablist">
<button
@@ -242,21 +245,21 @@ export function BackgroundPane() {
className={tab === "image" ? styles.isActive : ""}
onClick={() => handleTabChange("image")}
>
- Image
+ {ts("background.image")}
</button>
<button
type="button"
className={tab === "color" ? styles.isActive : ""}
onClick={() => handleTabChange("color")}
>
- Color
+ {ts("background.color")}
</button>
<button
type="button"
className={tab === "gradient" ? styles.isActive : ""}
onClick={() => handleTabChange("gradient")}
>
- Gradient
+ {ts("background.gradient")}
</button>
</div>
{tab === "image" ? (
@@ -267,7 +270,7 @@ export function BackgroundPane() {
disabled={!hasDocument}
onClick={handlePickFile}
>
- Upload custom
+ {ts("background.uploadCustom")}
</button>
<input
ref={fileInputRef}
@@ -283,7 +286,7 @@ export function BackgroundPane() {
key={`custom-${url.slice(-32)}`}
className={`${styles.bgThumb} ${isSelected(url) ? styles.isActive : ""}`}
style={{ background: `center/cover no-repeat url(${url})` }}
- aria-label="Custom wallpaper"
+ aria-label={ts("background.customWallpaper")}
disabled={!hasDocument}
onClick={() => void set({ wallpaper: url })}
/>
@@ -299,7 +302,7 @@ export function BackgroundPane() {
key={path}
className={`${styles.bgThumb} ${isSelected(path) ? styles.isActive : ""}`}
style={{ background: `center/cover no-repeat url(${previewUrl})` }}
- aria-label={`Background ${i + 1}`}
+ aria-label={ts("background.imageLabel", { index: i + 1 })}
disabled={!hasDocument}
onClick={() => void set({ wallpaper: path })}
/>
@@ -323,7 +326,7 @@ export function BackgroundPane() {
key={bg}
className={`${styles.bgThumb} ${isSelected(bg) ? styles.isActive : ""}`}
style={{ background: bg }}
- aria-label={`Gradient ${i + 1}`}
+ aria-label={ts("background.gradientLabel", { index: i + 1 })}
disabled={!hasDocument}
onClick={() => void set({ wallpaper: bg })}
/>
@@ -364,6 +367,7 @@ function BackgroundColorTab({
isSelected: (v: string) => boolean;
onPick: (next: string) => void;
}) {
+ const ts = useScopedT("settings");
const [hexDraft, setHexDraft] = useState(value.startsWith("#") ? value : "#000000");
useEffect(() => {
if (value.startsWith("#")) setHexDraft(value);
@@ -386,7 +390,7 @@ function BackgroundColorTab({
key={c}
className={`${styles.bgThumb} ${isSelected(c) ? styles.isActive : ""}`}
style={{ background: c }}
- aria-label={`Color ${c}`}
+ aria-label={ts("background.colorLabel", { color: c })}
disabled={!hasDocument}
onClick={() => {
onPick(c);
@@ -495,6 +499,7 @@ export function TranscriptPane({
canTranscribe: boolean;
isTranscribing: boolean;
}) {
+ const ts = useScopedT("settings");
const sections = useMemo(
() => buildAggregatedSections(clips, transcripts, assets, trimRanges),
[clips, transcripts, assets, trimRanges],
@@ -522,9 +527,9 @@ export function TranscriptPane({
if (clips.length === 0 || !hasAnyTranscript) {
return (
<Pane
- title="Current transcription"
+ title={ts("transcript.title")}
icon={<FileText size={14} />}
- helpText="Aggregated transcript of every clip on the timeline. Backspace / Delete a word or selection to mark it as skipped (red). Hover a red span to restore it."
+ helpText={ts("transcript.help")}
>
<div
style={{
@@ -540,10 +545,10 @@ export function TranscriptPane({
>
<FileText size={28} style={{ color: "var(--dim)" }} />
<p style={{ font: "500 13px var(--font-body)", color: "var(--fg-2)" }}>
- {clips.length === 0 ? "No clips yet" : "No transcript yet"}
+ {clips.length === 0 ? ts("transcript.noClips") : ts("transcript.noTranscript")}
</p>
<p style={{ font: "400 12px var(--font-body)", color: "var(--muted)", maxWidth: 260 }}>
- Transcribe uses local Whisper — runs in your browser, no data leaves the device.
+ {ts("transcript.whisperHint")}
</p>
<button
type="button"
@@ -551,7 +556,7 @@ export function TranscriptPane({
onClick={onTranscribe}
disabled={!canTranscribe || isTranscribing}
>
- {isTranscribing ? "Transcribing…" : "Transcribe now"}
+ {isTranscribing ? ts("transcript.transcribing") : ts("transcript.transcribeNow")}
</button>
</div>
</Pane>
@@ -561,7 +566,7 @@ export function TranscriptPane({
return (
<div className={`${styles.pane} ${styles.isActive}`}>
<header className={styles.paneHead}>
- <h2>Current transcription</h2>
+ <h2>{ts("transcript.title")}</h2>
</header>
<div className={styles.paneBody}>
{sections.map((section, idx) => (
@@ -603,6 +608,7 @@ function TranscriptClipBlock({
onAddTrimRange: (assetId: string, startSec: number, endSec: number, reason: string) => void;
onRemoveTrimRange: (trimId: string) => void;
}) {
+ const ts = useScopedT("settings");
const { clip, asset, words } = section;
const filename = asset?.label ?? clip.assetId;
const sourceRangeLabel =
@@ -851,7 +857,7 @@ function TranscriptClipBlock({
marginTop: 2,
}}
>
- Clip {index + 1} · {sourceRangeLabel}
+ {ts("transcript.clipLabel", { index: index + 1 })} · {sourceRangeLabel}
</span>
</span>
</span>
@@ -865,7 +871,7 @@ function TranscriptClipBlock({
fontStyle: "italic",
}}
>
- No transcript for this clip — open the asset card and regenerate.
+ {ts("transcript.noClipTranscript")}
</p>
) : (
<div
@@ -875,7 +881,7 @@ function TranscriptClipBlock({
contentEditable={!busy}
suppressContentEditableWarning
spellCheck={false}
- aria-label={`Transcript for ${filename}`}
+ aria-label={ts("transcript.editorAria", { filename })}
aria-multiline="true"
onBeforeInput={handleBeforeInput}
onKeyDown={handleKeyDown}
@@ -928,12 +934,14 @@ function TranscriptWord({
onRestore: (run: TrimRun) => void;
onAddTrimRange: (assetId: string, startSec: number, endSec: number, reason: string) => void;
}) {
+ const ts = useScopedT("settings");
const [hover, setHover] = useState(false);
const removed = !cw.kept;
if (isSilenceWord(cw.word)) {
const durationSec = cw.word.endSec - cw.word.startSec;
- const label = `[silence ${durationSec.toFixed(1)}s]`;
+ const duration = durationSec.toFixed(1);
+ const label = ts("transcript.silence", { duration });
if (removed) {
return (
<button
@@ -941,8 +949,8 @@ function TranscriptWord({
contentEditable={false}
data-word-id={cw.word.id}
data-silence="true"
- title={`Restore silence (${durationSec.toFixed(1)}s)`}
- aria-label={`Restore silence (${durationSec.toFixed(1)}s)`}
+ title={ts("transcript.restoreSilence", { duration })}
+ aria-label={ts("transcript.restoreSilence", { duration })}
onClick={(e) => {
e.stopPropagation();
onRestore({
@@ -977,8 +985,8 @@ function TranscriptWord({
contentEditable={false}
data-word-id={cw.word.id}
data-silence="true"
- title={`Trim silence (${durationSec.toFixed(1)}s)`}
- aria-label={`Trim silence (${durationSec.toFixed(1)}s)`}
+ title={ts("transcript.trimSilence", { duration })}
+ aria-label={ts("transcript.trimSilence", { duration })}
onClick={(e) => {
e.stopPropagation();
onAddTrimRange(
@@ -1034,8 +1042,8 @@ function TranscriptWord({
<button
type="button"
contentEditable={false}
- title={`Restore "${cw.word.text}"`}
- aria-label={`Restore "${cw.word.text}"`}
+ title={ts("transcript.restoreWord", { word: cw.word.text })}
+ aria-label={ts("transcript.restoreWord", { word: cw.word.text })}
onClick={(e) => {
e.stopPropagation();
// build a minimal TrimRun stub — only trimId is
@@ -1208,6 +1216,7 @@ export type { AxcutWord };
// ─── Video Effects ─────────────────────────────────────────────────
export function VideoEffectsPane() {
+ const ts = useScopedT("settings");
const { settings, set, setLive, commit, hasDocument } = useEditorSettings();
// Push the current frame-styling settings into the native D3D compositor
@@ -1246,13 +1255,9 @@ export function VideoEffectsPane() {
]);
return (
- <Pane
- title="Video effects"
- icon={<Sliders size={14} />}
- helpText="Frame styling for the recording: background blur, drop shadow, motion blur, corner radius, and padding around the video."
- >
+ <Pane title={ts("effects.title")} icon={<Sliders size={14} />} helpText={ts("effects.help")}>
<div className={styles.paneRow}>
- <span className="label">Blur BG</span>
+ <span className="label">{ts("effects.blurBg")}</span>
<Toggle
checked={settings.showBlur}
disabled={!hasDocument}
@@ -1266,7 +1271,7 @@ export function VideoEffectsPane() {
</div>
<div className={styles.sliderGrid}>
<SliderCell
- label="Motion blur"
+ label={ts("effects.motionBlur")}
value={settings.motionBlurAmount * 100}
min={0}
max={100}
@@ -1281,7 +1286,7 @@ export function VideoEffectsPane() {
onCommit={() => void commit()}
/>
<SliderCell
- label="Shadow"
+ label={ts("effects.shadow")}
value={settings.shadowIntensity * 100}
min={0}
max={100}
@@ -1296,7 +1301,7 @@ export function VideoEffectsPane() {
onCommit={() => void commit()}
/>
<SliderCell
- label="Roundness"
+ label={ts("effects.roundness")}
value={settings.borderRadius}
min={0}
max={64}
@@ -1312,7 +1317,7 @@ export function VideoEffectsPane() {
onCommit={() => void commit()}
/>
<SliderCell
- label="Padding"
+ label={ts("effects.padding")}
value={settings.padding}
min={0}
max={100}
@@ -1334,10 +1339,10 @@ export function VideoEffectsPane() {
// ─── Layout (webcam) ──────────────────────────────────────────────
const WEBCAM_PRESETS = [
- { value: "picture-in-picture", label: "Picture in picture" },
- { value: "dual-frame", label: "Side by side" },
- { value: "vertical-stack", label: "Top / bottom" },
- { value: "no-webcam", label: "Screen only" },
+ { value: "picture-in-picture", labelKey: "layout.pictureInPicture" },
+ { value: "dual-frame", labelKey: "layout.dualFrame" },
+ { value: "vertical-stack", labelKey: "layout.verticalStack" },
+ { value: "no-webcam", labelKey: "layout.noWebcam" },
] as const;
// Webcam size (% of frame width) that maps to the native compositor's default PiP webcam
@@ -1347,16 +1352,29 @@ const NATIVE_WEBCAM_BASE_PCT = 16.7;
const CAMERA_SHAPES: Array<{
value: "rectangle" | "circle" | "square" | "rounded";
- label: string;
+ labelKey: string;
icon: ReactNode;
}> = [
- { value: "rectangle", label: "Rect", icon: <rect x="3" y="6" width="18" height="12" rx="1" /> },
- { value: "circle", label: "Circle", icon: <circle cx="12" cy="12" r="9" /> },
- { value: "square", label: "Square", icon: <rect x="4" y="4" width="16" height="16" rx="1" /> },
- { value: "rounded", label: "Rounded", icon: <rect x="3" y="6" width="18" height="12" rx="6" /> },
+ {
+ value: "rectangle",
+ labelKey: "layout.shapes.rectangle",
+ icon: <rect x="3" y="6" width="18" height="12" rx="1" />,
+ },
+ { value: "circle", labelKey: "layout.shapes.circle", icon: <circle cx="12" cy="12" r="9" /> },
+ {
+ value: "square",
+ labelKey: "layout.shapes.square",
+ icon: <rect x="4" y="4" width="16" height="16" rx="1" />,
+ },
+ {
+ value: "rounded",
+ labelKey: "layout.shapes.rounded",
+ icon: <rect x="3" y="6" width="18" height="12" rx="6" />,
+ },
];
export function LayoutPane() {
+ const ts = useScopedT("settings");
const { settings, set, setLive, commit, hasDocument } = useEditorSettings();
const document = useProjectStore((s) => s.document);
@@ -1390,14 +1408,10 @@ export function LayoutPane() {
: false;
const layoutControlsDisabled = !hasDocument || !hasAnyCamera;
return (
- <Pane
- title="Layout"
- icon={<LayoutIcon size={14} />}
- helpText="How the webcam is composed with the screen: picture-in-picture, vertical stack, dual frame, mask shape, size, and mirroring."
- >
- <div className={styles.sectionLabel}>Preset</div>
+ <Pane title={ts("layout.title")} icon={<LayoutIcon size={14} />} helpText={ts("layout.help")}>
+ <div className={styles.sectionLabel}>{ts("layout.preset")}</div>
<div className={styles.field}>
- <label>Layout</label>
+ <label>{ts("layout.title")}</label>
<select
value={settings.webcamLayoutPreset}
disabled={layoutControlsDisabled}
@@ -1407,13 +1421,13 @@ export function LayoutPane() {
>
{WEBCAM_PRESETS.map((p) => (
<option key={p.value} value={p.value}>
- {p.label}
+ {ts(p.labelKey)}
</option>
))}
</select>
</div>
<div className={styles.paneRow}>
- <span className="label">Mirror webcam</span>
+ <span className="label">{ts("layout.mirrorWebcam")}</span>
<Toggle
checked={settings.webcamMirrored}
disabled={layoutControlsDisabled}
@@ -1427,7 +1441,7 @@ export function LayoutPane() {
</div>
{supportsReactiveZoom ? (
<div className={styles.paneRow}>
- <span className="label">Shrink on zoom</span>
+ <span className="label">{ts("layout.reactiveWebcam")}</span>
<Toggle
checked={settings.webcamReactiveZoom}
disabled={layoutControlsDisabled}
@@ -1437,7 +1451,7 @@ export function LayoutPane() {
) : null}
{isPip ? (
<>
- <div className={styles.sectionLabel}>Camera shape</div>
+ <div className={styles.sectionLabel}>{ts("layout.webcamShape")}</div>
<div
style={{
display: "grid",
@@ -1478,7 +1492,7 @@ export function LayoutPane() {
>
{shape.icon}
</svg>
- <span style={{ font: "500 11px/1 var(--font-body)" }}>{shape.label}</span>
+ <span style={{ font: "500 11px/1 var(--font-body)" }}>{ts(shape.labelKey)}</span>
</button>
);
})}
@@ -1489,7 +1503,7 @@ export function LayoutPane() {
<div className={styles.sliderGrid}>
<div className={`${styles.sliderCell} ${styles.full}`}>
<div className="head">
- <span className="label">Webcam size</span>
+ <span className="label">{ts("layout.webcamSize")}</span>
<span className="val">{Math.round(settings.webcamSizePreset)}%</span>
</div>
<input
@@ -1528,6 +1542,7 @@ function safeAssetUrl(relativePath: string): string {
}
export function CursorPane() {
+ const ts = useScopedT("settings");
const { settings, set, setLive, commit, hasDocument } = useEditorSettings();
// Push cursor settings into the native compositor (initial + on view activation); the
@@ -1557,7 +1572,7 @@ export function CursorPane() {
() => [
{
id: DEFAULT_CURSOR_THEME_ID,
- name: "Default",
+ name: ts("cursor.themeDefault"),
previewUrl: defaultCursorPreviewUrl,
},
...CURSOR_THEMES.map((theme) => {
@@ -1569,17 +1584,17 @@ export function CursorPane() {
};
}),
],
- [],
+ [ts],
);
return (
<Pane
- title="Cursor"
+ title={ts("cursor.title")}
icon={<MousePointerClick size={14} />}
- helpText="Cursor rendering from the recorded telemetry: theme, size, smoothing, motion blur, and click-bounce emphasis."
+ helpText={ts("cursor.help")}
>
<div className={styles.paneRow}>
- <span className="label">Show cursor</span>
+ <span className="label">{ts("cursor.show")}</span>
<Toggle
checked={settings.cursorShow}
disabled={!hasDocument}
@@ -1592,14 +1607,14 @@ export function CursorPane() {
/>
</div>
<div className={styles.paneRow}>
- <span className="label">Clip to canvas</span>
+ <span className="label">{ts("cursor.clipToBounds")}</span>
<Toggle
checked={settings.cursor.clipToBounds}
disabled={!hasDocument}
onChange={(v) => void set({ cursor: { clipToBounds: v } })}
/>
</div>
- <div className={styles.sectionLabel}>Cursor style</div>
+ <div className={styles.sectionLabel}>{ts("cursor.theme")}</div>
<div className={styles.cursorGrid}>
{cursorThemeOptions.map((option) => {
const isActive = settings.cursorTheme === option.id;
@@ -1628,7 +1643,7 @@ export function CursorPane() {
</div>
<div className={styles.sliderGrid}>
<SliderCell
- label="Size"
+ label={ts("cursor.size")}
value={settings.cursor.size * 10}
min={5}
max={100}
@@ -1644,7 +1659,7 @@ export function CursorPane() {
onCommit={() => void commit()}
/>
<SliderCell
- label="Smoothing"
+ label={ts("cursor.smoothing")}
value={settings.cursor.smoothing * 100}
min={0}
max={100}
@@ -1659,7 +1674,7 @@ export function CursorPane() {
onCommit={() => void commit()}
/>
<SliderCell
- label="Motion blur"
+ label={ts("cursor.motionBlur")}
value={settings.cursor.motionBlur * 100}
min={0}
max={100}
@@ -1674,7 +1689,7 @@ export function CursorPane() {
onCommit={() => void commit()}
/>
<SliderCell
- label="Click bounce"
+ label={ts("cursor.clickBounce")}
value={settings.cursor.clickBounce * 10}
min={0}
max={50}
@@ -1697,15 +1712,12 @@ export function CursorPane() {
// ─── Timeline (trim waveform) ──────────────────────────────────────
export function TimelinePaneBody() {
+ const ts = useScopedT("settings");
const { settings, set, hasDocument } = useEditorSettings();
return (
- <Pane
- title="Timeline"
- icon={<CropIcon size={14} />}
- helpText="Timeline display options, like showing the audio waveform on the trim track."
- >
+ <Pane title={ts("timeline.title")} icon={<CropIcon size={14} />} helpText={ts("timeline.help")}>
<div className={styles.paneRow}>
- <span className="label">Show audio waveform on trim track</span>
+ <span className="label">{ts("timeline.waveform")}</span>
<Toggle
checked={settings.showTrimWaveform}
disabled={!hasDocument}
diff --git a/src/components/ai-edition/TimelinePane.module.css b/src/components/ai-edition/TimelinePane.module.css
deleted file mode 100644
index 6c76d07bc..000000000
--- a/src/components/ai-edition/TimelinePane.module.css
+++ /dev/null
@@ -1,624 +0,0 @@
-/* Timeline viewport — custom scroll/pan model (NOT native overflow). The
- outer viewport is overflow: hidden; the inner .canvas uses
- transform: translateX(...) to pan, and its width is totalDuration *
- pxPerSec. This lets the lanes (T10) share the same coordinate space
- when they move into the canvas. Mirrors axcut TimelinePane.tsx's
- .timeline-viewport / .timeline-canvas. */
-
-.pane {
- position: relative;
- display: flex;
- flex-direction: column;
- min-height: 0;
- height: 100%;
-}
-
-.viewport {
- position: relative;
- flex: 1 1 auto;
- min-height: 0;
- overflow: hidden;
- cursor: pointer;
- /* ponytail: scrollbar hidden — the navigator strip (T11) is the
- scroll/zoom UI; we don't want native scroll chrome leaking in. */
- scrollbar-width: none;
-}
-.viewport::-webkit-scrollbar {
- display: none;
-}
-.viewport.panning {
- cursor: grabbing;
-}
-.viewport.reordering {
- cursor: grabbing;
-}
-.viewport.scrubbing {
- cursor: ew-resize;
-}
-.viewport.placingCut {
- cursor: crosshair;
-}
-
-/* T16 — body-level cursor classes that override child cursors while a
- timeline interaction is active. */
-body.timeline-scrubbing,
-body.timeline-scrubbing * {
- cursor: ew-resize !important;
-}
-body.timeline-panning,
-body.timeline-panning * {
- cursor: grabbing !important;
-}
-body.timeline-reordering,
-body.timeline-reordering * {
- cursor: grabbing !important;
-}
-/* T15 — Place-skip cursor. The class is added via
- document.body.classList.add() in Bottombar (raw string), so the
- selector MUST use :global() — otherwise CSS modules would hash
- `.timeline-placing-cut` and the rule would never match. Same hash
- issue as the navigator CSS had. The `*` selector cascades to
- every descendant with the body class applied. */
-body:global(.timeline-placing-cut),
-body:global(.timeline-placing-cut) * {
- cursor: crosshair !important;
-}
-/* Same problem on the specific element overrides. */
-body:global(.timeline-placing-cut) .trackBlock,
-body:global(.timeline-placing-cut) .trackBlock:active,
-body:global(.timeline-placing-cut) .skipControlBtn,
-body:global(.timeline-placing-cut) .editIcon,
-body:global(.timeline-placing-cut) .clipDelete,
-body:global(.timeline-placing-cut) .trackBlock .segment,
-body:global(.timeline-placing-cut) .reorderMarker,
-body:global(.timeline-placing-cut) .dropMarker,
-body:global(.timeline-placing-cut) .timelineHeader,
-body:global(.timeline-placing-cut) .timelineHeader *,
-body:global(.timeline-placing-cut) button,
-body:global(.timeline-placing-cut) [class*="vtBtn"] {
- cursor: crosshair !important;
-}
-
-.canvas {
- position: relative;
- height: 100%;
- min-width: 100%;
- display: flex;
- flex-direction: column;
- /* T15 — these tokens drive the playhead + placement-marker top
- offsets. The marker/playhead use a calc(-1 * (--rule-h + --lanes-h))
- to land inside the timing ruler regardless of lane-count changes. */
- --rule-h: 22px;
- --lanes-h: 78px;
- will-change: transform;
-}
-
-.ruler {
- position: relative;
- height: 22px;
- border-bottom: 1px solid var(--border-soft);
- user-select: none;
- cursor: text;
-}
-.tick {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 1px;
- background: var(--border-hi);
-}
-.tick.major::before {
- content: "";
- position: absolute;
- left: 0;
- bottom: -4px;
- width: 2px;
- height: 4px;
- background: var(--border-hi);
-}
-.tick span {
- position: absolute;
- left: 2px;
- top: 0;
- font-family: var(--font-mono);
- font-size: 10px;
- font-weight: 500;
- letter-spacing: 0.02em;
- /* v4 design ruler labels read in --meta. */
- color: var(--meta);
- white-space: nowrap;
- pointer-events: none;
-}
-
-.lanesContainer {
- position: relative;
- display: flex;
- flex-direction: column;
- gap: 2px;
- padding: 4px 0 2px;
- border-bottom: 1px solid var(--border-soft);
- flex-shrink: 0;
-}
-
-.trackLane {
- position: relative;
- display: flex;
- flex-direction: column;
- gap: 4px;
- padding: 4px 0;
- min-height: 0;
- flex: 1 1 auto;
-}
-
-.trackBlock {
- position: absolute;
- top: 4px;
- height: calc(100% - 8px);
- min-width: 68px;
- display: flex;
- flex-direction: column;
- /* v4 design clip card: --surface-1 fill, 1.5px frame, 11px radius. */
- background: var(--surface-1);
- border: 1.5px solid var(--border);
- border-radius: 11px;
- box-shadow: var(--elev-card-soft);
- cursor: grab;
- overflow: hidden;
- transition:
- border-color var(--motion-fast) var(--ease),
- box-shadow var(--motion-fast) var(--ease);
-}
-.trackBlock:hover {
- border-color: var(--border-hi);
-}
-.trackBlock:active {
- cursor: grabbing;
-}
-.trackBlock.selected {
- border-color: var(--accent);
- box-shadow: 0 0 0 1px var(--accent), 0 4px 12px -4px var(--accent-soft);
-}
-.trackBlock.reordering {
- opacity: 0.85;
- box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.45);
- z-index: 20;
-}
-
-.trackVisual {
- /* v4 design: the waveform fills the whole clip card; the label + delete
- float over it as blur chips (see .trackInfo / .clipDelete). */
- position: absolute;
- inset: 0;
- display: flex;
- overflow: hidden;
- background: var(--surface);
-}
-.segment {
- height: 100%;
- flex-basis: 0;
-}
-.segment.keep {
- background: transparent;
-}
-.segment.cut {
- position: relative;
- background-color: var(--accent-wash);
- background-image: repeating-linear-gradient(
- 45deg,
- color-mix(in srgb, var(--accent) 32%, transparent) 0,
- color-mix(in srgb, var(--accent) 32%, transparent) 8px,
- transparent 8px,
- transparent 16px
- );
-}
-
-.skipControls {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(
- calc(-50% + var(--skip-controls-shift-px, 0px)),
- -50%
- );
- display: flex;
- align-items: center;
- gap: 2px;
- padding: 2px;
- background: var(--surface);
- border: 1px solid var(--border-soft);
- border-radius: var(--r-sm);
- box-shadow: var(--elev-card-soft);
- z-index: 20;
- white-space: nowrap;
-}
-.skipControlBtn {
- width: 20px;
- height: 20px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- background: transparent;
- border: 0;
- border-radius: var(--r-xs);
- color: var(--muted);
- cursor: pointer;
- padding: 0;
- transition:
- background var(--motion-fast) var(--ease),
- color var(--motion-fast) var(--ease);
-}
-.skipControlBtn:hover {
- background: var(--surface-3);
- color: var(--fg);
-}
-.skipControlDelete:hover {
- background: var(--danger-soft);
- color: var(--danger);
-}
-
-.trackInfo {
- /* Floating label chip, top-left over the waveform (v4 design). */
- position: absolute;
- top: 8px;
- left: 10px;
- right: 40px;
- z-index: 2;
- display: inline-flex;
- align-items: center;
- gap: 8px;
- width: max-content;
- max-width: calc(100% - 50px);
- padding: 3px 9px 3px 6px;
- border-radius: 8px;
- background: color-mix(in srgb, #080a0d 55%, transparent);
- border: 1px solid rgba(255, 255, 255, 0.08);
- backdrop-filter: blur(8px);
- -webkit-backdrop-filter: blur(8px);
- overflow: hidden;
-}
-.editIcon {
- flex: 0 0 auto;
- width: 16px;
- height: 16px;
- display: grid;
- place-items: center;
- background: var(--surface);
- border: 0;
- border-radius: 5px;
- color: var(--fg);
- cursor: pointer;
- transition:
- border-color var(--motion-fast) var(--ease),
- color var(--motion-fast) var(--ease);
-}
-.editIcon:hover {
- border-color: var(--accent);
- color: var(--accent);
-}
-.trackText {
- display: flex;
- flex-direction: column;
- min-width: 0;
- flex: 1;
-}
-.trackTitle {
- margin: 0;
- font-size: 11px;
- font-weight: 500;
- letter-spacing: -0.005em;
- color: #fff;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-/* v4 design: the clip chip shows only the filename — the range/source
- readout is not part of the floating label. */
-.trackSubtitle {
- display: none;
-}
-.clipDelete {
- /* Floating delete, top-right over the waveform (v4 design), shown on
- hover / selection. */
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 2;
- width: 26px;
- height: 26px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: color-mix(in srgb, #080a0d 55%, transparent);
- border: 1px solid rgba(255, 255, 255, 0.08);
- backdrop-filter: blur(8px);
- -webkit-backdrop-filter: blur(8px);
- border-radius: 7px;
- color: var(--muted);
- cursor: pointer;
- opacity: 0;
- transition:
- background var(--motion-fast) var(--ease),
- color var(--motion-fast) var(--ease),
- opacity var(--motion-fast) var(--ease);
-}
-.trackBlock:hover .clipDelete,
-.trackBlock.selected .clipDelete {
- opacity: 1;
-}
-.clipDelete:hover {
- background: var(--danger-soft);
- color: var(--danger);
-}
-
-/* ── drop marker + playhead ────────────────────────────────────────── */
-.dropMarker {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 2px;
- background: var(--accent);
- border-radius: 2px;
- box-shadow: 0 0 6px var(--accent-soft);
- pointer-events: none;
- z-index: 9;
-}
-
-/* T08 — live marker shown between clips while a reorder drag is active. */
-.reorderMarker {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 4px;
- background: var(--accent);
- border-radius: 2px;
- box-shadow: 0 0 12px var(--accent-soft), 0 0 4px var(--accent);
- pointer-events: none;
- z-index: 30;
-}
-
-/* P3.7 — hover marker in the ruler: same footprint as .snapGuide but in
- the accent color so it reads as "preview", not "edit in progress". */
-.hoverGuide {
- position: absolute;
- top: 0;
- height: var(--rule-h, 22px);
- width: 1px;
- background: var(--accent);
- opacity: 0.8;
- pointer-events: none;
- z-index: 13;
-}
-
-/* T24 — thin vertical snap-guide lines at the resize edges during
- skip-edge drag. Shown in the ruler area (top: 0; height: 22px).
- Two of them, one per edge being dragged (axcut TimelinePane.tsx). */
-.snapGuide {
- position: absolute;
- top: 0;
- height: var(--rule-h, 22px);
- width: 2px;
- background: var(--danger);
- box-shadow: 0 0 6px color-mix(in oklch, var(--danger) 60%, transparent);
- pointer-events: none;
- z-index: 14;
-}
-
-/* T25 — floating drag tooltip showing the new time range during skip
- resize. Sits just to the right of the moving edge so it doesn't
- overlap the snap guide. Pill style matches the chip typography
- used elsewhere in the ruler / header. */
-.dragTooltip {
- position: absolute;
- top: 2px;
- height: 18px;
- padding: 0 8px;
- background: var(--surface);
- border: 1px solid var(--border-soft);
- border-radius: 9px;
- color: var(--fg-2);
- font: 500 10.5px/18px var(--font-mono);
- letter-spacing: 0.02em;
- white-space: nowrap;
- pointer-events: none;
- z-index: 15;
- box-shadow: var(--elev-card-soft);
-}
-
-/* T15 — Place-skip preview marker: 1s-wide red-tinted strip at the
- cursor's source time. Indicates where the next click would land.
- Top matches the playhead's top (ruler + lanes above) so it spans
- the entire visible timeline: ruler above + clip tracks below. */
-.placementMarker {
- position: absolute;
- top: calc(-1 * (var(--rule-h, 22px) + var(--lanes-h, 78px)));
- bottom: 0;
- width: 12px;
- margin-left: -6px;
- background: color-mix(in oklch, var(--danger) 50%, transparent);
- border-left: 2px solid var(--danger);
- border-right: 2px solid var(--danger);
- box-shadow: 0 0 8px color-mix(in oklch, var(--danger) 50%, transparent);
- pointer-events: none;
- z-index: 12;
-}
-
-/* T14 — Header row above the viewport: clip/skip/total readouts +
- Place-skip toggle + current timecode. */
-.timelineHeader {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 6px var(--sp-3) 6px var(--sp-3);
- border-bottom: 1px solid var(--border-soft);
- font: 500 11px/1 var(--font-mono);
- color: var(--muted);
- flex-shrink: 0;
-}
-.headerStat {
- letter-spacing: 0.02em;
-}
-.headerDivider {
- color: var(--dim);
-}
-.headerSpacer {
- flex: 1 1 auto;
-}
-.headerButton {
- height: 22px;
- padding: 0 10px;
- border: 1px solid var(--border-soft);
- border-radius: var(--r-sm);
- background: var(--surface-2);
- color: var(--fg-2);
- font: 500 11px/1 var(--font-body);
- cursor: pointer;
- transition:
- background var(--motion-fast) var(--ease),
- border-color var(--motion-fast) var(--ease);
-}
-.headerButton:hover {
- background: var(--surface-3);
- border-color: var(--border-hi);
-}
-.headerButton:disabled {
- opacity: 0.5;
- cursor: not-allowed;
-}
-.headerButtonActive {
- background: var(--accent-wash);
- border-color: var(--accent);
- color: var(--accent);
-}
-.headerTime {
- font-variant-numeric: tabular-nums;
- color: var(--fg);
- min-width: 5ch;
- text-align: right;
-}
-
-.playhead {
- position: absolute;
- /* Top: -(ruler + lanes) so the diamond head (::before, 8px tall,
- at top: 0) lands inside the .ruler (22px tall) at the very top of
- the canvas, not in the zoom/speed/annotation lanes below it.
- The vertical line still extends down through the canvas into the
- trackLane. */
- top: calc(-1 * (var(--rule-h, 22px) + var(--lanes-h, 78px)));
- bottom: 0;
- width: 2px;
- background: var(--accent);
- z-index: 10;
- pointer-events: none;
-}
-.playhead::before {
- content: "";
- position: absolute;
- top: 0;
- left: -3px;
- width: 8px;
- height: 8px;
- background: var(--accent);
- transform: rotate(45deg);
-}
-
-/* ── empty state ───────────────────────────────────────────────────── */
-.empty {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 1.5px dashed var(--border-hi);
- border-radius: var(--r-md);
- color: var(--muted);
- font-size: 12.5px;
- text-align: center;
- padding: 16px;
- transition:
- border-color var(--motion-fast) var(--ease),
- color var(--motion-fast) var(--ease);
-}
-.empty[data-drop-active="true"] {
- border-color: var(--accent);
- color: var(--accent);
- background: var(--accent-wash);
-}
-
-/* T11/T12 — Navigator strip. The Navigator is the row that drives
- the timeline's pan/zoom (axcut TimelinePane.tsx timeline-navigator
- + .timeline-navigator-window). Lives here, not in
- NewEditorShell.module.css, because TimelinePane applies the
- className via its own styles import — CSS modules' class hashes
- don't match across files. */
-.timelineNavigator {
- position: relative;
- height: 1.15rem;
- flex-shrink: 0;
- margin: 4px var(--sp-3) 4px var(--sp-3);
- border-radius: 3px;
- /* v4 design: a subtle grey track (--surface-3), no border. */
- background: var(--surface-3);
- overflow: visible;
-}
-.timelineNavigator.navigating {
- border-color: var(--accent);
-}
-.timelineNavigatorContent {
- position: absolute;
- inset: 0;
- background: transparent;
- pointer-events: none;
-}
-.timelineNavigatorSkip {
- position: absolute;
- top: 0;
- bottom: 0;
- min-width: 1px;
- background: color-mix(in oklch, var(--accent) 50%, transparent);
- border-left: 1px solid var(--accent);
- border-right: 1px solid var(--accent);
- pointer-events: none;
-}
-.timelineNavigatorWindow {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- height: calc(100% + 4px);
- min-width: 1.8rem;
- /* v4 design: neutral raised window (--surface-hi) with a --border-hi frame. */
- border: 1px solid var(--border-hi);
- border-radius: 5px;
- background: var(--surface-hi);
- cursor: grab;
-}
-.timelineNavigator.navigating .timelineNavigatorWindow {
- cursor: grabbing;
-}
-.timelineNavigatorHandleStart,
-.timelineNavigatorHandleEnd {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 12px;
- height: calc(100% + 8px);
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: ew-resize;
- z-index: 3;
-}
-/* grip bar per the v4 design (4px wide, --fg-2, haloed by the track). */
-.timelineNavigatorHandleStart::after,
-.timelineNavigatorHandleEnd::after {
- content: "";
- width: 4px;
- height: 14px;
- border-radius: 2px;
- background: var(--fg-2);
- box-shadow: 0 0 0 2px var(--surface);
-}
-.timelineNavigatorHandleStart {
- left: -6px;
-}
-.timelineNavigatorHandleEnd {
- right: -6px;
-}
diff --git a/src/components/ai-edition/TimelinePane.tsx b/src/components/ai-edition/TimelinePane.tsx
deleted file mode 100644
index cad9d202d..000000000
--- a/src/components/ai-edition/TimelinePane.tsx
+++ /dev/null
@@ -1,1312 +0,0 @@
-import { type Span } from "dnd-timeline";
-import { MessageSquare, Pencil, Scissors, Timer, Trash2, ZoomIn } from "lucide-react";
-import {
- type DragEvent as ReactDragEvent,
- type PointerEvent as ReactPointerEvent,
- type WheelEvent as ReactWheelEvent,
- useCallback,
- useEffect,
- useMemo,
- useRef,
- useState,
-} from "react";
-import type { AxcutClip } from "@/lib/ai-edition/schema";
-import { startGlobalPointerDrag } from "@/lib/ai-edition/timeline/pointer-drag";
-import {
- formatSeconds,
- locateSourcePosition,
- locateVirtualPosition,
-} from "@/lib/ai-edition/timeline/virtual-preview";
-import {
- RegionItem,
- RegionRow,
- RegionTimelineProvider,
- RegionTimelineSurface,
-} from "./RegionTimeline";
-import styles from "./TimelinePane.module.css";
-
-// pxPerSec limits — at zoom=1 the timeline fits the viewport (pxPerSec =
-// fitPxPerSec); MAX_PX_PER_SEC caps how dense the clips can get when zoomed
-// in. Mirrors axcut TimelinePane.tsx MAX_PX_PER_SEC.
-const MAX_PX_PER_SEC = 280;
-const MIN_SOURCE_DURATION_SEC = 0.001;
-const TIMELINE_START_GUTTER_PX = 6;
-const TIMELINE_END_GUTTER_PX = 6;
-const CLIP_REORDER_THRESHOLD_PX = 6;
-
-const ASSET_MIME = "application/x-axcut-asset";
-
-interface AssetMeta {
- id: string;
- label: string;
- durationSec?: number;
-}
-
-interface TrimRange {
- id: string;
- assetId: string;
- startSec: number;
- endSec: number;
-}
-
-interface ZoomRegion {
- id: string;
- startMs: number;
- endMs: number;
- depth?: number;
- customScale?: number;
-}
-
-interface AnnotationRegion {
- id: string;
- startMs: number;
- endMs: number;
- textContent?: string;
-}
-
-interface SpeedRegion {
- id: string;
- startMs: number;
- endMs: number;
- speed: number;
-}
-
-interface RegionSelection {
- kind: "zoom" | "trim" | "annotation" | "speed";
- id: string;
-}
-
-interface TimelinePaneProps {
- clips: AxcutClip[];
- assets: AssetMeta[];
- trimRanges: TrimRange[];
- zoomRegions: ZoomRegion[];
- annotationRegions: AnnotationRegion[];
- speedRegions: SpeedRegion[];
- regionSelection: RegionSelection | null;
- // F2.7 — full shift-click selection set, for multi-select highlighting.
- regionMultiSelection?: RegionSelection[];
- currentTimeSec: number;
- selectedClipId: string | null;
- onSelectClip: (id: string) => void;
- onSelectRegion: (kind: RegionSelection["kind"], id: string, additive?: boolean) => void;
- onSeek: (timelineSec: number) => void;
- onInsertAsset: (assetId: string, index: number) => void;
- onMoveClip: (clipId: string, toIndex: number) => void;
- onEditClip: (clip: AxcutClip) => void;
- onRemoveClip: (clipId: string) => void;
- // T15 — Place-skip callback. Bottombar wires this to
- // tl.addTrimAt(assetId, sourceStartSec, sourceEndSec) so the timeline
- // pane can add a skip at the cursor's source position without jumping
- // the playhead (which onAddTrim / onAddTrimRange can't do).
- onAddTrim?: (assetId: string, sourceStartSec: number, sourceEndSec: number) => void;
- // T10 — dnd-timeline drag/resize dispatch. Bottombar wires this to the
- // per-kind updaters (updateZoomSpan / updateAnnotationSpan / etc).
- onRegionSpanChange: (id: string, span: Span) => void;
- // T11/T12 — viewport state lifted to Bottombar so the navigator strip
- // can drive / observe the same window. TimelinePane stays controlled.
- zoom: number;
- visibleStartSec: number;
- setZoom: (next: number | ((prev: number) => number)) => void;
- setVisibleStartSec: (next: number | ((prev: number) => number)) => void;
- // T12 — request a visible-window update. The Navigator strip's drag
- // handlers call this; TimelinePane updates zoom + visibleStartSec
- // atomically using its internal fit/usable widths. Bottombar exposes
- // this to the navigator via prop drilling.
- onVisibleWindowRequest?: (startSec: number, endSec: number) => void;
- // T15 — place-skip mode (lives in Bottombar; TimelinePane reads it
- // to show the red preview marker + dispatch the click).
- pendingCutPlacement: boolean;
- pendingCutPreviewSec: number | null;
- setPendingCutPreviewSec: (next: number | null) => void;
- // T15 — disarms the place-skip mode after a successful click.
- onCancelPlaceTrim: () => void;
-}
-
-// T07 — Pan via Alt+drag or middle-click-drag. Refs only; no state needed
-// because the visible window updates frequently and the only side-effect is
-// the cursor class.
-type PanState = {
- startClientX: number;
- startVisibleStartSec: number;
-};
-
-// T08 — Pointer reorder. dragging flips on once the cursor has moved past
-// CLIP_REORDER_THRESHOLD_PX (a small click vs drag distinction); insertIndex
-// is recomputed every move so the live marker tracks the cursor.
-type ClipReorderState = {
- clipId: string;
- startClientX: number;
- startClientY: number;
- currentClientX: number;
- currentClientY: number;
- startLeftPx: number;
- widthPx: number;
- insertIndex: number;
- dragging: boolean;
-};
-
-interface ProjectedClipLayout {
- leftPx: number;
- widthPx: number;
- dragging: boolean;
-}
-
-function clamp(value: number, min: number, max: number): number {
- return Math.min(max, Math.max(min, value));
-}
-
-// Adaptive ruler: major step is the smallest entry in the standard
-// [0.1..600s] ladder whose px-size ≥ 90. Minor ticks fall at major/4. As
-// you zoom in the step shrinks; zoom out, it grows.
-function chooseTickStep(minStepSec: number): number {
- const steps = [0.1, 0.2, 0.5, 1, 2, 5, 10, 15, 30, 60, 120, 300, 600];
- return steps.find((step) => step >= minStepSec) ?? steps.at(-1)!;
-}
-
-interface RulerTick {
- timeSec: number;
- major: boolean;
-}
-
-const ZOOM_LABEL: Record<number, string> = {
- 1: "1.25×",
- 2: "1.5×",
- 3: "1.8×",
- 4: "2.2×",
- 5: "3.5×",
- 6: "5×",
-};
-
-function buildRulerTicks(durationSec: number, pxPerSec: number): RulerTick[] {
- const majorStepSec = chooseTickStep(90 / Math.max(pxPerSec, 0.001));
- const minorStepSec = majorStepSec / 4;
- const ticks: RulerTick[] = [];
- for (let t = 0; t <= durationSec + minorStepSec / 2; t += minorStepSec) {
- const rounded = Number(t.toFixed(4));
- const major = Math.abs(rounded / majorStepSec - Math.round(rounded / majorStepSec)) < 0.001;
- ticks.push({ timeSec: Math.min(durationSec, rounded), major });
- }
- return ticks;
-}
-
-export function TimelinePane({
- clips,
- assets,
- trimRanges,
- zoomRegions,
- annotationRegions,
- speedRegions,
- regionSelection,
- regionMultiSelection,
- currentTimeSec,
- selectedClipId,
- onSelectClip,
- onSelectRegion,
- zoom,
- visibleStartSec,
- setZoom,
- setVisibleStartSec,
- onVisibleWindowRequest,
- pendingCutPlacement,
- pendingCutPreviewSec,
- setPendingCutPreviewSec,
- onCancelPlaceTrim,
- onSeek,
- onInsertAsset,
- onMoveClip,
- onEditClip,
- onRemoveClip,
- onAddTrim,
- onRegionSpanChange,
-}: TimelinePaneProps) {
- const viewportRef = useRef<HTMLDivElement | null>(null);
- const panRef = useRef<PanState | null>(null);
- const clipReorderRef = useRef<ClipReorderState | null>(null);
- const [viewportWidthPx, setViewportWidthPx] = useState(0);
- // T16 — tracks whether the user is currently scrubbing so the body
- // cursor can flip to ew-resize. Cleared on pointerup.
- const [scrubbing, setScrubbing] = useState(false);
- // P3.7 — source time under the cursor while hovering the timeline; drives
- // the ruler's hover marker + time chip. Null when the pointer is outside.
- const [hoverSec, setHoverSec] = useState<number | null>(null);
- // viewport state is owned by Bottombar (T11). We only mirror it here.
- const [panning, setPanning] = useState(false);
- const [clipReorderState, setClipReorderState] = useState<ClipReorderState | null>(null);
- const [dropIndex, setDropIndex] = useState<number | null>(null);
- // T15 — place-skip state lives in Bottombar (it owns the body class
- // + Esc-to-cancel). TimelinePane reads it as a prop to render the
- // preview marker and dispatch the click.
-
- const sourceDuration = useMemo(
- () =>
- Math.max(
- MIN_SOURCE_DURATION_SEC,
- clips.reduce((m, c) => Math.max(m, c.timelineEndSec), 0),
- ),
- [clips],
- );
- // T10 — region lanes read totalMs in ms (dnd-timeline uses ms coords).
- // Equivalent to sourceDuration * 1000.
- const totalMs = Math.round(sourceDuration * 1000);
- const virtualDurationSec = useMemo(
- () => clips.reduce((m, c) => Math.max(m, c.timelineEndSec), 0),
- [clips],
- );
- const usableWidthPx = Math.max(
- 1,
- viewportWidthPx - TIMELINE_START_GUTTER_PX - TIMELINE_END_GUTTER_PX,
- );
- const fitPxPerSec = usableWidthPx / Math.max(sourceDuration, MIN_SOURCE_DURATION_SEC);
- const pxPerSec = clamp(fitPxPerSec * zoom, fitPxPerSec, MAX_PX_PER_SEC);
- const contentWidthPx = Math.max(
- viewportWidthPx,
- sourceDuration * pxPerSec + TIMELINE_START_GUTTER_PX + TIMELINE_END_GUTTER_PX,
- );
- const visibleDurationSec = clamp(usableWidthPx / Math.max(pxPerSec, 0.001), 0, sourceDuration);
- const canvasOffsetPx = visibleStartSec * pxPerSec;
- const ticks = useMemo(
- () => buildRulerTicks(sourceDuration, pxPerSec),
- [sourceDuration, pxPerSec],
- );
-
- const orderedClips = useMemo(
- () => [...clips].sort((a, b) => a.timelineStartSec - b.timelineStartSec),
- [clips],
- );
- const assetLabel = useCallback(
- (assetId: string) => assets.find((a) => a.id === assetId)?.label ?? "Untitled source",
- [assets],
- );
-
- // Skip ranges are source-time and get their own lane (mirrors main's
- // TrimRegion row) instead of the old in-clip chevron strip. Map each
- // skip's source-time span through whichever clip it falls within to
- // get a timeline(ms) span for the lane — same coordinate space the
- // zoom/speed/annotation lanes already use.
- const trimRegionSpans = useMemo(() => {
- const spans: Array<{ id: string; start: number; end: number; durationSec: number }> = [];
- for (const skip of trimRanges) {
- const startPos = locateSourcePosition(orderedClips, skip.startSec, skip.assetId);
- const endPos = locateSourcePosition(orderedClips, skip.endSec, skip.assetId);
- if (!startPos || !endPos) continue;
- spans.push({
- id: skip.id,
- start: startPos.virtualTimeSec * 1000,
- end: endPos.virtualTimeSec * 1000,
- durationSec: skip.endSec - skip.startSec,
- });
- }
- return spans;
- }, [trimRanges, orderedClips]);
-
- useEffect(() => {
- const el = viewportRef.current;
- if (!el) return;
- const updateMetrics = () => {
- setViewportWidthPx(el.clientWidth);
- };
- updateMetrics();
- const observer = new ResizeObserver(updateMetrics);
- observer.observe(el);
- window.addEventListener("resize", updateMetrics);
- return () => {
- observer.disconnect();
- window.removeEventListener("resize", updateMetrics);
- };
- }, []);
-
- // Clamp visibleStartSec into the legal range when sourceDuration or
- // pxPerSec changes (clips arrive, viewport resizes). Bottombar owns
- // the setter; we just invoke it.
- useEffect(() => {
- const maxVisibleStartSec = Math.max(0, sourceDuration - visibleDurationSec);
- setVisibleStartSec((current: number) => clamp(current, 0, maxVisibleStartSec));
- }, [sourceDuration, visibleDurationSec, setVisibleStartSec]);
-
- useEffect(() => {
- if (!panning) {
- document.body.classList.remove("timeline-panning");
- } else {
- document.body.classList.add("timeline-panning");
- }
- return () => {
- document.body.classList.remove("timeline-panning");
- };
- }, [panning]);
-
- // T16 — body cursor class while scrubbing. `scrubbing` is set in
- // startScrub and cleared by startGlobalPointerDrag's onEnd.
- useEffect(() => {
- if (scrubbing) document.body.classList.add("timeline-scrubbing");
- else document.body.classList.remove("timeline-scrubbing");
- return () => document.body.classList.remove("timeline-scrubbing");
- }, [scrubbing]);
-
- useEffect(() => {
- if (!clipReorderState?.dragging) {
- document.body.classList.remove("timeline-reordering");
- } else {
- document.body.classList.add("timeline-reordering");
- }
- return () => {
- document.body.classList.remove("timeline-reordering");
- };
- }, [clipReorderState?.dragging]);
-
- useEffect(
- () => () => {
- document.body.classList.remove("timeline-panning");
- document.body.classList.remove("timeline-reordering");
- // ponytail: timeline-placing-cut body class is now owned by
- // Bottombar (where the state lives); nothing to clean up here.
- },
- [],
- );
-
- // T15 — Place a 1s skip centered on `centerSec` (timeline time),
- // landing inside whatever clip the cursor is over. Mirrors axcut's
- // addCut helper.
- const addCut = useCallback(
- (centerSec: number) => {
- if (orderedClips.length === 0 || !onAddTrim) return;
- const position = locateVirtualPosition(orderedClips, centerSec);
- if (!position) return;
- const clip = position.clip;
- const clipEnd = clip.sourceEndSec ?? clip.sourceStartSec;
- const sourceStartSec = clamp(
- position.sourceTimeSec - 0.5,
- clip.sourceStartSec,
- Math.max(clip.sourceStartSec, clipEnd - 0.1),
- );
- const sourceEndSec = clamp(position.sourceTimeSec + 0.5, sourceStartSec + 0.1, clipEnd);
- onAddTrim(clip.assetId, sourceStartSec, sourceEndSec);
- },
- [orderedClips, onAddTrim],
- );
-
- // Convert screen-x (PointerEvent.clientX) to source-time, accounting for
- // the canvas's translateX pan offset.
- const sourceSecFromClientX = useCallback(
- (clientX: number): number => {
- const viewport = viewportRef.current;
- if (!viewport) return 0;
- const rect = viewport.getBoundingClientRect();
- const canvasX = clientX - rect.left + canvasOffsetPx;
- return clamp(
- (canvasX - TIMELINE_START_GUTTER_PX) / Math.max(pxPerSec, 0.001),
- 0,
- sourceDuration,
- );
- },
- [canvasOffsetPx, pxPerSec, sourceDuration],
- );
-
- // T08 — Given a clip center in canvas-x coords, find the insertion index
- // where the moving clip would land. axcut TimelinePane.tsx
- // insertionIndexFromClipCenter.
- const insertionIndexFromClipCenter = useCallback(
- (clipId: string, clipCenterPx: number): number => {
- const timelineSec = clamp(
- (clipCenterPx - TIMELINE_START_GUTTER_PX) / Math.max(pxPerSec, 0.001),
- 0,
- sourceDuration,
- );
- const remainingClips = orderedClips.filter((clip) => clip.id !== clipId);
- for (let i = 0; i < remainingClips.length; i += 1) {
- const c = remainingClips[i];
- const midpointSec = (c.timelineStartSec + c.timelineEndSec) / 2;
- if (timelineSec < midpointSec) return i;
- }
- return remainingClips.length;
- },
- [orderedClips, pxPerSec, sourceDuration],
- );
-
- const isReorderNoop = useCallback(
- (clipId: string, insertIndex: number): boolean => {
- const currentIds = orderedClips.map((clip) => clip.id);
- const movingClip = orderedClips.find((clip) => clip.id === clipId);
- if (!movingClip) return true;
- const remainingIds = currentIds.filter((id) => id !== clipId);
- const nextIds = [
- ...remainingIds.slice(0, insertIndex),
- clipId,
- ...remainingIds.slice(insertIndex),
- ];
- return (
- nextIds.length === currentIds.length &&
- nextIds.every((id, index) => id === currentIds[index])
- );
- },
- [orderedClips],
- );
-
- const indexFromClientX = useCallback(
- (clientX: number): number => {
- const timelineSec = sourceSecFromClientX(clientX);
- for (let i = 0; i < orderedClips.length; i += 1) {
- const c = orderedClips[i];
- const midpointSec = (c.timelineStartSec + c.timelineEndSec) / 2;
- if (timelineSec < midpointSec) return i;
- }
- return orderedClips.length;
- },
- [orderedClips, sourceSecFromClientX],
- );
-
- const dropMarkerLeftPx = useMemo(() => {
- if (dropIndex === null) return null;
- const boundarySec =
- dropIndex <= 0
- ? 0
- : dropIndex >= orderedClips.length
- ? (orderedClips[orderedClips.length - 1]?.timelineEndSec ?? 0)
- : (orderedClips[dropIndex]?.timelineStartSec ?? 0);
- return TIMELINE_START_GUTTER_PX + boundarySec * pxPerSec;
- }, [dropIndex, orderedClips, pxPerSec]);
-
- // T08 — Reorder marker lives at the boundary the moving clip would land
- // on, i.e. the timeline position where its START will be after the move.
- // In our model clips are contiguous (resequenceClips packs them back-to-
- // back), so when the moving clip lands at slot k the boundary equals the
- // END of the clip currently in slot k-1 (= the START of the slot where
- // the clip will go).
- //
- // ponytail: axcut's marker uses `remainingClips[insertIndex].timelineStartSec`,
- // which works in axcut's pre-resequence render but reads the WRONG boundary
- // in ours — it points to the next non-moving clip's start (e.g. sec 30),
- // not the contiguous boundary (e.g. sec 10). Fix: end of the preceding clip.
- const reorderMarkerLeftPx = useMemo(() => {
- if (!clipReorderState) return null;
- const remainingClips = orderedClips.filter((clip) => clip.id !== clipReorderState.clipId);
- const boundarySec =
- clipReorderState.insertIndex <= 0
- ? 0
- : (remainingClips[clipReorderState.insertIndex - 1]?.timelineEndSec ?? virtualDurationSec);
- return TIMELINE_START_GUTTER_PX + boundarySec * pxPerSec;
- }, [clipReorderState, orderedClips, pxPerSec, virtualDurationSec]);
-
- // T08 — Each clip's effective leftPx/widthPx during a reorder drag.
- // Outside of drag: matches the clip's natural timeline position.
- // During drag: moving clip follows cursor, remaining clips resequence
- // from 0 to fill the gap. axcut TimelinePane.tsx projectedClipLayoutById.
- const projectedClipLayoutById = useMemo(() => {
- const layout = new Map<string, ProjectedClipLayout>();
- if (!clipReorderState?.dragging) {
- for (const clip of orderedClips) {
- layout.set(clip.id, {
- leftPx: TIMELINE_START_GUTTER_PX + clip.timelineStartSec * pxPerSec,
- widthPx: Math.max(1, (clip.timelineEndSec - clip.timelineStartSec) * pxPerSec),
- dragging: false,
- });
- }
- return layout;
- }
- const movingClip = orderedClips.find((clip) => clip.id === clipReorderState.clipId);
- if (!movingClip) return layout;
- const remainingClips = orderedClips.filter((clip) => clip.id !== clipReorderState.clipId);
- const projectedOrder = [
- ...remainingClips.slice(0, clipReorderState.insertIndex),
- movingClip,
- ...remainingClips.slice(clipReorderState.insertIndex),
- ];
- let cursorSec = 0;
- for (const clip of projectedOrder) {
- const durationSec = Math.max(0, clip.timelineEndSec - clip.timelineStartSec);
- const isDragging = clip.id === clipReorderState.clipId;
- const widthPx = Math.max(1, durationSec * pxPerSec);
- const dragLeftPx = clamp(
- clipReorderState.startLeftPx +
- clipReorderState.currentClientX -
- clipReorderState.startClientX,
- TIMELINE_START_GUTTER_PX,
- Math.max(TIMELINE_START_GUTTER_PX, contentWidthPx - TIMELINE_END_GUTTER_PX - widthPx),
- );
- layout.set(clip.id, {
- leftPx: isDragging ? dragLeftPx : TIMELINE_START_GUTTER_PX + cursorSec * pxPerSec,
- widthPx,
- dragging: isDragging,
- });
- cursorSec += durationSec;
- }
- return layout;
- }, [clipReorderState, contentWidthPx, orderedClips, pxPerSec]);
-
- const handleDragOver = useCallback(
- (e: ReactDragEvent<HTMLDivElement>) => {
- const dt = e.dataTransfer;
- const isAsset = dt.types.includes(ASSET_MIME);
- if (!isAsset) return;
- e.preventDefault();
- dt.dropEffect = "copy";
- setDropIndex(indexFromClientX(e.clientX));
- },
- [indexFromClientX],
- );
-
- const handleDrop = useCallback(
- (e: ReactDragEvent<HTMLDivElement>) => {
- const index = indexFromClientX(e.clientX);
- const assetId = e.dataTransfer.getData(ASSET_MIME);
- setDropIndex(null);
- if (!assetId) return;
- e.preventDefault();
- onInsertAsset(assetId, index);
- },
- [indexFromClientX, onInsertAsset],
- );
-
- // T07 — Pan via Alt+drag or middle-click-drag. Skips if everything fits
- // the viewport (no pan needed). Mirrors axcut startPan.
- const startPan = useCallback(
- (event: ReactPointerEvent<HTMLDivElement>) => {
- if (visibleDurationSec >= sourceDuration) return;
- event.preventDefault();
- panRef.current = {
- startClientX: event.clientX,
- startVisibleStartSec: visibleStartSec,
- };
- setPanning(true);
- startGlobalPointerDrag(event, {
- onMove: (moveEvent) => {
- const pan = panRef.current;
- if (!pan) return;
- const maxVisibleStartSec = Math.max(0, sourceDuration - visibleDurationSec);
- const deltaSec = (moveEvent.clientX - pan.startClientX) / Math.max(pxPerSec, 0.001);
- setVisibleStartSec(clamp(pan.startVisibleStartSec - deltaSec, 0, maxVisibleStartSec));
- },
- onEnd: () => {
- panRef.current = null;
- setPanning(false);
- },
- });
- },
- [pxPerSec, sourceDuration, visibleDurationSec, visibleStartSec, setVisibleStartSec],
- );
-
- // Scrub via plain click+drag. Uses startGlobalPointerDrag so the drag
- // survives the pointer leaving the viewport.
- const startScrub = useCallback(
- (event: ReactPointerEvent<HTMLDivElement>) => {
- const target = event.target as Element | null;
- if (target?.closest("button, [data-clip-idx]")) return;
- if (event.button !== 0 || orderedClips.length === 0) return;
- event.preventDefault();
- onSeek(sourceSecFromClientX(event.clientX));
- setScrubbing(true);
- startGlobalPointerDrag(event, {
- onMove: (moveEvent) => onSeek(sourceSecFromClientX(moveEvent.clientX)),
- onEnd: () => setScrubbing(false),
- });
- },
- [onSeek, orderedClips.length, sourceSecFromClientX],
- );
-
- // Dispatch from the viewport's pointerdown. Order:
- // Alt/middle-click → pan; default click+drag → scrub.
- // Clip blocks and skip chevrons handle their own pointerdown and call
- // event.stopPropagation() to prevent this from firing.
- const handleTimelinePointerDown = useCallback(
- (event: ReactPointerEvent<HTMLDivElement>) => {
- // T15 — Place-skip mode. A left-click places a 1s skip centered
- // on the cursor; Esc cancels. Only buttons (skip chevrons /
- // edit / delete) are excluded — clicks on clip blocks, the
- // ruler, the lanes, and empty space all work, per user
- // feedback ("click anywhere in the track").
- if (pendingCutPlacement && event.button === 0) {
- const target = event.target as Element | null;
- if (target?.closest("button")) return;
- event.preventDefault();
- event.stopPropagation();
- addCut(sourceSecFromClientX(event.clientX));
- setPendingCutPreviewSec(null);
- onCancelPlaceTrim();
- return;
- }
- if (event.altKey || event.button === 1) {
- startPan(event);
- return;
- }
- startScrub(event);
- },
- [
- pendingCutPlacement,
- addCut,
- sourceSecFromClientX,
- setPendingCutPreviewSec,
- onCancelPlaceTrim,
- startPan,
- startScrub,
- ],
- );
-
- // T08 — Clip body pointerdown → reorder. 6px move threshold before the
- // gesture is treated as a drag (vs. a click that selects). Mirrors axcut
- // startClipReorder.
- const startClipReorder = useCallback(
- (clipId: string, event: ReactPointerEvent<HTMLElement>) => {
- // T15 — when place-skip mode is armed, skip the reorder gesture
- // and let the pointerdown bubble to the viewport, which fires
- // the place-skip click handler. Stops grab-cursor + reorder
- // from hijacking the user's intent.
- if (pendingCutPlacement) return;
- if (event.button !== 0) return;
- event.preventDefault();
- event.stopPropagation();
- const movingClip = orderedClips.find((clip) => clip.id === clipId);
- if (!movingClip) return;
- onSelectClip(clipId);
- const movingClipLeftPx = TIMELINE_START_GUTTER_PX + movingClip.timelineStartSec * pxPerSec;
- const movingClipWidthPx = Math.max(
- 1,
- (movingClip.timelineEndSec - movingClip.timelineStartSec) * pxPerSec,
- );
- const initial: ClipReorderState = {
- clipId,
- startClientX: event.clientX,
- startClientY: event.clientY,
- currentClientX: event.clientX,
- currentClientY: event.clientY,
- startLeftPx: movingClipLeftPx,
- widthPx: movingClipWidthPx,
- insertIndex: insertionIndexFromClipCenter(clipId, movingClipLeftPx + movingClipWidthPx / 2),
- dragging: false,
- };
- clipReorderRef.current = initial;
- setClipReorderState(initial);
-
- startGlobalPointerDrag(event, {
- onMove: (moveEvent) => {
- const current = clipReorderRef.current;
- if (!current) return;
- const deltaX = moveEvent.clientX - current.startClientX;
- const deltaY = moveEvent.clientY - current.startClientY;
- const dragging =
- current.dragging || Math.hypot(deltaX, deltaY) >= CLIP_REORDER_THRESHOLD_PX;
- const clipCenterPx = current.startLeftPx + deltaX + current.widthPx / 2;
- const next: ClipReorderState = {
- ...current,
- currentClientX: moveEvent.clientX,
- currentClientY: moveEvent.clientY,
- insertIndex: insertionIndexFromClipCenter(current.clipId, clipCenterPx),
- dragging,
- };
- clipReorderRef.current = next;
- setClipReorderState(next);
- },
- onEnd: () => {
- const current = clipReorderRef.current;
- const shouldMove = Boolean(
- current?.dragging && current && !isReorderNoop(current.clipId, current.insertIndex),
- );
- if (shouldMove && current) {
- onMoveClip(current.clipId, current.insertIndex);
- }
- clipReorderRef.current = null;
- setClipReorderState(null);
- },
- });
- },
- [
- insertionIndexFromClipCenter,
- isReorderNoop,
- onMoveClip,
- onSelectClip,
- orderedClips,
- pendingCutPlacement,
- pxPerSec,
- ],
- );
-
- // T12 — setVisibleWindow helper. Computes the new pxPerSec to fit
- // [startSec, endSec] into the viewport, derives the matching zoom
- // multiplier, and updates visibleStartSec + zoom atomically. axcut
- // TimelinePane.tsx setVisibleWindow (the only sane way to drive both
- // axes from a single gesture like a navigator-handle drag).
- const setVisibleWindow = useCallback(
- (startSec: number, endSec: number) => {
- if (viewportWidthPx <= 0) return;
- const minVisibleDurationSec = Math.min(
- sourceDuration,
- Math.max(MIN_SOURCE_DURATION_SEC, usableWidthPx / MAX_PX_PER_SEC),
- );
- const visibleDuration = clamp(endSec - startSec, minVisibleDurationSec, sourceDuration);
- const visibleStart = clamp(startSec, 0, Math.max(0, sourceDuration - visibleDuration));
- const nextPxPerSec = usableWidthPx / Math.max(visibleDuration, MIN_SOURCE_DURATION_SEC);
- const nextZoom = clamp(
- nextPxPerSec / Math.max(fitPxPerSec, 0.001),
- 1,
- MAX_PX_PER_SEC / Math.max(fitPxPerSec, 0.001),
- );
- setZoom(Number(nextZoom.toFixed(3)));
- setVisibleStartSec(visibleStart);
- },
- [viewportWidthPx, usableWidthPx, fitPxPerSec, sourceDuration, setZoom, setVisibleStartSec],
- );
-
- // ponytail: expose setVisibleWindow to the navigator via the
- // onVisibleWindowRequest prop. Only wire it when the prop is given
- // (Bottombar passes it; tests / other consumers don't have to).
- useEffect(() => {
- if (!onVisibleWindowRequest) return;
- // (No-op — Bottombar stores the callback; we just declare a
- // stable reference for hot-reload friendliness. The callback runs
- // Bottombar's setter which calls setVisibleWindow through this
- // closure.)
- }, [onVisibleWindowRequest]);
-
- const handleWheel = useCallback(
- (event: ReactWheelEvent<HTMLDivElement>) => {
- if (!(event.ctrlKey || event.metaKey)) return;
- event.preventDefault();
- const direction = event.deltaY > 0 ? -1 : 1;
- const factor = direction > 0 ? 1.18 : 1 / 1.18;
- setZoom((z) => {
- const maxZoom = MAX_PX_PER_SEC / Math.max(fitPxPerSec, 0.001);
- const next = clamp(z * factor, 1, maxZoom);
- const rect = viewportRef.current?.getBoundingClientRect();
- if (!rect) return next;
- const anchorOffsetPx = clamp(event.clientX - rect.left, 0, rect.width);
- const sourceAtAnchor =
- visibleStartSec + (anchorOffsetPx - TIMELINE_START_GUTTER_PX) / Math.max(pxPerSec, 0.001);
- const nextPxPerSec = clamp(fitPxPerSec * next, fitPxPerSec, MAX_PX_PER_SEC);
- const nextVisibleDurationSec = clamp(
- usableWidthPx / Math.max(nextPxPerSec, 0.001),
- 0,
- sourceDuration,
- );
- const maxVisibleStartSec = Math.max(0, sourceDuration - nextVisibleDurationSec);
- setVisibleStartSec(
- clamp(
- sourceAtAnchor - (anchorOffsetPx - TIMELINE_START_GUTTER_PX) / nextPxPerSec,
- 0,
- maxVisibleStartSec,
- ),
- );
- return Number(next.toFixed(3));
- });
- },
- [
- fitPxPerSec,
- pxPerSec,
- sourceDuration,
- usableWidthPx,
- visibleStartSec,
- setZoom,
- setVisibleStartSec,
- ],
- );
-
- // F2.7 — a region is highlighted when it's the focused selection or part
- // of the shift-click multi-selection.
- const isRegionSelected = (kind: RegionSelection["kind"], id: string) =>
- (regionSelection?.kind === kind && regionSelection.id === id) ||
- (regionMultiSelection?.some((h) => h.kind === kind && h.id === id) ?? false);
-
- return (
- // ponytail: data-* hooks let the Playwright test agent assert on
- // observable behavior (zoom, scrub, region count) without scraping
- // the DOM. Stays in sync with state automatically — render-only,
- // no logic change.
- <section
- className={styles.pane}
- data-testid="timeline-pane"
- data-clip-count={orderedClips.length}
- data-skip-count={trimRanges.length}
- data-zoom-range-count={zoomRegions.length}
- data-annotation-count={annotationRegions.length}
- data-current-time-sec={currentTimeSec.toFixed(3)}
- data-zoom-multiplier={zoom.toFixed(3)}
- >
- <div
- ref={viewportRef}
- className={
- panning
- ? `${styles.viewport} ${styles.panning}`
- : clipReorderState?.dragging
- ? `${styles.viewport} ${styles.reordering}`
- : scrubbing
- ? `${styles.viewport} ${styles.scrubbing}`
- : pendingCutPlacement
- ? `${styles.viewport} ${styles.placingCut}`
- : styles.viewport
- }
- data-testid="timeline-viewport"
- data-px-per-sec={pxPerSec.toFixed(2)}
- onPointerDown={handleTimelinePointerDown}
- onPointerMove={(event) => {
- // pointerType guards against touch-emulation hover
- if (event.pointerType === "touch") return;
- if (pendingCutPlacement) {
- setPendingCutPreviewSec(sourceSecFromClientX(event.clientX));
- return;
- }
- // P3.7 — hover feedback: a marker + time chip in the ruler
- // under the cursor. Click to seek (startScrub handles it).
- if (orderedClips.length > 0) {
- setHoverSec(Math.max(0, Math.min(sourceDuration, sourceSecFromClientX(event.clientX))));
- }
- }}
- onPointerLeave={() => {
- if (pendingCutPlacement) setPendingCutPreviewSec(null);
- setHoverSec(null);
- }}
- onDragOver={handleDragOver}
- onDragLeave={() => setDropIndex(null)}
- onDrop={handleDrop}
- onWheel={handleWheel}
- aria-label={
- pendingCutPlacement
- ? "Place-skip mode. Click on a clip to drop a 1s cut, or press Esc to cancel."
- : "Source timeline. Click and drag to scrub, Alt+drag to pan, Ctrl+wheel to zoom."
- }
- >
- {clips.length === 0 ? (
- <div className={styles.empty} data-drop-active={dropIndex !== null}>
- Drag a video from the media panel here to start your timeline.
- </div>
- ) : (
- <div
- className={styles.canvas}
- style={{
- width: contentWidthPx,
- transform: `translateX(${-canvasOffsetPx}px)`,
- }}
- >
- <div className={styles.ruler}>
- {ticks.map((tick) => (
- <div
- key={`${tick.timeSec}-${tick.major ? "m" : "n"}`}
- className={tick.major ? `${styles.tick} ${styles.major}` : styles.tick}
- style={{
- left: TIMELINE_START_GUTTER_PX + tick.timeSec * pxPerSec,
- }}
- >
- {tick.major ? <span>{formatSeconds(tick.timeSec)}</span> : null}
- </div>
- ))}
- {hoverSec !== null && !scrubbing && !panning ? (
- <>
- <div
- className={styles.hoverGuide}
- style={{ left: TIMELINE_START_GUTTER_PX + hoverSec * pxPerSec }}
- />
- <div
- className={styles.dragTooltip}
- style={{ left: TIMELINE_START_GUTTER_PX + hoverSec * pxPerSec + 6 }}
- >
- {formatSeconds(hoverSec)}
- </div>
- </>
- ) : null}
- </div>
- {/* T10 — region lanes (annotation / speed / zoom). They live
- inside the same .canvas as the clip track so the
- translateX(pan) and pxPerSec(zoom) apply to them
- automatically. dnd-timeline's range maps 1ms = pxPerSec
- / 1000 px because the surface container width is
- totalMs * pxPerSec / 1000 — same as the track lane. */}
- <div className={styles.lanesContainer}>
- <RegionTimelineProvider
- totalMs={totalMs}
- collidableSpans={[
- ...zoomRegions.map((z) => ({
- id: z.id,
- rowId: "zoom",
- start: z.startMs,
- end: z.endMs,
- })),
- ...speedRegions.map((s) => ({
- id: s.id,
- rowId: "speed",
- start: s.startMs,
- end: s.endMs,
- })),
- ...trimRegionSpans.map((s) => ({
- id: s.id,
- rowId: "trim",
- start: s.start,
- end: s.end,
- })),
- ]}
- onItemSpanChange={onRegionSpanChange}
- >
- <RegionTimelineSurface pxPerSec={pxPerSec} totalMs={totalMs}>
- <RegionRow id="annotation" empty="No annotations yet">
- {annotationRegions.map((a) => (
- <RegionItem
- key={a.id}
- id={a.id}
- rowId="annotation"
- span={{ start: a.startMs, end: a.endMs }}
- label={a.textContent?.slice(0, 40) || "Annotation"}
- icon={<MessageSquare size={11} strokeWidth={2} aria-hidden="true" />}
- selected={isRegionSelected("annotation", a.id)}
- onSelect={(additive) => onSelectRegion("annotation", a.id, additive)}
- variant="annotation"
- />
- ))}
- </RegionRow>
- <RegionRow id="speed" empty="Constant speed">
- {speedRegions.map((s) => (
- <RegionItem
- key={s.id}
- id={s.id}
- rowId="speed"
- span={{ start: s.startMs, end: s.endMs }}
- label={`${s.speed.toFixed(1)}×`}
- icon={<Timer size={11} strokeWidth={2} aria-hidden="true" />}
- selected={isRegionSelected("speed", s.id)}
- onSelect={(additive) => onSelectRegion("speed", s.id, additive)}
- variant="speed"
- />
- ))}
- </RegionRow>
- <RegionRow id="trim" empty="No skips">
- {trimRegionSpans.map((s) => (
- <RegionItem
- key={s.id}
- id={s.id}
- rowId="trim"
- span={{ start: s.start, end: s.end }}
- label={formatSeconds(s.durationSec)}
- icon={<Scissors size={11} strokeWidth={2} aria-hidden="true" />}
- selected={isRegionSelected("trim", s.id)}
- onSelect={(additive) => onSelectRegion("trim", s.id, additive)}
- variant="trim"
- />
- ))}
- </RegionRow>
- <RegionRow id="zoom" empty="No zoom regions">
- {zoomRegions.map((z) => (
- <RegionItem
- key={z.id}
- id={z.id}
- rowId="zoom"
- span={{ start: z.startMs, end: z.endMs }}
- label={
- z.customScale
- ? `${z.customScale.toFixed(1)}×`
- : (ZOOM_LABEL[z.depth ?? 1] ?? "1.8×")
- }
- icon={<ZoomIn size={11} strokeWidth={2} aria-hidden="true" />}
- selected={isRegionSelected("zoom", z.id)}
- onSelect={(additive) => onSelectRegion("zoom", z.id, additive)}
- variant="zoom"
- />
- ))}
- </RegionRow>
- </RegionTimelineSurface>
- </RegionTimelineProvider>
- </div>
- <div className={styles.trackLane}>
- {orderedClips.map((clip, i) => {
- const layout = projectedClipLayoutById.get(clip.id);
- const baseLeftPx =
- layout?.leftPx ?? TIMELINE_START_GUTTER_PX + clip.timelineStartSec * pxPerSec;
- const baseWidthPx =
- layout?.widthPx ??
- Math.max(1, (clip.timelineEndSec - clip.timelineStartSec) * pxPerSec);
-
- // ponytail: per user feedback (round 2), clip blocks NEVER merge visually
- // even when adjacent. The .joinedPrev / .joinedNext classes are removed
- // from the rendered classList, and the CSS for them is dropped too.
- // Adjacent clips keep their own border + border-radius on every side.
- const selected = clip.id === selectedClipId;
- const classes = [styles.trackBlock];
- if (selected) classes.push(styles.selected);
- if (layout?.dragging) classes.push(styles.reordering);
- return (
- <div
- key={clip.id}
- data-clip-idx={i}
- className={classes.join(" ")}
- style={{
- left: baseLeftPx,
- width: baseWidthPx,
- }}
- onPointerDown={(e) => startClipReorder(clip.id, e)}
- onClick={(e) => {
- // If the gesture upgraded to a reorder drag, suppress
- // the synthetic click. startClipReorder sets
- // clipReorderState.dragging only after the threshold.
- if (clipReorderState?.clipId === clip.id && clipReorderState.dragging) {
- e.stopPropagation();
- return;
- }
- e.stopPropagation();
- onSelectClip(clip.id);
- }}
- onKeyDown={(e) => {
- if (e.key === "Enter" || e.key === " ") {
- e.preventDefault();
- onSelectClip(clip.id);
- }
- }}
- role="button"
- tabIndex={0}
- aria-pressed={selected}
- title={`${assetLabel(clip.assetId)} · ${formatSeconds(clip.timelineStartSec)}–${formatSeconds(clip.timelineEndSec)}`}
- >
- <div className={styles.trackVisual}>
- <div
- className={`${styles.segment} ${styles.keep}`}
- aria-hidden="true"
- style={{ flexGrow: 100 }}
- />
- </div>
- <div className={styles.trackInfo}>
- <button
- type="button"
- className={styles.editIcon}
- aria-label="Edit clip"
- title="Edit clip in/out points"
- onPointerDown={(e) => e.stopPropagation()}
- onClick={(e) => {
- e.stopPropagation();
- onEditClip(clip);
- }}
- >
- <Pencil size={9} />
- </button>
- <div className={styles.trackText}>
- <h3 className={styles.trackTitle}>{assetLabel(clip.assetId)}</h3>
- <p className={styles.trackSubtitle}>
- {formatSeconds(clip.timelineStartSec)} —{" "}
- {formatSeconds(clip.timelineEndSec)} <span>•</span> source{" "}
- {formatSeconds(clip.sourceStartSec)}–
- {formatSeconds(clip.sourceEndSec ?? clip.sourceStartSec)}
- </p>
- </div>
- <button
- type="button"
- className={styles.clipDelete}
- aria-label="Remove clip"
- title="Remove clip from timeline"
- onPointerDown={(e) => e.stopPropagation()}
- onClick={(e) => {
- e.stopPropagation();
- onRemoveClip(clip.id);
- }}
- >
- <Trash2 size={13} />
- </button>
- </div>
- </div>
- );
- })}
- <div
- className={styles.playhead}
- style={{ left: TIMELINE_START_GUTTER_PX + currentTimeSec * pxPerSec }}
- aria-hidden="true"
- />
- {dropMarkerLeftPx !== null ? (
- <div
- className={styles.dropMarker}
- style={{ left: dropMarkerLeftPx }}
- aria-hidden="true"
- />
- ) : null}
- {clipReorderState?.dragging && reorderMarkerLeftPx !== null ? (
- <div
- className={styles.reorderMarker}
- style={{ left: reorderMarkerLeftPx }}
- aria-hidden="true"
- />
- ) : null}
- </div>
- {/* T15 — Place-skip marker is a SIBLING of .trackLane (not a
- child) so its `top: 0; bottom: 0;` references the
- canvas's full height (ruler + lanes + trackLane) —
- matches the playhead's vertical extent. */}
- {pendingCutPlacement && pendingCutPreviewSec !== null ? (
- <div
- className={styles.placementMarker}
- style={{
- left: TIMELINE_START_GUTTER_PX + pendingCutPreviewSec * pxPerSec,
- }}
- aria-hidden="true"
- />
- ) : null}
- </div>
- )}
- </div>
- {/* T14 — header row: clip / skip counts, total time, current
- time, and the Place-skip toggle. */}
- <header className={styles.timelineHeader}>
- <span className={styles.headerStat}>
- {orderedClips.length} clip{orderedClips.length === 1 ? "" : "s"}
- </span>
- <span className={styles.headerDivider}>·</span>
- <span className={styles.headerStat}>
- {trimRanges.length} skip{trimRanges.length === 1 ? "" : "s"}
- </span>
- <span className={styles.headerDivider}>·</span>
- <span className={styles.headerStat}>{formatSeconds(virtualDurationSec)} total</span>
- <span className={styles.headerSpacer} />
- {pendingCutPlacement ? (
- <span
- className={`${styles.headerButton} ${styles.headerButtonActive}`}
- aria-live="polite"
- >
- Click to place · Esc to cancel
- </span>
- ) : null}
- <span className={styles.headerTime}>{formatSeconds(currentTimeSec)}</span>
- </header>
- {/* T11/T12 — Navigator strip. Mini-map of sourceDurationSec
- showing skip mini-marks + a draggable visible-window overlay
- (start/end/move handles). Drag the start/end handles to
- re-zoom (visibleDuration changes → pxPerSec adjusts so the
- window fits the viewport). Drag the body to pan. axcut
- TimelinePane.tsx timeline-navigator. Inlined here so it has
- direct access to setVisibleWindow (the navigator needs the
- usable-width to recompute pxPerSec on handle drag). */}
- <Navigator
- trimRanges={trimRanges}
- sourceDurationSec={sourceDuration}
- visibleStartSec={visibleStartSec}
- visibleEndSec={visibleStartSec + visibleDurationSec}
- onSetVisibleWindow={setVisibleWindow}
- />
- </section>
- );
-}
-
-// T11/T12 — Navigator subcomponent. Self-contained; uses
-// NewEditorShell.module.css styles via the parent's CSS module import.
-interface NavigatorProps {
- trimRanges: TrimRange[];
- sourceDurationSec: number;
- visibleStartSec: number;
- visibleEndSec: number;
- onSetVisibleWindow: (startSec: number, endSec: number) => void;
-}
-
-type NavigatorDragMode = "move" | "start" | "end";
-
-function Navigator({
- trimRanges,
- sourceDurationSec,
- visibleStartSec,
- visibleEndSec,
- onSetVisibleWindow,
-}: NavigatorProps) {
- const overviewRef = useRef<HTMLDivElement | null>(null);
- const dragRef = useRef<{
- mode: NavigatorDragMode;
- startClientX: number;
- overviewWidthPx: number;
- startVisibleStartSec: number;
- startVisibleEndSec: number;
- } | null>(null);
- const [dragging, setDragging] = useState(false);
-
- const safeSource = Math.max(sourceDurationSec, 0.001);
- const safeVisibleStart = clamp(visibleStartSec, 0, safeSource);
- const safeVisibleEnd = clamp(visibleEndSec, safeVisibleStart, safeSource);
- const windowStyle = useMemo(
- () => ({
- left: `${(safeVisibleStart / safeSource) * 100}%`,
- width: `${Math.max(0, ((safeVisibleEnd - safeVisibleStart) / safeSource) * 100)}%`,
- }),
- [safeSource, safeVisibleStart, safeVisibleEnd],
- );
-
- useEffect(
- () => () => {
- dragRef.current = null;
- },
- [],
- );
-
- const startDrag = useCallback(
- (mode: NavigatorDragMode, event: ReactPointerEvent<HTMLElement>) => {
- const overview = overviewRef.current;
- if (!overview) return;
- event.preventDefault();
- event.stopPropagation();
- dragRef.current = {
- mode,
- startClientX: event.clientX,
- overviewWidthPx: Math.max(1, overview.clientWidth),
- startVisibleStartSec: safeVisibleStart,
- startVisibleEndSec: safeVisibleEnd,
- };
- setDragging(true);
- startGlobalPointerDrag(event, {
- onMove: (moveEvent) => {
- const current = dragRef.current;
- if (!current) return;
- const deltaFrac = (moveEvent.clientX - current.startClientX) / current.overviewWidthPx;
- const deltaSec = deltaFrac * safeSource;
- if (current.mode === "move") {
- const duration = current.startVisibleEndSec - current.startVisibleStartSec;
- const nextStart = clamp(
- current.startVisibleStartSec + deltaSec,
- 0,
- Math.max(0, safeSource - duration),
- );
- onSetVisibleWindow(nextStart, nextStart + duration);
- return;
- }
- if (current.mode === "start") {
- const minVisibleDurationSec = Math.max(0.1, safeSource / 280);
- const maxStart = Math.max(0, current.startVisibleEndSec - minVisibleDurationSec);
- const nextStart = clamp(current.startVisibleStartSec + deltaSec, 0, maxStart);
- onSetVisibleWindow(nextStart, current.startVisibleEndSec);
- return;
- }
- // mode === "end"
- const minVisibleDurationSec = Math.max(0.1, safeSource / 280);
- const minEnd = Math.min(safeSource, current.startVisibleStartSec + minVisibleDurationSec);
- const nextEnd = clamp(current.startVisibleEndSec + deltaSec, minEnd, safeSource);
- onSetVisibleWindow(current.startVisibleStartSec, nextEnd);
- },
- onEnd: () => {
- dragRef.current = null;
- setDragging(false);
- },
- });
- },
- [safeSource, safeVisibleStart, safeVisibleEnd, onSetVisibleWindow],
- );
-
- return (
- <div
- ref={overviewRef}
- className={
- dragging ? `${styles.timelineNavigator} ${styles.navigating}` : styles.timelineNavigator
- }
- aria-label="Timeline zoom and pan navigator"
- >
- <div className={styles.timelineNavigatorContent}>
- {trimRanges.map((skip) => (
- <span
- key={skip.id}
- className={styles.timelineNavigatorSkip}
- style={{
- left: `${(skip.startSec / safeSource) * 100}%`,
- width: `${((skip.endSec - skip.startSec) / safeSource) * 100}%`,
- }}
- />
- ))}
- </div>
- <div
- className={styles.timelineNavigatorWindow}
- style={windowStyle}
- onPointerDown={(event) => startDrag("move", event)}
- >
- <span
- className={styles.timelineNavigatorHandleStart}
- onPointerDown={(event) => startDrag("start", event)}
- />
- <span
- className={styles.timelineNavigatorHandleEnd}
- onPointerDown={(event) => startDrag("end", event)}
- />
- </div>
- </div>
- );
-}
diff --git a/src/components/ai-edition/Titlebar.tsx b/src/components/ai-edition/Titlebar.tsx
deleted file mode 100644
index 8675947b4..000000000
--- a/src/components/ai-edition/Titlebar.tsx
+++ /dev/null
@@ -1,522 +0,0 @@
-import {
- ChevronDown,
- Download,
- FileVideo,
- FolderOpen,
- FolderPlus,
- Languages,
- Moon,
- PanelLeft,
- PanelRight,
- Rows3,
- Save,
- Settings,
- Sun,
- Video,
-} from "lucide-react";
-import { type ReactNode, useEffect, useRef, useState } from "react";
-import { useI18n } from "@/contexts/I18nContext";
-import { useTheme } from "@/hooks/useTheme";
-import type { Locale } from "@/i18n/config";
-import styles from "./NewEditorShell.module.css";
-
-interface ProjectSummary {
- id: string;
- title: string;
- updatedAt: string;
-}
-
-export interface TitlebarActions {
- openProject: () => void;
- newProject: () => void;
- save: () => void;
- saveAs: () => void;
- newRecording: () => void;
- recorder: () => void;
- export: () => void;
- toggleLeft: () => void;
- toggleRight: () => void;
- toggleBottom: () => void;
- openSettings: () => void;
- renameProject: (title: string) => void;
-}
-
-interface TitlebarProps {
- project: ProjectSummary | null;
- dirty: boolean;
- lastSavedAt: Date | null;
- canExport: boolean;
- leftCollapsed: boolean;
- rightCollapsed: boolean;
- bottomCollapsed: boolean;
- actions: TitlebarActions;
-}
-
-function timeAgo(d: Date | null): string {
- if (!d) return "Not saved yet";
- const delta = Date.now() - d.getTime();
- if (delta < 5_000) return "just now";
- if (delta < 60_000) return `${Math.floor(delta / 1000)}s ago`;
- if (delta < 3_600_000) return `${Math.floor(delta / 60_000)}m ago`;
- if (delta < 86_400_000) return `${Math.floor(delta / 3_600_000)}h ago`;
- return d.toLocaleDateString();
-}
-
-export function Titlebar({
- project,
- dirty,
- lastSavedAt,
- canExport,
- leftCollapsed,
- rightCollapsed,
- bottomCollapsed,
- actions,
-}: TitlebarProps) {
- const { theme, toggle: toggleTheme } = useTheme();
- const [, setTick] = useState(0);
-
- useEffect(() => {
- if (dirty || !lastSavedAt) return;
- const timer = setInterval(() => {
- setTick((t) => t + 1);
- }, 10_000);
- return () => clearInterval(timer);
- }, [dirty, lastSavedAt]);
-
- const openShortcuts = () => window.dispatchEvent(new CustomEvent("openscreen:open-shortcuts"));
- return (
- <header className={styles.titlebar}>
- <span className={styles.lights} aria-hidden>
- <span className={styles.r} />
- <span className={styles.y} />
- <span className={styles.g} />
- </span>
- <span className={styles.brand}>
- <span className={styles.brandMark} aria-hidden>
- O
- </span>
- OpenScreen
- </span>
- <span className={styles.sep} aria-hidden />
- <ProjectNameField project={project} onRename={actions.renameProject} />
- <span className={styles.saved}>
- {dirty ? (
- <>
- <span className={styles.dot} aria-hidden style={{ background: "var(--warn)" }} />
- Unsaved changes
- </>
- ) : (
- <>
- <span className={styles.dot} aria-hidden />
- Saved · {timeAgo(lastSavedAt)}
- </>
- )}
- </span>
- <span className={styles.projActions}>
- <IconButton title="Open project" ariaLabel="Open project" onClick={actions.openProject}>
- <FolderOpen size={16} />
- </IconButton>
- <IconButton title="New project" ariaLabel="New project" onClick={actions.newProject}>
- <FolderPlus size={16} />
- </IconButton>
- <SaveDropdown
- disabled={!project}
- dirty={dirty}
- onSave={actions.save}
- onSaveAs={actions.saveAs}
- />
- </span>
- <LangButton />
- <button
- type="button"
- className={styles.recorderBtn}
- title="New recording"
- aria-label="New recording"
- onClick={actions.newRecording}
- >
- <Video size={16} />
- <span>New recording</span>
- </button>
- <button
- type="button"
- className={styles.recorderBtn}
- style={{ background: "transparent", borderColor: "var(--border)", color: "var(--fg-2)" }}
- title="Return to recorder"
- aria-label="Return to recorder"
- onClick={actions.recorder}
- >
- Return to recorder
- </button>
- <span className={styles.right}>
- <IconButton
- title="Export"
- ariaLabel="Export"
- onClick={actions.export}
- disabled={!canExport}
- >
- <Download size={16} />
- </IconButton>
- <IconButton
- title="Toggle left panel"
- ariaLabel="Toggle left panel"
- ariaPressed={!leftCollapsed}
- onClick={actions.toggleLeft}
- >
- <PanelLeft size={16} />
- </IconButton>
- <IconButton
- title="Toggle timeline"
- ariaLabel="Toggle timeline"
- ariaPressed={!bottomCollapsed}
- onClick={actions.toggleBottom}
- >
- <Rows3 size={16} />
- </IconButton>
- <IconButton
- title="Toggle right panel"
- ariaLabel="Toggle right panel"
- ariaPressed={!rightCollapsed}
- onClick={actions.toggleRight}
- >
- <PanelRight size={16} />
- </IconButton>
- <IconButton
- title={theme === "dark" ? "Switch to light theme" : "Switch to dark theme"}
- ariaLabel={theme === "dark" ? "Switch to light theme" : "Switch to dark theme"}
- ariaPressed={theme === "dark"}
- onClick={toggleTheme}
- >
- {theme === "dark" ? <Sun size={16} /> : <Moon size={16} />}
- </IconButton>
- <IconButton title="Shortcuts (?)" ariaLabel="Shortcuts" onClick={openShortcuts}>
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <circle cx="12" cy="12" r="10" />
- <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
- <line x1="12" y1="17" x2="12.01" y2="17" />
- </svg>
- </IconButton>
- <IconButton title="Settings" ariaLabel="Settings" onClick={actions.openSettings}>
- <Settings size={16} />
- </IconButton>
- </span>
- </header>
- );
-}
-
-function SaveDropdown({
- disabled,
- dirty,
- onSave,
- onSaveAs,
-}: {
- disabled: boolean;
- dirty: boolean;
- onSave: () => void;
- onSaveAs: () => void;
-}) {
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLDivElement | null>(null);
- useEffect(() => {
- if (!open) return;
- const onDocClick = (e: MouseEvent) => {
- if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);
- };
- document.addEventListener("mousedown", onDocClick);
- return () => document.removeEventListener("mousedown", onDocClick);
- }, [open]);
- return (
- <div ref={ref} style={{ position: "relative" }}>
- <button
- type="button"
- className={styles.iconBtn}
- title="Save project"
- aria-label="Save project"
- aria-pressed={open}
- disabled={disabled}
- onClick={() => setOpen((v) => !v)}
- >
- <Save size={16} />
- {dirty ? (
- <span
- aria-hidden
- style={{
- position: "absolute",
- top: 4,
- right: 4,
- width: 6,
- height: 6,
- borderRadius: "50%",
- background: "var(--warn)",
- }}
- />
- ) : null}
- </button>
- {open ? (
- <div
- role="menu"
- style={{
- position: "absolute",
- top: "calc(100% + 4px)",
- left: 0,
- minWidth: 180,
- background: "var(--surface)",
- border: "1px solid var(--border)",
- borderRadius: "var(--r-md)",
- boxShadow: "var(--elev-pop)",
- padding: 4,
- zIndex: 60,
- }}
- >
- <MenuItem
- icon={<Save size={14} />}
- label="Save"
- hint="⌘S"
- onClick={() => {
- setOpen(false);
- onSave();
- }}
- />
- <MenuItem
- icon={<FileVideo size={14} />}
- label="Save as…"
- hint="⌘⇧S"
- onClick={() => {
- setOpen(false);
- onSaveAs();
- }}
- />
- </div>
- ) : null}
- </div>
- );
-}
-
-function MenuItem({
- icon,
- label,
- hint,
- onClick,
-}: {
- icon: ReactNode;
- label: string;
- hint?: string;
- onClick: () => void;
-}) {
- return (
- <button
- type="button"
- role="menuitem"
- style={{
- display: "flex",
- alignItems: "center",
- gap: 8,
- width: "100%",
- padding: "6px 10px",
- border: 0,
- background: "transparent",
- color: "var(--fg-2)",
- borderRadius: "var(--r-sm)",
- cursor: "pointer",
- font: "500 12px var(--font-body)",
- }}
- onClick={onClick}
- >
- {icon}
- <span style={{ flex: 1, textAlign: "left" }}>{label}</span>
- {hint ? (
- <span
- style={{
- font: "500 10px/1 var(--font-mono)",
- color: "var(--meta)",
- letterSpacing: "0.04em",
- }}
- >
- {hint}
- </span>
- ) : null}
- </button>
- );
-}
-
-function IconButton({
- children,
- title,
- ariaLabel,
- ariaPressed,
- onClick,
- disabled,
-}: {
- children: ReactNode;
- title: string;
- ariaLabel?: string;
- ariaPressed?: boolean;
- onClick?: () => void;
- disabled?: boolean;
-}) {
- return (
- <button
- type="button"
- className={styles.iconBtn}
- title={title}
- aria-label={ariaLabel ?? title}
- aria-pressed={ariaPressed}
- onClick={onClick}
- disabled={disabled}
- >
- {children}
- </button>
- );
-}
-
-function LangButton() {
- const { locale, setLocale } = useI18n();
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLDivElement | null>(null);
- useEffect(() => {
- if (!open) return;
- const onDocClick = (e: MouseEvent) => {
- if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);
- };
- document.addEventListener("mousedown", onDocClick);
- return () => document.removeEventListener("mousedown", onDocClick);
- }, [open]);
- return (
- <div ref={ref} style={{ position: "relative" }}>
- <button
- type="button"
- className={styles.langSel}
- onClick={() => setOpen((v) => !v)}
- aria-label="Change language"
- aria-pressed={open}
- >
- <Languages size={16} style={{ color: "var(--fg)" }} />
- <span style={{ fontSize: 13, fontWeight: 500 }}>{locale.toUpperCase()}</span>
- <ChevronDown size={10} style={{ color: "var(--muted)" }} />
- </button>
- {open ? (
- <div
- style={{
- position: "absolute",
- top: "calc(100% + 4px)",
- right: 0,
- minWidth: 160,
- background: "var(--surface)",
- border: "1px solid var(--border)",
- borderRadius: "var(--r-md)",
- boxShadow: "var(--elev-pop)",
- padding: 4,
- zIndex: 60,
- }}
- >
- {LANGS.map((l) => (
- <button
- key={l.code}
- type="button"
- style={{
- display: "block",
- width: "100%",
- textAlign: "left",
- padding: "6px 10px",
- border: 0,
- background: l.code === locale ? "var(--accent-wash)" : "transparent",
- color: l.code === locale ? "var(--accent)" : "var(--fg-2)",
- borderRadius: "var(--r-sm)",
- cursor: "pointer",
- font: "500 12px var(--font-body)",
- }}
- onClick={() => {
- setLocale(l.code as Locale);
- setOpen(false);
- }}
- >
- {l.label}
- </button>
- ))}
- </div>
- ) : null}
- </div>
- );
-}
-
-function ProjectNameField({
- project,
- onRename,
-}: {
- project: ProjectSummary | null;
- onRename: (title: string) => void;
-}) {
- const [editing, setEditing] = useState(false);
- const [draft, setDraft] = useState(project?.title ?? "");
- const inputRef = useRef<HTMLInputElement | null>(null);
-
- useEffect(() => {
- if (editing) {
- setDraft(project?.title ?? "");
- inputRef.current?.select();
- }
- }, [editing, project?.title]);
-
- const commit = () => {
- setEditing(false);
- const next = draft.trim();
- if (next && next !== project?.title) onRename(next);
- };
-
- return (
- <span className={styles.project}>
- {editing ? (
- <input
- ref={inputRef}
- className={styles.projectInput}
- value={draft}
- onChange={(e) => setDraft(e.target.value)}
- onBlur={commit}
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- e.preventDefault();
- commit();
- } else if (e.key === "Escape") {
- setEditing(false);
- }
- }}
- />
- ) : (
- <button
- type="button"
- className={styles.projectName}
- title="Rename project"
- aria-label="Rename project"
- disabled={!project}
- onClick={() => setEditing(true)}
- >
- {project?.title ?? "No project"}
- </button>
- )}
- </span>
- );
-}
-
-const LANGS = [
- { code: "en", label: "English" },
- { code: "fr", label: "Français" },
- { code: "es", label: "Español" },
- { code: "de", label: "Deutsch" },
- { code: "it", label: "Italiano" },
- { code: "ja-JP", label: "日本語" },
- { code: "ko-KR", label: "한국어" },
- { code: "pt-BR", label: "Português (BR)" },
- { code: "ru", label: "Русский" },
- { code: "tr", label: "Türkçe" },
- { code: "vi", label: "Tiếng Việt" },
- { code: "zh-CN", label: "简体中文" },
- { code: "zh-TW", label: "繁體中文" },
-];
diff --git a/src/components/ai-edition/TransportBar.tsx b/src/components/ai-edition/TransportBar.tsx
index c9fce5504..73ee43fee 100644
--- a/src/components/ai-edition/TransportBar.tsx
+++ b/src/components/ai-edition/TransportBar.tsx
@@ -1,5 +1,6 @@
import { Maximize2, Pause, Play, Repeat, SkipBack, SkipForward } from "lucide-react";
import { memo } from "react";
+import { useScopedT } from "@/contexts/I18nContext";
import type { AxcutClip } from "@/lib/ai-edition/schema";
import styles from "./NewEditorShell.module.css";
@@ -37,6 +38,8 @@ export const TransportBar = memo(function TransportBar({
onExpand,
onSeek,
}: TransportBarProps) {
+ const te = useScopedT("editor");
+ const tc = useScopedT("common");
const virtualDurationSec = clips.reduce(
(acc, c) => acc + (c.timelineEndSec - c.timelineStartSec),
0,
@@ -48,12 +51,12 @@ export const TransportBar = memo(function TransportBar({
const progress = (inputValue / inputMax) * 100;
return (
- <div className={styles.transport} role="toolbar" aria-label="Playback controls">
+ <div className={styles.transport} role="toolbar" aria-label={te("transport.playbackControls")}>
<button
type="button"
className={`${styles.tbtn} ${styles.play}`}
- title="Play / Pause (Space)"
- aria-label="Play / Pause"
+ title={te("transport.playPauseTitle")}
+ aria-label={te("transport.playPause")}
data-playing={playing}
onClick={onTogglePlay}
>
@@ -62,8 +65,8 @@ export const TransportBar = memo(function TransportBar({
<button
type="button"
className={styles.tbtn}
- title="Previous clip"
- aria-label="Previous clip"
+ title={te("transport.previousClip")}
+ aria-label={te("transport.previousClip")}
onClick={onPrevClip}
>
<SkipBack size={13} />
@@ -71,8 +74,8 @@ export const TransportBar = memo(function TransportBar({
<button
type="button"
className={styles.tbtn}
- title="Next clip"
- aria-label="Next clip"
+ title={te("transport.nextClip")}
+ aria-label={te("transport.nextClip")}
onClick={onNextClip}
>
<SkipForward size={13} />
@@ -80,8 +83,8 @@ export const TransportBar = memo(function TransportBar({
<button
type="button"
className={styles.tbtn}
- title="Loop"
- aria-label="Loop"
+ title={te("transport.loop")}
+ aria-label={te("transport.loop")}
aria-pressed={loop}
onClick={onToggleLoop}
>
@@ -90,8 +93,8 @@ export const TransportBar = memo(function TransportBar({
<button
type="button"
className={styles.tbtn}
- title="Fullscreen"
- aria-label="Fullscreen"
+ title={tc("playback.fullscreen")}
+ aria-label={tc("playback.fullscreen")}
onClick={onExpand}
>
<Maximize2 size={13} />
@@ -113,7 +116,7 @@ export const TransportBar = memo(function TransportBar({
value={inputValue}
onChange={(e) => onSeek(Number(e.target.value))}
className={styles.scrubInput}
- aria-label="Seek video"
+ aria-label={te("transport.seekVideo")}
/>
<div
className={styles.scrubThumb}
diff --git a/src/components/ai-edition/v4/FloatingInspector.tsx b/src/components/ai-edition/v4/FloatingInspector.tsx
index 7fa773b22..d9ad854fc 100644
--- a/src/components/ai-edition/v4/FloatingInspector.tsx
+++ b/src/components/ai-edition/v4/FloatingInspector.tsx
@@ -457,16 +457,19 @@ function SelectionPane({ tl, onClose }: { tl: TimelineApi; onClose: () => void }
if (!region) return null;
return (
<div style={{ display: "flex", flexDirection: "column", minHeight: 0 }}>
- {paneHeader(<Maximize2 size={15} />, "Full Camera", onClose, tc("actions.close"))}
+ {paneHeader(
+ <Maximize2 size={15} />,
+ tt("labels.cameraFullscreen"),
+ onClose,
+ tc("actions.close"),
+ )}
<div style={bodyStyle}>
<p style={{ margin: 0, fontSize: 12, lineHeight: 1.5, color: "var(--muted)" }}>
- While this region plays, the camera takes the whole frame — no border, no rounding, no
- background — and eases back at the end. Drag the region's edges on the timeline to
- change when it starts and how long it lasts.
+ {te("inspector.cameraFullscreenDescription")}
</p>
<button type="button" onClick={deleteAndClose} style={deleteBtnStyle}>
<Trash2 size={14} />
- Delete region
+ {te("inspector.deleteRegion")}
</button>
</div>
</div>
diff --git a/src/components/ai-edition/v4/V4Timeline.tsx b/src/components/ai-edition/v4/V4Timeline.tsx
index 2d6c1bd04..df5dfe5b2 100644
--- a/src/components/ai-edition/v4/V4Timeline.tsx
+++ b/src/components/ai-edition/v4/V4Timeline.tsx
@@ -1096,8 +1096,8 @@ export function V4Timeline({
<button
type="button"
className={styles.tlToolBtn}
- title="Full Camera"
- aria-label="Full Camera"
+ title={t("buttons.addCameraFullscreen")}
+ aria-label={t("buttons.addCameraFullscreen")}
onClick={() => void tl.addCameraFullscreen()}
>
<Maximize2 size={15} />
diff --git a/src/i18n/locales/ar/editor.json b/src/i18n/locales/ar/editor.json
index 32270996c..32e2500fa 100644
--- a/src/i18n/locales/ar/editor.json
+++ b/src/i18n/locales/ar/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "إظهار في المجلد",
"exportFailed": "فشل التصدير",
"failedToWriteFile": "فشلت كتابة الملف",
- "qualityUpscaleWarning": "تكبير الدقة"
+ "qualityUpscaleWarning": "تكبير الدقة",
+ "exportedVideoOf": "من الفيديو تم تصديره في"
},
"inspector": {
"resetFocusPoint": "إعادة تعيين نقطة التركيز",
@@ -215,7 +216,9 @@
"captionsDescription": "إنشاء ترجمات مؤقتة بالكلمات من النص وإسقاطها على الجدول الزمني.",
"generateCaptions": "إنشاء ترجمات",
"cropDescription": "أعد تأطير التسجيل — اختر نسبة العرض إلى الارتفاع وقم بالتكبير على المنطقة التي تريد الاحتفاظ بها.",
- "openCrop": "فتح القص…"
+ "openCrop": "فتح القص…",
+ "cameraFullscreenDescription": "أثناء تشغيل هذه المنطقة تملأ الكاميرا الإطار بالكامل — بلا حدود ولا استدارة ولا خلفية — ثم تعود بسلاسة في النهاية. اسحب حواف المنطقة على المخطط الزمني لتغيير وقت بدايتها ومدتها.",
+ "deleteRegion": "حذف المنطقة"
},
"leftPanel": {
"mediaTitle": "الوسائط",
@@ -303,13 +306,9 @@
"create": "إنشاء المشروع",
"defaultTitle": "مشروع بلا عنوان",
"templates": {
- "blankTitle": "مشروع فارغ",
- "blankDesc": "جدول زمني فارغ، جاهز للاستيراد",
"screenRecordingTitle": "تسجيل الشاشة",
"screenRecordingDesc": "بدء التقاط النظام",
- "importMediaDesc": "فيديو، صوت، صور من القرص",
- "fromTemplateTitle": "من قالب",
- "fromTemplateDesc": "قصة مصورة محددة مسبقًا"
+ "importMediaDesc": "فيديو، صوت، صور من القرص"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "W",
"fieldH": "H"
+ },
+ "transport": {
+ "playbackControls": "عناصر التحكم في التشغيل",
+ "playPause": "تشغيل / إيقاف مؤقت",
+ "playPauseTitle": "تشغيل / إيقاف مؤقت (مسافة)",
+ "previousClip": "المقطع السابق",
+ "nextClip": "المقطع التالي",
+ "loop": "تكرار",
+ "seekVideo": "التنقل في الفيديو"
+ },
+ "shell": {
+ "aiEditor": "محرّر الذكاء الاصطناعي",
+ "resizeChatPanel": "تغيير حجم لوحة المحادثة",
+ "previewStage": "منطقة المعاينة",
+ "resizeTimeline": "تغيير حجم المخطط الزمني"
+ },
+ "preview": {
+ "videoPreview": "معاينة الفيديو",
+ "webcamPreview": "معاينة كاميرا الويب (اسحب لتغيير الموضع)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "تعليق توضيحي",
+ "noImage": "لا توجد صورة",
+ "noArrowData": "لا توجد بيانات سهم"
+ },
+ "providerSettings": {
+ "title": "إعدادات الذكاء الاصطناعي",
+ "subtitle": "اختر مزوّدًا. تُحفظ بيانات الاعتماد في سلسلة مفاتيح النظام (safeStorage).",
+ "loadFailed": "تعذّر تحميل إعدادات الذكاء الاصطناعي",
+ "saved": "تم حفظ {{provider}}",
+ "connected": "تم الاتصال بـ {{provider}}",
+ "disconnected": "تم قطع الاتصال بـ {{provider}}",
+ "deviceFlowFailed": "فشل تدفق مصادقة الجهاز.",
+ "pillConnected": "متصل",
+ "pillOAuth": "OAuth",
+ "pillToken": "رمز مميز",
+ "pillApiKey": "مفتاح API",
+ "notConnected": "غير متصل",
+ "back": "رجوع",
+ "modelLabel": "النموذج",
+ "modelHintLive": "نماذج من حسابك، تم جلبها مباشرةً.",
+ "modelHintError": "تعذّر جلب النماذج المباشرة ({{error}})؛ اكتب معرّف النموذج يدويًا.",
+ "modelHintLoading": "جارٍ تحميل النماذج المباشرة…",
+ "modelSavedOption": "{{model}} (محفوظ)",
+ "loadingModels": "جارٍ تحميل النماذج…",
+ "baseUrlLabel": "عنوان URL الأساسي",
+ "baseUrlHint": "اتركه فارغًا لاستخدام القيمة الافتراضية للمزوّد.",
+ "reasoningEffortLabel": "مستوى الاستدلال",
+ "apiKeyLabel": "مفتاح API",
+ "apiKeyHintStored": "محفوظ في safeStorage. اتركه فارغًا للاحتفاظ بالإدخال الحالي.",
+ "patLabel": "رمز وصول شخصي من GitHub",
+ "patHint": "الصق رمز PAT من GitHub بنطاق `copilot`.",
+ "projectEditsLabel": "تعديلات المشروع",
+ "projectEditsHint": "عند الإيقاف، يجب أن يستأذن الوكيل قبل تغيير المخطط الزمني. يمكن دائمًا التراجع عن التعديلات.",
+ "allowAgentEdits": "السماح للوكيل بتعديل المشروع",
+ "disconnect": "قطع الاتصال",
+ "cancel": "إلغاء",
+ "save": "حفظ",
+ "saveAndUse": "حفظ واستخدام",
+ "reconnect": "إعادة الاتصال",
+ "startLogin": "بدء تسجيل الدخول",
+ "connect": "اتصال",
+ "completingSignIn": "جارٍ إتمام تسجيل الدخول…",
+ "browserLoginPending": "في انتظار تسجيل الدخول عبر المتصفح",
+ "deviceCodeInstructions": "افتح صفحة تسجيل الدخول الخاصة بـ {{provider}} وأدخل هذا الرمز. سنُكمل الاتصال تلقائيًا بمجرد منحك الإذن.",
+ "copyCode": "نسخ الرمز",
+ "copied": "تم النسخ",
+ "openLoginPage": "فتح صفحة تسجيل الدخول"
}
}
diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.json
index 6543c683d..7b27972b7 100644
--- a/src/i18n/locales/ar/settings.json
+++ b/src/i18n/locales/ar/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "بدون كاميرا",
"mirrorWebcam": "عكس كاميرا الويب",
"reactiveWebcam": "تصغير عند التكبير",
- "reactiveWebcamDescription": "تتقلص الكاميرا بسلاسة أثناء تكبير الفيديو حتى لا تعيق الرؤية."
+ "reactiveWebcamDescription": "تتقلص الكاميرا بسلاسة أثناء تكبير الفيديو حتى لا تعيق الرؤية.",
+ "help": "طريقة دمج كاميرا الويب مع الشاشة: صورة داخل صورة، أو تكديس عمودي، أو إطار مزدوج، وشكل القناع والحجم والانعكاس.",
+ "shapes": {
+ "rectangle": "مستطيل",
+ "circle": "دائرة",
+ "square": "مربع",
+ "rounded": "زوايا مستديرة"
+ }
},
"effects": {
"title": "تأثيرات الفيديو",
@@ -60,7 +67,8 @@
"on": "تشغيل",
"shadow": "ظل",
"roundness": "الاستدارة",
- "padding": "المسافة البادئة"
+ "padding": "المسافة البادئة",
+ "help": "تنسيق إطار التسجيل: ضبابية الخلفية، والظل، وضبابية الحركة، واستدارة الزوايا، والحشو حول الفيديو."
},
"background": {
"title": "الخلفية",
@@ -72,7 +80,11 @@
"gradientLabel": "تدرج لوني {{index}}",
"colorWheel": "عجلة الألوان",
"colorPalette": "لوحة الألوان",
- "presets": "إعدادات مسبقة"
+ "presets": "إعدادات مسبقة",
+ "help": "اختر ما يظهر خلف التسجيل: صورة خلفية مضمّنة، أو لون خالص، أو تدرّج لوني، أو صورة خاصة بك من القرص.",
+ "customWallpaper": "خلفية مخصصة",
+ "imageLabel": "الخلفية {{index}}",
+ "colorLabel": "اللون {{color}}"
},
"crop": {
"title": "اقتصاص",
@@ -221,17 +233,38 @@
"motionBlur": "ضبابية الحركة",
"clickBounce": "ارتداد النقر",
"clipToBounds": "القص ضمن اللوحة",
- "clipToBoundsDescription": "يبقي المؤشر داخل إطار الفيديو. أوقف التشغيل للسماح للمؤشر بتجاوز الحواف - مفيد عند التكبير أو التحريك."
+ "clipToBoundsDescription": "يبقي المؤشر داخل إطار الفيديو. أوقف التشغيل للسماح للمؤشر بتجاوز الحواف - مفيد عند التكبير أو التحريك.",
+ "help": "عرض المؤشر اعتمادًا على بيانات التتبع المسجّلة: السمة، والحجم، والتنعيم، وضبابية الحركة، وارتداد النقر."
},
"language": {
"title": "اللغة"
},
"timeline": {
"title": "المخطط الزمني",
- "waveform": "عرض الموجة الصوتية على مسار القطع"
+ "waveform": "عرض الموجة الصوتية على مسار القطع",
+ "help": "خيارات عرض المخطط الزمني، مثل إظهار الموجة الصوتية على مسار القص."
},
"facets": {
"captions": "الترجمة",
"transcript": "النص"
+ },
+ "panes": {
+ "help": "مساعدة"
+ },
+ "transcript": {
+ "title": "النص الحالي",
+ "help": "نص مجمّع لكل المقاطع على المخطط الزمني. اضغط Backspace / Delete على كلمة أو تحديد لتمييزه كمتخطّى (بالأحمر). مرّر المؤشر فوق المقطع الأحمر لاستعادته.",
+ "noClips": "لا توجد مقاطع بعد",
+ "noTranscript": "لا يوجد نص بعد",
+ "whisperHint": "يستخدم التفريغ النصي Whisper محليًا — يعمل داخل متصفحك، ولا تغادر أي بيانات جهازك.",
+ "transcribeNow": "فرّغ النص الآن",
+ "transcribing": "جارٍ التفريغ…",
+ "clipLabel": "المقطع {{index}}",
+ "noClipTranscript": "لا يوجد نص لهذا المقطع — افتح بطاقة الوسيط وأعد التوليد.",
+ "editorAria": "نص {{filename}}",
+ "silence": "[صمت {{duration}} ث]",
+ "restoreSilence": "استعادة الصمت ({{duration}} ث)",
+ "trimSilence": "قص الصمت ({{duration}} ث)",
+ "restoreWord": "استعادة \"{{word}}\""
}
}
diff --git a/src/i18n/locales/en/editor.json b/src/i18n/locales/en/editor.json
index d7f85dd2b..d07999ae3 100644
--- a/src/i18n/locales/en/editor.json
+++ b/src/i18n/locales/en/editor.json
@@ -216,7 +216,9 @@
"captionsDescription": "Generate word-timed captions from the transcript and drop them onto the timeline.",
"generateCaptions": "Generate captions",
"cropDescription": "Reframe the recording — pick an aspect ratio and zoom into the region you want to keep.",
- "openCrop": "Open crop…"
+ "openCrop": "Open crop…",
+ "cameraFullscreenDescription": "While this region plays, the camera takes the whole frame — no border, no rounding, no background — and eases back at the end. Drag the region's edges on the timeline to change when it starts and how long it lasts.",
+ "deleteRegion": "Delete region"
},
"leftPanel": {
"mediaTitle": "Media",
@@ -304,13 +306,9 @@
"create": "Create project",
"defaultTitle": "Untitled project",
"templates": {
- "blankTitle": "Blank project",
- "blankDesc": "Empty timeline, ready to import",
"screenRecordingTitle": "Screen recording",
"screenRecordingDesc": "Start system capture",
- "importMediaDesc": "Video, audio, images from disk",
- "fromTemplateTitle": "From template",
- "fromTemplateDesc": "Predefined storyboard"
+ "importMediaDesc": "Video, audio, images from disk"
}
},
"openProjectDialog": {
@@ -350,5 +348,73 @@
"fieldY": "Y",
"fieldW": "W",
"fieldH": "H"
+ },
+ "transport": {
+ "playbackControls": "Playback controls",
+ "playPause": "Play / Pause",
+ "playPauseTitle": "Play / Pause (Space)",
+ "previousClip": "Previous clip",
+ "nextClip": "Next clip",
+ "loop": "Loop",
+ "seekVideo": "Seek video"
+ },
+ "shell": {
+ "aiEditor": "AI editor",
+ "resizeChatPanel": "Resize chat panel",
+ "previewStage": "Preview stage",
+ "resizeTimeline": "Resize timeline"
+ },
+ "preview": {
+ "videoPreview": "Video preview",
+ "webcamPreview": "Webcam preview (drag to reposition)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Annotation",
+ "noImage": "No image",
+ "noArrowData": "No arrow data"
+ },
+ "providerSettings": {
+ "title": "AI settings",
+ "subtitle": "Choose a provider. Credentials are stored in the OS keychain (safeStorage).",
+ "loadFailed": "Could not load AI settings",
+ "saved": "{{provider}} saved",
+ "connected": "{{provider}} connected",
+ "disconnected": "{{provider}} disconnected",
+ "deviceFlowFailed": "Device flow failed.",
+ "pillConnected": "Connected",
+ "pillOAuth": "OAuth",
+ "pillToken": "Token",
+ "pillApiKey": "API key",
+ "notConnected": "Not connected",
+ "back": "Back",
+ "modelLabel": "Model",
+ "modelHintLive": "Models from your account, fetched live.",
+ "modelHintError": "Couldn't fetch live models ({{error}}); type a model id manually.",
+ "modelHintLoading": "Loading live models…",
+ "modelSavedOption": "{{model}} (saved)",
+ "loadingModels": "Loading models…",
+ "baseUrlLabel": "Base URL",
+ "baseUrlHint": "Leave blank to use the provider's default.",
+ "reasoningEffortLabel": "Reasoning effort",
+ "apiKeyLabel": "API key",
+ "apiKeyHintStored": "Stored in safeStorage. Leave blank to keep the existing entry.",
+ "patLabel": "GitHub personal access token",
+ "patHint": "Paste a GitHub PAT with `copilot` scope.",
+ "projectEditsLabel": "Project edits",
+ "projectEditsHint": "When off, the agent must ask before changing the timeline. Edits are always undoable.",
+ "allowAgentEdits": "Allow the agent to edit the project",
+ "disconnect": "Disconnect",
+ "cancel": "Cancel",
+ "save": "Save",
+ "saveAndUse": "Save & use",
+ "reconnect": "Reconnect",
+ "startLogin": "Start login",
+ "connect": "Connect",
+ "completingSignIn": "Completing sign-in…",
+ "browserLoginPending": "Browser login pending",
+ "deviceCodeInstructions": "Open the {{provider}} login page and enter this code. We'll finish connecting automatically once you authorize.",
+ "copyCode": "Copy code",
+ "copied": "Copied",
+ "openLoginPage": "Open login page"
}
}
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index bc450ef1c..7b4cb6f7d 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -50,7 +50,14 @@
"webcamSize": "Webcam Size",
"mirrorWebcam": "Mirror Webcam",
"reactiveWebcam": "Shrink on Zoom",
- "reactiveWebcamDescription": "Camera smoothly shrinks while the video is zoomed in, so it stays out of the way."
+ "reactiveWebcamDescription": "Camera smoothly shrinks while the video is zoomed in, so it stays out of the way.",
+ "help": "How the webcam is composed with the screen: picture-in-picture, vertical stack, dual frame, mask shape, size, and mirroring.",
+ "shapes": {
+ "rectangle": "Rect",
+ "circle": "Circle",
+ "square": "Square",
+ "rounded": "Rounded"
+ }
},
"effects": {
"title": "Video Effects",
@@ -60,7 +67,8 @@
"on": "on",
"shadow": "Shadow",
"roundness": "Roundness",
- "padding": "Padding"
+ "padding": "Padding",
+ "help": "Frame styling for the recording: background blur, drop shadow, motion blur, corner radius, and padding around the video."
},
"background": {
"title": "Background",
@@ -72,7 +80,11 @@
"gradientLabel": "Gradient {{index}}",
"colorWheel": "Color Wheel",
"colorPalette": "Color Palette",
- "presets": "Presets"
+ "presets": "Presets",
+ "help": "Choose what appears behind the recording: a bundled wallpaper image, a solid color, a gradient, or a custom image from disk.",
+ "customWallpaper": "Custom wallpaper",
+ "imageLabel": "Background {{index}}",
+ "colorLabel": "Color {{color}}"
},
"crop": {
"title": "Crop",
@@ -221,17 +233,38 @@
"motionBlur": "Motion Blur",
"clickBounce": "Click Bounce",
"clipToBounds": "Clip to Canvas",
- "clipToBoundsDescription": "Keeps the cursor inside the video frame. Turn off to let the cursor extend past the edges - useful when zoomed in or panned."
+ "clipToBoundsDescription": "Keeps the cursor inside the video frame. Turn off to let the cursor extend past the edges - useful when zoomed in or panned.",
+ "help": "Cursor rendering from the recorded telemetry: theme, size, smoothing, motion blur, and click-bounce emphasis."
},
"language": {
"title": "Language"
},
"timeline": {
"title": "Timeline",
- "waveform": "Show Audio Waveform on Trim Track"
+ "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"
+ },
+ "panes": {
+ "help": "Help"
+ },
+ "transcript": {
+ "title": "Current transcription",
+ "help": "Aggregated transcript of every clip on the timeline. Backspace / Delete a word or selection to mark it as skipped (red). Hover a red span to restore it.",
+ "noClips": "No clips yet",
+ "noTranscript": "No transcript yet",
+ "whisperHint": "Transcribe uses local Whisper — runs in your browser, no data leaves the device.",
+ "transcribeNow": "Transcribe now",
+ "transcribing": "Transcribing…",
+ "clipLabel": "Clip {{index}}",
+ "noClipTranscript": "No transcript for this clip — open the asset card and regenerate.",
+ "editorAria": "Transcript for {{filename}}",
+ "silence": "[silence {{duration}}s]",
+ "restoreSilence": "Restore silence ({{duration}}s)",
+ "trimSilence": "Trim silence ({{duration}}s)",
+ "restoreWord": "Restore \"{{word}}\""
}
}
diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.json
index 7879cf28e..7caaf8e1e 100644
--- a/src/i18n/locales/es/editor.json
+++ b/src/i18n/locales/es/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "Mostrar en la carpeta",
"exportFailed": "Error al exportar",
"failedToWriteFile": "No se pudo escribir el archivo",
- "qualityUpscaleWarning": "Upscaling"
+ "qualityUpscaleWarning": "Upscaling",
+ "exportedVideoOf": "de vídeo exportado en"
},
"inspector": {
"resetFocusPoint": "Restablecer punto de enfoque",
@@ -215,7 +216,9 @@
"captionsDescription": "Genera subtítulos sincronizados con las palabras a partir de la transcripción y colócalos en la línea de tiempo.",
"generateCaptions": "Generar subtítulos",
"cropDescription": "Reencuadra la grabación: elige una relación de aspecto y haz zoom en la región que deseas conservar.",
- "openCrop": "Abrir recorte…"
+ "openCrop": "Abrir recorte…",
+ "cameraFullscreenDescription": "Mientras se reproduce esta región, la cámara ocupa todo el cuadro —sin borde, sin redondeo, sin fondo— y vuelve suavemente al final. Arrastra los bordes de la región en la línea de tiempo para cambiar cuándo empieza y cuánto dura.",
+ "deleteRegion": "Eliminar región"
},
"leftPanel": {
"mediaTitle": "Medios",
@@ -303,13 +306,9 @@
"create": "Crear proyecto",
"defaultTitle": "Proyecto sin título",
"templates": {
- "blankTitle": "Proyecto en blanco",
- "blankDesc": "Línea de tiempo vacía, lista para importar",
"screenRecordingTitle": "Grabación de pantalla",
"screenRecordingDesc": "Iniciar captura del sistema",
- "importMediaDesc": "Vídeo, audio, imágenes desde el disco",
- "fromTemplateTitle": "Desde plantilla",
- "fromTemplateDesc": "Storyboard predefinido"
+ "importMediaDesc": "Vídeo, audio, imágenes desde el disco"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "A",
"fieldH": "Al"
+ },
+ "transport": {
+ "playbackControls": "Controles de reproducción",
+ "playPause": "Reproducir / Pausar",
+ "playPauseTitle": "Reproducir / Pausar (Espacio)",
+ "previousClip": "Clip anterior",
+ "nextClip": "Clip siguiente",
+ "loop": "Bucle",
+ "seekVideo": "Desplazarse por el vídeo"
+ },
+ "shell": {
+ "aiEditor": "Editor de IA",
+ "resizeChatPanel": "Redimensionar el panel de chat",
+ "previewStage": "Área de vista previa",
+ "resizeTimeline": "Redimensionar la línea de tiempo"
+ },
+ "preview": {
+ "videoPreview": "Vista previa del vídeo",
+ "webcamPreview": "Vista previa de la webcam (arrastra para reubicar)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Anotación",
+ "noImage": "Sin imagen",
+ "noArrowData": "Sin datos de flecha"
+ },
+ "providerSettings": {
+ "title": "Ajustes de IA",
+ "subtitle": "Elige un proveedor. Las credenciales se guardan en el llavero del sistema (safeStorage).",
+ "loadFailed": "No se pudieron cargar los ajustes de IA",
+ "saved": "{{provider}} guardado",
+ "connected": "{{provider}} conectado",
+ "disconnected": "{{provider}} desconectado",
+ "deviceFlowFailed": "Error en el flujo de dispositivo.",
+ "pillConnected": "Conectado",
+ "pillOAuth": "OAuth",
+ "pillToken": "Token",
+ "pillApiKey": "Clave API",
+ "notConnected": "No conectado",
+ "back": "Atrás",
+ "modelLabel": "Modelo",
+ "modelHintLive": "Modelos de tu cuenta, obtenidos en vivo.",
+ "modelHintError": "No se pudieron obtener los modelos ({{error}}); escribe un id de modelo manualmente.",
+ "modelHintLoading": "Cargando modelos en vivo…",
+ "modelSavedOption": "{{model}} (guardado)",
+ "loadingModels": "Cargando modelos…",
+ "baseUrlLabel": "URL base",
+ "baseUrlHint": "Déjalo en blanco para usar el valor predeterminado del proveedor.",
+ "reasoningEffortLabel": "Esfuerzo de razonamiento",
+ "apiKeyLabel": "Clave API",
+ "apiKeyHintStored": "Guardada en safeStorage. Déjalo en blanco para conservar la entrada existente.",
+ "patLabel": "Token de acceso personal de GitHub",
+ "patHint": "Pega un PAT de GitHub con el ámbito `copilot`.",
+ "projectEditsLabel": "Ediciones del proyecto",
+ "projectEditsHint": "Si está desactivado, el agente debe preguntar antes de cambiar la línea de tiempo. Las ediciones siempre se pueden deshacer.",
+ "allowAgentEdits": "Permitir que el agente edite el proyecto",
+ "disconnect": "Desconectar",
+ "cancel": "Cancelar",
+ "save": "Guardar",
+ "saveAndUse": "Guardar y usar",
+ "reconnect": "Reconectar",
+ "startLogin": "Iniciar sesión",
+ "connect": "Conectar",
+ "completingSignIn": "Completando el inicio de sesión…",
+ "browserLoginPending": "Inicio de sesión en el navegador pendiente",
+ "deviceCodeInstructions": "Abre la página de inicio de sesión de {{provider}} e introduce este código. Terminaremos de conectar automáticamente en cuanto autorices.",
+ "copyCode": "Copiar código",
+ "copied": "Copiado",
+ "openLoginPage": "Abrir página de inicio de sesión"
}
}
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index 6c6eda5de..a2b106713 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "Sin cámara",
"mirrorWebcam": "Reflejar cámara",
"reactiveWebcam": "Reducir al ampliar",
- "reactiveWebcamDescription": "La cámara se reduce suavemente mientras el vídeo está ampliado, para no estorbar."
+ "reactiveWebcamDescription": "La cámara se reduce suavemente mientras el vídeo está ampliado, para no estorbar.",
+ "help": "Cómo se compone la webcam con la pantalla: imagen en imagen, pila vertical, marco doble, forma de máscara, tamaño y efecto espejo.",
+ "shapes": {
+ "rectangle": "Rect.",
+ "circle": "Círculo",
+ "square": "Cuadrado",
+ "rounded": "Redondeado"
+ }
},
"effects": {
"title": "Efectos de video",
@@ -60,7 +67,8 @@
"shadow": "Sombra",
"roundness": "Redondez",
"padding": "Relleno",
- "on": "activado"
+ "on": "activado",
+ "help": "Estilo del marco de la grabación: desenfoque de fondo, sombra, desenfoque de movimiento, radio de esquinas y margen alrededor del vídeo."
},
"background": {
"title": "Fondo",
@@ -72,7 +80,11 @@
"gradientLabel": "Degradado {{index}}",
"colorWheel": "Rueda de colores",
"colorPalette": "Paleta de colores",
- "presets": "Ajustes preestablecidos"
+ "presets": "Ajustes preestablecidos",
+ "help": "Elige qué aparece detrás de la grabación: un fondo incluido, un color sólido, un degradado o una imagen propia del disco.",
+ "customWallpaper": "Fondo personalizado",
+ "imageLabel": "Fondo {{index}}",
+ "colorLabel": "Color {{color}}"
},
"crop": {
"title": "Recortar",
@@ -221,17 +233,38 @@
"motionBlur": "Desenfoque de movimiento",
"clickBounce": "Rebote al clic",
"clipToBounds": "Recortar al lienzo",
- "clipToBoundsDescription": "Mantiene el cursor dentro del cuadro del vídeo. Desactívalo para dejar que el cursor sobrepase los bordes; útil al hacer zoom o desplazar la imagen."
+ "clipToBoundsDescription": "Mantiene el cursor dentro del cuadro del vídeo. Desactívalo para dejar que el cursor sobrepase los bordes; útil al hacer zoom o desplazar la imagen.",
+ "help": "Representación del cursor a partir de la telemetría grabada: tema, tamaño, suavizado, desenfoque de movimiento y rebote al hacer clic."
},
"language": {
"title": "Idioma"
},
"timeline": {
"title": "Línea de tiempo",
- "waveform": "Mostrar forma de onda en pista de recorte"
+ "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"
+ },
+ "panes": {
+ "help": "Ayuda"
+ },
+ "transcript": {
+ "title": "Transcripción actual",
+ "help": "Transcripción agregada de todos los clips de la línea de tiempo. Retroceso / Supr sobre una palabra o selección la marca como omitida (en rojo). Pasa el cursor sobre un fragmento rojo para restaurarlo.",
+ "noClips": "Aún no hay clips",
+ "noTranscript": "Aún no hay transcripción",
+ "whisperHint": "La transcripción usa Whisper local: se ejecuta en tu navegador y ningún dato sale del dispositivo.",
+ "transcribeNow": "Transcribir ahora",
+ "transcribing": "Transcribiendo…",
+ "clipLabel": "Clip {{index}}",
+ "noClipTranscript": "Este clip no tiene transcripción: abre la ficha del recurso y vuelve a generarla.",
+ "editorAria": "Transcripción de {{filename}}",
+ "silence": "[silencio {{duration}} s]",
+ "restoreSilence": "Restaurar silencio ({{duration}} s)",
+ "trimSilence": "Recortar silencio ({{duration}} s)",
+ "restoreWord": "Restaurar «{{word}}»"
}
}
diff --git a/src/i18n/locales/fr/editor.json b/src/i18n/locales/fr/editor.json
index fe7cbb4d8..3dab52641 100644
--- a/src/i18n/locales/fr/editor.json
+++ b/src/i18n/locales/fr/editor.json
@@ -216,7 +216,9 @@
"captionsDescription": "Générer des sous-titres synchronisés aux mots à partir de la transcription et les déposer sur la timeline.",
"generateCaptions": "Générer les sous-titres",
"cropDescription": "Recadrer l'enregistrement — choisissez un format et zoomez sur la région à conserver.",
- "openCrop": "Ouvrir le recadrage…"
+ "openCrop": "Ouvrir le recadrage…",
+ "cameraFullscreenDescription": "Pendant cette zone, la caméra occupe tout le cadre — sans bordure, sans arrondi, sans arrière-plan — puis revient en douceur à la fin. Faites glisser les bords de la zone sur la timeline pour changer son début et sa durée.",
+ "deleteRegion": "Supprimer la zone"
},
"leftPanel": {
"mediaTitle": "Médias",
@@ -304,13 +306,9 @@
"create": "Créer le projet",
"defaultTitle": "Projet sans titre",
"templates": {
- "blankTitle": "Projet vierge",
- "blankDesc": "Timeline vide, prête à importer",
"screenRecordingTitle": "Enregistrement d'écran",
"screenRecordingDesc": "Démarrer la capture système",
- "importMediaDesc": "Vidéo, audio, images depuis le disque",
- "fromTemplateTitle": "Depuis un modèle",
- "fromTemplateDesc": "Storyboard prédéfini"
+ "importMediaDesc": "Vidéo, audio, images depuis le disque"
}
},
"openProjectDialog": {
@@ -350,5 +348,73 @@
"fieldY": "Y",
"fieldW": "L",
"fieldH": "H"
+ },
+ "transport": {
+ "playbackControls": "Contrôles de lecture",
+ "playPause": "Lecture / Pause",
+ "playPauseTitle": "Lecture / Pause (Espace)",
+ "previousClip": "Clip précédent",
+ "nextClip": "Clip suivant",
+ "loop": "Boucle",
+ "seekVideo": "Naviguer dans la vidéo"
+ },
+ "shell": {
+ "aiEditor": "Éditeur IA",
+ "resizeChatPanel": "Redimensionner le panneau de discussion",
+ "previewStage": "Zone d'aperçu",
+ "resizeTimeline": "Redimensionner la timeline"
+ },
+ "preview": {
+ "videoPreview": "Aperçu vidéo",
+ "webcamPreview": "Aperçu webcam (glisser pour repositionner)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Annotation",
+ "noImage": "Aucune image",
+ "noArrowData": "Aucune donnée de flèche"
+ },
+ "providerSettings": {
+ "title": "Paramètres IA",
+ "subtitle": "Choisissez un fournisseur. Les identifiants sont stockés dans le trousseau du système (safeStorage).",
+ "loadFailed": "Impossible de charger les paramètres IA",
+ "saved": "{{provider}} enregistré",
+ "connected": "{{provider}} connecté",
+ "disconnected": "{{provider}} déconnecté",
+ "deviceFlowFailed": "Échec de l'authentification par appareil.",
+ "pillConnected": "Connecté",
+ "pillOAuth": "OAuth",
+ "pillToken": "Jeton",
+ "pillApiKey": "Clé API",
+ "notConnected": "Non connecté",
+ "back": "Retour",
+ "modelLabel": "Modèle",
+ "modelHintLive": "Modèles de votre compte, récupérés en direct.",
+ "modelHintError": "Impossible de récupérer les modèles ({{error}}) ; saisissez un identifiant de modèle manuellement.",
+ "modelHintLoading": "Chargement des modèles en direct…",
+ "modelSavedOption": "{{model}} (enregistré)",
+ "loadingModels": "Chargement des modèles…",
+ "baseUrlLabel": "URL de base",
+ "baseUrlHint": "Laissez vide pour utiliser la valeur par défaut du fournisseur.",
+ "reasoningEffortLabel": "Effort de raisonnement",
+ "apiKeyLabel": "Clé API",
+ "apiKeyHintStored": "Stockée dans safeStorage. Laissez vide pour conserver l'entrée existante.",
+ "patLabel": "Jeton d'accès personnel GitHub",
+ "patHint": "Collez un PAT GitHub avec la portée `copilot`.",
+ "projectEditsLabel": "Modifications du projet",
+ "projectEditsHint": "Si désactivé, l'agent doit demander avant de modifier la timeline. Les modifications sont toujours annulables.",
+ "allowAgentEdits": "Autoriser l'agent à modifier le projet",
+ "disconnect": "Déconnecter",
+ "cancel": "Annuler",
+ "save": "Enregistrer",
+ "saveAndUse": "Enregistrer et utiliser",
+ "reconnect": "Reconnecter",
+ "startLogin": "Démarrer la connexion",
+ "connect": "Connecter",
+ "completingSignIn": "Finalisation de la connexion…",
+ "browserLoginPending": "Connexion navigateur en attente",
+ "deviceCodeInstructions": "Ouvrez la page de connexion {{provider}} et saisissez ce code. La connexion se terminera automatiquement dès que vous aurez autorisé l'accès.",
+ "copyCode": "Copier le code",
+ "copied": "Copié",
+ "openLoginPage": "Ouvrir la page de connexion"
}
}
diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.json
index eb5e1630d..e9f3787c9 100644
--- a/src/i18n/locales/fr/settings.json
+++ b/src/i18n/locales/fr/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "Sans webcam",
"mirrorWebcam": "Inverser la webcam",
"reactiveWebcam": "Réduire au zoom",
- "reactiveWebcamDescription": "La caméra rétrécit doucement pendant le zoom, pour ne pas gêner."
+ "reactiveWebcamDescription": "La caméra rétrécit doucement pendant le zoom, pour ne pas gêner.",
+ "help": "Composition de la webcam avec l'écran : incrustation, empilement vertical, double cadre, forme du masque, taille et effet miroir.",
+ "shapes": {
+ "rectangle": "Rect.",
+ "circle": "Cercle",
+ "square": "Carré",
+ "rounded": "Arrondi"
+ }
},
"effects": {
"title": "Effets vidéo",
@@ -60,7 +67,8 @@
"shadow": "Ombre",
"roundness": "Arrondi",
"padding": "Marge",
- "on": "activé"
+ "on": "activé",
+ "help": "Mise en forme du cadre de l'enregistrement : flou d'arrière-plan, ombre portée, flou de mouvement, arrondi des coins et marge autour de la vidéo."
},
"background": {
"title": "Arrière-plan",
@@ -72,7 +80,11 @@
"gradientLabel": "Dégradé {{index}}",
"colorWheel": "Roue chromatique",
"colorPalette": "Palette de couleurs",
- "presets": "Préréglages"
+ "presets": "Préréglages",
+ "help": "Choisissez ce qui apparaît derrière l'enregistrement : un fond d'écran fourni, une couleur unie, un dégradé, ou une image personnelle depuis le disque.",
+ "customWallpaper": "Fond personnalisé",
+ "imageLabel": "Fond {{index}}",
+ "colorLabel": "Couleur {{color}}"
},
"crop": {
"title": "Recadrage",
@@ -221,17 +233,38 @@
"motionBlur": "Flou de mouvement",
"clickBounce": "Rebond au clic",
"clipToBounds": "Rogner au canevas",
- "clipToBoundsDescription": "Garde le curseur à l'intérieur du cadre vidéo. Désactivez pour laisser le curseur dépasser les bords — utile en cas de zoom ou de panoramique."
+ "clipToBoundsDescription": "Garde le curseur à l'intérieur du cadre vidéo. Désactivez pour laisser le curseur dépasser les bords — utile en cas de zoom ou de panoramique.",
+ "help": "Rendu du curseur à partir de la télémétrie enregistrée : thème, taille, lissage, flou de mouvement et rebond au clic."
},
"language": {
"title": "Langue"
},
"timeline": {
"title": "Montage",
- "waveform": "Afficher la forme d'onde sur la piste de découpe"
+ "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"
+ },
+ "panes": {
+ "help": "Aide"
+ },
+ "transcript": {
+ "title": "Transcription actuelle",
+ "help": "Transcription agrégée de tous les clips de la timeline. Retour arrière / Suppr sur un mot ou une sélection le marque comme ignoré (en rouge). Survolez un passage rouge pour le restaurer.",
+ "noClips": "Aucun clip pour l'instant",
+ "noTranscript": "Aucune transcription pour l'instant",
+ "whisperHint": "La transcription utilise Whisper en local — tout s'exécute dans votre navigateur, aucune donnée ne quitte l'appareil.",
+ "transcribeNow": "Transcrire maintenant",
+ "transcribing": "Transcription…",
+ "clipLabel": "Clip {{index}}",
+ "noClipTranscript": "Aucune transcription pour ce clip — ouvrez la fiche du média et relancez la génération.",
+ "editorAria": "Transcription de {{filename}}",
+ "silence": "[silence {{duration}} s]",
+ "restoreSilence": "Restaurer le silence ({{duration}} s)",
+ "trimSilence": "Couper le silence ({{duration}} s)",
+ "restoreWord": "Restaurer « {{word}} »"
}
}
diff --git a/src/i18n/locales/it/editor.json b/src/i18n/locales/it/editor.json
index 50c4bca44..68c877585 100644
--- a/src/i18n/locales/it/editor.json
+++ b/src/i18n/locales/it/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "Mostra nella cartella",
"exportFailed": "Esportazione non riuscita",
"failedToWriteFile": "Impossibile scrivere il file",
- "qualityUpscaleWarning": "Upscaling"
+ "qualityUpscaleWarning": "Upscaling",
+ "exportedVideoOf": "di video esportato in"
},
"inspector": {
"resetFocusPoint": "Reimposta punto di messa a fuoco",
@@ -215,7 +216,9 @@
"captionsDescription": "Genera sottotitoli sincronizzati con le parole dalla trascrizione e trascinali sulla timeline.",
"generateCaptions": "Genera sottotitoli",
"cropDescription": "Reinquadra la registrazione — scegli un rapporto d'aspetto e ingrandisci l'area da mantenere.",
- "openCrop": "Apri ritaglio…"
+ "openCrop": "Apri ritaglio…",
+ "cameraFullscreenDescription": "Mentre questa regione è in riproduzione, la camera occupa l'intero fotogramma — senza bordo, senza arrotondamento, senza sfondo — e rientra dolcemente alla fine. Trascina i bordi della regione sulla timeline per cambiarne l'inizio e la durata.",
+ "deleteRegion": "Elimina regione"
},
"leftPanel": {
"mediaTitle": "Contenuti multimediali",
@@ -303,13 +306,9 @@
"create": "Crea progetto",
"defaultTitle": "Progetto senza titolo",
"templates": {
- "blankTitle": "Progetto vuoto",
- "blankDesc": "Timeline vuota, pronta per l'importazione",
"screenRecordingTitle": "Registrazione schermo",
"screenRecordingDesc": "Avvia acquisizione di sistema",
- "importMediaDesc": "Video, audio, immagini dal disco",
- "fromTemplateTitle": "Da modello",
- "fromTemplateDesc": "Storyboard predefinito"
+ "importMediaDesc": "Video, audio, immagini dal disco"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "L",
"fieldH": "A"
+ },
+ "transport": {
+ "playbackControls": "Controlli di riproduzione",
+ "playPause": "Riproduci / Pausa",
+ "playPauseTitle": "Riproduci / Pausa (Spazio)",
+ "previousClip": "Clip precedente",
+ "nextClip": "Clip successivo",
+ "loop": "Ripeti",
+ "seekVideo": "Scorri il video"
+ },
+ "shell": {
+ "aiEditor": "Editor IA",
+ "resizeChatPanel": "Ridimensiona il pannello chat",
+ "previewStage": "Area di anteprima",
+ "resizeTimeline": "Ridimensiona la timeline"
+ },
+ "preview": {
+ "videoPreview": "Anteprima video",
+ "webcamPreview": "Anteprima webcam (trascina per riposizionare)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Annotazione",
+ "noImage": "Nessuna immagine",
+ "noArrowData": "Nessun dato freccia"
+ },
+ "providerSettings": {
+ "title": "Impostazioni IA",
+ "subtitle": "Scegli un provider. Le credenziali sono salvate nel portachiavi del sistema (safeStorage).",
+ "loadFailed": "Impossibile caricare le impostazioni IA",
+ "saved": "{{provider}} salvato",
+ "connected": "{{provider}} connesso",
+ "disconnected": "{{provider}} disconnesso",
+ "deviceFlowFailed": "Flusso dispositivo non riuscito.",
+ "pillConnected": "Connesso",
+ "pillOAuth": "OAuth",
+ "pillToken": "Token",
+ "pillApiKey": "Chiave API",
+ "notConnected": "Non connesso",
+ "back": "Indietro",
+ "modelLabel": "Modello",
+ "modelHintLive": "Modelli dal tuo account, recuperati in tempo reale.",
+ "modelHintError": "Impossibile recuperare i modelli ({{error}}); digita manualmente un id di modello.",
+ "modelHintLoading": "Caricamento dei modelli in tempo reale…",
+ "modelSavedOption": "{{model}} (salvato)",
+ "loadingModels": "Caricamento modelli…",
+ "baseUrlLabel": "URL di base",
+ "baseUrlHint": "Lascia vuoto per usare il valore predefinito del provider.",
+ "reasoningEffortLabel": "Sforzo di ragionamento",
+ "apiKeyLabel": "Chiave API",
+ "apiKeyHintStored": "Salvata in safeStorage. Lascia vuoto per mantenere la voce esistente.",
+ "patLabel": "Token di accesso personale GitHub",
+ "patHint": "Incolla un PAT GitHub con ambito `copilot`.",
+ "projectEditsLabel": "Modifiche al progetto",
+ "projectEditsHint": "Se disattivato, l'agente deve chiedere prima di cambiare la timeline. Le modifiche sono sempre annullabili.",
+ "allowAgentEdits": "Consenti all'agente di modificare il progetto",
+ "disconnect": "Disconnetti",
+ "cancel": "Annulla",
+ "save": "Salva",
+ "saveAndUse": "Salva e usa",
+ "reconnect": "Riconnetti",
+ "startLogin": "Avvia accesso",
+ "connect": "Connetti",
+ "completingSignIn": "Completamento accesso…",
+ "browserLoginPending": "Accesso dal browser in sospeso",
+ "deviceCodeInstructions": "Apri la pagina di accesso di {{provider}} e inserisci questo codice. Completeremo la connessione automaticamente non appena autorizzi.",
+ "copyCode": "Copia codice",
+ "copied": "Copiato",
+ "openLoginPage": "Apri pagina di accesso"
}
}
diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.json
index 33519a6f6..be3186af7 100644
--- a/src/i18n/locales/it/settings.json
+++ b/src/i18n/locales/it/settings.json
@@ -50,7 +50,14 @@
"webcamSize": "Dimensione webcam",
"mirrorWebcam": "Specchia webcam",
"reactiveWebcam": "Riduci con lo zoom",
- "reactiveWebcamDescription": "La webcam si riduce dolcemente durante lo zoom, così non intralcia."
+ "reactiveWebcamDescription": "La webcam si riduce dolcemente durante lo zoom, così non intralcia.",
+ "help": "Come la webcam viene composta con lo schermo: picture-in-picture, pila verticale, doppio riquadro, forma della maschera, dimensione e effetto specchio.",
+ "shapes": {
+ "rectangle": "Rett.",
+ "circle": "Cerchio",
+ "square": "Quadrato",
+ "rounded": "Arrotondato"
+ }
},
"effects": {
"title": "Effetti video",
@@ -60,7 +67,8 @@
"on": "acceso",
"shadow": "Ombra",
"roundness": "Arrotondamento",
- "padding": "Spaziatura"
+ "padding": "Spaziatura",
+ "help": "Stile della cornice della registrazione: sfocatura dello sfondo, ombra, sfocatura di movimento, raggio degli angoli e margine attorno al video."
},
"background": {
"title": "Sfondo",
@@ -72,7 +80,11 @@
"gradientLabel": "Sfumatura {{index}}",
"colorWheel": "Ruota dei colori",
"colorPalette": "Tavolozza dei colori",
- "presets": "Predefiniti"
+ "presets": "Predefiniti",
+ "help": "Scegli cosa appare dietro la registrazione: uno sfondo incluso, un colore pieno, un gradiente o un'immagine personale dal disco.",
+ "customWallpaper": "Sfondo personalizzato",
+ "imageLabel": "Sfondo {{index}}",
+ "colorLabel": "Colore {{color}}"
},
"crop": {
"title": "Ritaglia",
@@ -221,17 +233,38 @@
"motionBlur": "Sfocatura movimento",
"clickBounce": "Rimbalzo clic",
"clipToBounds": "Ritaglia al canvas",
- "clipToBoundsDescription": "Mantiene il cursore all'interno del fotogramma video. Disattiva per lasciare che il cursore superi i bordi — utile quando si esegue zoom o panoramica."
+ "clipToBoundsDescription": "Mantiene il cursore all'interno del fotogramma video. Disattiva per lasciare che il cursore superi i bordi — utile quando si esegue zoom o panoramica.",
+ "help": "Resa del cursore dalla telemetria registrata: tema, dimensione, smussatura, sfocatura di movimento e rimbalzo al clic."
},
"language": {
"title": "Lingua"
},
"timeline": {
"title": "Timeline",
- "waveform": "Mostra la forma d'onda sulla traccia di ritaglio"
+ "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"
+ },
+ "panes": {
+ "help": "Aiuto"
+ },
+ "transcript": {
+ "title": "Trascrizione corrente",
+ "help": "Trascrizione aggregata di tutti i clip sulla timeline. Backspace / Canc su una parola o selezione la segna come saltata (in rosso). Passa sopra un tratto rosso per ripristinarlo.",
+ "noClips": "Ancora nessun clip",
+ "noTranscript": "Ancora nessuna trascrizione",
+ "whisperHint": "La trascrizione usa Whisper in locale: gira nel tuo browser, nessun dato lascia il dispositivo.",
+ "transcribeNow": "Trascrivi ora",
+ "transcribing": "Trascrizione…",
+ "clipLabel": "Clip {{index}}",
+ "noClipTranscript": "Nessuna trascrizione per questo clip: apri la scheda della risorsa e rigenerala.",
+ "editorAria": "Trascrizione di {{filename}}",
+ "silence": "[silenzio {{duration}} s]",
+ "restoreSilence": "Ripristina silenzio ({{duration}} s)",
+ "trimSilence": "Taglia silenzio ({{duration}} s)",
+ "restoreWord": "Ripristina «{{word}}»"
}
}
diff --git a/src/i18n/locales/ja-JP/editor.json b/src/i18n/locales/ja-JP/editor.json
index dec7b4ea5..75669e76c 100644
--- a/src/i18n/locales/ja-JP/editor.json
+++ b/src/i18n/locales/ja-JP/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "フォルダーで表示",
"exportFailed": "エクスポートに失敗しました",
"failedToWriteFile": "ファイルの書き込みに失敗しました",
- "qualityUpscaleWarning": "アップスケール"
+ "qualityUpscaleWarning": "アップスケール",
+ "exportedVideoOf": "の動画を書き出しました。所要時間:"
},
"inspector": {
"resetFocusPoint": "フォーカスポイントをリセット",
@@ -215,7 +216,9 @@
"captionsDescription": "文字起こしから単語ごとにタイミングを合わせたキャプションを生成し、タイムラインに配置します。",
"generateCaptions": "キャプションを生成",
"cropDescription": "録画をリフレーム — アスペクト比を選び、保持したい範囲にズームします。",
- "openCrop": "切り抜きを開く…"
+ "openCrop": "切り抜きを開く…",
+ "cameraFullscreenDescription": "この区間の再生中は、カメラが画面全体を占めます(枠・角丸・背景なし)。終わりでは滑らかに元に戻ります。タイムライン上で区間の端をドラッグすると、開始位置と長さを変更できます。",
+ "deleteRegion": "区間を削除"
},
"leftPanel": {
"mediaTitle": "メディア",
@@ -303,13 +306,9 @@
"create": "プロジェクトを作成",
"defaultTitle": "無題のプロジェクト",
"templates": {
- "blankTitle": "空のプロジェクト",
- "blankDesc": "空のタイムライン、インポート準備完了",
"screenRecordingTitle": "画面録画",
"screenRecordingDesc": "システムキャプチャを開始",
- "importMediaDesc": "ディスクから動画・音声・画像",
- "fromTemplateTitle": "テンプレートから",
- "fromTemplateDesc": "定義済みのストーリーボード"
+ "importMediaDesc": "ディスクから動画・音声・画像"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "幅",
"fieldH": "高さ"
+ },
+ "transport": {
+ "playbackControls": "再生コントロール",
+ "playPause": "再生 / 一時停止",
+ "playPauseTitle": "再生 / 一時停止(スペース)",
+ "previousClip": "前のクリップ",
+ "nextClip": "次のクリップ",
+ "loop": "ループ",
+ "seekVideo": "動画をシーク"
+ },
+ "shell": {
+ "aiEditor": "AI エディター",
+ "resizeChatPanel": "チャットパネルのサイズを変更",
+ "previewStage": "プレビュー領域",
+ "resizeTimeline": "タイムラインのサイズを変更"
+ },
+ "preview": {
+ "videoPreview": "動画プレビュー",
+ "webcamPreview": "ウェブカメラのプレビュー(ドラッグで位置変更)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "注釈",
+ "noImage": "画像なし",
+ "noArrowData": "矢印データなし"
+ },
+ "providerSettings": {
+ "title": "AI 設定",
+ "subtitle": "プロバイダーを選択してください。認証情報は OS のキーチェーン(safeStorage)に保存されます。",
+ "loadFailed": "AI 設定を読み込めませんでした",
+ "saved": "{{provider}} を保存しました",
+ "connected": "{{provider}} に接続しました",
+ "disconnected": "{{provider}} の接続を解除しました",
+ "deviceFlowFailed": "デバイス認証に失敗しました。",
+ "pillConnected": "接続済み",
+ "pillOAuth": "OAuth",
+ "pillToken": "トークン",
+ "pillApiKey": "API キー",
+ "notConnected": "未接続",
+ "back": "戻る",
+ "modelLabel": "モデル",
+ "modelHintLive": "アカウントから取得した最新のモデル一覧です。",
+ "modelHintError": "モデル一覧を取得できませんでした({{error}})。モデル ID を手動で入力してください。",
+ "modelHintLoading": "最新のモデルを読み込み中…",
+ "modelSavedOption": "{{model}}(保存済み)",
+ "loadingModels": "モデルを読み込み中…",
+ "baseUrlLabel": "ベース URL",
+ "baseUrlHint": "空欄にするとプロバイダーの既定値を使用します。",
+ "reasoningEffortLabel": "推論の深さ",
+ "apiKeyLabel": "API キー",
+ "apiKeyHintStored": "safeStorage に保存されています。空欄のままにすると既存の値を保持します。",
+ "patLabel": "GitHub 個人用アクセストークン",
+ "patHint": "`copilot` スコープを持つ GitHub PAT を貼り付けてください。",
+ "projectEditsLabel": "プロジェクトの編集",
+ "projectEditsHint": "オフの場合、エージェントはタイムラインを変更する前に確認します。編集はいつでも元に戻せます。",
+ "allowAgentEdits": "エージェントによるプロジェクトの編集を許可",
+ "disconnect": "接続を解除",
+ "cancel": "キャンセル",
+ "save": "保存",
+ "saveAndUse": "保存して使用",
+ "reconnect": "再接続",
+ "startLogin": "ログインを開始",
+ "connect": "接続",
+ "completingSignIn": "サインインを完了しています…",
+ "browserLoginPending": "ブラウザーでのログイン待ちです",
+ "deviceCodeInstructions": "{{provider}} のログインページを開き、このコードを入力してください。承認が完了すると自動的に接続されます。",
+ "copyCode": "コードをコピー",
+ "copied": "コピーしました",
+ "openLoginPage": "ログインページを開く"
}
}
diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json
index 6782950bc..afb522733 100644
--- a/src/i18n/locales/ja-JP/settings.json
+++ b/src/i18n/locales/ja-JP/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "Webカメラなし",
"mirrorWebcam": "Webカメラを反転",
"reactiveWebcam": "ズーム時に縮小",
- "reactiveWebcamDescription": "ズーム中はカメラがスムーズに縮小し、邪魔になりません。"
+ "reactiveWebcamDescription": "ズーム中はカメラがスムーズに縮小し、邪魔になりません。",
+ "help": "ウェブカメラと画面の合成方法: ピクチャインピクチャ、縦積み、デュアルフレーム、マスク形状、サイズ、左右反転。",
+ "shapes": {
+ "rectangle": "長方形",
+ "circle": "円",
+ "square": "正方形",
+ "rounded": "角丸"
+ }
},
"effects": {
"title": "動画効果",
@@ -60,7 +67,8 @@
"shadow": "影",
"roundness": "丸み",
"padding": "余白",
- "on": "オン"
+ "on": "オン",
+ "help": "録画フレームのスタイル設定: 背景ぼかし、ドロップシャドウ、モーションブラー、角丸、動画まわりの余白。"
},
"background": {
"title": "背景",
@@ -72,7 +80,11 @@
"gradientLabel": "グラデーション {{index}}",
"colorWheel": "カラーホイール",
"colorPalette": "カラーパレット",
- "presets": "プリセット"
+ "presets": "プリセット",
+ "help": "録画の背景に表示するものを選びます。同梱の壁紙画像、単色、グラデーション、またはディスク上の任意の画像から選べます。",
+ "customWallpaper": "カスタム壁紙",
+ "imageLabel": "背景 {{index}}",
+ "colorLabel": "色 {{color}}"
},
"crop": {
"title": "クロップ",
@@ -221,17 +233,38 @@
"motionBlur": "モーションブラー",
"clickBounce": "クリックバウンス",
"clipToBounds": "キャンバスにクリップ",
- "clipToBoundsDescription": "カーソルを映像フレーム内に保ちます。オフにするとカーソルが端からはみ出せるようになります。ズームやパン時に便利です。"
+ "clipToBoundsDescription": "カーソルを映像フレーム内に保ちます。オフにするとカーソルが端からはみ出せるようになります。ズームやパン時に便利です。",
+ "help": "記録されたテレメトリからのカーソル描画: テーマ、サイズ、スムージング、モーションブラー、クリック時のバウンス。"
},
"language": {
"title": "言語"
},
"timeline": {
"title": "タイムライン",
- "waveform": "トリムトラックにオーディオ波形を表示"
+ "waveform": "トリムトラックにオーディオ波形を表示",
+ "help": "タイムラインの表示オプション(トリムトラックに音声波形を表示するなど)。"
},
"facets": {
"captions": "字幕",
"transcript": "文字起こし"
+ },
+ "panes": {
+ "help": "ヘルプ"
+ },
+ "transcript": {
+ "title": "現在の文字起こし",
+ "help": "タイムライン上のすべてのクリップをまとめた文字起こしです。単語や選択範囲を Backspace / Delete でスキップ(赤色)にできます。赤い部分にカーソルを合わせると元に戻せます。",
+ "noClips": "クリップがまだありません",
+ "noTranscript": "文字起こしがまだありません",
+ "whisperHint": "文字起こしはローカルの Whisper を使用します。ブラウザ内で実行され、データが端末外に出ることはありません。",
+ "transcribeNow": "今すぐ文字起こし",
+ "transcribing": "文字起こし中…",
+ "clipLabel": "クリップ {{index}}",
+ "noClipTranscript": "このクリップには文字起こしがありません。アセットカードを開いて再生成してください。",
+ "editorAria": "{{filename}} の文字起こし",
+ "silence": "[無音 {{duration}} 秒]",
+ "restoreSilence": "無音を元に戻す({{duration}} 秒)",
+ "trimSilence": "無音をトリム({{duration}} 秒)",
+ "restoreWord": "「{{word}}」を元に戻す"
}
}
diff --git a/src/i18n/locales/ko-KR/editor.json b/src/i18n/locales/ko-KR/editor.json
index c0a58f2de..5e88691c6 100644
--- a/src/i18n/locales/ko-KR/editor.json
+++ b/src/i18n/locales/ko-KR/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "폴더에서 보기",
"exportFailed": "내보내기 실패",
"failedToWriteFile": "파일 쓰기에 실패했습니다",
- "qualityUpscaleWarning": "업스케일"
+ "qualityUpscaleWarning": "업스케일",
+ "exportedVideoOf": "분량의 영상을 내보냈습니다. 소요 시간:"
},
"inspector": {
"resetFocusPoint": "포커스 지점 재설정",
@@ -215,7 +216,9 @@
"captionsDescription": "대본에서 단어 단위 타이밍의 자막을 생성하여 타임라인에 배치합니다.",
"generateCaptions": "자막 생성",
"cropDescription": "녹화 화면을 다시 프레이밍 — 화면 비율을 선택하고 유지할 영역으로 확대합니다.",
- "openCrop": "자르기 열기…"
+ "openCrop": "자르기 열기…",
+ "cameraFullscreenDescription": "이 구간이 재생되는 동안 카메라가 화면 전체를 채웁니다. 테두리, 둥근 모서리, 배경이 없으며 끝에서 부드럽게 돌아옵니다. 타임라인에서 구간의 가장자리를 끌어 시작 위치와 길이를 조정하세요.",
+ "deleteRegion": "구간 삭제"
},
"leftPanel": {
"mediaTitle": "미디어",
@@ -303,13 +306,9 @@
"create": "프로젝트 만들기",
"defaultTitle": "제목 없는 프로젝트",
"templates": {
- "blankTitle": "빈 프로젝트",
- "blankDesc": "빈 타임라인, 가져올 준비 완료",
"screenRecordingTitle": "화면 녹화",
"screenRecordingDesc": "시스템 캡처 시작",
- "importMediaDesc": "디스크에서 동영상, 오디오, 이미지",
- "fromTemplateTitle": "템플릿에서",
- "fromTemplateDesc": "미리 정의된 스토리보드"
+ "importMediaDesc": "디스크에서 동영상, 오디오, 이미지"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "너비",
"fieldH": "높이"
+ },
+ "transport": {
+ "playbackControls": "재생 컨트롤",
+ "playPause": "재생 / 일시정지",
+ "playPauseTitle": "재생 / 일시정지 (Space)",
+ "previousClip": "이전 클립",
+ "nextClip": "다음 클립",
+ "loop": "반복",
+ "seekVideo": "영상 탐색"
+ },
+ "shell": {
+ "aiEditor": "AI 편집기",
+ "resizeChatPanel": "채팅 패널 크기 조절",
+ "previewStage": "미리보기 영역",
+ "resizeTimeline": "타임라인 크기 조절"
+ },
+ "preview": {
+ "videoPreview": "영상 미리보기",
+ "webcamPreview": "웹캠 미리보기 (끌어서 위치 변경)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "주석",
+ "noImage": "이미지 없음",
+ "noArrowData": "화살표 데이터 없음"
+ },
+ "providerSettings": {
+ "title": "AI 설정",
+ "subtitle": "공급자를 선택하세요. 자격 증명은 OS 키체인(safeStorage)에 저장됩니다.",
+ "loadFailed": "AI 설정을 불러올 수 없습니다",
+ "saved": "{{provider}} 저장됨",
+ "connected": "{{provider}} 연결됨",
+ "disconnected": "{{provider}} 연결 해제됨",
+ "deviceFlowFailed": "기기 인증에 실패했습니다.",
+ "pillConnected": "연결됨",
+ "pillOAuth": "OAuth",
+ "pillToken": "토큰",
+ "pillApiKey": "API 키",
+ "notConnected": "연결되지 않음",
+ "back": "뒤로",
+ "modelLabel": "모델",
+ "modelHintLive": "계정에서 실시간으로 가져온 모델입니다.",
+ "modelHintError": "모델 목록을 가져오지 못했습니다({{error}}). 모델 ID를 직접 입력하세요.",
+ "modelHintLoading": "실시간 모델 불러오는 중…",
+ "modelSavedOption": "{{model}} (저장됨)",
+ "loadingModels": "모델 불러오는 중…",
+ "baseUrlLabel": "기본 URL",
+ "baseUrlHint": "비워 두면 공급자의 기본값을 사용합니다.",
+ "reasoningEffortLabel": "추론 강도",
+ "apiKeyLabel": "API 키",
+ "apiKeyHintStored": "safeStorage에 저장되어 있습니다. 기존 항목을 유지하려면 비워 두세요.",
+ "patLabel": "GitHub 개인 액세스 토큰",
+ "patHint": "`copilot` 범위를 가진 GitHub PAT를 붙여넣으세요.",
+ "projectEditsLabel": "프로젝트 편집",
+ "projectEditsHint": "끄면 에이전트가 타임라인을 변경하기 전에 확인을 요청합니다. 편집은 항상 실행 취소할 수 있습니다.",
+ "allowAgentEdits": "에이전트의 프로젝트 편집 허용",
+ "disconnect": "연결 해제",
+ "cancel": "취소",
+ "save": "저장",
+ "saveAndUse": "저장 후 사용",
+ "reconnect": "다시 연결",
+ "startLogin": "로그인 시작",
+ "connect": "연결",
+ "completingSignIn": "로그인 완료 중…",
+ "browserLoginPending": "브라우저 로그인 대기 중",
+ "deviceCodeInstructions": "{{provider}} 로그인 페이지를 열고 이 코드를 입력하세요. 승인하면 자동으로 연결이 완료됩니다.",
+ "copyCode": "코드 복사",
+ "copied": "복사됨",
+ "openLoginPage": "로그인 페이지 열기"
}
}
diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.json
index 3c966c5bc..b7a31b412 100644
--- a/src/i18n/locales/ko-KR/settings.json
+++ b/src/i18n/locales/ko-KR/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "웹캠 없음",
"mirrorWebcam": "웹캠 미러링",
"reactiveWebcam": "확대 시 축소",
- "reactiveWebcamDescription": "확대하는 동안 카메라가 부드럽게 작아져 방해되지 않습니다."
+ "reactiveWebcamDescription": "확대하는 동안 카메라가 부드럽게 작아져 방해되지 않습니다.",
+ "help": "웹캠과 화면을 합성하는 방식: PIP, 세로 배치, 이중 프레임, 마스크 모양, 크기, 좌우 반전.",
+ "shapes": {
+ "rectangle": "직사각형",
+ "circle": "원형",
+ "square": "정사각형",
+ "rounded": "둥근 모서리"
+ }
},
"effects": {
"title": "비디오 효과",
@@ -60,7 +67,8 @@
"on": "켜기",
"shadow": "그림자",
"roundness": "모서리 둥글기",
- "padding": "여백"
+ "padding": "여백",
+ "help": "녹화 프레임 스타일: 배경 흐림, 그림자, 모션 블러, 모서리 둥글기, 영상 주변 여백."
},
"background": {
"title": "배경",
@@ -72,7 +80,11 @@
"gradientLabel": "그라디언트 {{index}}",
"colorWheel": "색상 휠",
"colorPalette": "색상 팔레트",
- "presets": "프리셋"
+ "presets": "프리셋",
+ "help": "녹화 뒤에 표시할 항목을 선택하세요. 기본 제공 배경 이미지, 단색, 그라데이션 또는 디스크의 사용자 이미지를 사용할 수 있습니다.",
+ "customWallpaper": "사용자 배경",
+ "imageLabel": "배경 {{index}}",
+ "colorLabel": "색상 {{color}}"
},
"crop": {
"title": "자르기",
@@ -221,17 +233,38 @@
"motionBlur": "모션 블러",
"clickBounce": "클릭 바운스",
"clipToBounds": "캔버스에 맞춰 자르기",
- "clipToBoundsDescription": "커서를 비디오 프레임 안에 유지합니다. 꺼두면 확대하거나 이동할 때 커서가 가장자리를 벗어날 수 있습니다."
+ "clipToBoundsDescription": "커서를 비디오 프레임 안에 유지합니다. 꺼두면 확대하거나 이동할 때 커서가 가장자리를 벗어날 수 있습니다.",
+ "help": "기록된 텔레메트리를 기반으로 한 커서 렌더링: 테마, 크기, 스무딩, 모션 블러, 클릭 바운스."
},
"language": {
"title": "언어"
},
"timeline": {
"title": "타임라인",
- "waveform": "트림 트랙에 오디오 파형 표시"
+ "waveform": "트림 트랙에 오디오 파형 표시",
+ "help": "타임라인 표시 옵션(예: 트림 트랙에 오디오 파형 표시)."
},
"facets": {
"captions": "자막",
"transcript": "대본"
+ },
+ "panes": {
+ "help": "도움말"
+ },
+ "transcript": {
+ "title": "현재 전사",
+ "help": "타임라인의 모든 클립을 합친 전사입니다. 단어나 선택 영역에서 Backspace / Delete를 누르면 건너뛴 것으로 표시됩니다(빨간색). 빨간 부분에 마우스를 올리면 복원할 수 있습니다.",
+ "noClips": "아직 클립이 없습니다",
+ "noTranscript": "아직 전사가 없습니다",
+ "whisperHint": "전사는 로컬 Whisper를 사용합니다. 브라우저에서 실행되며 데이터가 기기를 벗어나지 않습니다.",
+ "transcribeNow": "지금 전사하기",
+ "transcribing": "전사 중…",
+ "clipLabel": "클립 {{index}}",
+ "noClipTranscript": "이 클립에는 전사가 없습니다. 에셋 카드를 열고 다시 생성하세요.",
+ "editorAria": "{{filename}}의 전사",
+ "silence": "[무음 {{duration}}초]",
+ "restoreSilence": "무음 복원 ({{duration}}초)",
+ "trimSilence": "무음 자르기 ({{duration}}초)",
+ "restoreWord": "\"{{word}}\" 복원"
}
}
diff --git a/src/i18n/locales/pt-BR/editor.json b/src/i18n/locales/pt-BR/editor.json
index a67e0894d..44ed2ed79 100644
--- a/src/i18n/locales/pt-BR/editor.json
+++ b/src/i18n/locales/pt-BR/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "Mostrar na pasta",
"exportFailed": "Falha na exportação",
"failedToWriteFile": "Falha ao gravar o arquivo",
- "qualityUpscaleWarning": "Upscaling"
+ "qualityUpscaleWarning": "Upscaling",
+ "exportedVideoOf": "de vídeo exportado em"
},
"inspector": {
"resetFocusPoint": "Redefinir ponto de foco",
@@ -215,7 +216,9 @@
"captionsDescription": "Gere legendas sincronizadas por palavra a partir da transcrição e solte-as na linha do tempo.",
"generateCaptions": "Gerar legendas",
"cropDescription": "Reenquadre a gravação — escolha uma proporção e dê zoom na região que deseja manter.",
- "openCrop": "Abrir corte…"
+ "openCrop": "Abrir corte…",
+ "cameraFullscreenDescription": "Enquanto esta região é reproduzida, a câmera ocupa o quadro inteiro — sem borda, sem arredondamento, sem fundo — e volta suavemente no fim. Arraste as bordas da região na linha do tempo para mudar quando ela começa e quanto dura.",
+ "deleteRegion": "Excluir região"
},
"leftPanel": {
"mediaTitle": "Mídia",
@@ -303,13 +306,9 @@
"create": "Criar projeto",
"defaultTitle": "Projeto sem título",
"templates": {
- "blankTitle": "Projeto em branco",
- "blankDesc": "Linha do tempo vazia, pronta para importar",
"screenRecordingTitle": "Gravação de tela",
"screenRecordingDesc": "Iniciar captura do sistema",
- "importMediaDesc": "Vídeo, áudio, imagens do disco",
- "fromTemplateTitle": "A partir de modelo",
- "fromTemplateDesc": "Storyboard predefinido"
+ "importMediaDesc": "Vídeo, áudio, imagens do disco"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "L",
"fieldH": "A"
+ },
+ "transport": {
+ "playbackControls": "Controles de reprodução",
+ "playPause": "Reproduzir / Pausar",
+ "playPauseTitle": "Reproduzir / Pausar (Espaço)",
+ "previousClip": "Clipe anterior",
+ "nextClip": "Próximo clipe",
+ "loop": "Repetir",
+ "seekVideo": "Navegar no vídeo"
+ },
+ "shell": {
+ "aiEditor": "Editor de IA",
+ "resizeChatPanel": "Redimensionar o painel de chat",
+ "previewStage": "Área de pré-visualização",
+ "resizeTimeline": "Redimensionar a linha do tempo"
+ },
+ "preview": {
+ "videoPreview": "Pré-visualização do vídeo",
+ "webcamPreview": "Pré-visualização da webcam (arraste para reposicionar)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Anotação",
+ "noImage": "Sem imagem",
+ "noArrowData": "Sem dados de seta"
+ },
+ "providerSettings": {
+ "title": "Configurações de IA",
+ "subtitle": "Escolha um provedor. As credenciais são armazenadas no chaveiro do sistema (safeStorage).",
+ "loadFailed": "Não foi possível carregar as configurações de IA",
+ "saved": "{{provider}} salvo",
+ "connected": "{{provider}} conectado",
+ "disconnected": "{{provider}} desconectado",
+ "deviceFlowFailed": "Falha no fluxo de dispositivo.",
+ "pillConnected": "Conectado",
+ "pillOAuth": "OAuth",
+ "pillToken": "Token",
+ "pillApiKey": "Chave de API",
+ "notConnected": "Não conectado",
+ "back": "Voltar",
+ "modelLabel": "Modelo",
+ "modelHintLive": "Modelos da sua conta, buscados ao vivo.",
+ "modelHintError": "Não foi possível buscar os modelos ({{error}}); digite um id de modelo manualmente.",
+ "modelHintLoading": "Carregando modelos ao vivo…",
+ "modelSavedOption": "{{model}} (salvo)",
+ "loadingModels": "Carregando modelos…",
+ "baseUrlLabel": "URL base",
+ "baseUrlHint": "Deixe em branco para usar o padrão do provedor.",
+ "reasoningEffortLabel": "Esforço de raciocínio",
+ "apiKeyLabel": "Chave de API",
+ "apiKeyHintStored": "Armazenada no safeStorage. Deixe em branco para manter a entrada existente.",
+ "patLabel": "Token de acesso pessoal do GitHub",
+ "patHint": "Cole um PAT do GitHub com o escopo `copilot`.",
+ "projectEditsLabel": "Edições do projeto",
+ "projectEditsHint": "Quando desativado, o agente precisa perguntar antes de alterar a linha do tempo. As edições sempre podem ser desfeitas.",
+ "allowAgentEdits": "Permitir que o agente edite o projeto",
+ "disconnect": "Desconectar",
+ "cancel": "Cancelar",
+ "save": "Salvar",
+ "saveAndUse": "Salvar e usar",
+ "reconnect": "Reconectar",
+ "startLogin": "Iniciar login",
+ "connect": "Conectar",
+ "completingSignIn": "Concluindo o login…",
+ "browserLoginPending": "Login no navegador pendente",
+ "deviceCodeInstructions": "Abra a página de login do {{provider}} e digite este código. Terminaremos de conectar automaticamente assim que você autorizar.",
+ "copyCode": "Copiar código",
+ "copied": "Copiado",
+ "openLoginPage": "Abrir página de login"
}
}
diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.json
index 25b7be890..94f986288 100644
--- a/src/i18n/locales/pt-BR/settings.json
+++ b/src/i18n/locales/pt-BR/settings.json
@@ -50,7 +50,14 @@
"webcamSize": "Tamanho da Webcam",
"mirrorWebcam": "Espelhar Webcam",
"reactiveWebcam": "Encolher ao ampliar",
- "reactiveWebcamDescription": "A câmera diminui suavemente enquanto o vídeo está ampliado, para não atrapalhar."
+ "reactiveWebcamDescription": "A câmera diminui suavemente enquanto o vídeo está ampliado, para não atrapalhar.",
+ "help": "Como a webcam é composta com a tela: picture-in-picture, pilha vertical, quadro duplo, formato da máscara, tamanho e espelhamento.",
+ "shapes": {
+ "rectangle": "Ret.",
+ "circle": "Círculo",
+ "square": "Quadrado",
+ "rounded": "Arredondado"
+ }
},
"effects": {
"title": "Efeitos de Vídeo",
@@ -60,7 +67,8 @@
"on": "ativado",
"shadow": "Sombra",
"roundness": "Arredondamento",
- "padding": "Espaçamento"
+ "padding": "Espaçamento",
+ "help": "Estilo do quadro da gravação: desfoque de fundo, sombra, desfoque de movimento, raio dos cantos e margem em volta do vídeo."
},
"background": {
"title": "Fundo",
@@ -72,7 +80,11 @@
"gradientLabel": "Gradiente {{index}}",
"colorWheel": "Roda de Cores",
"colorPalette": "Paleta de Cores",
- "presets": "Predefinições"
+ "presets": "Predefinições",
+ "help": "Escolha o que aparece atrás da gravação: um papel de parede incluído, uma cor sólida, um gradiente ou uma imagem sua do disco.",
+ "customWallpaper": "Papel de parede personalizado",
+ "imageLabel": "Fundo {{index}}",
+ "colorLabel": "Cor {{color}}"
},
"crop": {
"title": "Cortar",
@@ -221,17 +233,38 @@
"motionBlur": "Desfoque de movimento",
"clickBounce": "Rebote ao clicar",
"clipToBounds": "Recortar à tela",
- "clipToBoundsDescription": "Mantém o cursor dentro do quadro do vídeo. Desative para permitir que o cursor ultrapasse as bordas — útil ao aplicar zoom ou ao deslocar."
+ "clipToBoundsDescription": "Mantém o cursor dentro do quadro do vídeo. Desative para permitir que o cursor ultrapasse as bordas — útil ao aplicar zoom ou ao deslocar.",
+ "help": "Renderização do cursor a partir da telemetria gravada: tema, tamanho, suavização, desfoque de movimento e salto ao clicar."
},
"language": {
"title": "Idioma"
},
"timeline": {
"title": "Linha do Tempo",
- "waveform": "Mostrar Forma de Onda de Áudio na Faixa de Corte"
+ "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"
+ },
+ "panes": {
+ "help": "Ajuda"
+ },
+ "transcript": {
+ "title": "Transcrição atual",
+ "help": "Transcrição agregada de todos os clipes da linha do tempo. Backspace / Delete em uma palavra ou seleção marca como ignorada (em vermelho). Passe o mouse sobre um trecho vermelho para restaurá-lo.",
+ "noClips": "Nenhum clipe ainda",
+ "noTranscript": "Nenhuma transcrição ainda",
+ "whisperHint": "A transcrição usa o Whisper local — roda no seu navegador, nenhum dado sai do dispositivo.",
+ "transcribeNow": "Transcrever agora",
+ "transcribing": "Transcrevendo…",
+ "clipLabel": "Clipe {{index}}",
+ "noClipTranscript": "Sem transcrição para este clipe — abra o cartão do recurso e gere novamente.",
+ "editorAria": "Transcrição de {{filename}}",
+ "silence": "[silêncio {{duration}} s]",
+ "restoreSilence": "Restaurar silêncio ({{duration}} s)",
+ "trimSilence": "Cortar silêncio ({{duration}} s)",
+ "restoreWord": "Restaurar \"{{word}}\""
}
}
diff --git a/src/i18n/locales/ru/editor.json b/src/i18n/locales/ru/editor.json
index f5d0ea073..d238125a9 100644
--- a/src/i18n/locales/ru/editor.json
+++ b/src/i18n/locales/ru/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "Показать в папке",
"exportFailed": "Ошибка экспорта",
"failedToWriteFile": "Не удалось записать файл",
- "qualityUpscaleWarning": "Апскейл"
+ "qualityUpscaleWarning": "Апскейл",
+ "exportedVideoOf": "видео экспортировано за"
},
"inspector": {
"resetFocusPoint": "Сбросить точку фокуса",
@@ -215,7 +216,9 @@
"captionsDescription": "Создайте субтитры с привязкой по словам на основе транскрипции и добавьте их на таймлинию.",
"generateCaptions": "Создать субтитры",
"cropDescription": "Перекадрируйте запись — выберите соотношение сторон и увеличьте область, которую нужно сохранить.",
- "openCrop": "Открыть обрезку…"
+ "openCrop": "Открыть обрезку…",
+ "cameraFullscreenDescription": "Пока играет этот участок, камера занимает весь кадр — без рамки, скруглений и фона — и плавно возвращается в конце. Перетаскивайте края участка на таймлайне, чтобы изменить его начало и длительность.",
+ "deleteRegion": "Удалить участок"
},
"leftPanel": {
"mediaTitle": "Медиа",
@@ -303,13 +306,9 @@
"create": "Создать проект",
"defaultTitle": "Проект без названия",
"templates": {
- "blankTitle": "Пустой проект",
- "blankDesc": "Пустая таймлиния, готова к импорту",
"screenRecordingTitle": "Запись экрана",
"screenRecordingDesc": "Начать системный захват",
- "importMediaDesc": "Видео, аудио, изображения с диска",
- "fromTemplateTitle": "Из шаблона",
- "fromTemplateDesc": "Готовая раскадровка"
+ "importMediaDesc": "Видео, аудио, изображения с диска"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "Ш",
"fieldH": "В"
+ },
+ "transport": {
+ "playbackControls": "Элементы управления воспроизведением",
+ "playPause": "Воспроизведение / Пауза",
+ "playPauseTitle": "Воспроизведение / Пауза (Пробел)",
+ "previousClip": "Предыдущий клип",
+ "nextClip": "Следующий клип",
+ "loop": "Повтор",
+ "seekVideo": "Перемотка видео"
+ },
+ "shell": {
+ "aiEditor": "ИИ-редактор",
+ "resizeChatPanel": "Изменить размер панели чата",
+ "previewStage": "Область предпросмотра",
+ "resizeTimeline": "Изменить размер таймлайна"
+ },
+ "preview": {
+ "videoPreview": "Предпросмотр видео",
+ "webcamPreview": "Предпросмотр камеры (перетащите, чтобы переместить)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Аннотация",
+ "noImage": "Нет изображения",
+ "noArrowData": "Нет данных стрелки"
+ },
+ "providerSettings": {
+ "title": "Настройки ИИ",
+ "subtitle": "Выберите провайдера. Учётные данные хранятся в связке ключей ОС (safeStorage).",
+ "loadFailed": "Не удалось загрузить настройки ИИ",
+ "saved": "{{provider}} сохранён",
+ "connected": "{{provider}} подключён",
+ "disconnected": "{{provider}} отключён",
+ "deviceFlowFailed": "Не удалось выполнить вход через устройство.",
+ "pillConnected": "Подключено",
+ "pillOAuth": "OAuth",
+ "pillToken": "Токен",
+ "pillApiKey": "API-ключ",
+ "notConnected": "Не подключено",
+ "back": "Назад",
+ "modelLabel": "Модель",
+ "modelHintLive": "Модели из вашей учётной записи, загруженные в реальном времени.",
+ "modelHintError": "Не удалось получить список моделей ({{error}}); введите идентификатор модели вручную.",
+ "modelHintLoading": "Загрузка актуальных моделей…",
+ "modelSavedOption": "{{model}} (сохранено)",
+ "loadingModels": "Загрузка моделей…",
+ "baseUrlLabel": "Базовый URL",
+ "baseUrlHint": "Оставьте пустым, чтобы использовать значение провайдера по умолчанию.",
+ "reasoningEffortLabel": "Глубина рассуждений",
+ "apiKeyLabel": "API-ключ",
+ "apiKeyHintStored": "Хранится в safeStorage. Оставьте пустым, чтобы сохранить текущее значение.",
+ "patLabel": "Персональный токен доступа GitHub",
+ "patHint": "Вставьте GitHub PAT с областью `copilot`.",
+ "projectEditsLabel": "Правки проекта",
+ "projectEditsHint": "Если выключено, агент должен спрашивать перед изменением таймлайна. Правки всегда можно отменить.",
+ "allowAgentEdits": "Разрешить агенту редактировать проект",
+ "disconnect": "Отключить",
+ "cancel": "Отмена",
+ "save": "Сохранить",
+ "saveAndUse": "Сохранить и использовать",
+ "reconnect": "Переподключить",
+ "startLogin": "Начать вход",
+ "connect": "Подключить",
+ "completingSignIn": "Завершаем вход…",
+ "browserLoginPending": "Ожидается вход через браузер",
+ "deviceCodeInstructions": "Откройте страницу входа {{provider}} и введите этот код. Как только вы подтвердите доступ, подключение завершится автоматически.",
+ "copyCode": "Скопировать код",
+ "copied": "Скопировано",
+ "openLoginPage": "Открыть страницу входа"
}
}
diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.json
index 25cdc52e5..43f564023 100644
--- a/src/i18n/locales/ru/settings.json
+++ b/src/i18n/locales/ru/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "Без веб-камеры",
"mirrorWebcam": "Зеркалить веб-камеру",
"reactiveWebcam": "Уменьшать при зуме",
- "reactiveWebcamDescription": "Камера плавно уменьшается во время приближения, чтобы не мешать."
+ "reactiveWebcamDescription": "Камера плавно уменьшается во время приближения, чтобы не мешать.",
+ "help": "Как камера совмещается с экраном: «картинка в картинке», вертикальная стопка, двойной кадр, форма маски, размер и зеркальное отражение.",
+ "shapes": {
+ "rectangle": "Прямоуг.",
+ "circle": "Круг",
+ "square": "Квадрат",
+ "rounded": "Скруглённый"
+ }
},
"effects": {
"title": "Видеоэффекты",
@@ -60,7 +67,8 @@
"on": "вкл",
"shadow": "Тень",
"roundness": "Скругление",
- "padding": "Отступ"
+ "padding": "Отступ",
+ "help": "Оформление кадра записи: размытие фона, тень, размытие движения, скругление углов и отступ вокруг видео."
},
"background": {
"title": "Фон",
@@ -72,7 +80,11 @@
"gradientLabel": "Градиент {{index}}",
"colorWheel": "Цветовой круг",
"colorPalette": "Палитра цветов",
- "presets": "Пресеты"
+ "presets": "Пресеты",
+ "help": "Выберите, что будет за записью: встроенное изображение, сплошной цвет, градиент или собственная картинка с диска.",
+ "customWallpaper": "Свои обои",
+ "imageLabel": "Фон {{index}}",
+ "colorLabel": "Цвет {{color}}"
},
"crop": {
"title": "Обрезка",
@@ -221,17 +233,38 @@
"motionBlur": "Размытие движения",
"clickBounce": "Отскок при клике",
"clipToBounds": "Обрезать по холсту",
- "clipToBoundsDescription": "Удерживает курсор внутри кадра видео. Отключите, чтобы курсор мог выходить за края — полезно при увеличении или панорамировании."
+ "clipToBoundsDescription": "Удерживает курсор внутри кадра видео. Отключите, чтобы курсор мог выходить за края — полезно при увеличении или панорамировании.",
+ "help": "Отрисовка курсора по записанной телеметрии: тема, размер, сглаживание, размытие движения и отскок при клике."
},
"language": {
"title": "Язык"
},
"timeline": {
"title": "Шкала времени",
- "waveform": "Показывать форму волны на треке обрезки"
+ "waveform": "Показывать форму волны на треке обрезки",
+ "help": "Параметры отображения таймлайна, например показ звуковой волны на дорожке обрезки."
},
"facets": {
"captions": "Субтитры",
"transcript": "Транскрипт"
+ },
+ "panes": {
+ "help": "Справка"
+ },
+ "transcript": {
+ "title": "Текущая расшифровка",
+ "help": "Сводная расшифровка всех клипов на таймлайне. Backspace / Delete по слову или выделению помечает его как пропущенное (красным). Наведите курсор на красный фрагмент, чтобы вернуть его.",
+ "noClips": "Клипов пока нет",
+ "noTranscript": "Расшифровки пока нет",
+ "whisperHint": "Расшифровка использует локальный Whisper — работает в вашем браузере, данные не покидают устройство.",
+ "transcribeNow": "Расшифровать сейчас",
+ "transcribing": "Расшифровка…",
+ "clipLabel": "Клип {{index}}",
+ "noClipTranscript": "Для этого клипа нет расшифровки — откройте карточку файла и создайте её заново.",
+ "editorAria": "Расшифровка «{{filename}}»",
+ "silence": "[тишина {{duration}} с]",
+ "restoreSilence": "Вернуть тишину ({{duration}} с)",
+ "trimSilence": "Вырезать тишину ({{duration}} с)",
+ "restoreWord": "Вернуть «{{word}}»"
}
}
diff --git a/src/i18n/locales/tr/editor.json b/src/i18n/locales/tr/editor.json
index ffaaa14bd..957315e93 100644
--- a/src/i18n/locales/tr/editor.json
+++ b/src/i18n/locales/tr/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "Klasörde göster",
"exportFailed": "Dışa aktarma başarısız oldu",
"failedToWriteFile": "Dosya yazılamadı",
- "qualityUpscaleWarning": "Upscale"
+ "qualityUpscaleWarning": "Upscale",
+ "exportedVideoOf": "video şu sürede dışa aktarıldı:"
},
"inspector": {
"resetFocusPoint": "Odak noktasını sıfırla",
@@ -215,7 +216,9 @@
"captionsDescription": "Transkriptten kelime zamanlamalı altyazılar oluşturun ve zaman çizelgesine bırakın.",
"generateCaptions": "Altyazı oluştur",
"cropDescription": "Kaydı yeniden çerçeveleyin — bir en boy oranı seçin ve saklamak istediğiniz bölgeye yakınlaşın.",
- "openCrop": "Kırpmayı aç…"
+ "openCrop": "Kırpmayı aç…",
+ "cameraFullscreenDescription": "Bu bölge oynarken kamera tüm kareyi kaplar — kenarlık, yuvarlatma ve arka plan olmadan — ve sonunda yumuşakça geri döner. Ne zaman başlayacağını ve ne kadar süreceğini değiştirmek için zaman çizelgesinde bölgenin kenarlarını sürükleyin.",
+ "deleteRegion": "Bölgeyi sil"
},
"leftPanel": {
"mediaTitle": "Medya",
@@ -303,13 +306,9 @@
"create": "Proje oluştur",
"defaultTitle": "Adsız proje",
"templates": {
- "blankTitle": "Boş proje",
- "blankDesc": "İçe aktarmaya hazır boş zaman çizelgesi",
"screenRecordingTitle": "Ekran kaydı",
"screenRecordingDesc": "Sistem yakalamayı başlat",
- "importMediaDesc": "Diskten video, ses, görsel",
- "fromTemplateTitle": "Şablondan",
- "fromTemplateDesc": "Önceden tanımlanmış hikaye tahtası"
+ "importMediaDesc": "Diskten video, ses, görsel"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "G",
"fieldH": "Y"
+ },
+ "transport": {
+ "playbackControls": "Oynatma denetimleri",
+ "playPause": "Oynat / Duraklat",
+ "playPauseTitle": "Oynat / Duraklat (Boşluk)",
+ "previousClip": "Önceki klip",
+ "nextClip": "Sonraki klip",
+ "loop": "Döngü",
+ "seekVideo": "Videoda gezin"
+ },
+ "shell": {
+ "aiEditor": "Yapay zekâ düzenleyici",
+ "resizeChatPanel": "Sohbet panelini yeniden boyutlandır",
+ "previewStage": "Önizleme alanı",
+ "resizeTimeline": "Zaman çizelgesini yeniden boyutlandır"
+ },
+ "preview": {
+ "videoPreview": "Video önizlemesi",
+ "webcamPreview": "Web kamerası önizlemesi (taşımak için sürükleyin)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Açıklama",
+ "noImage": "Görsel yok",
+ "noArrowData": "Ok verisi yok"
+ },
+ "providerSettings": {
+ "title": "Yapay zekâ ayarları",
+ "subtitle": "Bir sağlayıcı seçin. Kimlik bilgileri işletim sisteminin anahtar zincirinde (safeStorage) saklanır.",
+ "loadFailed": "Yapay zekâ ayarları yüklenemedi",
+ "saved": "{{provider}} kaydedildi",
+ "connected": "{{provider}} bağlandı",
+ "disconnected": "{{provider}} bağlantısı kesildi",
+ "deviceFlowFailed": "Cihaz akışı başarısız oldu.",
+ "pillConnected": "Bağlı",
+ "pillOAuth": "OAuth",
+ "pillToken": "Belirteç",
+ "pillApiKey": "API anahtarı",
+ "notConnected": "Bağlı değil",
+ "back": "Geri",
+ "modelLabel": "Model",
+ "modelHintLive": "Hesabınızdan canlı olarak alınan modeller.",
+ "modelHintError": "Canlı modeller alınamadı ({{error}}); model kimliğini elle yazın.",
+ "modelHintLoading": "Canlı modeller yükleniyor…",
+ "modelSavedOption": "{{model}} (kayıtlı)",
+ "loadingModels": "Modeller yükleniyor…",
+ "baseUrlLabel": "Temel URL",
+ "baseUrlHint": "Sağlayıcının varsayılanını kullanmak için boş bırakın.",
+ "reasoningEffortLabel": "Akıl yürütme düzeyi",
+ "apiKeyLabel": "API anahtarı",
+ "apiKeyHintStored": "safeStorage'da saklanıyor. Mevcut kaydı korumak için boş bırakın.",
+ "patLabel": "GitHub kişisel erişim belirteci",
+ "patHint": "`copilot` kapsamına sahip bir GitHub PAT yapıştırın.",
+ "projectEditsLabel": "Proje düzenlemeleri",
+ "projectEditsHint": "Kapalıyken, aracı zaman çizelgesini değiştirmeden önce izin ister. Düzenlemeler her zaman geri alınabilir.",
+ "allowAgentEdits": "Aracının projeyi düzenlemesine izin ver",
+ "disconnect": "Bağlantıyı kes",
+ "cancel": "İptal",
+ "save": "Kaydet",
+ "saveAndUse": "Kaydet ve kullan",
+ "reconnect": "Yeniden bağlan",
+ "startLogin": "Girişi başlat",
+ "connect": "Bağlan",
+ "completingSignIn": "Oturum açma tamamlanıyor…",
+ "browserLoginPending": "Tarayıcı girişi bekleniyor",
+ "deviceCodeInstructions": "{{provider}} giriş sayfasını açın ve bu kodu girin. İzin verdiğinizde bağlantıyı otomatik olarak tamamlayacağız.",
+ "copyCode": "Kodu kopyala",
+ "copied": "Kopyalandı",
+ "openLoginPage": "Giriş sayfasını aç"
}
}
diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.json
index f591f3df3..119b99937 100644
--- a/src/i18n/locales/tr/settings.json
+++ b/src/i18n/locales/tr/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "Web kamerası yok",
"mirrorWebcam": "Web kamerasını aynala",
"reactiveWebcam": "Yakınlaştırınca küçült",
- "reactiveWebcamDescription": "Video yakınlaştırıldığında kamera yumuşakça küçülür, böylece yoldan çekilir."
+ "reactiveWebcamDescription": "Video yakınlaştırıldığında kamera yumuşakça küçülür, böylece yoldan çekilir.",
+ "help": "Web kamerasının ekranla birleştirilme biçimi: resim içinde resim, dikey yığın, çift çerçeve, maske şekli, boyut ve aynalama.",
+ "shapes": {
+ "rectangle": "Dikdörtgen",
+ "circle": "Daire",
+ "square": "Kare",
+ "rounded": "Yuvarlatılmış"
+ }
},
"effects": {
"title": "Video Efektleri",
@@ -60,7 +67,8 @@
"shadow": "Gölge",
"roundness": "Yuvarlaklık",
"padding": "Dolgu",
- "on": "açık"
+ "on": "açık",
+ "help": "Kayıt çerçevesinin biçimi: arka plan bulanıklığı, gölge, hareket bulanıklığı, köşe yuvarlaklığı ve videonun çevresindeki boşluk."
},
"background": {
"title": "Arka Plan",
@@ -72,7 +80,11 @@
"gradientLabel": "Gradyan {{index}}",
"colorWheel": "Renk çarkı",
"colorPalette": "Renk paleti",
- "presets": "Ön ayarlar"
+ "presets": "Ön ayarlar",
+ "help": "Kaydın arkasında ne görüneceğini seçin: yerleşik bir duvar kâğıdı, düz renk, gradyan veya diskinizdeki özel bir görsel.",
+ "customWallpaper": "Özel duvar kâğıdı",
+ "imageLabel": "Arka plan {{index}}",
+ "colorLabel": "Renk {{color}}"
},
"crop": {
"title": "Kırpma",
@@ -221,17 +233,38 @@
"motionBlur": "Hareket Bulanıklığı",
"clickBounce": "Tıklama Sıçraması",
"clipToBounds": "Tuvale Kırp",
- "clipToBoundsDescription": "İmleci video kare içinde tutar. İmlecin kenarları aşmasına izin vermek için kapatın — yakınlaştırma veya kaydırma yapılırken kullanışlıdır."
+ "clipToBoundsDescription": "İmleci video kare içinde tutar. İmlecin kenarları aşmasına izin vermek için kapatın — yakınlaştırma veya kaydırma yapılırken kullanışlıdır.",
+ "help": "Kaydedilen telemetriden imleç çizimi: tema, boyut, yumuşatma, hareket bulanıklığı ve tıklama sıçraması."
},
"language": {
"title": "Dil"
},
"timeline": {
"title": "Zaman Tüneli",
- "waveform": "Kırpma Parçasında Ses Dalgasını Göster"
+ "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ü"
+ },
+ "panes": {
+ "help": "Yardım"
+ },
+ "transcript": {
+ "title": "Geçerli döküm",
+ "help": "Zaman çizelgesindeki tüm kliplerin birleşik dökümü. Bir kelimede veya seçimde Backspace / Delete tuşuna basmak onu atlanmış (kırmızı) olarak işaretler. Kırmızı bölümün üzerine gelerek geri alabilirsiniz.",
+ "noClips": "Henüz klip yok",
+ "noTranscript": "Henüz döküm yok",
+ "whisperHint": "Döküm yerel Whisper kullanır — tarayıcınızda çalışır, hiçbir veri cihazdan çıkmaz.",
+ "transcribeNow": "Şimdi dökümünü çıkar",
+ "transcribing": "Döküm çıkarılıyor…",
+ "clipLabel": "Klip {{index}}",
+ "noClipTranscript": "Bu klip için döküm yok — medya kartını açıp yeniden oluşturun.",
+ "editorAria": "{{filename}} dökümü",
+ "silence": "[sessizlik {{duration}} sn]",
+ "restoreSilence": "Sessizliği geri al ({{duration}} sn)",
+ "trimSilence": "Sessizliği kırp ({{duration}} sn)",
+ "restoreWord": "\"{{word}}\" kelimesini geri al"
}
}
diff --git a/src/i18n/locales/vi/editor.json b/src/i18n/locales/vi/editor.json
index e5befc735..092824dee 100644
--- a/src/i18n/locales/vi/editor.json
+++ b/src/i18n/locales/vi/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "Hiện trong thư mục",
"exportFailed": "Xuất thất bại",
"failedToWriteFile": "Không thể ghi tệp",
- "qualityUpscaleWarning": "Upscale"
+ "qualityUpscaleWarning": "Upscale",
+ "exportedVideoOf": "video đã xuất trong"
},
"inspector": {
"resetFocusPoint": "Đặt lại điểm lấy nét",
@@ -215,7 +216,9 @@
"captionsDescription": "Tạo phụ đề đồng bộ theo từng từ từ bản ghi lời thoại và thả vào dòng thời gian.",
"generateCaptions": "Tạo phụ đề",
"cropDescription": "Đóng khung lại bản ghi — chọn tỷ lệ khung hình và phóng to vào vùng bạn muốn giữ lại.",
- "openCrop": "Mở cắt…"
+ "openCrop": "Mở cắt…",
+ "cameraFullscreenDescription": "Khi vùng này phát, máy quay chiếm trọn khung hình — không viền, không bo góc, không nền — rồi trở lại mượt mà ở cuối. Kéo hai mép của vùng trên dòng thời gian để thay đổi thời điểm bắt đầu và độ dài.",
+ "deleteRegion": "Xóa vùng"
},
"leftPanel": {
"mediaTitle": "Media",
@@ -303,13 +306,9 @@
"create": "Tạo dự án",
"defaultTitle": "Dự án chưa đặt tên",
"templates": {
- "blankTitle": "Dự án trống",
- "blankDesc": "Dòng thời gian trống, sẵn sàng nhập",
"screenRecordingTitle": "Ghi màn hình",
"screenRecordingDesc": "Bắt đầu chụp hệ thống",
- "importMediaDesc": "Video, âm thanh, hình ảnh từ ổ đĩa",
- "fromTemplateTitle": "Từ mẫu",
- "fromTemplateDesc": "Bảng phân cảnh dựng sẵn"
+ "importMediaDesc": "Video, âm thanh, hình ảnh từ ổ đĩa"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "R",
"fieldH": "C"
+ },
+ "transport": {
+ "playbackControls": "Điều khiển phát lại",
+ "playPause": "Phát / Tạm dừng",
+ "playPauseTitle": "Phát / Tạm dừng (Phím cách)",
+ "previousClip": "Clip trước",
+ "nextClip": "Clip tiếp theo",
+ "loop": "Lặp lại",
+ "seekVideo": "Tua video"
+ },
+ "shell": {
+ "aiEditor": "Trình biên tập AI",
+ "resizeChatPanel": "Đổi kích thước bảng trò chuyện",
+ "previewStage": "Khu vực xem trước",
+ "resizeTimeline": "Đổi kích thước dòng thời gian"
+ },
+ "preview": {
+ "videoPreview": "Xem trước video",
+ "webcamPreview": "Xem trước webcam (kéo để đổi vị trí)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "Chú thích",
+ "noImage": "Không có hình ảnh",
+ "noArrowData": "Không có dữ liệu mũi tên"
+ },
+ "providerSettings": {
+ "title": "Cài đặt AI",
+ "subtitle": "Chọn một nhà cung cấp. Thông tin đăng nhập được lưu trong kho khóa của hệ điều hành (safeStorage).",
+ "loadFailed": "Không thể tải cài đặt AI",
+ "saved": "Đã lưu {{provider}}",
+ "connected": "Đã kết nối {{provider}}",
+ "disconnected": "Đã ngắt kết nối {{provider}}",
+ "deviceFlowFailed": "Luồng xác thực thiết bị thất bại.",
+ "pillConnected": "Đã kết nối",
+ "pillOAuth": "OAuth",
+ "pillToken": "Token",
+ "pillApiKey": "Khóa API",
+ "notConnected": "Chưa kết nối",
+ "back": "Quay lại",
+ "modelLabel": "Mô hình",
+ "modelHintLive": "Các mô hình từ tài khoản của bạn, lấy trực tiếp.",
+ "modelHintError": "Không lấy được danh sách mô hình ({{error}}); hãy nhập id mô hình thủ công.",
+ "modelHintLoading": "Đang tải danh sách mô hình…",
+ "modelSavedOption": "{{model}} (đã lưu)",
+ "loadingModels": "Đang tải mô hình…",
+ "baseUrlLabel": "URL cơ sở",
+ "baseUrlHint": "Để trống để dùng giá trị mặc định của nhà cung cấp.",
+ "reasoningEffortLabel": "Mức độ suy luận",
+ "apiKeyLabel": "Khóa API",
+ "apiKeyHintStored": "Được lưu trong safeStorage. Để trống để giữ mục hiện có.",
+ "patLabel": "Mã truy cập cá nhân GitHub",
+ "patHint": "Dán một GitHub PAT có phạm vi `copilot`.",
+ "projectEditsLabel": "Chỉnh sửa dự án",
+ "projectEditsHint": "Khi tắt, tác nhân phải hỏi trước khi thay đổi dòng thời gian. Mọi chỉnh sửa đều có thể hoàn tác.",
+ "allowAgentEdits": "Cho phép tác nhân chỉnh sửa dự án",
+ "disconnect": "Ngắt kết nối",
+ "cancel": "Hủy",
+ "save": "Lưu",
+ "saveAndUse": "Lưu và dùng",
+ "reconnect": "Kết nối lại",
+ "startLogin": "Bắt đầu đăng nhập",
+ "connect": "Kết nối",
+ "completingSignIn": "Đang hoàn tất đăng nhập…",
+ "browserLoginPending": "Đang chờ đăng nhập trên trình duyệt",
+ "deviceCodeInstructions": "Mở trang đăng nhập {{provider}} và nhập mã này. Chúng tôi sẽ hoàn tất kết nối tự động ngay khi bạn cấp quyền.",
+ "copyCode": "Sao chép mã",
+ "copied": "Đã sao chép",
+ "openLoginPage": "Mở trang đăng nhập"
}
}
diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.json
index e11f1a51c..05cfd0495 100644
--- a/src/i18n/locales/vi/settings.json
+++ b/src/i18n/locales/vi/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "Không có webcam",
"mirrorWebcam": "Lật webcam",
"reactiveWebcam": "Thu nhỏ khi phóng to",
- "reactiveWebcamDescription": "Camera thu nhỏ mượt mà khi video được phóng to, để không che khuất."
+ "reactiveWebcamDescription": "Camera thu nhỏ mượt mà khi video được phóng to, để không che khuất.",
+ "help": "Cách ghép webcam với màn hình: hình trong hình, xếp dọc, khung đôi, hình dạng mặt nạ, kích thước và lật gương.",
+ "shapes": {
+ "rectangle": "Chữ nhật",
+ "circle": "Tròn",
+ "square": "Vuông",
+ "rounded": "Bo góc"
+ }
},
"effects": {
"title": "Hiệu ứng video",
@@ -60,7 +67,8 @@
"shadow": "Bóng đổ",
"roundness": "Độ bo tròn",
"padding": "Phần đệm",
- "on": "bật"
+ "on": "bật",
+ "help": "Kiểu khung của bản ghi: làm mờ nền, đổ bóng, mờ chuyển động, bo góc và khoảng đệm quanh video."
},
"background": {
"title": "Nền",
@@ -72,7 +80,11 @@
"gradientLabel": "Dải màu {{index}}",
"colorPalette": "Bảng màu",
"colorWheel": "Vòng màu",
- "presets": "Có sẵn"
+ "presets": "Có sẵn",
+ "help": "Chọn nội dung hiển thị phía sau bản ghi: ảnh nền có sẵn, màu đơn sắc, dải màu chuyển sắc, hoặc ảnh riêng của bạn từ ổ đĩa.",
+ "customWallpaper": "Ảnh nền tùy chỉnh",
+ "imageLabel": "Nền {{index}}",
+ "colorLabel": "Màu {{color}}"
},
"crop": {
"title": "Cắt xén",
@@ -221,17 +233,38 @@
"motionBlur": "Làm mờ chuyển động",
"clickBounce": "Nảy khi nhấp",
"clipToBounds": "Cắt theo khung",
- "clipToBoundsDescription": "Giữ con trỏ bên trong khung hình video. Tắt để cho phép con trỏ vượt ra ngoài mép — hữu ích khi phóng to hoặc lia máy."
+ "clipToBoundsDescription": "Giữ con trỏ bên trong khung hình video. Tắt để cho phép con trỏ vượt ra ngoài mép — hữu ích khi phóng to hoặc lia máy.",
+ "help": "Cách vẽ con trỏ từ dữ liệu đã ghi: chủ đề, kích thước, làm mượt, mờ chuyển động và hiệu ứng nảy khi nhấp."
},
"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"
+ "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"
+ },
+ "panes": {
+ "help": "Trợ giúp"
+ },
+ "transcript": {
+ "title": "Bản chép lời hiện tại",
+ "help": "Bản chép lời gộp của mọi clip trên dòng thời gian. Nhấn Backspace / Delete trên một từ hoặc vùng chọn để đánh dấu là bỏ qua (màu đỏ). Di chuột lên đoạn màu đỏ để khôi phục.",
+ "noClips": "Chưa có clip nào",
+ "noTranscript": "Chưa có bản chép lời",
+ "whisperHint": "Việc chép lời dùng Whisper cục bộ — chạy ngay trong trình duyệt, không dữ liệu nào rời khỏi thiết bị.",
+ "transcribeNow": "Chép lời ngay",
+ "transcribing": "Đang chép lời…",
+ "clipLabel": "Clip {{index}}",
+ "noClipTranscript": "Clip này chưa có bản chép lời — mở thẻ tài nguyên và tạo lại.",
+ "editorAria": "Bản chép lời của {{filename}}",
+ "silence": "[khoảng lặng {{duration}} giây]",
+ "restoreSilence": "Khôi phục khoảng lặng ({{duration}} giây)",
+ "trimSilence": "Cắt khoảng lặng ({{duration}} giây)",
+ "restoreWord": "Khôi phục \"{{word}}\""
}
}
diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.json
index 99e3ffb55..ac53cf0e4 100644
--- a/src/i18n/locales/zh-CN/editor.json
+++ b/src/i18n/locales/zh-CN/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "在文件夹中显示",
"exportFailed": "导出失败",
"failedToWriteFile": "写入文件失败",
- "qualityUpscaleWarning": "放大"
+ "qualityUpscaleWarning": "放大",
+ "exportedVideoOf": "的视频已导出,用时"
},
"inspector": {
"resetFocusPoint": "重置焦点",
@@ -215,7 +216,9 @@
"captionsDescription": "根据转录文本生成按字词计时的字幕,并将其放置到时间轴上。",
"generateCaptions": "生成字幕",
"cropDescription": "重新构图录制内容 — 选择宽高比并缩放到要保留的区域。",
- "openCrop": "打开裁剪…"
+ "openCrop": "打开裁剪…",
+ "cameraFullscreenDescription": "该区间播放时,摄像头会占满整个画面 — 没有边框、圆角和背景 — 并在结束时平滑还原。在时间轴上拖动区间边缘可调整其起始位置和时长。",
+ "deleteRegion": "删除区间"
},
"leftPanel": {
"mediaTitle": "媒体",
@@ -303,13 +306,9 @@
"create": "创建项目",
"defaultTitle": "未命名项目",
"templates": {
- "blankTitle": "空白项目",
- "blankDesc": "空时间轴,可直接导入",
"screenRecordingTitle": "屏幕录制",
"screenRecordingDesc": "开始系统捕获",
- "importMediaDesc": "从磁盘导入视频、音频、图片",
- "fromTemplateTitle": "从模板创建",
- "fromTemplateDesc": "预定义的故事板"
+ "importMediaDesc": "从磁盘导入视频、音频、图片"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "宽",
"fieldH": "高"
+ },
+ "transport": {
+ "playbackControls": "播放控件",
+ "playPause": "播放 / 暂停",
+ "playPauseTitle": "播放 / 暂停(空格)",
+ "previousClip": "上一个片段",
+ "nextClip": "下一个片段",
+ "loop": "循环",
+ "seekVideo": "拖动视频进度"
+ },
+ "shell": {
+ "aiEditor": "AI 编辑器",
+ "resizeChatPanel": "调整聊天面板大小",
+ "previewStage": "预览区域",
+ "resizeTimeline": "调整时间轴大小"
+ },
+ "preview": {
+ "videoPreview": "视频预览",
+ "webcamPreview": "摄像头预览(拖动可重新定位)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "批注",
+ "noImage": "无图片",
+ "noArrowData": "无箭头数据"
+ },
+ "providerSettings": {
+ "title": "AI 设置",
+ "subtitle": "选择一个提供商。凭据存储在系统钥匙串(safeStorage)中。",
+ "loadFailed": "无法加载 AI 设置",
+ "saved": "已保存 {{provider}}",
+ "connected": "已连接 {{provider}}",
+ "disconnected": "已断开 {{provider}}",
+ "deviceFlowFailed": "设备授权流程失败。",
+ "pillConnected": "已连接",
+ "pillOAuth": "OAuth",
+ "pillToken": "令牌",
+ "pillApiKey": "API 密钥",
+ "notConnected": "未连接",
+ "back": "返回",
+ "modelLabel": "模型",
+ "modelHintLive": "从您的账户实时获取的模型。",
+ "modelHintError": "无法获取实时模型({{error}}),请手动输入模型 ID。",
+ "modelHintLoading": "正在加载实时模型…",
+ "modelSavedOption": "{{model}}(已保存)",
+ "loadingModels": "正在加载模型…",
+ "baseUrlLabel": "基础 URL",
+ "baseUrlHint": "留空以使用提供商的默认值。",
+ "reasoningEffortLabel": "推理强度",
+ "apiKeyLabel": "API 密钥",
+ "apiKeyHintStored": "已存储在 safeStorage 中。留空可保留现有条目。",
+ "patLabel": "GitHub 个人访问令牌",
+ "patHint": "粘贴具有 `copilot` 权限范围的 GitHub PAT。",
+ "projectEditsLabel": "项目编辑",
+ "projectEditsHint": "关闭时,智能体在更改时间轴前必须先询问。所有编辑始终可以撤销。",
+ "allowAgentEdits": "允许智能体编辑项目",
+ "disconnect": "断开连接",
+ "cancel": "取消",
+ "save": "保存",
+ "saveAndUse": "保存并使用",
+ "reconnect": "重新连接",
+ "startLogin": "开始登录",
+ "connect": "连接",
+ "completingSignIn": "正在完成登录…",
+ "browserLoginPending": "等待浏览器登录",
+ "deviceCodeInstructions": "打开 {{provider}} 登录页面并输入此代码。您授权后,我们会自动完成连接。",
+ "copyCode": "复制代码",
+ "copied": "已复制",
+ "openLoginPage": "打开登录页面"
}
}
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 7de56cfad..70526105b 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -50,7 +50,14 @@
"noWebcam": "无摄像头",
"mirrorWebcam": "镜像摄像头",
"reactiveWebcam": "缩放时缩小",
- "reactiveWebcamDescription": "放大视频时摄像头会平滑缩小,以免遮挡内容。"
+ "reactiveWebcamDescription": "放大视频时摄像头会平滑缩小,以免遮挡内容。",
+ "help": "摄像头与屏幕的合成方式:画中画、垂直堆叠、双画面、遮罩形状、大小和镜像。",
+ "shapes": {
+ "rectangle": "矩形",
+ "circle": "圆形",
+ "square": "正方形",
+ "rounded": "圆角"
+ }
},
"effects": {
"title": "视频效果",
@@ -60,7 +67,8 @@
"shadow": "阴影",
"roundness": "圆角",
"padding": "内边距",
- "on": "开"
+ "on": "开",
+ "help": "录制画面的边框样式:背景模糊、投影、运动模糊、圆角半径以及视频四周的内边距。"
},
"background": {
"title": "背景",
@@ -72,7 +80,11 @@
"gradientLabel": "渐变 {{index}}",
"colorWheel": "颜色轮",
"colorPalette": "颜色调色板",
- "presets": "预设"
+ "presets": "预设",
+ "help": "选择录制内容背后显示的元素:内置壁纸图片、纯色、渐变,或来自磁盘的自定义图片。",
+ "customWallpaper": "自定义壁纸",
+ "imageLabel": "背景 {{index}}",
+ "colorLabel": "颜色 {{color}}"
},
"crop": {
"title": "裁剪",
@@ -221,17 +233,38 @@
"motionBlur": "运动模糊",
"clickBounce": "点击弹跳",
"clipToBounds": "裁剪到画布",
- "clipToBoundsDescription": "将光标保持在视频画面内。关闭后光标可以超出边缘——在放大或平移时很有用。"
+ "clipToBoundsDescription": "将光标保持在视频画面内。关闭后光标可以超出边缘——在放大或平移时很有用。",
+ "help": "基于录制遥测数据的光标渲染:主题、大小、平滑、运动模糊和点击回弹。"
},
"language": {
"title": "语言"
},
"timeline": {
"title": "时间轴",
- "waveform": "在剪辑轨道上显示音频波形"
+ "waveform": "在剪辑轨道上显示音频波形",
+ "help": "时间轴显示选项,例如在修剪轨道上显示音频波形。"
},
"facets": {
"captions": "字幕",
"transcript": "转录文本"
+ },
+ "panes": {
+ "help": "帮助"
+ },
+ "transcript": {
+ "title": "当前转录",
+ "help": "时间轴上所有片段的合并转录。对某个词或选区按退格 / Delete 会将其标记为跳过(红色)。将鼠标悬停在红色片段上可恢复。",
+ "noClips": "暂无片段",
+ "noTranscript": "暂无转录",
+ "whisperHint": "转录使用本地 Whisper — 在您的浏览器中运行,数据不会离开本设备。",
+ "transcribeNow": "立即转录",
+ "transcribing": "转录中…",
+ "clipLabel": "片段 {{index}}",
+ "noClipTranscript": "该片段没有转录 — 请打开素材卡片并重新生成。",
+ "editorAria": "{{filename}} 的转录",
+ "silence": "[静音 {{duration}} 秒]",
+ "restoreSilence": "恢复静音({{duration}} 秒)",
+ "trimSilence": "修剪静音({{duration}} 秒)",
+ "restoreWord": "恢复“{{word}}”"
}
}
diff --git a/src/i18n/locales/zh-TW/editor.json b/src/i18n/locales/zh-TW/editor.json
index 2699b70a6..3411b6021 100644
--- a/src/i18n/locales/zh-TW/editor.json
+++ b/src/i18n/locales/zh-TW/editor.json
@@ -204,7 +204,8 @@
"showInFolder": "在資料夾中顯示",
"exportFailed": "匯出失敗",
"failedToWriteFile": "寫入檔案失敗",
- "qualityUpscaleWarning": "放大"
+ "qualityUpscaleWarning": "放大",
+ "exportedVideoOf": "的影片已匯出,耗時"
},
"inspector": {
"resetFocusPoint": "重設焦點",
@@ -215,7 +216,9 @@
"captionsDescription": "根據逐字稿產生逐字計時的字幕,並放置到時間軸上。",
"generateCaptions": "產生字幕",
"cropDescription": "重新構圖錄製內容 — 選擇長寬比並縮放至想保留的區域。",
- "openCrop": "開啟裁切…"
+ "openCrop": "開啟裁切…",
+ "cameraFullscreenDescription": "此區間播放時,攝影機會佔滿整個畫面 — 沒有邊框、圓角與背景 — 並在結束時平順還原。在時間軸上拖曳區間邊緣,即可調整開始位置與長度。",
+ "deleteRegion": "刪除區間"
},
"leftPanel": {
"mediaTitle": "媒體",
@@ -303,13 +306,9 @@
"create": "建立專案",
"defaultTitle": "未命名專案",
"templates": {
- "blankTitle": "空白專案",
- "blankDesc": "空時間軸,可直接匯入",
"screenRecordingTitle": "螢幕錄製",
"screenRecordingDesc": "開始系統擷取",
- "importMediaDesc": "從磁碟匯入影片、音訊、圖片",
- "fromTemplateTitle": "從範本建立",
- "fromTemplateDesc": "預先定義的分鏡腳本"
+ "importMediaDesc": "從磁碟匯入影片、音訊、圖片"
}
},
"openProjectDialog": {
@@ -349,5 +348,73 @@
"fieldY": "Y",
"fieldW": "寬",
"fieldH": "高"
+ },
+ "transport": {
+ "playbackControls": "播放控制項",
+ "playPause": "播放 / 暫停",
+ "playPauseTitle": "播放 / 暫停(空白鍵)",
+ "previousClip": "上一個片段",
+ "nextClip": "下一個片段",
+ "loop": "循環",
+ "seekVideo": "拖曳影片進度"
+ },
+ "shell": {
+ "aiEditor": "AI 編輯器",
+ "resizeChatPanel": "調整聊天面板大小",
+ "previewStage": "預覽區域",
+ "resizeTimeline": "調整時間軸大小"
+ },
+ "preview": {
+ "videoPreview": "影片預覽",
+ "webcamPreview": "攝影機預覽(拖曳可重新定位)"
+ },
+ "annotationOverlay": {
+ "imageAlt": "註解",
+ "noImage": "沒有圖片",
+ "noArrowData": "沒有箭頭資料"
+ },
+ "providerSettings": {
+ "title": "AI 設定",
+ "subtitle": "選擇一個供應商。憑證會儲存在系統金鑰鏈(safeStorage)中。",
+ "loadFailed": "無法載入 AI 設定",
+ "saved": "已儲存 {{provider}}",
+ "connected": "已連線 {{provider}}",
+ "disconnected": "已中斷 {{provider}}",
+ "deviceFlowFailed": "裝置授權流程失敗。",
+ "pillConnected": "已連線",
+ "pillOAuth": "OAuth",
+ "pillToken": "權杖",
+ "pillApiKey": "API 金鑰",
+ "notConnected": "未連線",
+ "back": "返回",
+ "modelLabel": "模型",
+ "modelHintLive": "從您的帳戶即時取得的模型。",
+ "modelHintError": "無法取得即時模型({{error}}),請手動輸入模型 ID。",
+ "modelHintLoading": "正在載入即時模型…",
+ "modelSavedOption": "{{model}}(已儲存)",
+ "loadingModels": "正在載入模型…",
+ "baseUrlLabel": "基礎 URL",
+ "baseUrlHint": "留空以使用供應商的預設值。",
+ "reasoningEffortLabel": "推理強度",
+ "apiKeyLabel": "API 金鑰",
+ "apiKeyHintStored": "已儲存在 safeStorage 中。留空可保留現有項目。",
+ "patLabel": "GitHub 個人存取權杖",
+ "patHint": "貼上具有 `copilot` 範圍的 GitHub PAT。",
+ "projectEditsLabel": "專案編輯",
+ "projectEditsHint": "關閉時,代理在變更時間軸前必須先詢問。所有編輯都可以復原。",
+ "allowAgentEdits": "允許代理編輯專案",
+ "disconnect": "中斷連線",
+ "cancel": "取消",
+ "save": "儲存",
+ "saveAndUse": "儲存並使用",
+ "reconnect": "重新連線",
+ "startLogin": "開始登入",
+ "connect": "連線",
+ "completingSignIn": "正在完成登入…",
+ "browserLoginPending": "等待瀏覽器登入",
+ "deviceCodeInstructions": "開啟 {{provider}} 登入頁面並輸入此代碼。您授權後,我們會自動完成連線。",
+ "copyCode": "複製代碼",
+ "copied": "已複製",
+ "openLoginPage": "開啟登入頁面"
}
}
diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json
index f1654a9f6..053d9ed50 100644
--- a/src/i18n/locales/zh-TW/settings.json
+++ b/src/i18n/locales/zh-TW/settings.json
@@ -51,7 +51,14 @@
"noWebcam": "無網路攝影機",
"mirrorWebcam": "鏡像攝影機",
"reactiveWebcam": "縮放時縮小",
- "reactiveWebcamDescription": "放大影片時鏡頭會平滑縮小,以免遮擋內容。"
+ "reactiveWebcamDescription": "放大影片時鏡頭會平滑縮小,以免遮擋內容。",
+ "help": "攝影機與螢幕的合成方式:子母畫面、垂直堆疊、雙畫面、遮罩形狀、大小與鏡像。",
+ "shapes": {
+ "rectangle": "矩形",
+ "circle": "圓形",
+ "square": "正方形",
+ "rounded": "圓角"
+ }
},
"effects": {
"title": "影片效果",
@@ -61,7 +68,8 @@
"shadow": "陰影",
"roundness": "圓角",
"padding": "內邊距",
- "on": "開"
+ "on": "開",
+ "help": "錄製畫面的外框樣式:背景模糊、陰影、動態模糊、圓角半徑,以及影片四周的內距。"
},
"background": {
"title": "背景",
@@ -73,7 +81,11 @@
"gradientLabel": "漸層 {{index}}",
"colorWheel": "色輪",
"colorPalette": "調色盤",
- "presets": "預設"
+ "presets": "預設",
+ "help": "選擇錄製內容背後顯示的元素:內建桌布圖片、純色、漸層,或來自磁碟的自訂圖片。",
+ "customWallpaper": "自訂桌布",
+ "imageLabel": "背景 {{index}}",
+ "colorLabel": "顏色 {{color}}"
},
"crop": {
"title": "裁剪",
@@ -222,17 +234,38 @@
"motionBlur": "動態模糊",
"clickBounce": "點擊彈跳",
"clipToBounds": "裁切至畫布",
- "clipToBoundsDescription": "讓游標保持在影片畫面內。關閉後游標可超出邊緣——在縮放或平移時很有用。"
+ "clipToBoundsDescription": "讓游標保持在影片畫面內。關閉後游標可超出邊緣——在縮放或平移時很有用。",
+ "help": "根據錄製的遙測資料繪製游標:主題、大小、平滑、動態模糊與點擊回彈。"
},
"language": {
"title": "語言"
},
"timeline": {
"title": "時間軸",
- "waveform": "在剪輯軌道上顯示音訊波形"
+ "waveform": "在剪輯軌道上顯示音訊波形",
+ "help": "時間軸顯示選項,例如在修剪軌道上顯示音訊波形。"
},
"facets": {
"captions": "字幕",
"transcript": "逐字稿"
+ },
+ "panes": {
+ "help": "說明"
+ },
+ "transcript": {
+ "title": "目前的逐字稿",
+ "help": "時間軸上所有片段的合併逐字稿。對某個字或選取範圍按 Backspace / Delete 會標記為略過(紅色)。將滑鼠移到紅色片段上即可還原。",
+ "noClips": "尚無片段",
+ "noTranscript": "尚無逐字稿",
+ "whisperHint": "逐字稿使用本機 Whisper — 在您的瀏覽器中執行,資料不會離開本裝置。",
+ "transcribeNow": "立即產生逐字稿",
+ "transcribing": "轉錄中…",
+ "clipLabel": "片段 {{index}}",
+ "noClipTranscript": "此片段沒有逐字稿 — 請開啟素材卡片並重新產生。",
+ "editorAria": "{{filename}} 的逐字稿",
+ "silence": "[靜音 {{duration}} 秒]",
+ "restoreSilence": "還原靜音({{duration}} 秒)",
+ "trimSilence": "修剪靜音({{duration}} 秒)",
+ "restoreWord": "還原「{{word}}」"
}
}