Skip to content

fix(router-core): fix missing closing paren in CSS.supports check for view transition types#7369

Open
shkumbinhasani wants to merge 2 commits intoTanStack:mainfrom
shkumbinhasani:fix/view-transition-types-css-supports-typo
Open

fix(router-core): fix missing closing paren in CSS.supports check for view transition types#7369
shkumbinhasani wants to merge 2 commits intoTanStack:mainfrom
shkumbinhasani:fix/view-transition-types-css-supports-typo

Conversation

@shkumbinhasani
Copy link
Copy Markdown

@shkumbinhasani shkumbinhasani commented May 8, 2026

Summary

The isViewTransitionTypesSupported feature check in RouterCore passes an unbalanced selector string to CSS.supports():

// Before (broken)
CSS.supports('selector(:active-view-transition-type(a)')
//                                                    ^ missing )

// After (fixed)
CSS.supports('selector(:active-view-transition-type(a))')

The unbalanced parenthesis makes the string invalid CSS, so CSS.supports() always returns false — even in browsers that fully support View Transition Level 2 types.

Impact

  • isViewTransitionTypesSupported is always false
  • The types array passed via navigate({ viewTransition: { types: [...] } }) is silently dropped
  • document.startViewTransition() is called without types (falls back to bare callback)
  • Any CSS rules using :active-view-transition-type() never match
  • All view transitions fall back to the browser's default crossfade instead of using custom typed animations

Fix

Add the missing closing parenthesis — a one-character change.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected view transition feature detection to ensure proper browser capability identification.

… 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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cc0d8752-47cd-412f-9fae-828702b4d6c4

📥 Commits

Reviewing files that changed from the base of the PR and between 4eed408 and 8013ac1.

📒 Files selected for processing (2)
  • .changeset/fix-view-transition-types-typo.md
  • packages/router-core/src/router.ts

📝 Walkthrough

Walkthrough

A typo in the router's view-transition feature detection is fixed by correcting a CSS selector string passed to window.CSS.supports(). The selector now includes proper closing parentheses in selector(:active-view-transition-type(a)). A Changeset file documents this patch-level fix.

Changes

View Transition CSS Selector Fix

Layer / File(s) Summary
CSS Selector Syntax Correction
packages/router-core/src/router.ts
The window.CSS.supports() call now passes the correct selector string with proper closing parentheses for :active-view-transition-type(a) detection.
Release Documentation
.changeset/fix-view-transition-types-typo.md
A Changeset entry documents the patch fix for the CSS selector string syntax error.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A missing paren caused the view to blur,
But now the selector's syntax will purr,
Transition types detected, clean and right,
CSS.supports() shines in the light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing a missing closing parenthesis in a CSS.supports check for view transition types in router-core, which is the core issue addressed in the changeset and code modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Bundle Size Benchmarks

  • Commit: 4eed408f127b
  • Measured at: 2026-05-08T14:23:36.824Z
  • Baseline source: history:35e88f04996d
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.29 KiB +141 B (+0.16%) 87.15 KiB 274.07 KiB 75.85 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-router.full 90.82 KiB +141 B (+0.15%) 90.68 KiB 285.58 KiB 78.89 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.minimal 35.51 KiB +129 B (+0.36%) 35.39 KiB 106.36 KiB 31.97 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.full 40.23 KiB +129 B (+0.31%) 40.10 KiB 120.58 KiB 36.14 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.minimal 53.29 KiB +134 B (+0.25%) 53.15 KiB 151.51 KiB 47.85 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.full 58.41 KiB +135 B (+0.23%) 58.28 KiB 167.69 KiB 52.39 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.minimal 101.97 KiB +139 B (+0.13%) 101.83 KiB 322.51 KiB 88.17 KiB ▁▁▁▁▁▁▁▁▁▁▃█
react-start.full 105.41 KiB +142 B (+0.13%) 105.27 KiB 332.84 KiB 91.19 KiB ▁▁▁▁▁▁▁▁▁▁▄█
react-start.rsbuild.minimal 99.60 KiB +174 B (+0.17%) 99.43 KiB 316.97 KiB 85.64 KiB ▁▁▁▁▁▁▁▁▁▁▄█
react-start.rsbuild.full 102.89 KiB +175 B (+0.17%) 102.72 KiB 327.41 KiB 88.45 KiB ▁▁▁▁▁▁▁▁▁▁▃█
solid-start.minimal 49.61 KiB +133 B (+0.26%) 49.48 KiB 152.48 KiB 43.78 KiB ▁▁▁▁▁▁▁▁▁▁▄█
solid-start.full 55.40 KiB +133 B (+0.24%) 55.27 KiB 169.39 KiB 48.72 KiB ▁▁▁▁▁▁▁▁▁▁▄█

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.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 8, 2026

View your CI Pipeline Execution ↗ for commit 8013ac1

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 5m 32s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-08 14:52:22 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 8, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7369

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7369

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7369

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7369

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7369

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7369

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7369

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7369

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7369

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7369

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7369

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7369

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7369

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7369

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7369

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7369

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7369

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7369

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7369

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7369

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7369

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7369

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7369

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7369

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7369

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7369

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7369

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7369

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7369

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7369

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7369

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7369

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7369

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7369

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7369

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7369

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7369

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7369

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7369

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7369

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7369

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7369

commit: 8013ac1

nx-cloud[bot]

This comment was marked as outdated.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 8, 2026

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing shkumbinhasani:fix/view-transition-types-css-supports-typo (8013ac1) with main (a04d5e4)2

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

  2. No successful run was found on main (4eed408) during the generation of this report, so a04d5e4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@schiller-manuel
Copy link
Copy Markdown
Contributor

how could we test this in an e2e test?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants