Skip to content

fix(web-ui): prevent long model names from clipping composer Harness picker on mobile - #1278

Merged
iruriQ merged 1 commit into
mainfrom
fix/issue-1260
Nov 27, 2026
Merged

iruriQ merged 1 commit into
mainfrom
fix/issue-1260

Conversation

@iruriQ

@iruriQ iruriQ commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1260.

On narrow mobile viewports (390×844 and 360px), selecting a long model name (such as Claude Code's Default (recommended) or Pi's codex / gpt-5.6-luna) caused the model selector in the bottom composer toolbar to resist shrinking and push the adjacent HarnessSelect icon button past the right edge of .controlScroll into the send-button area (clipping it to a sliver or hiding it entirely).

Root Cause

  1. In InputBar.module.css, .row[data-phone-toolbar] .standardControls was locked to flex: none; width: max-content, preventing the right-side control group from shrinking inside .controlScroll when sibling controls (PermissionSelect, VoiceInput, FastToggle, HarnessSelect) competed for horizontal space.
  2. In ModelSelect.module.css, :global([data-phone]) .trigger set max-width: none and :global([data-phone]) .triggerLabel set flex-shrink: 0; max-width: 100px, preventing the model label from shrinking below 100px when the row became tighter than the full unshrunk control width.

Changes

  • apps/web-ui/packages/client/ui-model-selection/src/client/ModelSelect.module.css:
    • Explicitly mark .root as flex: 0 1 auto; min-width: 0.
    • Under :global([data-phone]), constrain .trigger with max-width: 100% and change .triggerLabel from flex-shrink: 0 to flex: 0 1 auto; min-width: 0; max-width: 100px so long model names truncate smoothly with ellipsis up to the existing 100px ceiling while yielding space on narrow rows.
  • apps/web-ui/packages/client/ui-model-selection/src/client/HarnessSelect.module.css:
    • Give .controls flex: 0 1 auto; min-width: 0; max-width: 100% so the wrapper shrinks around ModelSelect while keeping HarnessSelect's .trigger (flex-shrink: 0, 40×44px on mobile) intact.
  • apps/web-ui/packages/client/ui-conversation/src/client/skeleton/InputBar.module.css:
    • Allow .row[data-phone-toolbar] .standardControls to shrink (flex: 0 1 auto; min-width: 0; margin-left: 0) while keeping .modes and [data-slot="conversation.input.right"] > * non-shrinking (flex-shrink: 0).
    • Restore flex: none; width: max-content on .row[data-phone-toolbar][data-toolbar-measuring] .standardControls during observeControlRow's synchronous measurement pass so data-actions-overflow still moves overflow actions (e.g., screenshot) into the + menu when unshrunk demand exceeds available width.
    • Apply matching min-width: 0 / max-width: 100% / flex: 0 1 auto constraints to .pendingModel and .pendingModelLabel under :global([data-phone]) for consistent pending-session layout.

Validation

  • npx prettier --check on all 3 modified CSS files — passed
  • npx tsc -b packages/shared-contracts packages/desktop-control && npm run build:web:ui — passed (all 43 Web UI client plugins + browser shell built cleanly)
  • Captured and visually inspected before/after rendered screenshots and bounding-box geometry using the actual lightningcss-compiled CSS modules in both Playwright Chromium (Google Chrome) and WebKit (Safari):
    • 390px phone (Default (recommended) + permission + voice): clipped=0, overlaps=false, label cleanly ellipsizes to 78px, HarnessSelect (40px) and Send (44px) fully visible with 4px gap.
    • 390px phone (codex / gpt-5.6-luna + permission + voice + fast): clipped=0, overlaps=false, label ellipsizes to 36px, HarnessSelect and Send fully visible.
    • 360px phone (Default (recommended) + permission + voice; and minimal codex / gpt-5.6-luna): clipped=0, overlaps=false, HarnessSelect and Send fully visible.
    • 390px overflow measurement: data-actions-overflow still triggers as expected via [data-toolbar-measuring].
    • 1280px desktop: unchanged (labelW=137, HarnessSelect=30px, zero visual regression).

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

@iruriQ
iruriQ merged commit 3e523f7 into main Nov 27, 2026
4 of 8 checks passed
@iruriQ
iruriQ deleted the fix/issue-1260 branch November 27, 2026 01:13
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] 移动端 390px 下 Composer 的 Harness 选择器图标被长模型名挤压裁切

2 participants