Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
31ccf5b
added highlight
alanpoon Apr 3, 2025
8009d1e
added search message logic
alanpoon Apr 11, 2025
0cff367
Merge branch 'main' into search_messages#122
alanpoon Apr 11, 2025
4506ddb
resolve conflict
alanpoon Apr 11, 2025
1620a30
add search_all_room
alanpoon Apr 11, 2025
81a842a
added room_name in search result
alanpoon Apr 12, 2025
52d7efa
added small_state display in search result
alanpoon Apr 12, 2025
6b3fc4b
EventableWrapperETI
alanpoon Apr 13, 2025
a772bc2
before populate_small_state
alanpoon Apr 14, 2025
9c4b11e
migrate to use generic
alanpoon Apr 14, 2025
6d2d63e
Added early abort search message
alanpoon Apr 14, 2025
ea6cb60
t
alanpoon Apr 15, 2025
ef2ddb5
t
alanpoon Apr 15, 2025
5321861
added body_inner
alanpoon Apr 15, 2025
c76173e
fix condensed message in search result
alanpoon Apr 15, 2025
c0e0931
used relations
alanpoon May 10, 2025
497973a
Merge remote-tracking branch 'origin/main' into seacr2
alanpoon May 10, 2025
af68741
rebase
alanpoon May 16, 2025
02b09db
Merge branch 'main' into search_messages_3#122
alanpoon May 16, 2025
ca2ca78
move room_search_result underneath room_screen mod
alanpoon May 19, 2025
fbfb272
Merge branch 'main' into search_messages_3#122
alanpoon May 19, 2025
747cb44
search_button_wrap improvement
alanpoon May 23, 2025
dfa349b
Merge branch 'main' into search_messages_3#122
alanpoon May 23, 2025
3357364
abort previous search request
alanpoon May 23, 2025
687cdf1
allow finding messages in encrypted room
alanpoon May 26, 2025
2c160eb
Merge branch 'search_messages_3#122' of https://github.com/alanpoon/r…
alanpoon May 26, 2025
9a48f94
fix selection
alanpoon May 26, 2025
2d6f5f9
fix clippy
alanpoon May 27, 2025
c86643a
fix spelling
alanpoon May 27, 2025
769c517
remove specific ruma
alanpoon Jun 3, 2025
6d2c06e
don't use trait
alanpoon Jun 3, 2025
1a010bf
separate populate_message_search_view
alanpoon Jun 4, 2025
75aec63
display search result on the right
alanpoon Jun 6, 2025
51d5869
highlight yellow
alanpoon Jun 9, 2025
8314625
rounded view for search result
alanpoon Jun 10, 2025
50d3a5a
revert roomscreen
alanpoon Jun 10, 2025
b0e97af
cleanup
alanpoon Jun 11, 2025
5b8f99a
added date for search result
alanpoon Jun 11, 2025
9290fd8
Change to search_screen to right_panel
alanpoon Jun 13, 2025
8cb2ff0
Merge branch 'main' into search_messages_3#122
alanpoon Jul 16, 2025
31ca5dc
right
alanpoon Jul 16, 2025
6adad73
click search input to open
alanpoon Jul 16, 2025
20db1bd
search
alanpoon Jul 16, 2025
2025fb1
added right panel
alanpoon Jul 17, 2025
fb9b75d
remove cancel_button
alanpoon Jul 18, 2025
bccb820
Fix
alanpoon Jul 18, 2025
62d6612
added doc
alanpoon Jul 18, 2025
69bc0c4
cargo fmt
alanpoon Jul 18, 2025
874e95f
remove unneccessary changes
alanpoon Jul 21, 2025
64ab172
minor code improvement
alanpoon Jul 21, 2025
a830265
Merge branch 'main' into search_messages_3#122
alanpoon Jul 21, 2025
151f123
SearchResultView fix
alanpoon Jul 22, 2025
19e00fb
Merge branch 'main' into search_messages_4#122
alanpoon Jul 22, 2025
efb995e
Save Previous search result
alanpoon Jul 22, 2025
4f81dd8
Added scroll to message in roomscreen
alanpoon Jul 26, 2025
203fefa
Merge branch 'main' into search_messages_3#122
alanpoon Jul 28, 2025
d738c2d
code restructure
alanpoon Jul 28, 2025
98c8715
added constraint to search term length
alanpoon Jul 28, 2025
d4766d6
string optimization
alanpoon Jul 29, 2025
c69e9ba
update cargo lock
alanpoon Jul 29, 2025
609c73c
revert cargo lock
alanpoon Jul 29, 2025
557b0f0
Merge branch 'main' into search_messages_3#122
alanpoon Jul 29, 2025
faaf403
search again button
alanpoon Jul 29, 2025
ffd41d8
Added search input limit as const
alanpoon Aug 1, 2025
568096f
speed up Scroll To Message from search result
alanpoon Aug 5, 2025
aee984c
Merge branch 'main' into search_messages_3#122
alanpoon Aug 6, 2025
2d71975
remove set_room_screen_widget_uid
alanpoon Aug 6, 2025
4003e5c
remove populate_message_search_view's search widget_uid
alanpoon Aug 6, 2025
6fe116f
search_message cleanup
alanpoon Aug 12, 2025
e3de362
minor cleanup
alanpoon Aug 12, 2025
59d7169
Text improvement
alanpoon Aug 13, 2025
3c9d936
change function name
alanpoon Aug 13, 2025
bf71ffd
search_all_rooms_button fix query twice
alanpoon Aug 13, 2025
c5eb255
fix query twice
alanpoon Aug 13, 2025
ce12f4f
Rephrasing
alanpoon Aug 13, 2025
db2f1af
Use 2 dots
alanpoon Aug 13, 2025
bdd4383
add new line
alanpoon Aug 13, 2025
da4c301
Added regex
alanpoon Aug 20, 2025
499c370
Merge branch 'main' into search_messages_3#122
alanpoon Aug 20, 2025
8144a44
Added remove_timeline_loaded_notify
alanpoon Aug 26, 2025
32b0463
Merge branch 'main' into search_messages_3#122
alanpoon Aug 26, 2025
e541b3e
search message improvement
alanpoon Aug 27, 2025
4833fcd
fix clippy
alanpoon Aug 27, 2025
fbb72dc
Merge branch 'main' into search_messages_3#122
alanpoon Sep 26, 2025
c2417e4
remove notify
alanpoon Sep 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ bytesize = "1.3.0"
bitflags = "2.6.0"
indexmap = "2.6.0"
blurhash = { version = "0.2.3", default-features = false }
ruma = { git = "https://github.com/ruma/ruma", rev = "7755c7cbc580f8d8aea30d78cc1a6850b1a6fd39", default-features = false, features = ["api", "client-api-c"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be necessary, as you can access ruma types via matrix_sdk::ruma::

The problem with doing this is that we now have an added maintenance burden because we have to ensure that this version perfectly matches that of the matrix SDK and its UI crate.

Does matrix_sdk::ruma not already publicly re-export the types/functions that you need?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


[package.metadata.docs.rs]
all-features = true
Expand Down
18 changes: 9 additions & 9 deletions src/event_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn text_preview_of_timeline_item(
text_preview_of_member_profile_change(profile_change, sender_username, true)
}
TimelineItemContent::OtherState(other_state) => {
text_preview_of_other_state(other_state, true)
text_preview_of_other_state(other_state.content(), true, other_state.state_key())
.unwrap_or_else(|| TextPreview::from((
String::from("<i>initiated another state change</i>"),
BeforeText::UsernameWithoutColon,
Expand Down Expand Up @@ -151,7 +151,7 @@ pub fn plaintext_body_of_timeline_item(
).text
}
TimelineItemContent::OtherState(other_state) => {
text_preview_of_other_state(other_state, false)
text_preview_of_other_state(other_state.content(), true, other_state.state_key())
Comment thread
alanpoon marked this conversation as resolved.
Outdated
.unwrap_or_else(|| TextPreview::from((
String::from("initiated another state change."),
BeforeText::UsernameWithoutColon,
Expand Down Expand Up @@ -312,13 +312,13 @@ pub fn text_preview_of_redacted_message(
TextPreview::from((text, BeforeText::Nothing))
}


/// Returns a text preview of the given other state event as an Html-formatted string.
pub fn text_preview_of_other_state(
other_state: &timeline::OtherState,
other_state: &AnyOtherFullStateEventContent,
format_as_html: bool,
state_key: &str,
) -> Option<TextPreview> {
let text = match other_state.content() {
let text = match other_state {
AnyOtherFullStateEventContent::RoomAliases(FullStateEventContent::Original { content, .. }) => {
let mut s = String::from("set this room's aliases to ");
let last_alias = content.aliases.len() - 1;
Expand Down Expand Up @@ -404,17 +404,17 @@ pub fn text_preview_of_other_state(
}
AnyOtherFullStateEventContent::SpaceParent(_) => {
let state_key = if format_as_html {
htmlize::escape_text(other_state.state_key())
htmlize::escape_text(state_key)
} else {
Cow::Borrowed(other_state.state_key())
Cow::Borrowed(state_key)
};
Some(format!("set this room's parent space to \"{state_key}\"."))
}
AnyOtherFullStateEventContent::SpaceChild(_) => {
let state_key = if format_as_html {
htmlize::escape_text(other_state.state_key())
htmlize::escape_text(state_key)
} else {
Cow::Borrowed(other_state.state_key())
Cow::Borrowed(state_key)
};
Some(format!("added a new child to this space: \"{state_key}\"."))
}
Expand Down
4 changes: 2 additions & 2 deletions src/home/main_desktop_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use makepad_widgets::*;
use matrix_sdk::ruma::OwnedRoomId;
use std::collections::HashMap;

use crate::{app::{AppState, AppStateAction, SelectedRoom}, utils::room_name_or_id};
use crate::{app::{AppState, AppStateAction, SelectedRoom}, shared::room_filter_input_bar::RoomFilterAction, utils::room_name_or_id};
use super::{invite_screen::InviteScreenWidgetRefExt, room_screen::RoomScreenWidgetRefExt, rooms_list::RoomsListAction};

live_design! {
use link::theme::*;
use link::shaders::*;
Expand Down Expand Up @@ -210,6 +209,7 @@ impl MainDesktopUI {
dock.close_tab(cx, tab_id);
self.tab_to_close = None;
self.open_rooms.remove(&tab_id);
cx.widget_action(self.widget_uid(), &Scope::empty().path, RoomFilterAction::Clear);
Copy link

Copilot AI May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using Scope::empty().path may not target the filter widget correctly. You may need to reference the actual scope path where the RoomFilterInputBar lives.

Suggested change
cx.widget_action(self.widget_uid(), &Scope::empty().path, RoomFilterAction::Clear);
cx.widget_action(self.widget_uid(), &scope.path, RoomFilterAction::Clear);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@emmettlu emmettlu May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be there is better to use action() if we dont want an actual Scope rather than widget_action()?

}

/// Replaces an invite with a joined room in the dock.
Expand Down
2 changes: 2 additions & 0 deletions src/home/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod main_mobile_ui;
pub mod room_preview;
pub mod room_screen;
pub mod room_read_receipt;
pub mod room_search_result;
pub mod rooms_list;
pub mod rooms_sidebar;
pub mod spaces_dock;
Expand All @@ -28,6 +29,7 @@ pub fn live_design(cx: &mut Cx) {
new_message_context_menu::live_design(cx);
invite_screen::live_design(cx);
room_screen::live_design(cx);
room_search_result::live_design(cx);
room_read_receipt::live_design(cx);
rooms_sidebar::live_design(cx);
main_mobile_ui::live_design(cx);
Expand Down
10 changes: 4 additions & 6 deletions src/home/new_message_context_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use bitflags::bitflags;
use makepad_widgets::*;
use matrix_sdk::ruma::OwnedEventId;
use matrix_sdk_ui::timeline::EventTimelineItem;

use crate::sliding_sync::UserPowerLevels;

use super::room_screen::{MessageAction, MessageOrSticker};
use super::room_screen::{Eventable, MessageAction, MessageOrSticker, MsgTypeAble};

const BUTTON_HEIGHT: f64 = 35.0; // KEEP IN SYNC WITH BUTTON_HEIGHT BELOW
const MENU_WIDTH: f64 = 215.0; // KEEP IN SYNC WITH MENU_WIDTH BELOW
Expand Down Expand Up @@ -247,10 +246,10 @@ bitflags! {
}
}
impl MessageAbilities {
pub fn from_user_power_and_event(
pub fn from_user_power_and_event_generic<T: Eventable, M: MsgTypeAble>(
user_power_levels: &UserPowerLevels,
event_tl_item: &EventTimelineItem,
_message: &MessageOrSticker,
event_tl_item: &T,
_message: &MessageOrSticker<M>,
has_html: bool,
) -> Self {
let mut abilities = Self::empty();
Expand All @@ -269,7 +268,6 @@ impl MessageAbilities {
abilities.set(Self::HasHtml, has_html);
abilities
}

}

/// Details about the message that define its context menu content.
Expand Down
21 changes: 12 additions & 9 deletions src/home/room_read_receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ use crate::utils::human_readable_list;
use indexmap::IndexMap;
use makepad_widgets::*;
use matrix_sdk::ruma::{events::receipt::Receipt, EventId, OwnedUserId, RoomId};
use matrix_sdk_ui::timeline::EventTimelineItem;
use std::cmp;

use super::room_screen::Eventable;


/// The maximum number of items to display in the read receipts AvatarRow
/// and its accompanying tooltip.
Expand Down Expand Up @@ -225,18 +226,20 @@ impl AvatarRowRef {
/// room ID, and an EventTimelineItem, this will populate the avatar
/// row of the item with the read receipts of the event.
///
pub fn populate_read_receipts(
pub fn populate_read_receipts<T: Eventable>(
item: &WidgetRef,
cx: &mut Cx,
room_id: &RoomId,
event_tl_item: &EventTimelineItem,
event_tl_item: &T,
) {
item.avatar_row(id!(avatar_row)).set_avatar_row(
cx,
room_id,
event_tl_item.event_id(),
event_tl_item.read_receipts(),
);
if let Some(read_receipts) = event_tl_item.read_receipts() {
item.avatar_row(id!(avatar_row)).set_avatar_row(
cx,
room_id,
event_tl_item.event_id(),
read_receipts,
);
}
}

/// Populate the tooltip text for a read receipts avatar row.
Expand Down
Loading