Skip to content

chore: standardize button and icon button primitives - #537

Open
harshil-2096 wants to merge 3 commits into
mainfrom
chore/hv/button-with-variants
Open

chore: standardize button and icon button primitives#537
harshil-2096 wants to merge 3 commits into
mainfrom
chore/hv/button-with-variants

Conversation

@harshil-2096

@harshil-2096 harshil-2096 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add compound Button and IconButton APIs
  • Require explicit Primary, Secondary, Ghost, or Destructive variants
  • Standardize sizes to small, medium, and large
  • Migrate all existing button usages
  • Remove legacy button class helpers and aliases

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Large, UI-wide refactor with a breaking public Button/IconButton contract for package consumers; behavior should be equivalent but visual edge cases are possible where custom classNames replaced old icon sizing.

Overview
Introduces a public compound API for Button and IconButton in @truefoundry/trueforge-ui: callers must use Button.Primary, .Secondary, .Ghost, or .Destructive (and matching IconButton.*) instead of a single <Button variant="…" />. Sizes are renamed to small, medium, and large; icon-only controls rely on size="small" plus aspect-square / px-0 overrides where needed.

The auiButtonClass helper is removed; styling lives in the primitives. Every in-package usage (atoms, layouts, settings, composer, tool approval, etc.) is migrated to the new API. outline / default variants are folded into Primary or Secondary as appropriate.

Docs, README exports table, changeset (minor), and tests are updated—including compound variant coverage and a reasoning-effort selector assertion for selected-option hover styling.

Reviewed by Cursor Bugbot for commit c59ea8e. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c59ea8e

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

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge-ui Minor

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 04f194f. Configure here.

Comment thread packages/trueforge-ui/src/containers/SettingsBuilder/index.tsx
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.

1 participant