Skip to content

fix(ui): correct light-theme UI primitive rendering and storybook coverage (#303) - #309

Draft
deamybro wants to merge 1 commit into
GoodDollar:mainfrom
deamybro:fix/ui-primitives-light-theme-303
Draft

deamybro wants to merge 1 commit into
GoodDollar:mainfrom
deamybro:fix/ui-primitives-light-theme-303

Conversation

@deamybro

@deamybro deamybro commented Nov 11, 2026 •

Copy link
Copy Markdown

Summary

Fixes #303. Resolves the shared UI primitive rendering and theme resolution bugs identified in @goodwidget/ui during the Storybook-to-Penpot pass, ensuring full parity and readability across both Light and Dark themes.

Changes by Item

  1. Non-primary Button labels render white in Light:

    • In packages/ui/src/components/Button.tsx, stopped ButtonFrame from imposing the light_Button sub-theme onto non-primary variants.
    • Bound theme="Button" exclusively to primary buttons (variant === 'primary'). Non-primary variants (secondary, outline, ghost, pill, text, list) now inherit ambient theme text color directly.
    • Made ButtonText variant-aware (primary: $textColor, non-primary: $color), ensuring high-contrast readable text in both Light (#333333) and Dark (#E0E0E0) themes.
    • Added textColor to base light and dark themes in packages/ui/src/theme.ts for consistent token resolution.
  2. CircularActionButton hardcoded $grey600:

    • In packages/ui/src/components/CircularActionButton.tsx, replaced hardcoded $grey600 for both the disabled/pending label and the spinner with semantic theme token $colorDim. Adapts dynamically to Light (#555555) and Dark (#888888).
  3. Horizontal Separator 0px height clamp:

    • In packages/ui/src/components/Separator.ts, overridden Tamagui's native horizontal maxHeight: 0 clamp with maxHeight: 'none' and explicit height/minHeight/maxHeight per size variant (sm: 1px, md: 2px, lg: 4px), allowing horizontal dividers to render visibly. Checked and preserved vertical mode (vertical: true).
  4. TokenAmount empty (0x0) spans in Light:

    • In packages/ui/src/components/TokenAmount.tsx, replaced non-existent $text token with $color on TokenAmountText.
    • Replaced $secondaryColor with $placeholderColor for the secondary variant.
  5. Streaming widget inputs falling back to browser defaults:

    • In packages/ui/src/components-test/Input.tsx, added placeholderTextColor: '$placeholderColor' to InputFrame so input placeholders resolve cleanly against the theme instead of browser-default grey (#757575).
    • In packages/ui/src/components-test/Select.tsx, added borderWidth: 0, borderColor: 'transparent', and outlineWidth: 0 to OptionItem to remove the default 2px outset button border.

Relation to #255 / #291

Storybook Coverage

  • Added examples/storybook/src/stories/design-system/Button.stories.tsx covering all 7 button variants across Light and Dark themes side-by-side.
  • Added examples/storybook/src/stories/design-system/Separator.stories.tsx covering all horizontal sizes, colors, and vertical orientation.
  • Extended examples/storybook/src/stories/design-system/TokenAmount.stories.tsx with dedicated LightTheme and DarkTheme stories.

Verification

  • pnpm --filter @goodwidget/ui lint: PASS (0 errors)
  • pnpm --filter @goodwidget/ui build: PASS (100% clean tsup build, ESM + CJS + DTS)
  • Git line endings: Strictly preserved LF (core.autocrlf false) with zero noise diffs.

Payout Coordinates: 0x759797593fed8f313d8fdba7a3a0d491f0e4b9f7 (USDC on Base L2)

Summary by Sourcery

Fix theme-aware rendering across shared UI primitives and expand Storybook coverage for light and dark themes.

Bug Fixes:

  • Correct light- and dark-theme rendering for buttons, circular action buttons, separators, token amounts, and form controls.
  • Fix horizontal separator sizing so dividers render visibly while preserving vertical separators.
  • Replace invalid or hardcoded color tokens with theme-aware values for readable, consistent UI primitives.

Enhancements:

  • Ensure primary buttons use their component theme while non-primary variants inherit readable ambient theme colors.
  • Add Storybook coverage for button variants, separator configurations, and token amounts across light and dark themes.

Tests:

  • Expand Storybook design-system coverage with light/dark theme stories for buttons, separators, and token amounts.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review could not proceed because the required external GoodDollar contribution guidelines could not be retrieved with the available tools.

No open issues 🎉

What changed in this PR

Updates shared @goodwidget/ui primitives to address the light/dark rendering issues in #303, complementing the streaming-widget theme changes in #291.

Changes:

  • Adjusts button theme selection and semantic text colors for buttons and token amounts.
  • Updates separator sizing, input placeholder colors, and select option styling.
  • Adds light/dark Storybook coverage for buttons, separators, and token amounts.
File Description
packages/​ui/​src/​theme.ts Adds textColor fields to base and component themes.
packages/​ui/​src/​components/​TokenAmount.tsx Changes primary and secondary text color tokens.
packages/​ui/​src/​components/​Separator.ts Overrides horizontal height clamps and adjusts vertical constraints.
packages/​ui/​src/​components/​CircularActionButton.tsx Uses semantic colors for disabled/pending labels and spinners.
packages/​ui/​src/​components/​Button.tsx Changes frame theme selection and adds variant-aware label styles.
packages/​ui/​src/​components-test/​Select.tsx Removes default option borders and outlines.
packages/​ui/​src/​components-test/​Input.tsx Adds a themed placeholder color.
examples/​storybook/​src/​stories/​design-system/​TokenAmount.stories.tsx Adds dedicated light and dark amount stories.
examples/​storybook/​src/​stories/​design-system/​Separator.stories.tsx Adds stories for sizes, colors, and orientations in both themes.
examples/​storybook/​src/​stories/​design-system/​Button.stories.tsx Adds all-variant stories and a side-by-side theme comparison.

Review effort: Balanced

@L03TJ3

L03TJ3 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Please make yourself and your possible agent aware of our contribution guidelines: https://github.com/GoodDollar/.github/blob/master/CONTRIBUTING.md

and verify if your submissions has followed the rules, not only for this PR, the others as well

@deamybro
deamybro marked this pull request as draft November 13, 2026 21:06
@deamybro

Copy link
Copy Markdown
Author

Thank you @L03TJ3 for pointing this out. We have reviewed the updated GoodDollar contribution guidelines and payment rules in full and are aligning our submissions accordingly:

  • Converted this PR to Draft per Section 3 pending lead confirmation and review checklists.
  • Verified that all automated lint (0 errors) and build suites pass cleanly.
  • Fully acknowledged the Gardens OS Contributors Pool structure and contribution gates.

We appreciate the guidance and are committed to adhering strictly to the repository standards.

…verage (GoodDollar#303)

Fixes GoodDollar#303

- packages/ui/src/components/Button.tsx:
  * Stop non-primary variants from re-entering light_Button sub-theme.
  * Add variant-aware coloring to ButtonText (primary: $textColor; non-primary: $color).
  * Only bind 'Button' component theme to primary buttons so non-primary variants render readable dark text in Light.
- packages/ui/src/components/CircularActionButton.tsx:
  * Replace hardcoded $grey600 with $colorDim for pending/disabled label and spinner to adapt to light/dark themes.
- packages/ui/src/components/Separator.ts:
  * Add maxHeight: 'none' and explicit height/minHeight/maxHeight to prevent Tamagui's horizontal maxHeight: 0 clamp from collapsing dividers to 0px.
- packages/ui/src/components/TokenAmount.tsx:
  * Replace unresolved $text token with $color.
  * Replace $secondaryColor with $placeholderColor.
- packages/ui/src/components-test/Input.tsx & Select.tsx:
  * Add placeholderTextColor: '$placeholderColor' to InputFrame.
  * Add borderWidth: 0 and outlineWidth: 0 to OptionItem in Select to remove browser 2px button outset border.
- packages/ui/src/theme.ts:
  * Add textColor to base light/dark themes for consistent token resolution.
- examples/storybook/src/stories/design-system/:
  * Add Button.stories.tsx covering all variants across Light and Dark.
  * Add Separator.stories.tsx covering horizontal sizes and vertical mode.
  * Add LightTheme and DarkTheme coverage to TokenAmount.stories.tsx.

Payout: 0x759797593fed8f313d8fdba7a3a0d491f0e4b9f7 (USDC on Base L2)

This branch is waiting to be deployed

1 waiting deployment
external — 84c2e7ff Waiting Nov 27, 2026 by sourcery-ai[bot] via authorize-gooddata-web-preview #279
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.

[Patch] UI primitives: Light-theme label/colour bugs found during Storybook-to-Penpot pass

3 participants