You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
One options layer for owned controls: Options, Configure/Interactive traits, refused(reason), when/when_some #315
A proposal from a consumer port (written against v0.1.0-m8.26).
Problem: each owned control's chain implements the common options (`named`, `tooltip`, `enablement`, `size`, `classes`, `on_response`) as its own inherent methods, with its own fields and docs. The copies have drifted:
Gaps: radio and segmented have no `named`; text_field has no `tooltip` or `enablement`; radio has no `tooltip`; dropdown has no `tooltip`; custom has no `enablement`.
`classes` merges on button, toggle and dropdown, but replaces everywhere else.
`Enablement` is `Option` in ButtonOptions but plain elsewhere.
`on_x_with` (handlers that get the Context) exists only on button and segmented.
Two things can't be done well at the call site: disabling a control and saying why in one step, and adding an option only when a condition holds. The consumer has ~10 rebind-to-add-a-tooltip sites, 2 bool→Enablement helpers, and 7 inline conversions.
Proposal (staged):
Additive:
`IntoTip` (text or `Option` of text);
`refused(reason)`: disabled, with the reason as its tooltip and accessible description, while `Some`;
`when(cond, f)` and `when_some(opt, f)`;
fill the matrix gaps;
(`From for Enablement`, under discussion).
One breaking tag:
the chains hold one `Options` value (ButtonOptions = Options + button extras);
traits `Configure` / `Interactive` / `Respond` with provided methods, and a `prelude`;
`classes` merges everywhere.
Uniform handlers: `on_x_with` on every terminator; `FieldEvents` and `Focus` traits; `NodeHandle::on_response` takes `Fn`.
Still open, taking the defaults unless the user says otherwise: refused(None) clears (the last call wins); custom is Interactive (its draw sees ui.is_enabled()); Choice gets refused, and NodeHandle later.
Activity
samitbasu commentedon Nov 18, 2026
Decisions (user, 2026-11-17/18):
classesmerges everywhere..namedis on every control (Names follow the web: .named() on every control as the override; bare icon faces allowed and reported #320).From<bool> for Enablementis done (Audit: bool-like two-variant enums (From<bool> or plain bool) #317).refused(reason),when/when_some, the gap fills, andclassesmerging everywhere.disabled).Configure/Interactiveand theOptionsvalue) lands with the crate split, One crate: merge eggshell-ui-extras and eggshell-ui-shadcn into eggshell-ui (features for opt-in widgets) #366, in one breaking tag.refused(None)clears (the last call wins); custom isInteractive(its draw seesui.is_enabled());Choicegetsrefused, andNodeHandlelater.A refused control: the disabled look, and a press shows its reason (#315
Merge pull request #385 from samitbasu/refused-315