Skip to content

Commit 34d3cd4

Browse files
committed
feat(multiverse): Show thread roots even if we can't find the latest message
1 parent 1f9c339 commit 34d3cd4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

labs/multiverse/src/widgets/room_view/timeline.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ impl StatefulWidget for &mut TimelineView<'_> {
5454
fn format_timeline_item(item: &Arc<TimelineItem>) -> Option<ListItem<'_>> {
5555
let item = match item.kind() {
5656
TimelineItemKind::Event(ev) => {
57+
// TODO: Once the SDK allows you to filter out messages that are part of a
58+
// thread, switch to that mechanism instead of manually returning `None` here.
5759
if ev.content().thread_root().is_some() {
5860
return None;
5961
}
@@ -119,8 +121,10 @@ fn format_text_message(
119121

120122
if let Some(thread_summary) = thread_summary {
121123
match thread_summary.latest_event {
122-
TimelineDetails::Unavailable => {}
123-
TimelineDetails::Pending => {}
124+
TimelineDetails::Unavailable | TimelineDetails::Pending => {
125+
let thread_line = Line::from(" 💬 ...");
126+
lines.push(thread_line);
127+
}
124128
TimelineDetails::Ready(e) => {
125129
let sender = e.sender;
126130
let content = e.content.as_message().map(|m| m.msgtype());

0 commit comments

Comments
 (0)