Skip to content

feat(Badge): support a button after the text - #3049

Open
Lisa18289 wants to merge 8 commits into
nextfrom
claude/badge-button-after-text-0e8248
Open

feat(Badge): support a button after the text#3049
Lisa18289 wants to merge 8 commits into
nextfrom
claude/badge-button-after-text-0e8248

Conversation

@Lisa18289

Copy link
Copy Markdown
Member

A Button, CopyButton, Action, ContextualHelpTrigger or ModalTrigger placed in the badge content now renders at the end of the badge, shaped and colored exactly like the onClose icon. With both, the close icon stays rightmost. The actual use case is a ContextualHelpTrigger.

Buttons reach that spot through a tunnel, the same way Label and Heading handle theirs. Triggers move along with their button: tunneling only the button would mount it outside the trigger, where it no longer gets its press behavior.

Verification: browser tests cover the DOM order, the geometry against the close button, and that action, modal and contextual help still fire from inside the badge. The visual suite has a new Badge actions scenario; the existing badge baselines are untouched, so badges without a trailing button render exactly as before.

Needs the update-screenshots label — the new scenario only has -darwin baselines so far.

🤖 Generated with Claude Code

@Lisa18289 Lisa18289 self-assigned this Sep 1, 2026
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6495 for commit 380c730 by the Vitest Coverage Report Action

@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
@Lisa18289
Lisa18289 force-pushed the claude/badge-button-after-text-0e8248 branch from 900bd51 to 380c730 Compare September 1, 2026 09:46
@Lisa18289
Lisa18289 changed the base branch from main to next September 1, 2026 09:46
@Lisa18289
Lisa18289 force-pushed the claude/badge-button-after-text-0e8248 branch from 380c730 to 6dd9054 Compare September 1, 2026 09:52
A Button, CopyButton, Action, ContextualHelpTrigger or ModalTrigger in the
badge content is moved to the end of the badge and rendered like the onClose
icon. With both, the close icon stays rightmost.

Triggers move along with their button — a button tunneled out on its own mounts
outside the trigger and loses its press behavior.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lisa18289
Lisa18289 force-pushed the claude/badge-button-after-text-0e8248 branch from 6dd9054 to f340da9 Compare September 1, 2026 09:53
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3049.docs.review.flow-components.de
storybook pr-3049.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3049
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3049

@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
github-actions Bot and others added 3 commits September 1, 2026 11:11
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
The badge does not remove itself — onClose renders the X and calls the handler,
which decides what happens.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The two cases that carry the feature — a button after the text, with and
without the close icon — move into "Badge colors", so every color and both
alpha variants cover them. Drops the separate "Badge actions" scenario.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Sep 1, 2026
github-actions Bot and others added 4 commits September 1, 2026 11:55
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
Matches the "Mit Button" section it sits under.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The screenshots cover what the trailing button looks like and where it sits, in
every color. What is left asserts the wiring: a button leaves the content, and
action, modal and contextual help still fire from inside the badge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
WithContextualHelp shows the trailing button; the close icon has its own story.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lisa18289
Lisa18289 marked this pull request as ready for review September 1, 2026 12:09
@Lisa18289
Lisa18289 requested a review from a team September 1, 2026 12:09
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