Skip to content

Commit 9f40f3c

Browse files
committed
remove markdown in search message summary
1 parent 8d99f4a commit 9f40f3c

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

src/home/home_screen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,5 +344,5 @@ impl MatchEvent for NavigationWrapper {
344344
pub enum MessageSearchInputAction {
345345
#[default]
346346
Show,
347-
Hide
348-
}
347+
Hide,
348+
}

src/home/main_desktop_ui.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::{collections::HashMap, sync::Arc};
55

66
use crate::{app::{AppState, AppStateAction, SelectedRoom}, shared::message_search_input_bar::{MessageSearchAction, MessageSearchInputBarRef}, utils::room_name_or_id};
77
use super::{invite_screen::InviteScreenWidgetRefExt, room_screen::RoomScreenWidgetRefExt, rooms_list::RoomsListAction};
8+
89
live_design! {
910
use link::theme::*;
1011
use link::shaders::*;
@@ -172,7 +173,7 @@ impl MainDesktopUI {
172173

173174
self.open_rooms.insert(room_id_as_live_id, room.clone());
174175
self.most_recently_selected_room = Some(room.clone());
175-
// Calls AppStateAction::RoomFocused action to display the search message input box when a room is open.
176+
// Call AppStateAction::RoomFocused action to display the search message input box when a room is open.
176177
cx.widget_action(
177178
self.widget_uid(),
178179
&HeapLiveIdPath::default(),

src/home/room_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ impl RoomScreen {
17951795
item_id: index
17961796
};
17971797
} else {
1798-
log!("essage not found - trigger backwards pagination to find it");
1798+
log!("Message not found - trigger backwards pagination to find it");
17991799
// Message not found - trigger backwards pagination to find it
18001800
loading_pane.set_state(
18011801
cx,

src/home/search_message.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,16 @@ live_design! {
123123
}
124124

125125
<SearchIcon> {}
126-
summary_label = <Markdown> {
127-
height: Fit,
126+
summary_label = <Label> {
127+
width:Fill, height: Fit,
128128
margin: {left: 10, top: 0},
129-
align: {x: 0.3, y: 0.5}
129+
align: {x: 0.0, y: 0.5}
130130
padding: 5,
131-
font_color: (MESSAGE_TEXT_COLOR),
132-
font_size: (MESSAGE_FONT_SIZE),
133-
body: "Type to search."
131+
draw_text: {
132+
color: (MESSAGE_TEXT_COLOR),
133+
text_style: <REGULAR_TEXT> { font_size: (MESSAGE_FONT_SIZE) }
134+
}
135+
text: "Type to search."
134136
}
135137
search_all_rooms_button = <RobrixIconButton> {
136138
flow: RightWrap,
@@ -313,7 +315,6 @@ fn apply_highlights(text: String, highlights: &[String]) -> String {
313315
/// * `highlights` - Array of search terms to highlight in the message content
314316
///
315317
/// # Behavior
316-
/// - Only processes `MessageType::Text` messages, ignoring other message types
317318
/// - Uses case-insensitive matching to find search terms
318319
/// - Wraps matches in `<span data-mx-bg-color="#fcdb03">` tags for yellow highlighting
319320
/// - Preserves original case and formatting of the matched text
@@ -890,10 +891,10 @@ impl SearchResultSummary {
890891
"".to_string()
891892
}
892893
};
893-
self.view.markdown(id!(summary_label)).set_text(
894+
self.view.label(id!(summary_label)).set_text(
894895
cx,
895896
&format!(
896-
"Searching for **'{}'** {}",
897+
"Searching for '{}' {}",
897898
truncate_to_50(&search_criteria.search_term),
898899
location_text
899900
),
@@ -917,10 +918,10 @@ impl SearchResultSummary {
917918
))
918919
};
919920

920-
self.view.markdown(id!(summary_label)).set_text(
921+
self.view.label(id!(summary_label)).set_text(
921922
cx,
922923
&format!(
923-
"{} result{} for **'{}'** {}",
924+
"{} result{} for '{}' {}",
924925
results.count,
925926
if results.count <= 1 { "" } else { "s" },
926927
truncate_to_50(&results.search_term),
@@ -941,7 +942,7 @@ impl SearchResultSummaryRef {
941942
let Some(mut inner) = self.borrow_mut() else {
942943
return;
943944
};
944-
inner.view.markdown(id!(summary_label)).set_text(
945+
inner.view.label(id!(summary_label)).set_text(
945946
cx,
946947
"Type to search.",
947948
);

src/shared/message_search_input_bar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct MessageSearchInputBar {
7777
#[rust] search_term: String,
7878
}
7979

80-
/// Actions emitting by the `MessageSearchInputBar`.
80+
/// Actions emitted by the `MessageSearchInputBar`.
8181
#[derive(Clone, Debug, DefaultNone)]
8282
pub enum MessageSearchAction {
8383
/// Emitted when the user has changed the text (after debounce delay or clear button).
@@ -167,4 +167,4 @@ impl MessageSearchInputBarRef {
167167
String::new()
168168
}
169169
}
170-
}
170+
}

src/sliding_sync.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,6 @@ fn handle_sync_indicator_subscriber(sync_service: &SyncService) {
23852385
const SYNC_INDICATOR_DELAY: Duration = Duration::from_millis(100);
23862386
/// Duration for sync indicator delay before hiding
23872387
const SYNC_INDICATOR_HIDE_DELAY: Duration = Duration::from_millis(200);
2388-
23892388
let sync_indicator_stream = sync_service.room_list_service()
23902389
.sync_indicator(
23912390
SYNC_INDICATOR_DELAY,
@@ -2459,7 +2458,7 @@ pub struct BackwardsPaginateUntilEventRequest {
24592458
const LOG_TIMELINE_DIFFS: bool = cfg!(feature = "log_timeline_diffs");
24602459
/// Whether to enable verbose logging of all room list service diff updates.
24612460
const LOG_ROOM_LIST_DIFFS: bool = cfg!(feature = "log_room_list_diffs");
2462-
/// Timeout duration for waiting for room timeline to be drawn before jumping to event in seconds.
2461+
/// Timeout duration for waiting for room timeline to be drawn before jumping to an event, in seconds.
24632462
const ROOM_TIMELINE_JUMP_TIMEOUT: Duration = Duration::from_secs(5);
24642463

24652464
/// A per-room async task that listens for timeline updates and sends them to the UI thread.

0 commit comments

Comments
 (0)