cx.bind_keys([
KeyBinding::new("enter", Send, Some(COMPOSER)),
KeyBinding::new("shift-enter", input::InsertNewline, Some(COMPOSER)),
]);
let field = cx.new(|cx| TextField::new(cx)
.with_shape(Shape::Grow { min: 3, max: 12 })
.with_key_context(COMPOSER)
.with_placeholder("Ask anything, or # to attach a file"));
// the # picker: popover::Filter state, mounted at the caret
let at = self.field.read(cx).offset_bounds(hash)?;
popover::menu_at("mentions", point(at.left(), at.bottom() + px(4.0)), card, None)- Bind
enterin a key context of the field's own; a container around the field cannot takeenterfrom it. offset_boundsisNoneuntil the field has painted once, and is in window coordinates, whichmenu_attakes.- The card is a
divontheme.card_glass_bg(). What#offers is the app's list; the demo isapps/gallery/src/pages/agent/activity.rs.