Skip to content

fix(bots): keep Cancel inside the Import dialog when the bot name is long - #48308

Merged
nwparker merged 1 commit into
stablyai:mainfrom
akira-fukue:fix/bot-import-long-name-footer
Nov 24, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
akira-fukue:fix/bot-import-long-name-footer

Conversation

@akira-fukue

@akira-fukue akira-fukue commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When you import a bot with a long name, the big "Create " button grew so wide that it pushed the Cancel button off the side of the dialog, so you could not back out. Now the button shortens its label with "…" when space runs out, and Cancel always stays visible. Short names look exactly the same as before.

What Changed

src/renderer/src/components/bots/ImportBotDialog.tsx, class names only.

  • Before: in Bots > New bot > Import from another app, the primary button reads Create {name} or Update {bot}. Button is shrink-0 whitespace-nowrap, and the footer is a right-aligned flex row in a 448px dialog. With a name of about 30+ characters (the field allows 64), the button got wider than the footer, and the hint and Cancel ended up off the dialog's left edge. Below the 640px sm breakpoint (the footer stacks), a wide 64-character CJK name overflowed both sides.
  • After: both primary buttons get max-w-full min-w-0 shrink, with the label in a truncate span, so the label ends in an ellipsis instead of overflowing. max-w-full also clamps the button in the stacked layout. The two hint spans (Add its folder / remote-host hint, and Keys and logins stay behind) get max-w-max flex-1: when the row fits they fill exactly the space main gave them, so the layout matches main to the pixel; when main would overflow, the hint stops at its min-content and only the button shrinks.

Why

With a long name there was no Cancel to click. Truncating keeps the name in the button (it is deliberate here) and the full name is still visible in the Name input right above it; the button's accessible name is unchanged since truncation is CSS only. A width floor on the hint (for example min-w-1/3 wrap-anywhere) was measured and rejected: it truncated Create {name} for 18 to 34 character names that main shows whole.

Linked Issue

Fixes #48307

Visual Proof

Headless component fixture of the dialog (1280px viewport unless noted). Name: Customer Support Escalation Assistant for the Billing Team 2026.

Long name, no bots found

Before After
Before: Cancel and hint pushed off the dialog After: Cancel stays, label truncated

Update for a long-named bot imported before

Before After
Before: Cancel off the dialog After: Cancel stays, Update label truncated

Stacked footer (620px), 64-character CJK name

Before After
Before: button overflows both sides After: button clamped to the dialog

Short name Molty (unchanged)

Before After
Before: short name After: identical layout

Testing

Reproduced on main with a scratch component fixture (not committed) rendered headlessly and measured with Playwright against the dialog bounds (dialog x 152..600 at 1280px, 32..620 stacked):

state main this PR
short name Molty hint 177..253, Cancel 386..457, button 465..575 identical (footer pixel-identical)
long name, no bots hint -53..-20, Cancel -12..59 (off dialog) hint 177..210, Cancel 218..289, button 297..575 truncated
long CJK name Cancel -86..-15 Cancel 218..289, button 297..575 truncated
Hermes bot picked, long name Cancel -12..59 Cancel 223..294, button 302..575 truncated
Update, long bot name Cancel -15..55 Cancel 177..248, button 256..575 truncated
stacked 620px, 64-char CJK button -128..780 button 57..595 truncated

A wider sweep (names of 0 to 63 characters, the remote-host hint, 1280/620/360px) matched main to the pixel wherever main fit, and kept every footer item inside the dialog where main overflowed. Tested on macOS (headless Chromium); the change is CSS only with no platform branch.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

No unit test: layout-only change, which the test anti-patterns guide says not to unit test. NewBotDialog.test.tsx passes; oxlint, oxfmt, anti-slop, native code-quality, ast-grep and the changed-code quality gate are clean.

Performance

None, because this only changes Tailwind classes on four elements of a modal dialog footer: no JS, effects, I/O or polling. Measured forced reflow of the footer stays within noise (about 0.02 ms on main vs 0.023 to 0.034 ms here).

Risk

Level: Low

One file, class names only. The riskiest part is the hint: with a long name it is squeezed to its longest word (the same width main squeezed it to). A host label with no break point wider than about 313px still overflows, exactly as on main. A plain revert backs it out.

Review

  • Cross-platform: class names only, no platform branch, shortcut or path.
  • SSH/remote: no host code touched; the remote-host hint state was measured.
  • Mobile: mobile/src/bots/MobileBotImportSheet.tsx is a separate sheet and is unaffected.
  • DialogFooter and Button are unchanged, so other dialogs are unaffected.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Original fix by @akira-fukue in #48308; the button truncation is theirs, and the hint sizing and stacked-layout clamp were adjusted in review. Pre-existing and out of scope: the imported before as <long name> subtitle in ImportBotSourceList can overflow the dialog's right edge.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The import dialog footer now constrains the width of its notices and allows the Update and Create button labels to truncate. Button enablement and click actions remain unchanged.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 5f707

This change keeps Cancel and the hint visible in the Import dialog when a bot name is long, by truncating the primary button label. It is a layout-only change with no behavioral logic changes, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Issue #48307 requires that a long name cut the Create {name} label with an ellipsis, while Cancel and the hint stay visible. At the reviewed head, src/renderer/src/components/bots/ImportBotDialog.tsx …
Out of Scope Changes check Passed The changes at the reviewed head are limited to class names on the footer's hint spans and the two primary buttons in ImportBotDialog.tsx. Every changed element belongs to the footer of the dialog nam…
Title check Passed The title names the fix and its scope: keeping the Cancel button inside the Import dialog when the bot name is long. The raw summary confirms the change to the footer and primary button classes in Imp…
Description check Passed The description follows the template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #48307), Visual Proof with before/after images, Testing with a measurement table and checkboxes, Perfo…
Full details: Linked Issues check

Explanation

Issue #48307 requires that a long name cut the Create {name} label with an ellipsis, while Cancel and the hint stay visible. At the reviewed head, src/renderer/src/components/bots/ImportBotDialog.tsx sets both primary buttons (Update {{bot}} and Create {{name}}) to max-w-full min-w-0 shrink, and wraps each label in a &lt;span className="truncate"&gt;. The span has overflow hidden, so it can shrink below its text width and show an ellipsis. Cancel keeps the Button base shrink-0 whitespace-nowrap, so it is not compressed. The hint spans use mr-auto max-w-max flex-1 and can shrink, but they remain in the footer and wrap instead of leaving the dialog. The PR text describes a different hint class set (shrink-0 with max-w-3/5). That description does not match the code at head, so the code is the basis for this verdict. The rendered layout was not independently measured. The author's macOS measurements support the mechanism but were not re-run here. No automated test covers the layout; the issue does not require one.

Full details: Out of Scope Changes check

Explanation

The changes at the reviewed head are limited to class names on the footer's hint spans and the two primary buttons in ImportBotDialog.tsx. Every changed element belongs to the footer of the dialog named in #48307. No unrelated logic changed: button enablement, click handlers, and create/update behavior are unchanged in the file. The PR description's claim of a max-w-3/5 hint cap and shrink-0 on the hint does not appear in the code at head. This is a description accuracy issue, not an out-of-scope change.

Full details: Title check

Explanation

The title names the fix and its scope: keeping the Cancel button inside the Import dialog when the bot name is long. The raw summary confirms the change to the footer and primary button classes in ImportBotDialog.tsx, so the title matches the main change. It is 73 characters, a little long but within normal range.

Full details: Description check

Explanation

The description follows the template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #48307), Visual Proof with before/after images, Testing with a measurement table and checkboxes, Performance, Risk with level, Review, Agent skill upstream boundary, Notes, and Checklist. The AI Disclosure section is left blank, which the template allows for internal contributors, and the author does not say whether they are internal. The Performance line is complete. The main gap is that the Visual Proof section relies on headless fixture images rather than a live-app capture, but it is still a before/after comparison as the template asks.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0114dde-1482-41d3-b24a-748a9bd31179
Commits

Reviewing files that changed from the base of the PR and between 61b0474 and 5f707e9.

Files selected for processing: 1

  • src/renderer/src/components/bots/ImportBotDialog.tsx
Files skipped from review as they are similar to previous changes: 1

  • src/renderer/src/components/bots/ImportBotDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bed54711-4256-405b-974a-c1b4be590b84
Commits

Reviewing files that changed from the base of the PR and between 2982744 and baba448.

Files selected for processing: 1

  • src/renderer/src/components/bots/ImportBotDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…long

The Import dialog's primary button reads "Create {name}" or "Update {bot}".
Button is shrink-0 and whitespace-nowrap, so with a name of about 30+
characters it grew wider than the footer and pushed the hint and Cancel off
the dialog's left edge.

Both primary buttons now get max-w-full min-w-0 shrink with the label in a
truncate span, so the label ends in an ellipsis instead of overflowing, and
max-w-full keeps the button inside the stacked footer below 640px. The hint
spans get max-w-max flex-1, so when the row fits the layout matches main
exactly and only the button shrinks once it would overflow.

Fixes stablyai#48307

Co-authored-by: Neil <[email protected]>
@nwparker
nwparker force-pushed the fix/bot-import-long-name-footer branch from 61b0474 to 5f707e9 Compare November 24, 2026 14:49
@nwparker nwparker changed the title fix(bots): keep Cancel in the Import dialog when the bot name is long fix(bots): keep Cancel inside the Import dialog when the bot name is long Nov 24, 2026
@nwparker
nwparker merged commit cd5c7e7 into stablyai:main Nov 24, 2026
55 of 56 checks passed
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.

[Bug]: A long bot name pushes Cancel out of the Import from another app dialog

2 participants