Skip to content

fix: native preview should contain pathname#2606

Merged
Sherry-hue merged 1 commit into
lynx-family:mainfrom
Sherry-hue:fix/native-preview-prefix
May 12, 2026
Merged

fix: native preview should contain pathname#2606
Sherry-hue merged 1 commit into
lynx-family:mainfrom
Sherry-hue:fix/native-preview-prefix

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented May 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed demo preview URL generation to correctly handle applications deployed with sub-paths in development mode.

Review Change Stack

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 May 12, 2026

⚠️ No Changeset found

Latest commit: be9550c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c0871b04-6294-4255-b48e-e9a13b05685d

📥 Commits

Reviewing files that changed from the base of the PR and between 33b124f and be9550c.

📒 Files selected for processing (1)
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx

📝 Walkthrough

Walkthrough

DemosPage's native Lynx preview flow for known demos now constructs messagesUrl by resolving demos/<scenarioId>.json against the full shareBaseUrl (including sub-paths) with trailing slash normalization, rather than using only the origin.

Changes

Native Lynx preview URL resolution

Layer / File(s) Summary
Known demo messagesUrl resolution
packages/genui/a2ui-playground/src/pages/DemosPage.tsx
messagesUrl for known demos in rspeedy dev mode now resolves against the full shareBaseUrl with trailing slash, preserving deployed sub-paths instead of constructing from origin only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • lynx-family/lynx-stack#2530: Adds native preview and messagesUrl wiring in DemosPage; this PR refines how messagesUrl is resolved against the full shareBaseUrl.
  • lynx-family/lynx-stack#2555: Modifies messagesUrl construction for known demos by switching to static JSON URLs and adjusting base URL resolution logic.
  • lynx-family/lynx-stack#2575: Updates known demo URL construction in DemosPage so messagesUrl is derived from shareBaseUrl including sub-path and trailing slash.

Suggested reviewers

  • PupilTong
  • luhc228

Poem

🐰 A URL that wandered only down the origin's lane
Now takes the full path home, sub-paths in its mane,
With trailing slash to guide, through rspeedy's demo domain,
The preview finds its way—a rabbit's small refrain! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: native preview should contain pathname' clearly summarizes the main change: fixing native preview URL generation to properly include pathname from the base URL.
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

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

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 May 12, 2026

Merging this PR will degrade performance by 8.17%

❌ 1 regressed benchmark
✅ 80 untouched benchmarks
⏩ 26 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
transform 1000 view elements 43.1 ms 46.9 ms -8.17%

Comparing Sherry-hue:fix/native-preview-prefix (be9550c) with main (33b124f)

Open in CodSpeed

Footnotes

  1. 26 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 May 12, 2026

React MTF Example

#1190 Bundle Size — 206.6KiB (0%).

be9550c(current) vs e51f9f1 main#1188(baseline)

Bundle metrics  no changes
                 Current
#1190
     Baseline
#1188
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 3 3
No change  Modules 192 192
No change  Duplicate Modules 77 77
No change  Duplicate Code 44.36% 44.36%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1190
     Baseline
#1188
No change  IMG 111.23KiB 111.23KiB
No change  Other 95.37KiB 95.37KiB

Bundle analysis reportBranch Sherry-hue:fix/native-preview-pr...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React External

#1172 Bundle Size — 690.27KiB (0%).

be9550c(current) vs e51f9f1 main#1170(baseline)

Bundle metrics  no changes
                 Current
#1172
     Baseline
#1170
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 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1172
     Baseline
#1170
No change  Other 690.27KiB 690.27KiB

Bundle analysis reportBranch Sherry-hue:fix/native-preview-pr...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

Web Explorer

#9632 Bundle Size — 900.04KiB (0%).

be9550c(current) vs e51f9f1 main#9630(baseline)

Bundle metrics  Change 1 change
                 Current
#9632
     Baseline
#9630
No change  Initial JS 44.46KiB 44.46KiB
No change  Initial CSS 2.22KiB 2.22KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 9 9
No change  Assets 11 11
Change  Modules 228(+0.44%) 227
No change  Duplicate Modules 11 11
No change  Duplicate Code 27.28% 27.28%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#9632
     Baseline
#9630
No change  JS 495.91KiB 495.91KiB
No change  Other 401.92KiB 401.92KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch Sherry-hue:fix/native-preview-pr...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React Example with Element Template

#325 Bundle Size — 197.79KiB (0%).

be9550c(current) vs e51f9f1 main#323(baseline)

Bundle metrics  no changes
                 Current
#325
     Baseline
#323
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 80 80
No change  Duplicate Modules 23 23
No change  Duplicate Code 40.31% 40.31%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#325
     Baseline
#323
No change  IMG 145.76KiB 145.76KiB
No change  Other 52.03KiB 52.03KiB

Bundle analysis reportBranch Sherry-hue:fix/native-preview-pr...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React Example

#8059 Bundle Size — 235.77KiB (0%).

be9550c(current) vs e51f9f1 main#8057(baseline)

Bundle metrics  no changes
                 Current
#8059
     Baseline
#8057
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 197 197
No change  Duplicate Modules 80 80
No change  Duplicate Code 44.85% 44.85%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8059
     Baseline
#8057
No change  IMG 145.76KiB 145.76KiB
No change  Other 90.01KiB 90.01KiB

Bundle analysis reportBranch Sherry-hue:fix/native-preview-pr...Project dashboard


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue merged commit 04170f2 into lynx-family:main May 12, 2026
111 of 117 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 14, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants