ui: native text fields + action buttons (search, browse, accounts) - #279
Merged
Conversation
The reader dispatches clicks by geometry, not widget callbacks, so a native button needs its action wired separately. The Scene records, per frame, each native button's key -> the Hit its click runs (addNativeButton / NativeHit); the windowapp Handler gives each button descriptor an OnActivate that runs that Hit through the same runHit a click reaches. The accounts editor's action buttons (Back, Done, sign-in, the imports) are the first converted. Selection pills (provider selector, tabs, on/off toggles) are left drawn for now: a plain native button loses the selected-state a pill shows; those want native radios/checkboxes, a separate step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the native-controls rollout (after #278), on the same Surface-provider mechanism.
Native text fields (composed input, IME, secure)
Topbar feed search, Reddit search + regex, and browse filter each get a real NSTextField over the drawn SearchEntry, bound to the widget's own Text() observable the filter already reads. Composed input (CJK, dead keys, emoji) the drawn toolkit can't accept now works.
Native action buttons — via a hit-dispatch bridge
The reader dispatches clicks by geometry, not widget callbacks. Scene.addNativeButton records key→Hit per frame; the windowapp Handler gives each button descriptor an OnActivate that runs that Hit through the same runHit a click reaches. The accounts editor's action buttons (Back, Done, sign-in, imports) are converted.
Deliberately still drawn (bibliography-confirmed)
Selection pills (provider selector, tabs) can't become clean native radios: the backend adds all controls to one superview with one action selector, and AppKit auto-groups radios by shared superview+action — so every native radio would form one global group. Making pills native needs per-group container views (a separate backend step). Settings text fields need the hit-bridge extended with a commit Hit (their commit is an app method reached via runHit) — also separate.
New producer + bridge tests; new code 100% covered; full reader suite green; verified on-device.