Skip to main content

find_prior_surface

Function find_prior_surface 

Source
pub fn find_prior_surface(messages: &[HistoryMessage]) -> Option<PriorSurface>
Expand description

Finds the most recently rendered surface in the conversation.

Messages are newest-last, as they would be in a chat transcript. The scan runs backwards to pick the surface, then forwards to replay it, so an update targets whatever the user is actually looking at.

Returns None when history holds no A2UI at all.