fix(web) lynx-view display flex important#1997
fix(web) lynx-view display flex important#1997Sherry-hue wants to merge 1 commit intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 595bd57 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
📝 WalkthroughWalkthroughA changeset file was added documenting a patch version bump for Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/hungry-things-cover.md(1 hunks)packages/web-platform/web-core/index.css(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
For contributions, generate and commit a Changeset describing your changes
Files:
.changeset/hungry-things-cover.md
🧠 Learnings (9)
📓 Common learnings
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1370
File: .changeset/brave-melons-add.md:1-7
Timestamp: 2025-08-14T12:54:51.143Z
Learning: In the lynx-family/lynx-stack repository, packages use 0.x.x versioning where minor version bumps indicate breaking changes (not major bumps), following pre-1.0 semantic versioning conventions.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1558
File: .changeset/solid-squids-fall.md:2-2
Timestamp: 2025-08-19T11:25:36.127Z
Learning: In the lynx-family/lynx-stack repository, changesets should use the exact package name from package.json#name, not generic or unscoped names. Each package has its own specific scoped name (e.g., "lynx-js/react-transform" for packages/react/transform).
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1670
File: packages/webpack/css-extract-webpack-plugin/test/hotCases/hot/hot-update-json/dual-thread/__snapshot__/index.css:6-8
Timestamp: 2025-09-23T08:54:39.966Z
Learning: In the lynx-stack CSS extract webpack plugin tests, many test fixture CSS files intentionally use invalid CSS syntax like `color: 'red';` with quoted values. The snapshots correctly reflect this invalid CSS from the source fixtures. To fix CSS validation issues, the source fixture files should be updated first, then snapshots regenerated, rather than manually editing snapshots.
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.
Applied to files:
.changeset/hungry-things-cover.md
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Applied to files:
.changeset/hungry-things-cover.md
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
Applied to files:
.changeset/hungry-things-cover.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.
Applied to files:
.changeset/hungry-things-cover.md
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.
Applied to files:
.changeset/hungry-things-cover.md
📚 Learning: 2025-09-29T06:43:40.182Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-29T06:43:40.182Z
Learning: Applies to .changeset/*.md : For contributions, generate and commit a Changeset describing your changes
Applied to files:
.changeset/hungry-things-cover.md
📚 Learning: 2025-09-18T08:12:56.802Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.
Applied to files:
packages/web-platform/web-core/index.css
📚 Learning: 2025-09-23T08:54:39.966Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1670
File: packages/webpack/css-extract-webpack-plugin/test/hotCases/hot/hot-update-json/dual-thread/__snapshot__/index.css:6-8
Timestamp: 2025-09-23T08:54:39.966Z
Learning: In the lynx-stack CSS extract webpack plugin tests, many test fixture CSS files intentionally use invalid CSS syntax like `color: 'red';` with quoted values. The snapshots correctly reflect this invalid CSS from the source fixtures. To fix CSS validation issues, the source fixture files should be updated first, then snapshots regenerated, rather than manually editing snapshots.
Applied to files:
packages/web-platform/web-core/index.css
🔇 Additional comments (1)
packages/web-platform/web-core/index.css (1)
7-10: Verify the CSS fix addresses the root cause, not just specificity masking.Adding
!importantmasks specificity issues rather than solving them. Before this lands, verify:
- What underlying layout bug or style conflict was occurring without
!important?- Are there other CSS rules in the codebase with higher specificity unintentionally overriding
display: flexon lynx-view?- Is there a better solution, such as reordering rules, adjusting selectors, or ensuring proper cascade precedence?
| --- | ||
| "@lynx-js/web-core": patch | ||
| --- | ||
|
|
||
| fix: lynx-view display flex add !important |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's find files related to lynx-view and CSS
find . -type f \( -name "*.css" -o -name "*.scss" -o -name "*.less" \) | grep -i "lynx\|view" | head -20Repository: lynx-family/lynx-stack
Length of output: 1711
🏁 Script executed:
# Let's also search for lynx-view in the codebase
rg "lynx-view" --type-listRepository: lynx-family/lynx-stack
Length of output: 455
🏁 Script executed:
# Search for the actual CSS rule that uses !important
rg "display.*flex.*!important" -A 2 -B 2Repository: lynx-family/lynx-stack
Length of output: 2463
🏁 Script executed:
# Also search for lynx-view styles
rg "lynx-view" -l | head -20Repository: lynx-family/lynx-stack
Length of output: 1216
🏁 Script executed:
# Find the actual change in the changeset
cat .changeset/hungry-things-cover.mdRepository: lynx-family/lynx-stack
Length of output: 144
🏁 Script executed:
# Check git history for web-core index.css
git log --oneline --all -- packages/web-platform/web-core/index.css | head -20Repository: lynx-family/lynx-stack
Length of output: 282
🏁 Script executed:
# Get the full content of web-core/index.css to see the current state
cat packages/web-platform/web-core/index.cssRepository: lynx-family/lynx-stack
Length of output: 584
🏁 Script executed:
# Look for recent changes to lynx-view CSS
git log --oneline --all -p -- packages/web-platform/web-core/index.css | head -100Repository: lynx-family/lynx-stack
Length of output: 2728
🏁 Script executed:
# Check if there are any related issues or PRs mentioning this
rg "lynx-view.*display" -B 3 -A 3 | head -50Repository: lynx-family/lynx-stack
Length of output: 48
🏁 Script executed:
# Look for test failures or related changes
git log --oneline --all --grep="lynx-view" | head -20Repository: lynx-family/lynx-stack
Length of output: 1368
🏁 Script executed:
# Check if there's any documentation about CSS specificity issues
rg "display.*flex" packages/web-platform/web-core/ -B 2 -A 2Repository: lynx-family/lynx-stack
Length of output: 332
🏁 Script executed:
# Look at similar uses of !important in the codebase to understand the pattern
rg "!important" packages/web-platform/web-elements/src/ -lRepository: lynx-family/lynx-stack
Length of output: 892
🏁 Script executed:
# Check the related issue about CSS style being lost
git log --oneline --all | grep -i "reload\|css.*lost\|display.*flex"Repository: lynx-family/lynx-stack
Length of output: 872
🏁 Script executed:
# Look at the exact commit that added !important
git show 595bd574 --statRepository: lynx-family/lynx-stack
Length of output: 50379
🏁 Script executed:
# Check how many other components use !important for display
rg "display:.*!important|display: .*!important" packages/web-platform/web-elements/src/ | wc -lRepository: lynx-family/lynx-stack
Length of output: 68
🏁 Script executed:
# Check the pattern of !important usage in the codebase
rg "display.*!important" packages/web-platform/ -c | grep -v ":0$"Repository: lynx-family/lynx-stack
Length of output: 713
🏁 Script executed:
# Look for the related PR mentioned in git log: #1982
rg "1982" packages/web-platform/ -lRepository: lynx-family/lynx-stack
Length of output: 120
🏁 Script executed:
# Look for any issues or PRs discussing this change
git log --oneline --all --grep="display" | grep -i lynxRepository: lynx-family/lynx-stack
Length of output: 316
🏁 Script executed:
# Check the CHANGELOG for any related entries
cat packages/web-platform/web-core/CHANGELOG.md | head -50Repository: lynx-family/lynx-stack
Length of output: 1853
🏁 Script executed:
# Look at the pattern of !important usage - is it consistently applied to display flex?
rg "display.*flex.*!important" packages/web-platform/web-elements/src/ -l | xargs -I {} sh -c 'echo "=== {} ===" && cat {}'Repository: lynx-family/lynx-stack
Length of output: 10950
🏁 Script executed:
# Check PR #1982 mentioned in the git log to understand the regression
git log --oneline | grep -i "1982\|css.*lost" | head -5Repository: lynx-family/lynx-stack
Length of output: 48
🏁 Script executed:
# Look for any test files that might indicate why !important is needed
find packages/web-platform -name "*.test.*" -o -name "*.spec.*" | xargs grep -l "lynx-view.*display" 2>/dev/null | head -5Repository: lynx-family/lynx-stack
Length of output: 48
Changelog entry is appropriate; this is a regression fix following established framework patterns.
The !important usage on display: flex for lynx-view is consistent with established framework practice—scroll-view, x-text, and other components already use !important on display rules to enforce layout constraints. This change fixes a regression where CSS was being lost on reload (related to PR #1982), rather than introducing a new restriction.
The patch version is correct for a regression fix. Users who need to override the display property can use standard CSS escalation (including !important themselves), just as they would with other framework constraints like Bootstrap or Tailwind.
🤖 Prompt for AI Agents
In .changeset/hungry-things-cover.md lines 1-5, confirm the changelog entry
states this is a regression fix and uses a patch bump; update the entry to
explicitly mention "Add !important to display: flex on lynx-view to restore
layout on reload" if not exact, keep the patch version for "@lynx-js/web-core",
and save/commit the changes so the release tooling includes the regression fix.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #1997 will not alter performanceComparing Summary
Footnotes
|
Web Explorer#6628 Bundle Size — 372.49KiB (~+0.01%).595bd57(current) vs 4e17b0b main#6616(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch Sherry-hue:fix/lynx-view-display Project dashboard Generated by RelativeCI Documentation Report issue |
React Example#6468 Bundle Size — 236.9KiB (0%).595bd57(current) vs 4e17b0b main#6456(baseline) Bundle metrics
|
| Current #6468 |
Baseline #6456 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
162 |
162 |
|
65 |
65 |
|
46.74% |
46.74% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #6468 |
Baseline #6456 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.14KiB |
91.14KiB |
Bundle analysis report Branch Sherry-hue:fix/lynx-view-display Project dashboard
Generated by RelativeCI Documentation Report issue
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist