diff --git a/crates/ui-patterns/src/patterns/panels/palette.rs b/crates/ui-patterns/src/patterns/panels/palette.rs index f08d4ed1e..733a190f3 100644 --- a/crates/ui-patterns/src/patterns/panels/palette.rs +++ b/crates/ui-patterns/src/patterns/panels/palette.rs @@ -69,8 +69,8 @@ impl crate::contract::Outcome for PaletteOutput { /// - Keys: the field keeps the focus; Up, Down, Page Up, Page Down move the active row (Up and Down wrap at the ends), /// Enter picks it, Escape clears /// the query and, on an empty query, closes the box; a press outside closes it. A caption under the list names the keys. The number of results is announced politely. -/// - Picking: the output's `picked` names the command and the box closes. With `recents` bound the command is also -/// put first in the list; [`CommandPalette::remember`] is the rule. +/// - Picking: the output's `picked` names the command, the box closes and the command goes first in `recents`; +/// [`CommandPalette::remember`] is the rule. Without a binding the palette keeps `recents` for the session. #[derive(Pattern, Props)] pub struct CommandPalette<'a> { label: Label, @@ -78,13 +78,13 @@ pub struct CommandPalette<'a> { open: Bind<'a, bool>, /// The commands last run, newest first. #[prop] - recents: Option>>, + recents: Bind<'a, Vec>, } impl<'a> CommandPalette<'a> { /// A palette named `label` over `entries`, open while `open` is true. pub fn new(label: impl Into