Skip to content

fix: native preview should decode#2631

Merged
HuJean merged 1 commit into
lynx-family:mainfrom
Sherry-hue:fix/native-preview-decode
May 14, 2026
Merged

fix: native preview should decode#2631
HuJean merged 1 commit into
lynx-family:mainfrom
Sherry-hue:fix/native-preview-decode

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

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

Summary by CodeRabbit

  • Bug Fixes

    • Properly decode multi-encoded URL parameters in initialization data before use.
  • Changes

    • Preview/share URLs now embed payloads or use a demo ID directly in the query string (messages, action mocks, speed, theme) instead of using an external shortening step.

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

⚠️ No Changeset found

Latest commit: 15bd7f0

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 14, 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: 7e625536-e3c6-444e-a9be-9896a5a19746

📥 Commits

Reviewing files that changed from the base of the PR and between 8452988 and 15bd7f0.

📒 Files selected for processing (2)
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/src/components/PreviewPanel.tsx
💤 Files with no reviewable changes (1)
  • packages/genui/a2ui-playground/src/components/PreviewPanel.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx

📝 Walkthrough

Walkthrough

Adds an iterative URL-decoding helper used when normalizing InitData and simplifies PreviewPanel to inline or use demoId for Lynx dev bundle query parameters instead of POSTing payloads for URL shortening.

Changes

Init & Preview URL handling

Layer / File(s) Summary
Decode helper and normalization
packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
Adds decodeUrlString that decodes up to three times with early exit; normalizeInitDataLike now decodes messagesUrl and actionMocksUrl when they are strings before storing in InitData.
PreviewPanel: inline Lynx dev query params
packages/genui/a2ui-playground/src/components/PreviewPanel.tsx
Removes the async POST to /__a2ui_payload and related URL-rewriting. PreviewPanel now sets lynxDevUrl query params directly, using demoId for messagesUrl or inlining messages/actionMocks JSON, and includes speed/theme when applicable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • HuJean

Poem

"I nibble at encodings till layers unwind,
Thrice I unroll what the browsers confined. 🐇
No tiny POSTs to shorten the trail tonight,
Queries inlined — preview hops into light. ✨"

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The title "fix: native preview should decode" is vague and incomplete, failing to specify what is being decoded or the full context of the fix. Improve the title to be more specific about the decode operation, such as "fix: decode URL parameters in native preview" or "fix: add URL decoding to preview payload handling".
✅ 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

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

Merging this PR will not alter performance

✅ 81 untouched benchmarks
⏩ 26 skipped benchmarks1


Comparing Sherry-hue:fix/native-preview-decode (15bd7f0) with main (7b8d63c)

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

React External

#1338 Bundle Size — 693.04KiB (0%).

15bd7f0(current) vs ee79eff main#1335(baseline)

Bundle metrics  no changes
                 Current
#1338
     Baseline
#1335
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
#1338
     Baseline
#1335
No change  Other 693.04KiB 693.04KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 14, 2026

Web Explorer

#9798 Bundle Size — 901.38KiB (~+0.01%).

15bd7f0(current) vs ee79eff main#9795(baseline)

Bundle metrics  Change 1 change
                 Current
#9798
     Baseline
#9795
No change  Initial JS 45.06KiB 45.06KiB
No change  Initial CSS 2.22KiB 2.22KiB
No change  Cache Invalidation 8.13% 8.13%
No change  Chunks 9 9
No change  Assets 11 11
Change  Modules 228(-0.44%) 229
No change  Duplicate Modules 11 11
No change  Duplicate Code 27.22% 27.22%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#9798
     Baseline
#9795
Regression  JS 497.1KiB (~+0.01%) 497.08KiB
No change  Other 402.06KiB 402.06KiB
No change  CSS 2.22KiB 2.22KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 14, 2026

React Example with Element Template

#491 Bundle Size — 199.83KiB (0%).

15bd7f0(current) vs ee79eff main#488(baseline)

Bundle metrics  no changes
                 Current
#491
     Baseline
#488
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 86 86
No change  Duplicate Modules 25 25
No change  Duplicate Code 39.95% 39.95%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#491
     Baseline
#488
No change  IMG 145.76KiB 145.76KiB
No change  Other 54.08KiB 54.08KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 14, 2026

React MTF Example

#1357 Bundle Size — 207.46KiB (0%).

15bd7f0(current) vs ee79eff main#1354(baseline)

Bundle metrics  no changes
                 Current
#1357
     Baseline
#1354
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.38% 44.38%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1357
     Baseline
#1354
No change  IMG 111.23KiB 111.23KiB
No change  Other 96.23KiB 96.23KiB

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


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 14, 2026

React Example

#8224 Bundle Size — 236.51KiB (0%).

15bd7f0(current) vs ee79eff main#8221(baseline)

Bundle metrics  no changes
                 Current
#8224
     Baseline
#8221
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.87% 44.87%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8224
     Baseline
#8221
No change  IMG 145.76KiB 145.76KiB
No change  Other 90.75KiB 90.75KiB

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


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue force-pushed the fix/native-preview-decode branch from 32a5c37 to 8452988 Compare May 14, 2026 11:17
@Sherry-hue Sherry-hue force-pushed the fix/native-preview-decode branch from 8452988 to 15bd7f0 Compare May 14, 2026 11:36
@HuJean HuJean merged commit d55deae into lynx-family:main May 14, 2026
103 of 108 checks passed
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.

3 participants