Skip to content

feat(a2ui-playground): add logo for playground#2670

Merged
HuJean merged 1 commit into
mainfrom
p/a2ui-icon
May 19, 2026
Merged

feat(a2ui-playground): add logo for playground#2670
HuJean merged 1 commit into
mainfrom
p/a2ui-icon

Conversation

@HuJean
Copy link
Copy Markdown
Collaborator

@HuJean HuJean commented May 19, 2026

Summary by CodeRabbit

  • New Features

    • Added a themed logo to the app header with light and dark variants based on current theme selection.
  • Style

    • Added page favicon displayed in browser tabs.
    • Improved spacing and layout of the brand area header.

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

⚠️ No Changeset found

Latest commit: 430e25d

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

📝 Walkthrough

Walkthrough

The PR adds a themed logo image to the A2UI playground header. A light/dark logo variant is conditionally rendered based on the current theme, styled to 26×26 px, and accompanied by updated layout spacing and favicon configuration.

Changes

Playground Branding and Logo

Layer / File(s) Summary
Logo constants and header markup
packages/genui/a2ui-playground/src/App.tsx
LYNX_LIGHT_LOGO and LYNX_DARK_LOGO constants are introduced, and the header is updated to render a themed <img> element with dynamic src selection based on theme, alongside the brand text within a brandGroup container.
Logo and container styling
packages/genui/a2ui-playground/src/styles.css
New .brandLogo selector defines 26×26 px dimensions, block display, non-growing flex sizing, and object-fit: contain. The .brandGroup container gains gap: 10px spacing.
Favicon configuration
packages/genui/a2ui-playground/rsbuild.config.ts
Build configuration adds an html.tags entry with a <link rel="icon"> pointing to a hosted SVG asset.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes


Possibly related PRs


Suggested reviewers

  • gaoachao
  • PupilTong
  • Sherry-hue
  • fzx2666-fz

Poem

🐰 A logo appears in shades of light,

Dark and bright, a themed delight,

The favicon crowns the page with pride,

Where Lynx branding now resides. 🦊✨

🚥 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 'feat(a2ui-playground): add logo for playground' accurately and concisely describes the main change: adding a logo feature to the a2ui-playground component.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch p/a2ui-icon

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.

🧹 Nitpick comments (2)
packages/genui/a2ui-playground/src/App.tsx (1)

22-25: ⚡ Quick win

Consider renaming constants for clarity.

The constant names are counterintuitive: LYNX_LIGHT_LOGO points to lynx-dark-logo.svg and LYNX_DARK_LOGO points to lynx-light-logo.svg. While the logic is correct (dark logo on light background, light logo on dark background), the naming creates confusion. Consider either:

  1. Renaming to reflect the logo appearance and inverting usage:
const LYNX_DARK_LOGO_URL = 'https://.../lynx-dark-logo.svg';
const LYNX_LIGHT_LOGO_URL = 'https://.../lynx-light-logo.svg';
// Then use: theme === 'dark' ? LYNX_LIGHT_LOGO_URL : LYNX_DARK_LOGO_URL
  1. Or making the purpose explicit:
