Expand description
day-piece-searchfield — an EXTERNAL Day Piece (DESIGN.md §15): a NATIVE search input realized as a distinct search control per toolkit (NSSearchField / UISearchTextField / GtkSearchEntry / a QLineEdit search shim / an EditText styled for search / a XAML AutoSuggestBox), registered link-time into each backend’s renderer slice without touching day.
It is bound two-way to a Signal<String> — the same pattern as day-piece-picker: a native
edit dispatches an Event::TextChanged back to Rust which sets the signal, and an external
signal change patches the control with SearchPatch::SetText. A per-build echo guard remembers
the last value that arrived FROM the native control so its own change is not written straight
back (which some toolkits would re-emit → a feedback loop). Like day-core’s text_field it is a
width-growing leaf (grow_w = true, natural height): a search field fills its row.
let query = Signal::new(String::new());
search_field(query).placeholder("Search fruit…")Structs§
- Search
Field - A native search field bound two-way to
query. Set a prompt with.placeholder(_). - Search
Props - Full props (realize).
textseeds the control;placeholderis the empty-state prompt. Onlytextchanges after build (viaSearchPatch::SetText); the placeholder is fixed at build.
Enums§
- Search
Patch - The single imperative update: replace the control’s text (programmatic sync from the signal).
Constants§
Functions§
- search_
field search_field(query)— a native search input whose text mirrorsqueryin both directions.