Repository navigation
fix(native-chat): wrap long translated placeholders in the agent setup prompt - #37546
Conversation
The placeholder float had margin-right:-100% and no width, so it could reach 200% of the paragraph before wrapping and overflowed in French and German. width:100% wraps it at the paragraph, and its margin box stays zero-wide so the caret line does not move.
|
No actionable comments were generated in the recent review.
|
Resolve conflicts with stablyai#37409, stablyai#37546, stablyai#37724 and stablyai#38082. Main's publishClaudeTurnActivity now owns turn activity, so the transient publications class keeps only prompt suggestions (ClaudePromptSuggestions). Count suggestion publications separately in the status-feed test: Claude's first turn clears any suggestion the host retained from a previous launch.
ELI5
In French and German, the hint in the empty prompt box of an agent's setup panel ran off the side and got cut off. It now wraps onto a second line and the box grows to fit.
What Changed
Before: the French hint stayed on one line, was clipped at "… / pour les sk", and a horizontal scrollbar appeared under it. German overran the same way once the panel got narrower, and so did English in a narrow window.
After: the hint wraps inside the box in every language and the box grows to fit it, with no horizontal scrollbar.
The hint is a floated
::beforewithmargin-right: -100%and no width. That negative margin makes the float's available width 200% of the paragraph, so it could reach twice the paragraph's width before wrapping. Addingwidth: 100%makes it wrap at the paragraph. Its margin box is still zero wide, so the empty line and caret stay where they were.Why
The ticket's measurement (
scrollWidth437 againstclientWidth376 in French) came straight back on main, and it comes from the float's width rule, so that's the rule I changed. Dropping the negative margin would also wrap the text, but the float would then take up the whole line and push the caret below it. Only the launch prompt's class changes. The placeholder rule inNativeChatPromptEditoris shared with the ordinary chat composer, which has to keep its zero-height float.Linked Issue
Fixes STA-13245
Visual Proof
Empty, blurred prompt, before and after:
Testing
Ran on macOS in a hidden dev build over CDP, through the real + menu and the agent's › setup panel. French, German and English at full width, 620 px and 420 px windows. Blurred, focused, typing and cleared states were measured for each.
clientWidth/scrollWidth, blurred::beforeis still auto width and 0 px tall, and doesn't get the new class.Focused tests for the composer and setup panel pass (13 files, 176 tests).
No automated test added. The unit tests run in happy-dom, which has no layout, so a test could only assert the class string, and that would still pass with a different broken layout rule.
Risk
Low. It's one CSS class on the setup panel's prompt. If it went wrong, the empty hint in that box would be laid out badly; typed prompts have no placeholder, and other composers don't get the class. Nothing crosses to saved data, paired phones or SSH hosts. A plain revert backs it out. Only tested on macOS; the ticket's numbers came from Windows, and the rule is plain CSS with no platform branch.
Level: Low
AI Disclosure
Review
Codex and a separate reviewer each read the diff once. Neither had findings.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Renderer CSS only. Security, SSH, mobile, compatibility and performance aren't affected.
A separate bug, on main too and not fixed here: with the empty prompt focused, the first press of a Launch button does nothing. Pressing blurs the editor, the composer's controls row hides, the footer moves up 34 px and the release misses the button. A second press works.
#37107 touches the same class line, so whichever lands second needs a small rebase.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)