Expand description
Interaction cues: the moments an application may want to mark with a sound, haptic, or notification.
gpui-ai does not play audio. Components emit a Cue at the moments
that matter (a reply arriving, a response settling, text copied, a
prompt submitted, …) and an application can observe them in one place:
use gpui_ai::cues::{self, Cue};
let _cues = cues::observe(cx, move |cue, _cx| match cue {
Cue::ResponseSettled { .. } => play("chime"),
Cue::Copied => play("tick"),
_ => {}
});
// Keep `_cues` alive for as long as the sounds should play.Cues are hints, never state: every cue corresponds to a typed component event or snapshot transition that the application already receives.
Structs§
- CueSubscription
- Keeps a cue observer registered; dropping it unregisters the observer.
Enums§
- Cue
- A moment worth a cue.