mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-10-05 00:01:00 +00:00
Every input in the new/edit-connection dialog was a label div sharing one focus handle, with a `focused_field` enum routing keystrokes to whichever draft string was "active". Clicking a field only moved that enum, so there was no caret, no selection, no pointer positioning, no composition, and password masking was a string of bullets rebuilt on each render. Each text input is now a `TextField` entity, built when the editor opens and cleared when it closes, so the widgets live exactly as long as the draft they mirror. `ConnectionEditorState` stays a plain value the runtime can clone and save from; the fields write back through their subscriptions. The password field masks itself while the buffer keeps the secret in the clear, which is what the save path needs. The folder-name editor gets the same treatment. Two focus fixes fall out of this. The editor surface's blanket `on_click` focus grab is gone: it existed to keep the old fake inputs "focused", and would now steal focus back from whichever field the pointer just landed on, since click follows mouse-down. And because focus is per-window, the detached editor window claims the name field itself on its first frame rather than trusting what the main window focused. The labelled row is the hit target, not just the one text line inside it, and it takes its ring from the widget's own focus rather than from an enum nothing updates any more.