Skip to content

feat(a2ui): refactor ui and support theme#2607

Merged
HuJean merged 1 commit into
mainfrom
p/a2ui-theme
May 12, 2026
Merged

feat(a2ui): refactor ui and support theme#2607
HuJean merged 1 commit into
mainfrom
p/a2ui-theme

Conversation

@HuJean
Copy link
Copy Markdown
Collaborator

@HuJean HuJean commented May 12, 2026

Summary by CodeRabbit

  • New Features

    • App/playground now support light/dark themes and propagate theme into preview and share URLs.
    • Components: Button gains variant styling; Card supports variants and optional weighting; Image supports sizing modes and fallback behavior; List adds alignment variants; Text gains weight options.
  • UI/Styling Updates

    • Introduced centralized design tokens and refreshed component styles for consistent theming across the UI.

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

🦋 Changeset detected

Latest commit: 5ee4f3a

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

This PR includes changesets to release 0 packages

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

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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds light/dark theme support and a new a2ui token theme; threads theme through playground init, render URLs, Lynx/web App, and pages; migrates catalog CSS to --a2ui-* tokens and replaces Luna/Lunaris theme blocks; updates many catalog components with variant/weight/behavior and adds CSS typing.

Changes

Theme + playground wiring

Layer / File(s) Summary
A2UI token root and legacy theme removal
packages/genui/a2ui/styles/theme.css, packages/genui/a2ui/styles/catalog/luna*.css, packages/genui/a2ui/styles/catalog/lunaris*.css, packages/genui/a2ui/styles/catalog/luna.css
Introduce :root --a2ui-* design tokens in theme.css and remove legacy per-theme Luna/Lunaris blocks and aggregate imports.
Playground preview mapping, typings, and dependency
packages/genui/a2ui-playground/lynx-src/a2ui/index.css, packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts, packages/genui/a2ui-playground/package.json
Add Luna preview CSS that maps Luna tokens into --a2ui-*, augment @lynx-js/types to include optional `GlobalProps.theme?: 'light'
Init / render URL / global props wiring
packages/genui/a2ui-playground/src/render.tsx, packages/genui/a2ui-playground/src/utils/renderUrl.ts
Add optional theme to InitData/RenderInit, parse theme from URL/query only when `'light'
Lynx app theme class & color-scheme
packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx, packages/genui/a2ui-playground/src/App.tsx, packages/genui/a2ui-playground/src/styles.css
Derive memoized theme/themeClassName in Lynx App, change root to className={\page ${themeClassName}`}, set document.documentElement.style.colorSchemein web App, scope dark/light selectors tohtml[data-theme="..."], and update playground styles to use --a2ui-/--geist-` tokens.
Pages accept and thread theme
packages/genui/a2ui-playground/src/pages/DemosPage.tsx, packages/genui/a2ui-playground/src/pages/DemosListPage.tsx, packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
Page components now require/accept a theme prop and thread it into preview/render URL construction and memo/useCallback dependency arrays so previews update when theme changes.

Catalog components and typings

Layer / File(s) Summary
Component prop additions and runtime behavior
packages/genui/a2ui/src/catalog/Button/index.tsx, packages/genui/a2ui/src/catalog/Card/index.tsx, packages/genui/a2ui/src/catalog/Image/index.tsx, packages/genui/a2ui/src/catalog/Text/index.tsx, packages/genui/a2ui/src/catalog/List/index.tsx
Button: default variant='primary' and variant-based class; Card: adds `variant?: 'elevated'
Weighted children & stateful classes
packages/genui/a2ui/src/catalog/Column/index.tsx, packages/genui/a2ui/src/catalog/Row/index.tsx, packages/genui/a2ui/src/catalog/CheckBox/index.tsx
Column/Row: weighted child wrappers include numeric weight in class (*-weighted-item-${weight}); CheckBox: input wrapper conditionally appends checkbox-input-checked when checked.
Type helper for CSS imports
packages/genui/a2ui/src/css.d.ts
Add declare module '*.css'; to allow TypeScript imports of CSS files.

Catalog styles: import switch and token migration

Layer / File(s) Summary
Catalog CSS import and token migration
packages/genui/a2ui/styles/catalog/*.css (Button.css, Card.css, CheckBox.css, Column.css, Divider.css, Image.css, List.css, RadioGroup.css, Row.css, Text.css)
All catalog styles switched imports from Luna to ../theme.css and were migrated from Luna variables/hardcoded values to --a2ui-* tokens; layout/spacing/min-size constraints and variant/weight utilities added.
Button/Card visual variants
packages/genui/a2ui/styles/catalog/Button.css, packages/genui/a2ui/styles/catalog/Card.css
Button: overhaul to tokenized layout and colors, add .button-primary and .button-borderless variants; Card: `card-elevated
Image/Radio/List/Row typography & layout updates
packages/genui/a2ui/styles/catalog/Image.css, packages/genui/a2ui/styles/catalog/RadioGroup.css, packages/genui/a2ui/styles/catalog/List.css, packages/genui/a2ui/styles/catalog/Row.css, packages/genui/a2ui/styles/catalog/Text.css
Image variant selectors renamed to image-variant-* and .image-weighted added; RadioGroup restyled with token borders/checked/active states; List/Row updated to flex-based layouts and alignment variants; Text reworked to use --a2ui-* typography tokens and adds .text-weight-* utilities.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

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

"I’m a rabbit painting tokens bright,
Hopped through CSS and set themes right,
Light and dark now pass with care,
Buttons, cards, previews—everywhere. 🐇🎨"

🚥 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): refactor ui and support theme' accurately describes the main changes in the pull request. The changeset includes refactoring of a2ui UI components with extensive style updates and addition of comprehensive theme support across the playground and component library.
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
  • Commit unit tests in branch p/a2ui-theme

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!

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/genui/a2ui/styles/catalog/Text.css (1)

