-
-
Notifications
You must be signed in to change notification settings - Fork 713
fix(css): allow navigation property for view-transition (fixes #7340) #7353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(css): allow navigation property for view-transition (fixes #7340) #7353
Conversation
Fixes biomejs#7233 The error message was incorrectly suggesting to prefer findIndex() over indexOf(), when it should suggest the opposite. Updated the diagnostic message to correctly recommend using indexOf()/lastIndexOf() over findIndex()/findLastIndex().
Updated test snapshots to reflect the corrected error message that now properly suggests using indexOf()/lastIndexOf() over findIndex()/findLastIndex().
Remove extra backticks at the end of error messages in the test snapshots to match the exact format expected by the test runner.
Fixes biomejs#7225 Added test case to verify that noExtraBooleanCast rule correctly preserves parentheses when removing Boolean calls inside negations. The expression !Boolean(b0 && b1) should become !(b0 && b1) not !b0 && b1 to maintain correct operator precedence. Test Plan Added reproduction test case for the reported issue. The test will verify whether the existing parentheses preservation logic correctly handles binary expressions inside negated Boolean calls.
Fixes biomejs#7225 Added test case to verify that noExtraBooleanCast rule correctly preserves parentheses when removing Boolean calls inside negations. The expression !Boolean(b0 && b1) should become !(b0 && b1) not !b0 && b1 to maintain correct operator precedence. Test Plan Added reproduction test case for the reported issue. The test will verify whether the existing parentheses preservation logic correctly handles binary expressions inside negated Boolean calls.
…olean calls - Add parentheses preservation logic for Boolean calls inside negations - Add needs_parentheses_when_negated helper function - Ensure !Boolean(b0 && b1) becomes !(b0 && b1) not !b0 && b1 - Preserve operator precedence for binary/conditional/assignment expressions Fixes biomejs#7225
…preservation - Add JsLogicalExpression and JsSequenceExpression to imports - Update needs_parentheses_when_negated to handle && || ?? operators - Update needs_parentheses_when_negated to handle comma operator - Improve comments to clarify binary vs logical expressions Addresses CodeRabbit review feedback
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
🦋 Changeset detectedLatest commit: 1895b94 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds "navigation" to the KNOWN_PROPERTIES set in crates/biome_css_analyze/src/keywords.rs, annotated with a link to the CSS View Transitions 2 descriptor. Extends the analyser’s recognised CSS properties without changing public APIs or control flow. Updates tests by appending a valid @view-transition rule using navigation: auto in crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css. Assessment against linked issues
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.changeset/fix-grammar-duplicate-object-keys.md (1)
6-6
: Minor punctuation: end the subject line with a period.The guidelines ask for sentences to end with a period; the subject line should, too (or replace it entirely per the main suggestion above).
-fix(noDuplicateObjectKeys): correct grammatical error in JSON diagnostic message +fix(noDuplicateObjectKeys): correct grammatical error in JSON diagnostic message.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.changeset/fix-grammar-duplicate-object-keys.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: Create changesets withjust new-changeset
; store them in.changeset/
with correct frontmatter (package keys and change type).
In changeset descriptions, follow content conventions: user-facing changes only; past tense for what you did; present tense for current behavior; link issues for fixes; link rules/assists; include representative code blocks; end every sentence with a period.
When adding headers in a changeset, only use #### or ##### levels.
Files:
.changeset/fix-grammar-duplicate-object-keys.md
--- | ||
"@biomejs/biome": patch | ||
"@biomejs/backend-jsonrpc": patch | ||
--- | ||
|
||
fix(noDuplicateObjectKeys): correct grammatical error in JSON diagnostic message | ||
|
||
Fixed missing "is" in the diagnostic message for the noDuplicateObjectKeys rule when applied to JSON files. The message now correctly reads "This is where a duplicated key was declared again." instead of "This where a duplicated key was declared again." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Changeset content doesn’t match PR intent (CSS ‘navigation’ fix).
This changeset talks about a JSON diagnostic grammar tweak, but the PR title/objective is to accept the CSS navigation
property in lint/correctness/noUnknownProperty
. Please align the changeset to the actual fix, link #7340, and include a representative CSS snippet.
Apply this update (adjust package list if other packages are affected by the CSS rule change):
---
-"@biomejs/biome": patch
-"@biomejs/backend-jsonrpc": patch
+"@biomejs/biome": patch
---
-
-fix(noDuplicateObjectKeys): correct grammatical error in JSON diagnostic message
-
-Fixed missing "is" in the diagnostic message for the noDuplicateObjectKeys rule when applied to JSON files. The message now correctly reads "This is where a duplicated key was declared again." instead of "This where a duplicated key was declared again."
+fix(css/noUnknownProperty): recognise the CSS `navigation` property for View Transitions.
+
+Fixed a false positive where the linter reported `navigation` as an unknown property. The rule `lint/correctness/noUnknownProperty` now recognises `navigation` per the CSS View Transitions specification. Fixes #7340.
+
+```css
+/* Previously reported as unknown; now accepted. */
+.box {
+ navigation: auto;
+}
+```
Run to confirm scope and impacted packages:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Changed files:"
git --no-pager diff --name-only origin/main...HEAD
echo -e "\nTouches CSS property maps/rules?"
rg -nP -C2 'noUnknownProperty|navigation\s*:\s*auto|View\s*Transitions'
echo -e "\nDid backend-jsonrpc change?"
git --no-pager diff --name-only origin/main...HEAD | rg -n 'backend-jsonrpc' || echo "No backend-jsonrpc changes detected."
Length of output: 10545
Update changeset to document CSS navigation
support in noUnknownProperty
The current changeset describes a JSON grammar tweak, but this PR actually adds recognition for the CSS navigation
property in the lint/correctness/noUnknownProperty
rule (fixes #7340). Update .changeset/fix-grammar-duplicate-object-keys.md
accordingly:
--- a/.changeset/fix-grammar-duplicate-object-keys.md
+++ b/.changeset/fix-no-unknown-property-navigation.md
@@
- "@biomejs/biome": patch
- "@biomejs/backend-jsonrpc": patch
+ "@biomejs/biome": patch
---
-fix(noDuplicateObjectKeys): correct grammatical error in JSON diagnostic message
-
-Fixed missing "is" in the diagnostic message for the noDuplicateObjectKeys rule when applied to JSON files. The message now correctly reads "This is where a duplicated key was declared again." instead of "This where a duplicated key was declared again."
+fix(css/noUnknownProperty): recognise the CSS `navigation` property for View Transitions. Fixes #7340.
+
+```css
+/* Previously reported as unknown; now accepted. */
+.box {
+ navigation: auto;
+}
+```
🤖 Prompt for AI Agents
In .changeset/fix-grammar-duplicate-object-keys.md around lines 1 to 8, the
changeset message currently describes a JSON grammar tweak but the PR actually
adds support for the CSS `navigation` property in the
lint/correctness/noUnknownProperty rule; update the changeset text and title to
reflect that change (mention noUnknownProperty now accepts CSS `navigation`,
reference fixes #7340), include a short CSS example showing .box { navigation:
auto; } and a one-line note like "Previously reported as unknown; now
accepted.", and keep the packages and version bumps as-is.
0928764
to
9607d7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_css_analyze/src/keywords.rs (1)
1333-1334
: Optional: scopenavigation
to @view-transition if/when descriptors are distinguishedAdding it to KNOWN_PROPERTIES allows
navigation
anywhere. If the rule later differentiates descriptors, consider a scoped allowlist so we don’t silently permitnavigation
in regular style rules. A small spec-context test (invalid outside@view-transition
) would future-proof this.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
crates/biome_css_analyze/src/keywords.rs
(1 hunks)crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f
/just format
).
Files:
crates/biome_css_analyze/src/keywords.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_css_analyze/src/keywords.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_css_analyze/src/keywords.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: autofix
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_graphql_parser)
🔇 Additional comments (1)
crates/biome_css_analyze/src/keywords.rs (1)
1333-1334
: LGTM: addingnavigation
here resolves the false positiveSorted correctly between
nav-up
andobject-fit
; should keeptest_known_properties_order
happy.
CodSpeed Performance ReportMerging #7353 will improve performances by 9.07%Comparing Summary
Benchmarks breakdown
Footnotes |
bd1928c
to
3de8292
Compare
37a855e
to
38dcfa7
Compare
@dyc3 Yes got it ! Now u can review |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.changeset/allow-navigation-property.md (1)
9-9
: Stray character at EOF.There’s an orphaned "9" at the end of the file. Please remove it.
Apply:
-9
🧹 Nitpick comments (1)
.changeset/allow-navigation-property.md (1)
5-8
: Tighten the changeset copy and add a representative snippet.Reference the rule and include an example so the release notes are crystal-clear.
Apply:
- Fixed [#7340](https://github.com/biomejs/biome/issues/7340): The linter now allows the `navigation` property for view-transition in CSS. + Fixed [#7340](https://github.com/biomejs/biome/issues/7340): The linter now allows the `navigation` property for view transitions in CSS. See rule `lint/correctness/noUnknownProperty`. - Previously, the linter incorrectly flagged `navigation: auto` as an unknown property. This fix adds `navigation` to the list of known CSS properties, following the [CSS View Transitions spec](https://www.w3.org/TR/css-view-transitions-2/#view-transition-navigation-descriptor). + Previously, the linter incorrectly flagged `navigation: auto` as an unknown property. This fix adds `navigation` to the list of known CSS properties, following the [CSS View Transitions spec](https://www.w3.org/TR/css-view-transitions-2/#view-transition-navigation-descriptor). + + #### Example + ```css + @view-transition { + navigation: auto; + } + ```
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (1)
.changeset/allow-navigation-property.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: Create changesets withjust new-changeset
; store them in.changeset/
with correct frontmatter (package keys and change type).
In changeset descriptions, follow content conventions: user-facing changes only; past tense for what you did; present tense for current behavior; link issues for fixes; link rules/assists; include representative code blocks; end every sentence with a period.
When adding headers in a changeset, only use #### or ##### levels.
Files:
.changeset/allow-navigation-property.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: autofix
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test Node.js API
🔇 Additional comments (1)
.changeset/allow-navigation-property.md (1)
1-3
: Frontmatter looks good.Package key and patch bump are correct for this scope.
This PR fixes a false positive in the lint/correctness/noUnknownProperty rule for CSS.
->Adds "navigation" to the list of known CSS properties, following the CSS View Transitions spec.
->Adds a test to ensure navigation: auto is not flagged as unknown.
Why:
The navigation property is valid for view transitions, but was previously not recognized by the linter, causing a false positive.
Test:
A test case is added to valid.css to confirm that navigation: auto is accepted.
Fixes #7340