Skip to content

Commit 327e06f

Browse files
committed
fix(timeline): drop the test's any and refresh the checklist's line refs
Two findings from the automated review on aa8d3bb: - the mocked `tl` was cast to `any` behind a biome-ignore, which AGENTS.md rules out ("don't add new `any`"). Cast through `unknown` to the real `ReturnType<typeof useTimeline>` instead: the prop keeps its type and the suppression goes away. - the "add a region kind" checklist pointed at pre-PR line numbers in V4Timeline.tsx, and this branch moved them by ~130 lines. Recomputed against the current file: :461-509 for the pill call site, :1478-1488 for the lane render block, :332 for the `kind` union. (They were already drifting before this branch — check-docs does not verify line numbers.) The third finding, `currentColor` → `currentcolor` for stylelint's value-keyword-case, does not apply here: the repo has no stylelint at all (CI's Lint job is `biome check`, green on both spellings), and the convention in website/src/css/custom.css is `currentColor`. Changing it would leave the only lowercase spelling in the codebase.
1 parent f4d8c01 commit 327e06f

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/ai-edition/v4/V4Timeline.geometry.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ vi.mock("@/contexts/I18nContext", () => ({
1313
}));
1414
vi.mock("sonner", () => ({ toast: { error: vi.fn(), info: vi.fn(), success: vi.fn() } }));
1515

16+
import type { useTimeline } from "@/lib/ai-edition/store/useTimeline";
1617
import { V4Timeline } from "./V4Timeline";
1718

1819
beforeAll(() => {
@@ -86,8 +87,9 @@ function renderTimeline(
8687
};
8788
render(
8889
<V4Timeline
89-
// biome-ignore lint/suspicious/noExplicitAny: a partial timeline API is enough to draw pills
90-
tl={tl as any}
90+
// Only the members the lanes and the clip row read are mocked; the prop
91+
// stays typed as the real API rather than widened to `any` (AGENTS.md).
92+
tl={tl as unknown as ReturnType<typeof useTimeline>}
9193
setCurrentTime={vi.fn()}
9294
playing={false}
9395
onTogglePlay={vi.fn()}

technical-documentation/architecture/editor-shell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ switches on it is checked below. Each path has been verified on this branch.
129129
(`document/timeline.ts:591`) for batch / single deletes.
130130
4. **Lane in `V4Timeline`**`src/components/ai-edition/v4/V4Timeline.tsx`.
131131
Compute the pills at the same call site as the four existing lanes
132-
(`coalesceRegionsForRuler(tl.xxxRegions).map(...)` near `:321-347`), render
132+
(`coalesceRegionsForRuler(tl.xxxRegions).map(...)` near `:461-509`), render
133133
them through `renderPills` inside a `<div className={styles.tlLane}>`
134-
block (`:1244-1252`), and extend the `kind` union at `:203` so drag,
134+
block (`:1478-1488`), and extend the `kind` union at `:332` so drag,
135135
resize, and delete handler switches route correctly.
136136

137137
**Coordinates on the timeline canvas obey one rule**: position and size are

0 commit comments

Comments
 (0)