110-121: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Duplicate CSS rule conflict with Button.css.

This rule block is duplicated in packages/genui/a2ui/styles/catalog/Button.css at lines 39-50 with a conflicting color value:

  • Text.css (here): color: var(--a2ui-color-on-primary);
  • Button.css: color: inherit;

Both files define identical selectors (.button .text-body, .button .text-caption, etc.) with the same specificity, making the effective style dependent on CSS load order. This creates unpredictable behavior.

Resolution: Keep only one rule. Since Button.css already sets .button { color: var(--a2ui-color-on-primary); }, the color: inherit; in Button.css is the correct approach. Remove this block from Text.css.

🔧 Proposed fix

Remove the duplicate rule block:

-.button .text-body,
-.button .text-caption,
-.button .text-h1,
-.button .text-h2,
-.button .text-h3,
-.button .text-h4,
-.button .text-h5,
-.button .text-price,
-.button .text-link,
-.button .text-label {
-  color: var(--a2ui-color-on-primary);
-}
🤖 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/styles/catalog/Text.css` around lines 110 - 121, Remove
the duplicate selector block from Text.css that defines ".button .text-body,
.button .text-caption, .button .text-h1, .button .text-h2, .button .text-h3,
.button .text-h4, .button .text-h5, .button .text-price, .button .text-link,
.button .text-label { color: var(--a2ui-color-on-primary); }" so Button.css's
approach is authoritative; rely on Button.css's ".button { color:
var(--a2ui-color-on-primary); }" + its ".button .text-*" rules using "color:
inherit" to ensure consistent styling and remove the conflicting rule from
Text.css.
🧹 Nitpick comments (3)
packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts (1)

5-9: ⚡ Quick win

Strengthen theme type for consistency.

The theme field is typed as string, while throughout the rest of the codebase it's strictly typed as 'light' | 'dark' (e.g., packages/genui/a2ui-playground/src/utils/renderUrl.ts:13, packages/genui/a2ui-playground/src/render.tsx:24). This type inconsistency weakens type safety—code consuming globalProps.theme in the Lynx context won't benefit from the literal type constraint.

🔧 Proposed fix
 declare module '@lynx-js/types' {
   interface GlobalProps {
-    theme?: string;
+    theme?: 'light' | 'dark';
   }
 }
🤖 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/lynx-src/a2ui/rspeedy-env.d.ts` around lines 5
- 9, The GlobalProps.theme is currently typed as string in the declared module
'@lynx-js/types'; change the type of the theme property on interface GlobalProps
to the literal union 'light' | 'dark' so it matches the rest of the codebase
(e.g., renderUrl.ts and render.tsx) and restores strict type safety when
consuming globalProps.theme.
packages/genui/a2ui-playground/package.json (1)

17-17: 💤 Low value

Consider using a version range for consistency.

The dependency @lynx-js/luna-styles is pinned to an exact version (0.1.0), while other external dependencies in this file use caret ranges (e.g., ^6.0.2, ^4.25.9). Exact pinning prevents automatic patch and minor updates that might include bug fixes.

Unless exact version pinning is required for theme compatibility, consider using "^0.1.0" for consistency with the project's dependency management pattern.

🤖 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/package.json` at line 17, The dependency entry
for `@lynx-js/luna-styles` in package.json is pinned to an exact version "0.1.0";
update it to a caret range "^0.1.0" to match the project's other dependencies
and allow minor/patch upgrades, i.e., modify the dependency string for
"@lynx-js/luna-styles" in package.json to use "^0.1.0" unless there is a
specific compatibility reason to keep the exact pin—if so, add a comment in the
package.json or PR explanation documenting why it must remain exact.
packages/genui/a2ui/styles/catalog/Button.css (1)

24-26: 💤 Low value

.button-primary is redundant.

The .button base class already sets background-color: var(--a2ui-color-primary); at line 12, making this variant modifier redundant:

.button {
  background-color: var(--a2ui-color-primary);  /* line 12 */
}

.button-primary {
  background-color: var(--a2ui-color-primary);  /* duplicate */
}

Consider removing .button-primary unless it's intended for future extension or explicit override scenarios.

🤖 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/styles/catalog/Button.css` around lines 24 - 26, Remove
the redundant .button-primary rule that duplicates the background-color already
set by .button; locate the .button-primary selector and either delete it or
consolidate any unique styles into the base .button (or rename/extend it only if
you plan a distinct modifier), ensuring no behavioral change and keeping .button
as the single source for background-color.
🤖 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.

