Skip to content

Wrap button and option text when content overflows#12

Open
masnwilliams wants to merge 2 commits into
mainfrom
hypeship/wrap-button-text
Open

Wrap button and option text when content overflows#12
masnwilliams wants to merge 2 commits into
mainfrom
hypeship/wrap-button-text

Conversation

@masnwilliams
Copy link
Copy Markdown
Contributor

@masnwilliams masnwilliams commented May 14, 2026

Summary

  • .kma-button used white-space: nowrap plus a fixed height, so long
    MFA / SSO / sign-in option labels overflowed the card on narrower
    viewports.
  • Switched to min-height and overflow-wrap: anywhere so labels wrap
    and the row grows to fit. Also added padding + min-width: 0 on
    .kma-sso-button so its label can shrink.
  • Extended two mock MFA options in the demo (States tab → Awaiting Input — MFA only)
    with longer labels so the wrapping case is visible while scrubbing.

Before / After

Viewport 460x750, Statesawaiting_input_mfa. The long totp label
("Get a verification code from the Google Authenticator app") clipped
past the card on the right in the old build and now wraps cleanly to two
lines inside the row.

Test plan

  • bun run --filter '@onkernel/managed-auth-react' typecheck
  • bun run --filter '@onkernel/managed-auth-react' build
  • bun run format:check
  • Manual: demo at 460px wide, every mfaOptions row now wraps inside the card

Note

Low Risk
Low risk styling-only changes that adjust button sizing/wrapping; main risk is minor visual layout shifts across consumers.

Overview
Prevents long MFA/SSO labels from overflowing narrow viewports by switching buttons from fixed height to min-height and enabling text wrapping via overflow-wrap: anywhere (removing white-space: nowrap).

Tweaks SSO button layout to better accommodate wrapping (padding and new .kma-sso-button__label { min-width: 0; }), extends demo MFA mock labels to exercise the wrap case, and adds a vercel.json to build the library + demo with Bun.

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

The shared `.kma-button` rule used `white-space: nowrap` + a fixed
height, so long MFA/SSO/sign-in option labels (e.g. "Get a verification
code from the Google Authenticator app") overflowed the card. Switch
buttons to `min-height` and `overflow-wrap: anywhere` so labels wrap and
the row grows to fit. Extend two demo MFA options with longer labels so
the wrapping case is exercised when scrubbing through States.
@masnwilliams masnwilliams marked this pull request as ready for review May 15, 2026 14:23
@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR modifies UI styling in managed-auth-react package, not kernel API endpoints or Temporal workflows as specified in the filter.

To monitor this PR anyway, reply with @firetiger monitor this.

Configures Vercel to build the library before the demo app and
output from packages/demo/dist, so workspace:* dependency resolves
correctly in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
managed-auth-react-demo Ready Ready Preview, Comment May 15, 2026 2:28pm

gap: 8px;
padding: 0 1rem;
height: 3rem;
min-height: 3rem;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Text wrapping with overflow-wrap: anywhere does not work reliably on inline-flex containers without explicit width constraints

Fix on Vercel

Comment thread vercel.json
@@ -0,0 +1,6 @@
{
"buildCommand": "bun run --filter @onkernel/managed-auth-react build && cd packages/demo && bun run build",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
"buildCommand": "bun run --filter @onkernel/managed-auth-react build && cd packages/demo && bun run build",
"buildCommand": "bun run --filter @onkernel/managed-auth-react build && (cd packages/demo && bun run build)",

The buildCommand in vercel.json fails when trying to execute cd packages/demo after bun run --filter @onkernel/managed-auth-react build, causing the Vercel build to fail with "No such file or directory"

Fix on Vercel

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