voelin-ui: keep the stream chat right when its tab is not shown

Since the chat keeps a session's stored messages as the truth, the main
window builds lines only for the tab it shows, and the stream chat shared
that tab's lines: when the stream's channel was not the shown tab its
chat stood still, and a line pushed by hand (the sample data's go-live
message) was gone at the next refresh. The studio now has its own lines,
made from the destination tab's messages the way the chat view makes
them, and the chat tells it when that tab gets messages. The sample data
posts its go-live message as a stored message, as the engine's echo
would arrive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-03 11:47:27 +03:00
1 parent 055f74059f
commit fe598e67e8
2 files changed
+84 -40

No files matched your search

+10 -2
View File
@@ -170,6 +170,7 @@ impl App {
if !shown {
self.refresh_servers();
}
self.studio_chat_changed(id, &message.target);
}
/// Messages the engine stored: added or updated by their local id.
@@ -218,6 +219,7 @@ impl App {
if fresh > 0 && !shown {
self.refresh_servers();
}
self.studio_chat_changed(id, target);
}
/// The page of messages before the oldest one shown.
@@ -235,8 +237,14 @@ impl App {
self.refresh_chat();
}
/// The lines of a tab, grouped and with everything the row shows.
fn lines_of(&self, view: &SessionView, tab: &Tab, messages: &[Msg]) -> Vec<ChatLine> {
/// The lines of a tab, grouped and with everything the row shows (also
/// the stream chat of the Stream Studio, studio.rs).
pub(crate) fn lines_of(
&self,
view: &SessionView,
tab: &Tab,
messages: &[Msg],
) -> Vec<ChatLine> {
let gateway = view.gateway_has(feature::PINS)
|| view.gateway_has(feature::REACTIONS)
|| view.gateway_has(feature::TOPICS);