Repository navigation
fix(bots): wrap the Runs on line in Import so a long computer name stays inside the dialog - #48454
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
…ays inside the dialog The folded "Runs on <computer> with <agent>" row in Import from another app was a no-wrap flex row, and the computer name span could not shrink below its longest word. A long name pushed "with <agent>" under the Change button and past the dialog edge. Let the row wrap between its parts (flex-wrap, gap-x-1.5 so wrapped lines keep normal line height) and cap the name at the row width with wrap-anywhere so a name wider than the row breaks inside it. Fixes stablyai#48453
dd11f49 to
e836ef4
Compare
ELI5
In Import from another app, the dialog shows a line like "Runs on (your computer) with (your agent)". If the computer has a long name, that line could not wrap, so the agent's name slid under the Change button and out of the dialog. Now the line wraps like a normal sentence, and a very long name breaks inside the box. A short name looks exactly the same as before.
What Changed
src/renderer/src/components/bots/BotRunsOnPicker.tsx: class names only, on two spans of the foldedrowvariant (onlyImportBotDialogrenders it).flex min-w-0 items-center gap-1.5), and the computer-name span (inline-flex, no break rule) could not shrink below its longest word. With a long, unbroken name the row overflowed its column, so "with " was drawn under theshrink-0Change button and past the dialog's right edge (a 64-character name made the dialog scroll sideways). Mid-length names squeezed "Runs on" and the agent into stacked words.flex-wrapandgap-x-1.5(column gap only, so wrapped lines keep normal line height), so the sentence breaks between its parts. The name span getsmax-w-full wrap-anywhere, so a name wider than the whole row breaks inside the row instead of overflowing.Why
A computer's name has no length limit (Rename host, or a paired server's own name), and with a long one "with" and the agent were unreadable under Change. The account span in the same row already breaks (
min-w-0 break-all); the name had nothing. Alternatives that only addmin-w-0 wrap-anywhereto the name split 12 to 20 character names mid-word where main shows them whole;flex-shrinktricks still overflowed or needed a pseudo-element and a magic number. Letting the row wrap is the smallest change that never hides a name main showed whole.Linked Issue
Fixes #48453
Visual Proof
Component fixture of
ImportBotDialog, dark theme, computer name set throughhostSettingOverrides.local.displayLabel.448px dialog,
build_server_production_eu_west_01(33 characters)328px dialog (narrow window), 64-character name with no break point
448px dialog, default
Local Mac(unchanged)Testing
Reproduced on main with a scratch component fixture (not committed) rendering
ImportBotDialogin 448px and 328px dialogs with default, spaced, hyphenated, CJK, URL-like, 11/17/22/33/64-character names, folded and expanded. Shots taken withpnpm fixtures:shot(headless fixture server). On main 6 of 8 measured cases overflowed (33 characters at 448px overflowed by 27px and overlapped Change; 64 characters overflowed by 380px). With the fix all cases have zero overflow, no overlap with Change, and no sideways scroll; the defaultLocal Macrow is identical to main (one 36px line).The contributor's dev-build sweep (1,446 states across 1280/620/360px windows) found every row that fit on one line on main pixel-identical, and all 461 overflowing states fixed.
vitestonNewBotDialog.test.tsxandbot-presentation.test.ts(thefieldsvariant of the same picker) pass;oxlint,oxfmt --check, the anti-slop and code-quality oxlint configs,ast-grep, and the changed-code quality gate are clean.Platforms: macOS (fixture rendering). Class names only, 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: this is layout only, which jsdom cannot measure and the test anti-patterns guide says not to unit test.
Performance
None, because this only changes Tailwind class names on two spans in one row of a modal dialog that renders while Import is open: no JS, effects, I/O, IPC or polling, and the component tree is unchanged.
Risk
Level: Low
One file, class names only. The riskiest part is mid-length names (about 12 to 20 characters) where main already stacked words: "with " now moves to a second line instead, so the row can be 20 to 40px taller. Connectors like "with" or ", as" can start a wrapped line, and a multi-line name's icon is vertically centered on the block. A row that fits on one line is unchanged. A plain revert backs it out.
Review
runsOnrenders only in therowvariant used byImportBotDialog;NewBotDialogusesvariant="fields"and is unaffected. The account span is untouched.wrap-anywhereis already used elsewhere in the renderer (Tailwind 4).Agent skill upstream boundary
Notes
Fix by @akira-fukue; this branch was rebased as a single commit on current main with their authorship kept. Pre-existing and out of scope: the
imported before as <long name>subtitle inImportBotSourceListcan still overflow (noted in #48308).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Ran targeted vitest, oxlint, oxfmt and CI's static gates on the touched file; full typecheck/test/build left to CI.