Repository navigation
cmux NEXT Home: search text stays beside the magnifier while editing - #28021
Conversation
…tays right of the magnifier #27967: once the Home list's search field took the keyboard, CmuxSidebarSearchFieldCell handed AppKit's edit(withFrame:) and select(withFrame:) a frame already cut to one 16 pt line. AppKit lays out the magnifier slot and the text rect inside that frame, so the field editor started over the magnifier and its line no longer matched the filter circle beside it. The cell now passes the whole frame; its searchTextRect, titleRect and drawingRect overrides still centre the line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppKit puts an unbezeled search field's editor in the frame the cell is handed; pass searchTextRect(forBounds:) so typed text and the caret sit where the placeholder does at rest (#27967). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppKit's search text rect overlaps its magnifier slot by a point at rest as well, so the clear line is one point inside the slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
web and size checks: green |
|
Found 2 test failures on Blacksmith runners: Failures
|
Correctness review (subagent), head e118113Verdict: PASS. No blocking findings.
An earlier review of a superseded head (0e03fa0, which removed the overrides) also passed. The real app then showed that fix did not work, which led to this change. |
Head cccbc17: receiptsThis head is a merge of feat-cmux-next b719608 into the branch, to pick up the base's package-deps fix (#28036). It does not change either PR file. The diff against the base is still
|
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)





Fixes #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/selectputs 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 insearchTextRect, which looked fine.Fix
CmuxSidebarSearchFieldCellhandsedit(withFrame:)andselect(withFrame:)itssearchTextRect(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 classicCmuxSidebarView/SidebarView, keeps AppKit's frame.Tests
New
HomeSearchGlassTests.theTypedTextStaysRightOfTheMagnifierat 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.box.minX 0.0 >= icon.maxX 27.0andfield editor starts at 0.0, the placeholder at rest at 26.0.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.cmux-ci compile-check --app --package CmuxNext): job 8df07a60938c7f789c054c67 at cccbc17, CmuxNext and app pass.Visual (real app, cmux DEV 27967-chief-search-align, fleet build 9063d03cc6c023f20b2b3a8d at e118113, rechecked on build cc2ae106e5741909a23b1be8 at the merged head cccbc17 (same ink columns); base build 08541a94af5cd86c73716c61 at dc38061)
Measured with
debug.home.sidebar_fixtureanddebug.window_snapshoton the 2x window: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-homeate118113583e2(fleet build, capture mini, text checked for private data)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
#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
HomeSearchGlassTestson the fleet; real-app captures on the tagged dev build at this head.🤖 Generated with Claude Code