cmux NEXT Home: search text stays beside the magnifier while editing
Fixes https://github.com/manaflow-ai/cmux/issues/27967
Changelog: Fixed: the Home search field's text no longer slides over the magnifier while you type; it stays centred beside the magnifier, level with the filter button.
Cause
While editing, the Home list's unbezeled search field put its field editor at the field's left edge (x = 0). NSSearchFieldCell.edit/select puts the editor in whatever frame the cell is handed, and the cell handed it the field's full width. So "Search", the caret and typed text drew over the magnifier. At rest the cell draws in searchTextRect, which looked fine.
Fix
CmuxSidebarSearchFieldCell hands edit(withFrame:) and select(withFrame:) its searchTextRect(forBounds:). That rect is clear of the magnifier and cancel button, and the cell already centres it on one line. A bezeled field, as used in classic CmuxSidebarView / SidebarView, keeps AppKit's frame.
Tests
New HomeSearchGlassTests.theTypedTextStaysRightOfTheMagnifier at widths 180, 320 and 480. It makes the field first responder and checks that the field editor starts clear of the magnifier slot and at the placeholder's resting x, within 1 pt. AppKit's own text rect starts 1 pt inside its magnifier slot, even at rest. It then types text, which shows the cancel button, and checks again. Both editing tests now close their windows.
- Red at the test-only commit 4a8fffaf (base code), fleet step d737db5219984ee321a5a4fa: fails,
box.minX 0.0 >= icon.maxX 27.0andfield editor starts at 0.0, the placeholder at rest at 26.0. - Green at head cccbc177c62f (feat-cmux-next b7196082e9f4 merged in), fleet step 3d8c654c9d934bc0a4ecc16d; and before the merge at e118113583e2, step 60d44ec621542d86cb71a96f (
cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref e118113583e2c149b5bb50d0d2fa11e491c1d50c --arg suite --arg Packages/macOS/CmuxNext --arg HomeSearchGlassTests): 8 tests pass, no window leaks. - Compile-check at head (
cmux-ci compile-check --app --package CmuxNext): job 8df07a60938c7f789c054c67 at cccbc177c62f, CmuxNext and app pass.
Visual (real app, cmux DEV 27967-chief-search-align, fleet build 9063d03cc6c023f20b2b3a8d at e118113583e2, rechecked on build cc2ae106e5741909a23b1be8 at the merged head cccbc177c62f (same ink columns); base build 08541a94af5cd86c73716c61 at dc38061f72c6)
Measured with debug.home.sidebar_fixture and debug.window_snapshot on the 2x window:
| state | magnifier ink x / centre y | text ink start x / centre y | filter centre y |
|---|---|---|---|
| base, rest | 52ā76 / 52.0 | 93 / 51.5 | 51.5 |
| base, editing | merged with text, 41ā83 | 41 (over the magnifier) | 52.0 |
| fix, rest | 52ā76 / 52.0 | 93 / 51.5 | 51.5 |
| fix, editing | 52ā76 / 52.0 | 93 / 51.5 | 52.0 |
Resizing the list while editing ({"search":true,"width":400}, then {"width":320}) keeps the same ink positions. Images are in the visual review comment.
Fleet capture
Capture tour-home at e118113583e2 (fleet build, capture mini, text checked for private data)
| Light | Dark |
|---|---|
![]() | ![]() |
Viewed after image: yes
Visual verdict: Yes: in light and dark the magnifier, the "Search" placeholder and the round filter button sit on one line, and while editing the text stays beside the magnifier instead of over it, as in Messages.
Coordination
https://github.com/manaflow-ai/cmux/issues/27950 (Chief search content) touches the search results, not the field's cell or header layout. The two changes share no source files.
Observed / Not run
- Observed: red/green of
HomeSearchGlassTestson the fleet; real-app captures on the tagged dev build at this head. - Not run: real keyboard typing in the app (no focus-free route; the unit test types into the field editor); the full CmuxNext suite (the change is one cell class used by the Home list and the classic sidebars, and the bezeled path is unchanged); hover/press states (unchanged).
š¤ Generated with Claude Code