Inline comments:
In `@packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx`:
- Around line 40-46: ComponentsPage currently ignores the incoming theme prop
when rendering the JSON editors and always forces the dark CodeMirror theme;
update the CodeMirror instances inside ComponentsPage (the CodeMirror component
usages around the initial snippet and at the block referenced 134-140) to use
the passed-in theme prop instead of a hardcoded 'dark' (e.g., derive the editor
theme from the theme prop or map 'light'/'dark' to the appropriate CodeMirror
theme names) so the JSON editors follow the selected theme.

In `@packages/genui/a2ui/src/catalog/CheckBox/index.tsx`:
- Around line 27-31: The resolved label from resolveA2UIValue (assigned to
label) is typed unknown and is being cast to string unsafely; update the
CheckBox component to validate the resolved value before rendering (and apply
the same pattern for Text usage): check if label is null/undefined and use an
empty string or props.fallback, if typeof label === 'string' use it directly, if
it's a primitive (number/boolean) convert with String(label), and if it's an
object/array serialize safely (e.g., JSON.stringify or a safe inspector) or
fallback rather than blindly casting—refer to the label variable and
resolveA2UIValue call and the Text rendering sites to locate where to add these
guards and fallback logic.

In `@packages/genui/a2ui/src/catalog/Image/index.tsx`:
- Line 53: The JSX currently passes style={weight ? { flex: `${weight} ${weight}
0` } : undefined}, which violates exactOptionalPropertyTypes because it
explicitly passes undefined to an optional prop; instead, stop passing the style
prop when weight is falsy by conditionally spreading the prop object into the
element: build an object like ...(weight ? { style: { flex: `${weight} ${weight}
0` } } : {}) and spread it into the component props so style is only present
when weight is set (refer to the weight identifier and the style prop usage in
packages/genui/a2ui/src/catalog/Image/index.tsx).

In `@packages/genui/a2ui/src/catalog/Text/index.tsx`:
- Around line 31-39: The weight threshold logic in the Text component sets
'text-weight-1' for any numeric weight < 1.5 (including 0 or negatives); update
the conditional in the block that computes weightClass so a weight class is only
applied for valid positive weights (e.g., require weight >= 1 or another chosen
lower bound) and skip assigning weightClass (leave undefined/null) for values
below that bound; adjust the branches around the existing checks (the if (typeof
weight === 'number') { ... } block that assigns 'text-weight-2',
'text-weight-1-5', or 'text-weight-1') to include the lower-bound check and
ensure negative/zero weights don’t map to 'text-weight-1'.

In `@packages/genui/a2ui/src/utils/resolveValue.ts`:
- Around line 300-305: The top-level string branch in resolveA2UIValue returns
plain strings without handling binding or call-expression strings; update the
string handling in resolveValue.ts so that after checking for template
interpolation (resolveTemplate) you also detect and resolve top-level
call-expression and binding strings by invoking the existing
resolveCallExpression and resolveBinding helpers (use the same surface and
dataContextPath/context arguments) before returning the value, ensuring
resolveTemplate, resolveCallExpression and resolveBinding are tried in the
correct order.

---

Outside diff comments:
In `@packages/genui/a2ui/styles/catalog/Text.css`:
- Around line 110-121: Remove the duplicate selector block from Text.css that
defines ".button .text-body, .button .text-caption, .button .text-h1, .button
.text-h2, .button .text-h3, .button .text-h4, .button .text-h5, .button
.text-price, .button .text-link, .button .text-label { color:
var(--a2ui-color-on-primary); }" so Button.css's approach is authoritative; rely
on Button.css's ".button { color: var(--a2ui-color-on-primary); }" + its
".button .text-*" rules using "color: inherit" to ensure consistent styling and
remove the conflicting rule from Text.css.

---

Nitpick comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts`:
- Around line 5-9: The GlobalProps.theme is currently typed as string in the
declared module '@lynx-js/types'; change the type of the theme property on
interface GlobalProps to the literal union 'light' | 'dark' so it matches the
rest of the codebase (e.g., renderUrl.ts and render.tsx) and restores strict
type safety when consuming globalProps.theme.

In `@packages/genui/a2ui-playground/package.json`:
- Line 17: The dependency entry for `@lynx-js/luna-styles` in package.json is
pinned to an exact version "0.1.0"; update it to a caret range "^0.1.0" to match
the project's other dependencies and allow minor/patch upgrades, i.e., modify
the dependency string for "@lynx-js/luna-styles" in package.json to use "^0.1.0"
unless there is a specific compatibility reason to keep the exact pin—if so, add
a comment in the package.json or PR explanation documenting why it must remain
exact.

In `@packages/genui/a2ui/styles/catalog/Button.css`:
- Around line 24-26: Remove the redundant .button-primary rule that duplicates
the background-color already set by .button; locate the .button-primary selector
and either delete it or consolidate any unique styles into the base .button (or
rename/extend it only if you plan a distinct modifier), ensuring no behavioral
change and keeping .button as the single source for background-color.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d06e7252-5826-4a62-a480-c63e4e7a033b

📥 Commits

Reviewing files that changed from the base of the PR and between e51f9f1 and 0a5320b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (41)
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/RadioGroup/index.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/src/core/A2UIRender.tsx
  • packages/genui/a2ui/src/core/useDataBinding.ts
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/src/utils/binding.ts
  • packages/genui/a2ui/src/utils/resolveValue.ts
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/theme.css
💤 Files with no reviewable changes (5)
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css

Comment thread packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
Comment thread packages/genui/a2ui/src/catalog/CheckBox/index.tsx Outdated
Comment thread packages/genui/a2ui/src/catalog/Image/index.tsx Outdated
Comment thread packages/genui/a2ui/src/catalog/Text/index.tsx
Comment thread packages/genui/a2ui/src/utils/resolveValue.ts Outdated
@HuJean HuJean force-pushed the p/a2ui-theme branch 2 times, most recently from c703a0e to 8fbe5df Compare May 12, 2026 08:55
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: 7

🧹 Nitpick comments (1)
packages/genui/a2ui/src/catalog/Button/index.tsx (1)

51-53: 💤 Low value

Minor: className construction adds trailing space when enabled.

The template literal button button-${variant} ${isButtonEnabled(props) ? '' : 'button-disabled'} results in a trailing space when the button is enabled (e.g., "button button-primary "). While this typically doesn't cause rendering issues, it's cleaner to avoid it.

♻️ Proposed fix to remove trailing space
-      className={`button button-${variant} ${
-        isButtonEnabled(props) ? '' : 'button-disabled'
-      }`}
+      className={`button button-${variant}${
+        isButtonEnabled(props) ? '' : ' button-disabled'
+      }`}

Or use an array-based approach:

-      className={`button button-${variant} ${
-        isButtonEnabled(props) ? '' : 'button-disabled'
-      }`}
+      className={[
+        'button',
+        `button-${variant}`,
+        !isButtonEnabled(props) && 'button-disabled',
+      ]
+        .filter(Boolean)
+        .join(' ')}
🤖 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/src/catalog/Button/index.tsx` around lines 51 - 53, The
className template in the Button component produces a trailing space when
enabled; update the className build in
packages/genui/a2ui/src/catalog/Button/index.tsx (the Button component) to
conditionally include 'button-disabled' without leaving an extra space—e.g.,
construct className from an array like ['button', `button-${variant}`,
isButtonEnabled(props) ? null : 'button-disabled'].filter(Boolean).join(' ') or
otherwise conditionally concatenate so no trailing space remains; ensure
references to variant and isButtonEnabled(props) are used as in the current
code.
🤖 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.

Inline comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Line 74: The CSS uses an unknown type selector "page" which triggers
selector-type-no-unknown; either convert the selector to a class (rename "page"
to ".page" and update all usages in HTML/JSX/JSX-like components) or, if "page"
is a valid Lynx intrinsic element, locally suppress the lint rule by adding a
one-line stylelint disable comment immediately above the "page" rule (e.g., /*
stylelint-disable-next-line selector-type-no-unknown */) so the selector remains
unchanged; update any references accordingly (look for the "page" selector in
the stylesheet and related templates/components).

In `@packages/genui/a2ui-playground/src/styles.css`:
- Around line 974-978: The radial-gradient call uses the CSS custom property
--a2ui-color-overlay without a fallback, so if that token is undefined the
background may vanish; update the radial-gradient(...) expression to use a
fallback value (e.g. var(--a2ui-color-overlay, rgba(0,0,0,0.5)) or another
theme-safe color) so the gradient always renders, and ensure the change is
applied where radial-gradient(circle at top right, var(--a2ui-color-overlay),
transparent 18%) is defined.

In `@packages/genui/a2ui/src/catalog/Button/index.tsx`:
- Around line 15-18: The checks[].message property is declared but never used;
remove it from the checks prop type (change checks?: Array<{ condition?: unknown
}>) and from any related prop definitions/usages (e.g., Button props/interface
and any prop-types or TS interfaces referring to checks) to keep the API clean,
then update any tests, Storybook stories, or docs that mention checks.message;
alternatively, if you intended to surface messages to the UI, implement
rendering (e.g., show checks messages as tooltip/validation text in the Button
component) and ensure the checks prop is consumed where the Button is rendered.
- Line 54: The button currently always binds bindtap to handleClick so disabled
buttons still respond; update the component to only bind the handler when
isButtonEnabled(props) is true (i.e., conditionally set bindtap={handleClick} or
undefined), or add an early-return guard inside handleClick that checks
isButtonEnabled(props) and returns without dispatching if false; ensure
references to isButtonEnabled, handleClick, and the dispatch call are updated so
no action is dispatched for disabled buttons.

In `@packages/genui/a2ui/src/catalog/Image/index.tsx`:
- Around line 52-55: The code currently converts props.weight to a boolean and
only toggles image-weighted, losing numeric values and dropping 0; update the
Image component (the local weight constant and weightClass) so weight is
preserved as a number (e.g. const weight = typeof props.weight === 'number' ?
props.weight : undefined) and compute weightClass only based on existence
(weight !== undefined) while applying the numeric value to layout via inline
style or a data-attribute (for example style={{ flex: weight }} or style={{
flexGrow: weight }}), ensuring weight=0 results in flex:0 rather than being
ignored; adjust any analogous logic at the later block (lines ~61-67) the same
way.

In `@packages/genui/a2ui/styles/catalog/Image.css`:
- Around line 15-19: The .image-variant-smallFeature CSS sets width: 120px but
uses max-width: var(--a2ui-image-small-feature-size, 100px) which undercuts the
intended baseline; fix by aligning the default sizes: update max-width to use
the same baseline (e.g. max-width: var(--a2ui-image-small-feature-size, 120px))
or remove the max-width if you want a hard 120px width, ensuring the CSS
variable --a2ui-image-small-feature-size is the single source of truth for the
default size.

In `@packages/genui/a2ui/styles/catalog/List.css`:
- Around line 13-16: The .list.list-horizontal rule sets align-items with higher
specificity than the utility selectors (.list-align-*) so those utilities are
overridden; change the CSS so the horizontal default center alignment uses the
same specificity as the utilities (e.g., replace the generic
.list.list-horizontal { align-items: center } with a selector that combines the
horizontal class and the center utility, e.g.
.list.list-horizontal.list-align-center { align-items: center }) and apply the
same pattern to the other horizontal-related rules referenced (lines ~24-37) so
.list-align-start/.list-align-end/.list-align-stretch can override when present.

---

Nitpick comments:
In `@packages/genui/a2ui/src/catalog/Button/index.tsx`:
- Around line 51-53: The className template in the Button component produces a
trailing space when enabled; update the className build in
packages/genui/a2ui/src/catalog/Button/index.tsx (the Button component) to
conditionally include 'button-disabled' without leaving an extra space—e.g.,
construct className from an array like ['button', `button-${variant}`,
isButtonEnabled(props) ? null : 'button-disabled'].filter(Boolean).join(' ') or
otherwise conditionally concatenate so no trailing space remains; ensure
references to variant and isButtonEnabled(props) are used as in the current
code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 16f092a3-e3da-4449-bcad-d9e66243746a

📥 Commits

Reviewing files that changed from the base of the PR and between 0a5320b and c703a0e.

📒 Files selected for processing (37)
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/theme.css
💤 Files with no reviewable changes (5)
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
✅ Files skipped from review due to trivial changes (5)
  • packages/genui/a2ui-playground/package.json
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui/styles/catalog/Column.css
🚧 Files skipped from review as they are similar to previous changes (19)
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui/styles/theme.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx

Comment thread packages/genui/a2ui-playground/lynx-src/a2ui/index.css
Comment thread packages/genui/a2ui-playground/src/styles.css
Comment thread packages/genui/a2ui/src/catalog/Button/index.tsx Outdated
Comment thread packages/genui/a2ui/src/catalog/Button/index.tsx
Comment thread packages/genui/a2ui/src/catalog/Image/index.tsx Outdated
Comment thread packages/genui/a2ui/styles/catalog/Image.css
Comment thread packages/genui/a2ui/styles/catalog/List.css
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.

♻️ Duplicate comments (1)
packages/genui/a2ui-playground/lynx-src/a2ui/index.css (1)

74-81: ⚠️ Potential issue | 🔴 Critical

The page type selector issue remains unresolved.

The previous review already identified that line 74 uses page as a type selector, which triggers the stylelint selector-type-no-unknown error. According to the AI summary, App.tsx applies className="page", which requires a class selector (.page), not a type selector. Additionally, this creates ambiguity with the existing .page class defined at lines 7-11.

🤖 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/lynx-src/a2ui/index.css` around lines 74 - 81,
The CSS currently uses a type selector "page" which causes the stylelint
selector-type-no-unknown error and conflicts with the existing .page class used
in App.tsx (className="page"); change the selector from the type selector page
to the class selector .page, merge or reconcile any duplicate rules with the
existing .page block (remove the ambiguous type selector), and ensure all
references in App.tsx continue to use className="page" so the styles apply
correctly.
🤖 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.

Duplicate comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Around line 74-81: The CSS currently uses a type selector "page" which causes
the stylelint selector-type-no-unknown error and conflicts with the existing
.page class used in App.tsx (className="page"); change the selector from the
type selector page to the class selector .page, merge or reconcile any duplicate
rules with the existing .page block (remove the ambiguous type selector), and
ensure all references in App.tsx continue to use className="page" so the styles
apply correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f39526e-053f-42f0-9fd4-09bfe5681082

📥 Commits

Reviewing files that changed from the base of the PR and between c703a0e and 8fbe5df.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/theme.css
💤 Files with no reviewable changes (5)
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/luna.css
✅ Files skipped from review due to trivial changes (6)
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/src/css.d.ts
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui/styles/theme.css
🚧 Files skipped from review as they are similar to previous changes (25)
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui/styles/catalog/Image.css

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.

♻️ Duplicate comments (1)
packages/genui/a2ui-playground/lynx-src/a2ui/index.css (1)

74-74: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix the unknown page selector lint failure.

This issue was previously flagged and remains unresolved. The page type selector triggers selector-type-no-unknown. If page is a valid Lynx intrinsic element, add a stylelint disable comment; otherwise, consider using a class selector.

🤖 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/lynx-src/a2ui/index.css` at line 74, The CSS
rule using the type selector "page" is triggering stylelint's
selector-type-no-unknown; either replace the type selector with a class (e.g.,
.page) and update usages accordingly, or if "page" is a valid Lynx intrinsic
element, add a stylelint-disable comment scoped to that selector (e.g., /*
stylelint-disable-next-line selector-type-no-unknown */) immediately before the
"page" rule in a2ui/index.css so the linter stops flagging it; update any
corresponding markup references if you change the selector type.
🤖 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.

Duplicate comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Line 74: The CSS rule using the type selector "page" is triggering stylelint's
selector-type-no-unknown; either replace the type selector with a class (e.g.,
.page) and update usages accordingly, or if "page" is a valid Lynx intrinsic
element, add a stylelint-disable comment scoped to that selector (e.g., /*
stylelint-disable-next-line selector-type-no-unknown */) immediately before the
"page" rule in a2ui/index.css so the linter stops flagging it; update any
corresponding markup references if you change the selector type.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5ddf4108-3dcf-4665-8463-9b7e2f76fb07

📥 Commits

Reviewing files that changed from the base of the PR and between 8fbe5df and 4992874.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/theme.css
💤 Files with no reviewable changes (5)
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
✅ Files skipped from review due to trivial changes (5)
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/styles/theme.css
  • packages/genui/a2ui/styles/catalog/Divider.css
🚧 Files skipped from review as they are similar to previous changes (26)
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/css.d.ts
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/Button.css

@HuJean HuJean force-pushed the p/a2ui-theme branch 2 times, most recently from b46f2f9 to a8bdbdb Compare May 12, 2026 09:17
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: 3

♻️ Duplicate comments (1)
packages/genui/a2ui-playground/lynx-src/a2ui/index.css (1)

74-74: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

The stylelint error for unknown page selector remains unaddressed.

This is the same issue flagged in the previous review. The selector-type-no-unknown lint error will still fail CI checks. If page is a Lynx intrinsic element, add a stylelint disable comment as suggested in the previous review.

🔧 Suggested fix
+/* stylelint-disable-next-line selector-type-no-unknown -- Lynx intrinsic element */
 page {
   display: flex;
🤖 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/lynx-src/a2ui/index.css` at line 74, The CSS
contains an unknown type selector "page" that trips stylelint's
selector-type-no-unknown rule; if "page" is a Lynx intrinsic element, suppress
the lint for that selector by adding a stylelint disable comment immediately
before the selector (for example use a single-line disable such as disabling
selector-type-no-unknown for the next line) and optionally re-enable afterward
so only the "page" rule is ignored; update the file containing the "page" rule
(index.css) around the page selector to include the appropriate /*
stylelint-disable(-next-line) selector-type-no-unknown */ comment.
🧹 Nitpick comments (3)
packages/genui/a2ui/styles/catalog/Button.css (2)

24-26: ⚡ Quick win

Remove redundant .button-primary rule.

The .button-primary class sets background-color: var(--a2ui-color-primary), but the base .button rule already sets this same background color on line 12. Unless this variant is intended to override a different variant (not visible in context), this rule is redundant and can be removed.

♻️ Proposed fix to remove redundancy
-.button-primary {
-  background-color: var(--a2ui-color-primary);
-}
-
 .button-borderless {
   background-color: transparent;
   padding-left: 0;
🤖 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/styles/catalog/Button.css` around lines 24 - 26, Remove
the redundant .button-primary CSS rule that duplicates the background-color
already defined on .button; delete the .button-primary block (the rule setting
background-color: var(--a2ui-color-primary)) so styling is only defined once on
.button and avoid duplication between .button and .button-primary.

14-17: 💤 Low value

Consider removing unused transition properties.

The transition includes transform and opacity, but these properties don't appear to be modified within the visible button styles. If they're not used by hover states, active states, or external interactions, consider removing them to keep the CSS lean.

🤖 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/styles/catalog/Button.css` around lines 14 - 17, The
transition declaration in Button.css currently lists transform, opacity, and
background-color but transform and opacity are unused; either remove the unused
properties from the transition shorthand (leave only background-color) or add
corresponding interactions that actually change transform/opacity (e.g.,
:hover/:active rules) so the transitions are meaningful—update the transition
declaration in Button.css (the rule containing "transform 0.12s ease, opacity
0.12s ease, background-color 0.12s ease") and adjust/remove related hover/active
styles accordingly.
packages/genui/a2ui-playground/lynx-src/a2ui/index.css (1)

7-11: 💤 Low value

Consider clarifying the relationship between .page class and page element styles.

Both .page (lines 7-11) and page (lines 74-81) set background-color, though to different CSS variables that resolve to the same value via the theme mapping. If the .page class is always applied to the page element (as suggested by className={\page ${themeClassName}`}` in App.tsx), this duplication may be unnecessary.

If they serve distinct purposes (e.g., .page for a wrapper div and page for the Lynx element), consider adding a comment explaining the separation.

Also applies to: 74-81

🤖 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/lynx-src/a2ui/index.css` around lines 7 - 11,
The .page class and the page element selector both set background-color to theme
variables and appear redundant when the App.tsx renders the page element with
className={`page ${themeClassName}`}; either remove one of the duplicate
background-color declarations (prefer keeping the element selector or the class
depending on intended scoping) or add a brief comment above the selectors
explaining why both exist (e.g., one targets a wrapper div vs the custom page
element) and ensure the remaining rule has the correct specificity and ordering
so themeClassName can override it as intended; reference the .page CSS rule and
the page element rule and the App.tsx usage (`className={`page
${themeClassName}`}`) when making the change.
🤖 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.

Inline comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Around line 23-24: The light/dark CSS variables (--a2ui-color-primary-light,
--a2ui-color-primary-dark, --a2ui-color-secondary-light,
--a2ui-color-secondary-dark) are all mapped to the same Luna tokens, nullifying
the light/dark distinction; update these vars to use the color-mixing pattern
from packages/genui/a2ui/styles/theme.css (mix base token with white for *-light
and with black for *-dark) so each pair produces distinct lighter and darker
variants while still sourcing the base Luna token.

In `@packages/genui/a2ui/styles/catalog/Button.css`:
- Around line 35-46: There are duplicate rules for the selectors (.button
.text-body, .button .text-caption, .button .text-h1, .button .text-h2, .button
.text-h3, .button .text-h4, .button .text-h5, .button .text-price, .button
.text-link, .button .text-label) that set conflicting color values (one file
uses color: inherit, the other color: var(--a2ui-color-on-primary)); remove the
redundancy by deleting the entire .button .text-* color block from Button.css so
Text.css is the single source of truth, or alternatively change the Button.css
block to the same var(--a2ui-color-on-primary) value (or reference the same CSS
variable) so both files align and there is no load-order dependency.
- Line 11: The change in Button.css replaces the previous fully-rounded value
with the CSS token --a2ui-border-radius (currently 0.25rem) which reduces button
corners from 9999px to slightly rounded; confirm this visual change matches the
updated design spec and either (a) update the token value to the intended
rounding or (b) revert the button rule to the previous fully-rounded value, and
then refresh and commit updated UI screenshots/screenshots folder so visual
tests reflect the new border radius; check the modified selector in Button.css
and the --a2ui-border-radius definition in theme.css when making the change.

---

Duplicate comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Line 74: The CSS contains an unknown type selector "page" that trips
stylelint's selector-type-no-unknown rule; if "page" is a Lynx intrinsic
element, suppress the lint for that selector by adding a stylelint disable
comment immediately before the selector (for example use a single-line disable
such as disabling selector-type-no-unknown for the next line) and optionally
re-enable afterward so only the "page" rule is ignored; update the file
containing the "page" rule (index.css) around the page selector to include the
appropriate /* stylelint-disable(-next-line) selector-type-no-unknown */
comment.

---

Nitpick comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Around line 7-11: The .page class and the page element selector both set
background-color to theme variables and appear redundant when the App.tsx
renders the page element with className={`page ${themeClassName}`}; either
remove one of the duplicate background-color declarations (prefer keeping the
element selector or the class depending on intended scoping) or add a brief
comment above the selectors explaining why both exist (e.g., one targets a
wrapper div vs the custom page element) and ensure the remaining rule has the
correct specificity and ordering so themeClassName can override it as intended;
reference the .page CSS rule and the page element rule and the App.tsx usage
(`className={`page ${themeClassName}`}`) when making the change.

In `@packages/genui/a2ui/styles/catalog/Button.css`:
- Around line 24-26: Remove the redundant .button-primary CSS rule that
duplicates the background-color already defined on .button; delete the
.button-primary block (the rule setting background-color:
var(--a2ui-color-primary)) so styling is only defined once on .button and avoid
duplication between .button and .button-primary.
- Around line 14-17: The transition declaration in Button.css currently lists
transform, opacity, and background-color but transform and opacity are unused;
either remove the unused properties from the transition shorthand (leave only
background-color) or add corresponding interactions that actually change
transform/opacity (e.g., :hover/:active rules) so the transitions are
meaningful—update the transition declaration in Button.css (the rule containing
"transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease") and
adjust/remove related hover/active styles accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 287026d5-7152-44b9-96ff-f8eabd52efb9

📥 Commits

Reviewing files that changed from the base of the PR and between 4992874 and b46f2f9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Image/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/styles/catalog/Button.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/theme.css
💤 Files with no reviewable changes (5)
  • packages/genui/a2ui/styles/catalog/luna-dark.css
  • packages/genui/a2ui/styles/catalog/luna-light.css
  • packages/genui/a2ui/styles/catalog/lunaris-light.css
  • packages/genui/a2ui/styles/catalog/luna.css
  • packages/genui/a2ui/styles/catalog/lunaris-dark.css
✅ Files skipped from review due to trivial changes (6)
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/rspeedy-env.d.ts
  • .changeset/soft-tomatoes-wave.md
  • packages/genui/a2ui/src/catalog/Column/index.tsx
🚧 Files skipped from review as they are similar to previous changes (24)
  • packages/genui/a2ui-playground/src/utils/renderUrl.ts
  • packages/genui/a2ui/src/catalog/CheckBox/index.tsx
  • packages/genui/a2ui-playground/src/App.tsx
  • packages/genui/a2ui-playground/src/pages/ComponentsPage.tsx
  • packages/genui/a2ui/src/css.d.ts
  • packages/genui/a2ui/styles/catalog/Column.css
  • packages/genui/a2ui-playground/src/pages/DemosListPage.tsx
  • packages/genui/a2ui/styles/catalog/Image.css
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/render.tsx
  • packages/genui/a2ui/styles/catalog/List.css
  • packages/genui/a2ui/styles/catalog/Row.css
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/styles/catalog/RadioGroup.css
  • packages/genui/a2ui/styles/catalog/Text.css
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/src/pages/DemosPage.tsx
  • packages/genui/a2ui/src/catalog/Text/index.tsx
  • packages/genui/a2ui/styles/catalog/Divider.css
  • packages/genui/a2ui/styles/catalog/Card.css
  • packages/genui/a2ui/styles/catalog/CheckBox.css
  • packages/genui/a2ui/styles/theme.css
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui/src/catalog/Image/index.tsx

Comment thread packages/genui/a2ui-playground/lynx-src/a2ui/index.css
Comment thread packages/genui/a2ui/styles/catalog/Button.css
Comment thread packages/genui/a2ui/styles/catalog/Button.css
@HuJean HuJean enabled auto-merge (squash) May 12, 2026 09:30
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 12, 2026

Merging this PR will improve performance by 17.07%

⚡ 1 improved benchmark
✅ 80 untouched benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
transform 1000 view elements 46.8 ms 40 ms +17.07%

Comparing p/a2ui-theme (5ee4f3a) with main (1e1257e)2

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.

  2. No successful run was found on main (47bb2ff) during the generation of this report, so 1e1257e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React Example

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

5ee4f3a(current) vs 1e1257e main#8075(baseline)

Bundle metrics  no changes
                 Current
#8093
     Baseline
#8075
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 38.18%
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
#8093
     Baseline
#8075
No change  IMG 145.76KiB 145.76KiB
No change  Other 90.75KiB 90.75KiB

Bundle analysis reportBranch p/a2ui-themeProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React Example with Element Template

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

5ee4f3a(current) vs 1e1257e main#341(baseline)

Bundle metrics  Change 2 changes
                 Current
#359
     Baseline
#341
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(-3.7%) 81
No change  Duplicate Modules 23 23
Change  Duplicate Code 40.34%(+0.12%) 40.29%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#359
     Baseline
#341
No change  IMG 145.76KiB 145.76KiB
No change  Other 52.03KiB 52.03KiB

Bundle analysis reportBranch p/a2ui-themeProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React MTF Example

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

5ee4f3a(current) vs 1e1257e main#1206(baseline)

Bundle metrics  no changes
                 Current
#1224
     Baseline
#1206
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 46.17%
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
#1224
     Baseline
#1206
No change  IMG 111.23KiB 111.23KiB
No change  Other 96.23KiB 96.23KiB

Bundle analysis reportBranch p/a2ui-themeProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

Web Explorer

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

5ee4f3a(current) vs 1e1257e main#9648(baseline)

Bundle metrics  Change 2 changes
                 Current
#9666
     Baseline
#9648
No change  Initial JS 45.06KiB 45.06KiB
No change  Initial CSS 2.22KiB 2.22KiB
Change  Cache Invalidation 1.53% 0%
No change  Chunks 9 9
No change  Assets 11 11
No change  Modules 229 229
No change  Duplicate Modules 11 11
Change  Duplicate Code 27.22%(-0.07%) 27.24%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#9666
     Baseline
#9648
Regression  JS 497.1KiB (+0.02%) 497KiB
No change  Other 402.06KiB 402.06KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch p/a2ui-themeProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 12, 2026

React External

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

5ee4f3a(current) vs 1e1257e main#1188(baseline)

Bundle metrics  no changes
                 Current
#1207
     Baseline
#1188
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 40.57%
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
#1207
     Baseline
#1188
No change  Other 693.04KiB 693.04KiB

Bundle analysis reportBranch p/a2ui-themeProject dashboard


Generated by RelativeCIDocumentationReport issue

@HuJean HuJean merged commit f8a3cbd into main May 12, 2026
81 of 85 checks passed
@HuJean HuJean deleted the p/a2ui-theme branch May 12, 2026 12:06
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