Skip to content

fix(web) lynx-view display flex important#1997

Closed
Sherry-hue wants to merge 1 commit intolynx-family:mainfrom
Sherry-hue:fix/lynx-view-display
Closed

fix(web) lynx-view display flex important#1997
Sherry-hue wants to merge 1 commit intolynx-family:mainfrom
Sherry-hue:fix/lynx-view-display

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented Dec 15, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed display rendering for lynx-view components to ensure proper layout display.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 15, 2025

🦋 Changeset detected

Latest commit: 595bd57

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@lynx-js/web-core Patch
upgrade-rspeedy Patch
@lynx-js/web-rsbuild-server-middleware Patch
@lynx-js/web-core-server Patch
@lynx-js/web-constants Patch
@lynx-js/web-mainthread-apis Patch
@lynx-js/web-worker-rpc Patch
@lynx-js/web-worker-runtime Patch
@lynx-js/rspeedy Patch
create-rspeedy Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 15, 2025

📝 Walkthrough

Walkthrough

A changeset file was added documenting a patch version bump for @lynx-js/web-core. The CSS for lynx-view was modified to add !important to the display property, increasing the rule's specificity.

Changes

Cohort / File(s) Summary
Changeset documentation
.changeset/hungry-things-cover.md
New changeset file documenting a patch version bump for @lynx-js/web-core with fix note about lynx-view display flex.
CSS style updates
packages/web-platform/web-core/index.css
Modified lynx-view display rule from display: flex; to display: flex !important; to increase specificity and override behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Straightforward CSS modification with a single property enhancement
  • Changeset file is documentation-only with minimal content
  • No logic changes or complex interactions involved

Suggested reviewers

  • PupilTong

Poem

🐰 A flex display needed might,
So !important brings it to light,
The specificity's set just right,
One changeset marks the fix so tight,
Lynx-view now renders bright!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding !important to the display: flex property in lynx-view, which matches the changeset and code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e17b0b and 595bd57.

📒 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 !important masks specificity issues rather than solving them. Before this lands, verify:

  1. What underlying layout bug or style conflict was occurring without !important?
  2. Are there other CSS rules in the codebase with higher specificity unintentionally overriding display: flex on lynx-view?
  3. Is there a better solution, such as reordering rules, adjusting selectors, or ensuring proper cascade precedence?

Comment on lines +1 to +5
---
"@lynx-js/web-core": patch
---

fix: lynx-view display flex add !important
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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 -20

Repository: lynx-family/lynx-stack

Length of output: 1711


🏁 Script executed:

# Let's also search for lynx-view in the codebase
rg "lynx-view" --type-list

Repository: 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 2

Repository: lynx-family/lynx-stack

Length of output: 2463


🏁 Script executed:

# Also search for lynx-view styles
rg "lynx-view" -l | head -20

Repository: lynx-family/lynx-stack

Length of output: 1216


🏁 Script executed:

# Find the actual change in the changeset
cat .changeset/hungry-things-cover.md

Repository: 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 -20

Repository: 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.css

Repository: 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 -100

Repository: 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 -50

Repository: 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 -20

Repository: 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 2

Repository: 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/ -l

Repository: 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 --stat

Repository: 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 -l

Repository: 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/ -l

Repository: 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 lynx

Repository: 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 -50

Repository: 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 -5

Repository: 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 -5

Repository: 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
Copy link
Copy Markdown

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 15, 2025

CodSpeed Performance Report

Merging #1997 will not alter performance

Comparing Sherry-hue:fix/lynx-view-display (595bd57) with main (4e17b0b)

Summary

✅ 63 untouched
⏩ 3 skipped1

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Dec 15, 2025

Web Explorer

#6628 Bundle Size — 372.49KiB (~+0.01%).

595bd57(current) vs 4e17b0b main#6616(baseline)

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#6628
     Baseline
#6616
No change  Initial JS 146.21KiB 146.21KiB
Regression  Initial CSS 32.41KiB(+0.03%) 32.4KiB
Change  Cache Invalidation 8.7% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 230 230
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.97% 2.97%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#6628
     Baseline
#6616
No change  JS 243.1KiB 243.1KiB
No change  Other 96.98KiB 96.98KiB
Regression  CSS 32.41KiB (+0.03%) 32.4KiB

Bundle analysis reportBranch Sherry-hue:fix/lynx-view-displayProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Dec 15, 2025

React Example

#6468 Bundle Size — 236.9KiB (0%).

595bd57(current) vs 4e17b0b main#6456(baseline)

Bundle metrics  no changes
                 Current
#6468
     Baseline
#6456
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 162 162
No change  Duplicate Modules 65 65
No change  Duplicate Code 46.74% 46.74%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6468
     Baseline
#6456
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.14KiB 91.14KiB

Bundle analysis reportBranch Sherry-hue:fix/lynx-view-displayProject dashboard


Generated by RelativeCIDocumentationReport issue

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants