Skip to content

Fix: layout-transition false positives on JSX quoted transition values (#548) - #554

Merged
pbakaus merged 1 commit into
mainfrom
fix/548-layout-transition-quoted-values
Aug 13, 2026
Merged

Fix: layout-transition false positives on JSX quoted transition values (#548)#554
pbakaus merged 1 commit into
mainfrom
fix/548-layout-transition-quoted-values

Conversation

@abdulwahabone

Copy link
Copy Markdown
Collaborator

The layout-transition matchers in the regex engine captured transition values with [^;{}]+, which doesn't stop at a closing quote — so single-line JSX style objects like style={{ transition: 'border-color 200ms ease', height: '100%' }} falsely flagged height. The capture is now quote-aware, with the old bounds kept as fallback for real CSS. Fixes #548.

Validation: 4 new regression tests in tests/detect-antipatterns.test.js, full bun run test green, both repro cases from the issue verified clean via the CLI while genuine quoted width transitions still flag. No generated output touched (detect-text.mjs is not in the browser bundle).

Prepared with AI assistance under maintainer direction.

Made with Cursor

#548)

The value-capture regex stopped only at ;{}, so in single-line JSX
style objects it ran past the closing quote and swallowed later
properties, flagging layout props that were never transitioned. The
capture now stops at the matching closing quote when the value is a
quoted string, falling back to the old bounds for real CSS.

Prepared with AI assistance under maintainer direction.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abdulwahabone
abdulwahabone requested a review from pbakaus as a code owner August 10, 2026 09:01
@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown

Greptile Summary

This change updates the regex detector so quoted JSX values for transition and transition-property end at their closing quote rather than consuming later style properties. The detector was exercised against the prior and updated implementations: the earlier implementation falsely reported quoted paint-only transitions followed by layout properties, while the updated implementation produced the expected results across quoted JSX values, transition: all, and unquoted CSS. No defects remain in the reviewed change.

Confidence Score: 5/5

Safe to merge based on focused execution of the affected detector behavior and the repository motion tests.

The executed checks reproduced the previous false positives, confirmed they are corrected without losing intended width-transition detection, and passed all focused motion tests.

Files Needing Attention: No additional attention is needed; cli/engine/engines/regex/detect-text.mjs and tests/detect-antipatterns.test.js were covered by the focused validation.

T-Rex T-Rex Logs

What T-Rex did

  • Ran a review-authored Bun harness to validate layout-transition findings against the detector both before and after the change, covering transition and transition-property with quoted JSX values, all, actual width transitions, and unquoted CSS, and observed that false positives were removed for most cases after the change while quoted width values still yielded a finding and unquoted CSS behavior remained correct.
  • Ran the repository's focused motion test group with Bun; all 16 tests passed.
  • Validated that the review-authored executable source and every command’s captured output were included in the PR materials.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "Fix: layout-transition false positives o..." | Re-trigger Greptile

@github-actions github-actions Bot added the ready to merge Passing, resolved, and ready for a maintainer merge decision label Aug 10, 2026
@pbakaus
pbakaus merged commit fde4a3e into main Aug 13, 2026
12 checks passed
@pbakaus
pbakaus deleted the fix/548-layout-transition-quoted-values branch August 13, 2026 21:01
@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

REN-186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Passing, resolved, and ready for a maintainer merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

layout-transition detector false-positives on JSX inline style objects (regex value-capture doesn't stop at closing quote)

2 participants