feat(components): wire visual repetition into geometry report - #408
feat(components): wire visual repetition into geometry report#408wibus-wee wants to merge 4 commits into
Conversation
The authored contracts only find what a reviewer already wrote down, and they name their members by DOM shape — row family, role, accessible name. That hides the defects worth finding: a layout bug comes from two code paths rendering one visual thing differently, so it correlates with the structural difference, and a structural key files the two paths into different groups and never compares them. So group by what renders alike and mine the expected edge from what the run's best-supported level actually does. Nobody writes down that the indent step is 26px; it is counted. Bias is recall — candidates are ranked, never filtered — so a legitimate indent ladder comes back too and sorts below the stray, whose level has no company. Not wired to the capture run or the gate: a recall-first pass that blocks CI has one natural remedy, raising its thresholds, which destroys the recall it exists for. Model: claude-opus-5[1m] Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Model: gpt-5
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 545e26de06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const axis = seriesAxis(group); | ||
| for (const run of splitIntoSeries(group, axis, seriesBreakRatio, minimumSeriesLength)) { |
There was a problem hiding this comment.
Infer orientation after isolating each visual series
When one signature occurs in multiple side-by-side vertical lists, seriesAxis(group) measures the entire page-wide group before those lists are separated; if their horizontal separation exceeds their vertical span, it classifies them as one horizontal series. splitIntoSeries then orders by X (often producing zero gaps for same-column atoms), emits false Y/pitch deviations for an otherwise regular grid, and never checks either list's X alignment. Partition local series before selecting an orientation for each one.
AGENTS.md reference: packages/components/src/lib/geometry-discovery/AGENTS.md:L46-L48
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9e90b2cca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| blockedRequests, | ||
| }); | ||
| await writeFile( | ||
| '/tmp/geom-run/capture-one.json', |
There was a problem hiding this comment.
Remove the undeclared scratch-dump directory dependency
When pnpm --filter @lody/components test:e2e collects this new spec on a clean machine, nothing creates /tmp/geom-run, so writeFile throws ENOENT after the capture completes and fails the full E2E suite. Keep this debugging dump out of the suite or write through a test-managed output path/create the directory first.
AGENTS.md reference: AGENTS.md:L127-L130
Useful? React with 👍 / 👎.
| (style.clip === 'auto' || style.clip === '') && | ||
| style.clipPath === 'none' && |
There was a problem hiding this comment.
Check primitive ancestors for clipping
When a visually hidden wrapper carries clip or clip-path but its child owns the text, SVG, or image primitive, the child's computed values remain auto/none; isRendered therefore admits the child even though the ancestor clips all its pixels, allowing its nonzero layout/range bounds to pollute visual-repetition candidates. Check the ancestor chain up to the capture boundary rather than only the primitive itself.
AGENTS.md reference: packages/components/tests/e2e/support/AGENTS.md:L23-L26
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0715aa24df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| */ | ||
| function visualSignature(atom: VisualAtom, heightTolerance: number): string { | ||
| const height = atom.yEnd - atom.yStart; | ||
| const bucket = heightTolerance > 0 ? Math.round(height / heightTolerance) : height; |
There was a problem hiding this comment.
Group nearby heights without hard bucket boundaries
When visually identical primitives have fractional heights on opposite sides of a rounding boundary—for example, 15.49px and 15.51px with the default 1px tolerance—this assigns them different signatures despite their 0.02px difference. Either subgroup can then fall below minimumSeriesLength, so genuine alignment deviations are never compared or reported. Form height groups by distance to a representative anchor, as the coordinate-level grouping already does, rather than by Math.round.
AGENTS.md reference: packages/components/src/lib/geometry-discovery/AGENTS.md:L25-L28
Useful? React with 👍 / 👎.
Related issue
Problem / pressure
Visual repetition mining existed as an algorithm prototype, but the real geometry capture plan did not run it and the report did not expose its evidence. That made it impossible to review what the heuristic finds on real Lody surfaces.
Summary
GeometryCaptureinto capture-localVisualAtomvalues.visual-repetition.json.GeometryFinding, the ledger, and the gate.sr-onlyfrom visual measurement while retaining visiblearia-hiddendecorations.Before / after
clipandclip-pathcontent is excluded at the browser measurement boundary.Test plan
corepack pnpm --filter @lody/components exec vitest run tests/geometry-discovery-visual-capture.test.tscorepack pnpm --filter @lody/components exec playwright test tests/e2e/geometry-visual-capture.spec.ts --workers=1 --retries=0corepack pnpm --filter @lody/components typecheckcorepack pnpm --filter @lody/components geometry:report /tmp/lody-geometry-report-pr-check-afteract is not a function) and an avatar-cache revalidation failure.Context handoff
Instructions for reviewing agents
visual-capture.ts, the browser measurement exclusion inchat-workspace-geometry.ts, and the report's witness/overlay rendering.Authoring context