Skip to content

fix(native-chat): wrap long translated placeholders in the agent setup prompt - #37546

Merged
AmoabaKelvin merged 1 commit into
mainfrom
fix/launch-placeholder-wrap
Nov 2, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
fix/launch-placeholder-wrap

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 0

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 ::before with margin-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. Adding width: 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 (scrollWidth 437 against clientWidth 376 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 in NativeChatPromptEditor is 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:

Before After
French, wide window (screenshot removed: contained real product data) (screenshot removed: contained real product data)
French, 620 px window (screenshot removed: contained real product data) (screenshot removed: contained real product data)
German, 620 px window (screenshot removed: contained real product data) (screenshot removed: contained real product data)

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.

Editor clientWidth / scrollWidth, blurred Before After
French, wide 376 / 437 376 / 376
German, 620 px 291 / 371 291 / 291
English, 620 px 291 / 308 291 / 291
German, 420 px 365 / 371 365 / 365
  • English at full width stays one line, 28 px, same as before.
  • Focusing and clearing keep the wrapped hint with no overflow. Clearing returns to the same height as before typing.
  • Typed prompts grow as before: 68 px at full width and 108 px in the 620 px window, in all three languages, with or without the fix.
  • Pressing on the hint's second line, which sits outside the paragraph box, still focuses the editor, and the caret and typed text land at the start of the paragraph.
  • Launch chat and Launch terminal both start from the panel.
  • The ordinary chat composer's ::before is 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.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

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

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

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

  • 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)

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

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: 8b0dd9d8-9e2e-40b3-b2d9-ce73c2efd54d
Commits

Reviewing files that changed from the base of the PR and between aab098f and a230c9c.

Files selected for processing: 1
  • src/renderer/src/components/native-chat/NativeChatComposerField.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.

Walkthrough

The empty launch-prompt placeholder now applies before:w-full to its pseudo-element. The existing negative right margin remains. The comment now describes the paragraph-wide float and its zero-width margin box.

Merge Risk: Minimal · up to a230c

This localized layout fix is ready to merge with no identified actionable risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: wrapping long translated placeholders in the agent setup prompt.
Description check Passed The description is complete and focused. It includes the user impact, implementation details, rationale, linked issue identifier, before-and-after visual proof, testing results, risk assessment, AI di…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and focused. It includes the user impact, implementation details, rationale, linked issue identifier, before-and-after visual proof, testing results, risk assessment, AI disclosure section, compatibility notes, and checklist completion.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • 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

@AmoabaKelvin
AmoabaKelvin merged commit 1629dc4 into main Nov 2, 2026
41 checks passed
mreinhofferxd-pixel pushed a commit to mreinhofferxd-pixel/orca that referenced this pull request Nov 5, 2026
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.
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