Skip to content

feat(visual): automatically detect hover interactions from CSS diffs - #7382

Merged
JSONbored merged 1 commit into
mainfrom
feat/visual-auto-hover-detection
Jul 20, 2026
Merged

feat(visual): automatically detect hover interactions from CSS diffs#7382
JSONbored merged 1 commit into
mainfrom
feat/visual-auto-hover-detection

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • review.visual.interactions required a maintainer to hand-author CSS selectors ahead of time before any hover/click/drag GIF could be captured — the actual goal is for relevant screenshots/GIFs to be captured automatically for any frontend/visual change, with zero pre-selection.
  • New review.visual.auto_detect_interactions (config-as-code, global-default + per-repo): scans a PR's own diff for a newly-added :hover/:focus-visible CSS rule in a plain .css/.scss/.sass/.less file and automatically captures a hover-interaction GIF for it, targeting the PR's own first captured route — no maintainer selector-authoring step.
  • Composes with the existing manual interactions list: a hand-authored selector always wins over the same one auto-detected (it may carry a label/path the detector can't infer); both draw from the same 3-per-PR cap.
  • Scoped to plain stylesheets on purpose — a Tailwind utility class or CSS-in-JS :hover state has no selector explicit in the diff text to extract this way. Click/drag auto-detection is out of scope (far higher false-positive rate; not every onClick is visually interesting).
  • Default false, byte-identical to today.

Test plan

  • npm run typecheck
  • Full unit suite (npx vitest run test/unit) — 18,585 tests passing
  • npm run docs:drift-check / manifest:drift-check / engine-parity:drift-check
  • Contract parity suites (engine-parity, live-gate-parity, coding-agent-driver-parity)
  • Scoped coverage confirms 100% patch coverage on every changed line/branch
  • New unit tests for the detection module itself (added/removed/context diff lines, comma-separated selector lists, file-extension scoping, dedup, the 3-selector cap) and for buildCapture's wiring (manual-vs-auto dedup, shared cap, route targeting, config gating)

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.13%. Comparing base (6c834ab) to head (5b8d150).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7382   +/-   ##
=======================================
  Coverage   91.13%   91.13%           
=======================================
  Files         715      716    +1     
  Lines       72579    72613   +34     
  Branches    20166    20177   +11     
=======================================
+ Hits        66143    66177   +34     
  Misses       5394     5394           
  Partials     1042     1042           
Flag Coverage Δ
shard-1 41.59% <27.77%> (-0.01%) ⬇️
shard-2 35.50% <19.44%> (+0.04%) ⬆️
shard-3 31.72% <16.66%> (+0.09%) ⬆️
shard-4 31.62% <91.66%> (-0.09%) ⬇️
shard-5 31.05% <16.66%> (+0.68%) ⬆️
shard-6 43.17% <30.55%> (-0.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-engine/src/focus-manifest.ts 99.08% <100.00%> (+<0.01%) ⬆️
src/queue/processors.ts 95.50% <100.00%> (+<0.01%) ⬆️
src/review/visual/capture.ts 95.73% <100.00%> (+0.08%) ⬆️
src/review/visual/interaction-detection.ts 100.00% <100.00%> (ø)

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 5b8d150 Commit Preview URL

Branch Preview URL
Jul 19 2026, 11:43 PM

review.visual.interactions required a maintainer to hand-author CSS
selectors ahead of time -- the actual goal is for relevant screenshots/GIFs
to get captured automatically for any frontend/visual change, with no
pre-selection step at all.

Adds review.visual.auto_detect_interactions: scans a PR's own diff for a
newly-added `:hover`/`:focus-visible` CSS rule (plain .css/.scss/.sass/.less
only -- a Tailwind utility class or CSS-in-JS hover state has no selector to
extract this way) and captures a hover-interaction GIF for it automatically,
targeting the PR's own first captured route. Composes with the existing
manual `interactions` list (a hand-authored selector always wins over the
same one auto-detected); both draw from the same 3-per-PR cap. Default
false, byte-identical to today.
@JSONbored
JSONbored force-pushed the feat/visual-auto-hover-detection branch from 355ef9f to 5b8d150 Compare July 19, 2026 23:40
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-19 23:51:43 UTC

10 files · 1 AI reviewer · 3 blockers · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This PR adds an opt-in `review.visual.auto_detect_interactions` config that scans a PR's own CSS/SCSS/SASS/LESS diff for newly-added `:hover`/`:focus-visible` rules and auto-captures a hover-interaction GIF for the detected selector, composing with the existing hand-authored `interactions` list under the same 3-per-PR cap. The regex-based selector extraction (including the last-selector-in-comma-list heuristic) is correctly reasoned through and matches its extensive test coverage, the config plumbing (schema, overlay, parseVisualConfig, reviewConfigToJson) follows the existing boolean-flag pattern used by `bugAnalysis`/`actionsFallback`, and the feature is default-off/byte-identical when unused. The PR body does not link or close any specific open issue number, which this repo's contribution rules require of external PRs regardless of code quality.

Blockers

  • The PR description does not reference or close a specific open, maintainer-authorized issue number (only internal `#auto-interaction-detection` tags and historical PR references) — per this repo's contribution policy every external PR must close/link an eligible open issue, so this cannot be marked merge-ready without that link.
Nits — 5 non-blocking
  • src/queue/processors.ts: `changedCssFiles` is now built by mapping over every `unifiedFiles` entry on every visual capture, even when `review.visual.autoDetectInteractions` is off or the repo has no CSS changes — cheap, but could be gated behind the config flag to avoid the unconditional allocation.
  • src/review/visual/interaction-detection.ts: `HOVER_SELECTOR_LINE_PATTERN` only matches when the selector and opening `{` are on the same diff line, so a multi-line selector list (`.a:hover,\n.b:hover {`) silently produces no match — worth a one-line doc caveat since it's a real, if narrow, gap in an otherwise well-scoped heuristic.
  • overlayVisualConfig's OR-style merge (`override.autoDetectInteractions ? override : base`) means a per-repo config can never turn the feature back off once a global default sets it true — consistent with the existing pattern for other visual booleans in this file, but worth a comment noting it's intentional rather than an oversight.
  • Confirm/attach the issue this PR is meant to close before merge, per repo policy.
  • Consider gating the `changedCssFiles` mapping in src/queue/processors.ts:10387 behind `reviewVisualConfig.autoDetectInteractions` to skip the extra work on the common (feature-off) path.

Concerns raised — review before merging

  • The PR description does not reference or close a specific open, maintainer-authorized issue number (only internal `#auto-interaction-detection` tags and historical PR references) — per this repo's contribution policy every external PR must close/link an eligible open issue, so this cannot be marked merge-ready without that link.
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. The PR description does not reference or close a specific open, maintainer-authorized issue number \(only internal \`\#auto-interaction-detection\` tags and historical PR references\) — per this repo's contribution policy every external PR must close/link an eligible open issue, so this cannot be marked merge-ready without that link.

2. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

3. Maintainer requires a linked issue — Link the relevant issue (for example `Closes #123`) before opening the PR.

Decision drivers

  • ❌ Code review — 3 blockers (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 28 registered-repo PR(s), 21 merged, 263 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 28 PR(s), 263 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 28 PR(s), 263 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 2 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 19, 2026
@JSONbored
JSONbored merged commit 35631c3 into main Jul 20, 2026
18 checks passed
@JSONbored
JSONbored deleted the feat/visual-auto-hover-detection branch July 20, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant