Skip to content

fix: native preview send messages directly#2598

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

fix: native preview send messages directly#2598
Sherry-hue merged 1 commit into
lynx-family:mainfrom
Sherry-hue:fix/native-preview-url

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

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

Summary by CodeRabbit

  • Bug Fixes
    • Native Preview QR code now available even without a running development server. The playground will fall back to a deployed bundle URL, improving availability and reliability of the Native Preview feature across different deployment scenarios.

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 11, 2026

⚠️ No Changeset found

Latest commit: 01b734d

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 11, 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: 71d990cd-78dd-4761-9284-90256ccf69a4

📥 Commits

Reviewing files that changed from the base of the PR and between d588d03 and 01b734d.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/rsbuild.config.ts
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/pages/OpenUIDemosPage.tsx

📝 Walkthrough

Walkthrough

The PR updates the a2ui playground's native preview QR functionality to improve availability. The dev server now serves a2ui.lynx.js instead of main.lynx.js, and both demo pages add fallback logic to derive a deployed bundle URL from the current page location, enabling preview QR availability even when the rspeedy dev server is offline.

Changes

Native Preview Bundle URL Fallback

Layer / File(s) Summary
Dev Server Bundle Update
packages/genui/a2ui-playground/rsbuild.config.ts
The /__rspeedy_url middleware now constructs http://<local-ip>:<port>/a2ui.lynx.js instead of main.lynx.js.
DemosPage Native Preview Logic
packages/genui/a2ui-playground/src/pages/DemosPage.tsx
Added getDeployedLynxBundleUrl() helper to derive the deployed bundle URL from window.location.href. Updated useRspeedyDevUrl() to initialize from the deployed URL and tighten the fetch-result handling to set state only when data.url is a non-empty string.
OpenUIDemosPage Native Preview Logic
packages/genui/a2ui-playground/src/pages/OpenUIDemosPage.tsx
Added getDeployedLynxBundleUrl() helper for deployed URL derivation. Updated useRspeedyDevUrl() to initialize from the deployed URL with tightened fetch-update condition to apply the URL only when data.url is non-empty.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • lynx-family/lynx-stack#2555: Both PRs modify native preview and rspeedy bundle URL logic in the same playground pages and config.
  • lynx-family/lynx-stack#2533: Both PRs adjust the a2ui playground's bundle filename and URL handling across rsbuild.config.ts and demo pages.
  • lynx-family/lynx-stack#2530: Both PRs modify the playground's dev-bundle URL handling and native preview logic in rsbuild.config.ts and demo pages.

Suggested labels

platform:Web

Suggested reviewers

  • PupilTong
  • colinaaa
  • gaoachao

Poem

🐰 A bundled path now shines so bright,
With fallback URL in hand,
From RSpeedy dev to deployed light—
The preview QR, forever spanned!
No server down can dim this sight. 🎯✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: native preview send messages directly' does not match the actual changes, which update RSpeedy bundle URL routing and improve QR code availability—no 'send messages' functionality is implemented. Update the title to accurately reflect the changes, such as: 'fix: improve native preview QR availability by using deployed bundle URL' or 'fix: update RSpeedy bundle URL routing for a2ui.lynx.js'.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 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 11, 2026

Merging this PR will degrade performance by 16.18%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 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
008-many-use-state-destroyBackground 8 ms 9.5 ms -16.18%

Comparing Sherry-hue:fix/native-preview-url (01b734d) with main (d588d03)

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 11, 2026

Web Explorer

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

01b734d(current) vs d588d03 main#9570(baseline)

Bundle metrics  no changes
                 Current
#9594
     Baseline
#9570
No change  Initial JS 44.46KiB 44.46KiB
No change  Initial CSS 2.22KiB 2.22KiB
Change  Cache Invalidation 0% 13.59%
No change  Chunks 9 9
No change  Assets 11 11
No change  Modules 229 229
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
#9594
     Baseline
#9570
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-ur...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 11, 2026

React Example

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

01b734d(current) vs d588d03 main#7998(baseline)

Bundle metrics  no changes
                 Current
#8021
     Baseline
#7998
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
#8021
     Baseline
#7998
No change  IMG 145.76KiB 145.76KiB
No change  Other 90.01KiB 90.01KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 11, 2026

React External

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

01b734d(current) vs d588d03 main#1112(baseline)

Bundle metrics  no changes
                 Current
#1135
     Baseline
#1112
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
#1135
     Baseline
#1112
No change  Other 690.27KiB 690.27KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 11, 2026

React Example with Element Template

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

01b734d(current) vs d588d03 main#263(baseline)

Bundle metrics  Change 2 changes
                 Current
#287
     Baseline
#263
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
Change  Modules 78(-1.27%) 79
No change  Duplicate Modules 23 23
Change  Duplicate Code 40.34%(+0.02%) 40.33%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#287
     Baseline
#263
No change  IMG 145.76KiB 145.76KiB
No change  Other 52.03KiB 52.03KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 11, 2026

React MTF Example

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

01b734d(current) vs d588d03 main#1128(baseline)

Bundle metrics  no changes
                 Current
#1152
     Baseline
#1128
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
#1152
     Baseline
#1128
No change  IMG 111.23KiB 111.23KiB
No change  Other 95.37KiB 95.37KiB

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


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue enabled auto-merge (squash) May 11, 2026 12:50
@Sherry-hue Sherry-hue merged commit 9775793 into lynx-family:main May 11, 2026
111 of 117 checks passed
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