const LYNX_LOGO_FOR_LIGHT_THEME = 'https://.../lynx-dark-logo.svg';
const LYNX_LOGO_FOR_DARK_THEME = 'https://.../lynx-light-logo.svg';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/a2ui-playground/src/App.tsx` around lines 22 - 25, The current
constants LYNX_LIGHT_LOGO and LYNX_DARK_LOGO are misnamed (their URLs point to
the opposite color variants); rename them to clear, unambiguous names (e.g.
LYNX_DARK_LOGO_URL and LYNX_LIGHT_LOGO_URL) and update the selection logic where
the theme is checked (the ternary that currently uses LYNX_LIGHT_LOGO /
LYNX_DARK_LOGO) so the names match the actual SVG they reference (or
alternatively rename to LYNX_LOGO_FOR_LIGHT_THEME and LYNX_LOGO_FOR_DARK_THEME
if you prefer explicit-purpose names and adjust the theme-based usage
accordingly).
packages/genui/a2ui-playground/rsbuild.config.ts (1)

176-186: 💤 Low value

Consider making the favicon theme-aware.

The favicon currently uses the dark logo variant regardless of the user's system theme preference. Modern browsers support theme-aware favicons via multiple <link> tags with media queries:

💡 Optional enhancement for theme-aware favicon
 html: {
   title: 'Lynx A2UI Playground',
   tags: [
     {
       tag: 'link',
       attrs: {
         rel: 'icon',
         type: 'image/svg+xml',
         href:
           'https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-dark-logo.svg',
+        media: '(prefers-color-scheme: light)',
       },
     },
+    {
+      tag: 'link',
+      attrs: {
+        rel: 'icon',
+        type: 'image/svg+xml',
+        href:
+          'https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/lynx-light-logo.svg',
+        media: '(prefers-color-scheme: dark)',
+      },
+    },
   ],
 },

This is purely cosmetic and can be deferred if out of scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/a2ui-playground/rsbuild.config.ts` around lines 176 - 186, The
current tags array contains a single link favicon pointing to the dark logo;
make the favicon theme-aware by replacing or augmenting that single link entry
(the object with tag: 'link' in the tags array) with two link entries using
media attributes for prefers-color-scheme (e.g., media: '(prefers-color-scheme:
dark)' with the dark SVG href and media: '(prefers-color-scheme: light)' with a
light SVG href) and keep a neutral fallback link (no media) to ensure older
browsers still get a favicon; update the attrs for these link objects
accordingly within the same tags configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/genui/a2ui-playground/rsbuild.config.ts`:
- Around line 176-186: The current tags array contains a single link favicon
pointing to the dark logo; make the favicon theme-aware by replacing or
augmenting that single link entry (the object with tag: 'link' in the tags
array) with two link entries using media attributes for prefers-color-scheme
(e.g., media: '(prefers-color-scheme: dark)' with the dark SVG href and media:
'(prefers-color-scheme: light)' with a light SVG href) and keep a neutral
fallback link (no media) to ensure older browsers still get a favicon; update
the attrs for these link objects accordingly within the same tags configuration.

In `@packages/genui/a2ui-playground/src/App.tsx`:
- Around line 22-25: The current constants LYNX_LIGHT_LOGO and LYNX_DARK_LOGO
are misnamed (their URLs point to the opposite color variants); rename them to
clear, unambiguous names (e.g. LYNX_DARK_LOGO_URL and LYNX_LIGHT_LOGO_URL) and
update the selection logic where the theme is checked (the ternary that
currently uses LYNX_LIGHT_LOGO / LYNX_DARK_LOGO) so the names match the actual
SVG they reference (or alternatively rename to LYNX_LOGO_FOR_LIGHT_THEME and
LYNX_LOGO_FOR_DARK_THEME if you prefer explicit-purpose names and adjust the
theme-based usage accordingly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4b5efce8-95eb-432a-8d22-0658d82d17f4

📥 Commits

Reviewing files that changed from the base of the PR and between 3161422 and 430e25d.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/rsbuild.config.ts
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/styles.css

@codecov
Copy link
Copy Markdown

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

Merging this PR will improve performance by 28.95%

⚡ 2 improved benchmarks
✅ 79 untouched benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
002-hello-reactLynx-destroyBackground 931.4 µs 886.5 µs +5.07%
basic-performance-large-css 25.5 ms 16.1 ms +58.26%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing p/a2ui-icon (430e25d) with main (3161422)

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.

@HuJean HuJean enabled auto-merge (squash) May 19, 2026 12:14
@HuJean HuJean merged commit 5182ff4 into main May 19, 2026
43 checks passed
@HuJean HuJean deleted the p/a2ui-icon branch May 19, 2026 12:20
@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 19, 2026

React External

#1592 Bundle Size — 695.71KiB (0%).

430e25d(current) vs 3161422 main#1588(baseline)

Bundle metrics  no changes
                 Current
#1592
     Baseline
#1588
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 41.03%
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
#1592
     Baseline
#1588
No change  Other 695.71KiB 695.71KiB

Bundle analysis reportBranch p/a2ui-iconProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 19, 2026

React MTF Example

#1610 Bundle Size — 208.25KiB (0%).

430e25d(current) vs 3161422 main#1606(baseline)

Bundle metrics  no changes
                 Current
#1610
     Baseline
#1606
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 46.57%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 193 193
No change  Duplicate Modules 77 77
No change  Duplicate Code 44.24% 44.24%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1610
     Baseline
#1606
No change  IMG 111.23KiB 111.23KiB
No change  Other 97.02KiB 97.02KiB

Bundle analysis reportBranch p/a2ui-iconProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 19, 2026

React Example

#8477 Bundle Size — 237.3KiB (0%).

430e25d(current) vs 3161422 main#8473(baseline)

Bundle metrics  no changes
                 Current
#8477
     Baseline
#8473
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 38.56%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 198 198
No change  Duplicate Modules 80 80
No change  Duplicate Code 44.74% 44.74%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8477
     Baseline
#8473
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.55KiB 91.55KiB

Bundle analysis reportBranch p/a2ui-iconProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 19, 2026

React Example with Element Template

#746 Bundle Size — 200.14KiB (0%).

430e25d(current) vs 3161422 main#742(baseline)

Bundle metrics  Change 2 changes
                 Current
#746
     Baseline
#742
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 27.15%
No change  Chunks 0 0
No change  Assets 4 4
Change  Modules 92(+1.1%) 91
No change  Duplicate Modules 27 27
Change  Duplicate Code 39.76%(-0.03%) 39.77%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#746
     Baseline
#742
No change  IMG 145.76KiB 145.76KiB
No change  Other 54.39KiB 54.39KiB

Bundle analysis reportBranch p/a2ui-iconProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 19, 2026

Web Explorer

#10051 Bundle Size — 903.53KiB (0%).

430e25d(current) vs 3161422 main#10047(baseline)

Bundle metrics  Change 1 change
                 Current
#10051
     Baseline
#10047
No change  Initial JS 45.06KiB 45.06KiB
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 230(-0.86%) 232
No change  Duplicate Modules 11 11
No change  Duplicate Code 27.12% 27.12%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#10051
     Baseline
#10047
No change  JS 499.15KiB 499.15KiB
No change  Other 402.16KiB 402.16KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch p/a2ui-iconProject dashboard


Generated by RelativeCIDocumentationReport issue

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