fix(router-core): fix missing closing paren in CSS.supports check for view transition types#7369
Conversation
… view transition types
The `isViewTransitionTypesSupported` feature check passes an unbalanced
selector string to `CSS.supports()`:
CSS.supports('selector(:active-view-transition-type(a)')
^ missing )
This is invalid CSS, so `CSS.supports()` always returns `false`,
causing `isViewTransitionTypesSupported` to be `false` even in
browsers that fully support View Transition types (Level 2).
As a result, the `types` array passed to `navigate({ viewTransition: { types } })`
is silently dropped — `document.startViewTransition()` is called
without types, and any CSS rules using `:active-view-transition-type()`
never match.
Fix: add the missing closing parenthesis.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA typo in the router's view-transition feature detection is fixed by correcting a CSS selector string passed to ChangesView Transition CSS Selector Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size Benchmarks
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
|
View your CI Pipeline Execution ↗ for commit 8013ac1
☁️ Nx Cloud last updated this comment at |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
Since the failure was identified as flaky, the solution is to rerun CI. Because this branch comes from a fork, it is not possible for us to push directly, but you can rerun by pushing an empty commit:
git commit --allow-empty -m "chore: trigger rerun"
git push
🎓 Learn more about Self-Healing CI on nx.dev
|
how could we test this in an e2e test? |
Summary
The
isViewTransitionTypesSupportedfeature check inRouterCorepasses an unbalanced selector string toCSS.supports():The unbalanced parenthesis makes the string invalid CSS, so
CSS.supports()always returnsfalse— even in browsers that fully support View Transition Level 2 types.Impact
isViewTransitionTypesSupportedis alwaysfalsetypesarray passed vianavigate({ viewTransition: { types: [...] } })is silently droppeddocument.startViewTransition()is called without types (falls back to bare callback):active-view-transition-type()never matchFix
Add the missing closing parenthesis — a one-character change.
Summary by CodeRabbit