mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-10-05 00:01:00 +00:00
Outside the connection editor every "input" in the app is a label div over a draft string, with a focus handle per box and a hand-written key handler — no caret, no selection, no IME, no clipboard, and a little of it reimplemented in each panel. The search-engine editor showed the failure plainly: the placeholder and the value were stacked inside one box that only had room for one of them. The connection editor solved this by owning a TextField entity per field. Threading that map through every panel's state would be a lot of churn, so the fields live in one registry keyed by a string id, created the first time a panel renders one. A panel keeps no state beyond the value it already had, and edits arrive as one event with the id attached, which the registry routes by prefix. The search-engine editor is the first caller: its two boxes are real inputs now, and the key handler and focus-steering they needed are gone. Structural changes forget the ids they invalidate — adding an engine shifts every row's index.