Skip to content

ui: back the Settings text fields with native OS controls - #282

Merged
tannevaled merged 2 commits into
mainfrom
feat/native-settings-fields
Aug 31, 2026
Merged

ui: back the Settings text fields with native OS controls#282
tannevaled merged 2 commits into
mainfrom
feat/native-settings-fields

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The preferences view's seven text fields (rename, add-channel, cache path/size/backend, the two zoom-shortcut keys) were drawn-only; now each publishes a native-entry descriptor over its drawn twin, like the Accounts fields already do. Keystrokes flow to the same buffer (OnTextsetSettingsField, keeping Scene focus in step and clamping a zoom field to one rune), and the native entry's Enter commits through the same commitSettingsField the drawn field's keyboard Enter uses — persisting the value and re-aggregating — via a NativeSettingsCommit record the windowapp Handler wires to OnActivate (the settings analogue of the button hit-bridge).

So on a host that embeds native controls (cocoa, win32, gtk) the settings fields are real OS text fields; the drawn field stays as the fallback. Fully reachable on macOS/Windows today; on GTK they render but the view isn't navigable until the backend routes pointer input to the Surface.

Tests: TestSettingsFieldsEmitNativeControls (all seven published, buffers written, zoom clamped) and TestNativeSettingsFieldCommitsOnEnter (native Enter commits through the real Handler and the app applies it).

The preferences view's seven text fields (profile rename, add-channel, cache path,
cache size, cache backend, the two zoom-shortcut keys) were drawn-only; now each
publishes a native-entry descriptor over its drawn twin, the way the Accounts
fields already do. Keystrokes flow to the same buffer (OnText → setSettingsField,
which also keeps Scene focus in step and clamps a zoom field to one rune), and the
native entry's Enter commits through the SAME commitSettingsField the drawn field's
keyboard Enter uses — persisting the value and re-aggregating — via a
NativeSettingsCommit record the windowapp Handler wires to OnActivate (the
settings-view analogue of the button hit bridge).

So on a host that embeds native controls (cocoa, win32, gtk) the settings fields
are real OS text fields; the drawn field stays as the fallback. Fully reachable on
macOS/Windows today; on GTK the fields render but the view is not yet navigable
until the backend routes pointer input to the Surface.

Tests: TestSettingsFieldsEmitNativeControls (all seven published, buffers written,
zoom clamped) and TestNativeSettingsFieldCommitsOnEnter (the native Enter commits
through the real Handler and the app applies it).
The 100% gate flagged the new setSettingsField (FocusZoomOut branch),
FocusSettingsField, and lastRune (empty input) as uncovered. Extend
TestSettingsFieldsEmitNativeControls to type into the zoom-out field, clear a zoom
field, and focus a field by name.
@tannevaled
tannevaled merged commit 0862f52 into main Aug 31, 2026
13 checks passed
@tannevaled
tannevaled deleted the feat/native-settings-fields branch August 31, 2026 19:09
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