fix(cmux-next): a density change restyles the omnibar field in place
Summary
This is the root cause of the omnibar field-editor flakes: OmnibarFieldEditorTests.markedTextNeverCompletesAndItsCommitDoes (3 of 27 failed jobs in a 60-run census, and #17626's 1 in 4 package runs) and OmnibarSelectionViewTests.aFocusingDragSelectsTheDraggedURL (#17601).
AddressBarView's DensityBinding observes DesignSettings.shared, and on any change it called field.write(fieldText, ...). With the field editor active, that write replaces the editor's whole text storage. The input method's marked text is dropped, and the caret jumps to the end of the URL. Every failure matched that: "https://example.org/startgi", a {27, 0} caret, and {25, 0} in place of the dragged range.
Ten test files change DesignSettings.shared. One of them is OmnibarViewTests, in the same target, which sets the density while the other omnibar suites run in parallel. That's the cross-suite disturbance #17626 saw ("the field editor lost its IME marked text mid-test") without a named source.
It's a product bug too: changing density in Settings while typing or composing in the address bar loses the composition and the selection.
The fix: AddressField.restyle sets the font on the active editor's text in place, the same way viewDidChangeEffectiveAppearance already recolors it. An inactive field is written again as before.
With this fix, the isolation in #17626 and #17650 should no longer be needed. They're harmless to land as well.
Testing
aDensityChangeKeepsTheSelectionAndMarkedTextwas committed first, red: focus selects the URL, then the density changes, and the selection must survive; then it composesgi, changes the density, and expects the marked text and caret kept. The old code fails it on any machine.- Not run locally (fleet builds only). This PR's
cmux-next swift testjob is the green check. scripts/cmux-next/check-concurrency.shpasses.
Changelog
- Fixed: Changing interface density while typing in the address bar no longer drops input-method composition or moves the cursor.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Changing interface density while the address bar field editor is active no longer drops input-method composition or moves the caret to the end of the URL. The density binding used to rewrite the field text, replacing the editor's storage; it now sets the font on the active editor's text in place (the same way a theme change recolors), preserving the selection and marked text. Inactive fields are still rewritten as before. The regression test runs the bar's density appliers directly, so it never changes the app-wide density and can't disturb the omnibar suites running in parallel.