diff --git a/src/components/ai-edition/NewEditorShell.module.css b/src/components/ai-edition/NewEditorShell.module.css index bbae1605c..f2ba47dc3 100644 --- a/src/components/ai-edition/NewEditorShell.module.css +++ b/src/components/ai-edition/NewEditorShell.module.css @@ -764,8 +764,6 @@ display: flex; align-items: center; gap: 6px; - flex: 1; - min-width: 0; } .transport .tbtn { width: 32px; @@ -2211,57 +2209,6 @@ textarea.control { box-shadow: 0 0 0 2px var(--accent-soft); } -.scrubBar { - flex: 1; - min-width: 0; - position: relative; - height: 24px; - display: flex; - align-items: center; - cursor: pointer; -} -.scrubTrack { - position: absolute; - left: 0; - right: 0; - height: 6px; - background: var(--border-hi); - border-radius: 9999px; - overflow: hidden; -} -/* The playhead's violet, not mint: this bar IS the playhead, seen from afar. */ -.scrubProgress { - height: 100%; - background: var(--playhead); - border-radius: 9999px; -} -.scrubInput { - position: absolute; - inset: 0; - width: 100%; - height: 100%; - opacity: 0; - cursor: pointer; - z-index: 10; - margin: 0; -} -.scrubThumb { - position: absolute; - width: 12px; - height: 12px; - background: #ffffff; - border-radius: 50%; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - pointer-events: none; - transform: translate(-50%, -50%); - top: 50%; - opacity: 1; - transition: transform 100ms ease; -} -.scrubBar:hover .scrubThumb { - transform: translate(-50%, -50%) scale(1.2); -} - /* ─── AI provider settings (axcut parity) ────────────────────────── */ .providerGrid { diff --git a/src/components/ai-edition/TransportBar.test.tsx b/src/components/ai-edition/TransportBar.test.tsx index 981d26df5..ffa50c9b3 100644 --- a/src/components/ai-edition/TransportBar.test.tsx +++ b/src/components/ai-edition/TransportBar.test.tsx @@ -1,6 +1,6 @@ // @vitest-environment jsdom import "@testing-library/jest-dom"; -import { act, cleanup, fireEvent, render, screen } from "@testing-library/react"; +import { act, cleanup, render, screen } from "@testing-library/react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { I18nProvider } from "@/contexts/I18nContext"; import { useProjectStore } from "@/lib/ai-edition/store/projectStore"; @@ -45,13 +45,7 @@ describe("TransportBar reads the playhead from the store", () => { function Parent() { parentRenders++; return ( - + ); } @@ -77,171 +71,9 @@ describe("TransportBar reads the playhead from the store", () => { useProjectStore.setState({ currentTimeSec: 12.3 }); render( - + , ); expect(screen.getByText("0:04.5")).toBeInTheDocument(); }); }); - -describe("le drag de la barre de progression est coalescé en rAF", () => { - beforeEach(() => { - useProjectStore.setState({ currentTimeSec: 0 }); - }); - - afterEach(() => { - cleanup(); - vi.clearAllMocks(); - vi.unstubAllGlobals(); - }); - - /** rAF piloté à la main : les callbacks ne partent que sur `flush()`, ce qui permet de - * compter ce qui se passe DANS une frame — impossible avec le vrai rAF en test. */ - function stubRaf() { - const pending: FrameRequestCallback[] = []; - vi.stubGlobal("requestAnimationFrame", (cb: FrameRequestCallback) => { - pending.push(cb); - return pending.length; - }); - vi.stubGlobal("cancelAnimationFrame", () => { - // rien à annuler : `flush()` ne rejoue que ce qui reste en attente - }); - return () => { - const due = pending.splice(0, pending.length); - for (const cb of due) cb(0); - }; - } - - // C'est LE défaut que ce chemin avait : `onChange` d'un `` se - // déclenche à la cadence du pointeur (jusqu'à 1000 Hz) et appelait `onSeek` à chaque - // fois. Or `onSeek` repose un `seekTarget` dans l'état de la racine de l'éditeur, donc - // re-rend tout et fait poser `