-
Notifications
You must be signed in to change notification settings - Fork 51
Searching messages in a room (not encrypted) #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 68 commits
31ccf5b
8009d1e
0cff367
4506ddb
1620a30
81a842a
52d7efa
6b3fc4b
a772bc2
9c4b11e
6d2d63e
ea6cb60
ef2ddb5
5321861
c76173e
c0e0931
497973a
af68741
02b09db
ca2ca78
fbfb272
747cb44
dfa349b
3357364
687cdf1
2c160eb
9a48f94
2d6f5f9
c86643a
769c517
6d2c06e
1a010bf
75aec63
51d5869
8314625
50d3a5a
b0e97af
5b8f99a
9290fd8
8cb2ff0
31ca5dc
6adad73
20db1bd
2025fb1
fb9b75d
bccb820
62d6612
69bc0c4
874e95f
64ab172
a830265
151f123
19e00fb
efb995e
4f81dd8
203fefa
d738c2d
98c8715
d4766d6
c69e9ba
609c73c
557b0f0
faaf403
ffd41d8
568096f
aee984c
2d71975
4003e5c
6fe116f
e3de362
59d7169
3c9d936
bf71ffd
c5eb255
ce12f4f
db2f1af
bdd4383
da4c301
499c370
8144a44
32b0463
e541b3e
4833fcd
fbb72dc
c2417e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,11 @@ live_design! { | |
| use crate::home::spaces_dock::SpacesDock; | ||
| use crate::shared::styles::*; | ||
| use crate::shared::room_filter_input_bar::RoomFilterInputBar; | ||
| use crate::shared::message_search_input_bar::MessageSearchInputBar; | ||
| use crate::shared::icon_button::RobrixIconButton; | ||
| use crate::home::main_desktop_ui::MainDesktopUI; | ||
| use crate::settings::settings_screen::SettingsScreen; | ||
| use crate::right_panel::*; | ||
|
|
||
| NavigationWrapper = {{NavigationWrapper}} { | ||
| view_stack = <StackNavigation> {} | ||
|
|
@@ -51,11 +54,32 @@ live_design! { | |
| main_page = <View> { | ||
| width: Fill, height: Fill | ||
| flow: Down | ||
|
|
||
| <CachedWidget> { | ||
| room_filter_input_bar = <RoomFilterInputBar> {} | ||
| <View> { | ||
| width: Fill, height: Fit | ||
| flow: Right, | ||
| <CachedWidget> { | ||
| room_filter_input_bar = <RoomFilterInputBar> { | ||
| align: {x: 0.0 } | ||
| } | ||
| } | ||
| message_search_input_view = <View> { | ||
| width: Fill, height: Fit, | ||
| visible: false, | ||
| align: {x: 1.0}, | ||
| <CachedWidget> { | ||
| message_search_input_bar = <MessageSearchInputBar> { | ||
| width: 300, | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
68
to
78
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't we want the outer I think that would simplify a lot of the code too. If you tried that already and it didn't work, or there is some other reason why that design is not desirable, please let me know.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cachedWidget also cached the width of the width, causing a singleton for the width. I want the search input bar to display shorter in the mobile mode. So there is an extra view wrapper for that. Also the cached visibility is not useful as the search input bar should always appear at the room screen stack navigation view. While in the desktop, search input bar should not appear in the welcome screen. |
||
| } | ||
|
|
||
| <View> { | ||
| width: Fill, height: Fill | ||
| flow: Right | ||
| <MainDesktopUI> {} | ||
| <RightPanel> {} | ||
| } | ||
| <MainDesktopUI> {} | ||
| } | ||
|
|
||
| settings_page = <View> { | ||
|
|
@@ -128,12 +152,57 @@ live_design! { | |
| } | ||
| } | ||
| } | ||
| <View> { | ||
| height: Fit, | ||
| width: Fill, | ||
| align: {x: 1.0 } | ||
| mobile_message_search_input_view = <View> { | ||
| height: Fit, | ||
| width: 140, | ||
| visible: false, | ||
| <CachedWidget> { | ||
| message_search_input_bar = <MessageSearchInputBar> { | ||
| width: 300 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| body = { | ||
| main_content = <MainMobileUI> {} | ||
| } | ||
| } | ||
| search_result_view = <SearchResultView> { | ||
| flow: Overlay | ||
| header = { | ||
| height: 50.0, | ||
| margin: { top: 30.0 }, | ||
| content = { | ||
| flow: Right, | ||
| title_container = { | ||
| width: 0 | ||
| } | ||
| button_container = <View> { | ||
| align: { y: 0.5 } | ||
| left_button = <RobrixIconButton> { | ||
| draw_icon: { | ||
| color: #666; | ||
| } | ||
| text: "Back" | ||
| } | ||
| } | ||
| <CachedWidget> { | ||
| message_search_input_bar = <MessageSearchInputBar> { | ||
| width: 300 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| body = { | ||
| margin: { top: 80.0 }, | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this (and the other two places where you call
set_visible()onmessage_search_input_view), we ideally should not query and access/modify views or states that are far outside of the bounds of the current widget/module. That violates separation of concerns and typical best practices surrounding abstraction layers.Instead, you should access the
message_search_input_viewwithin the widget/module code where it is defined (or its immediate parent). You can do this in one of two ways:MessageSearchInputAction::Show/Hide) and emitting the appropriate action here.RoomsListAction::Selected,AppStateAction::RoomFocused/FocusNone) within the other widget or its parent.In my opinion, #1 is much better because it is much more clear about expressing the intent of the action.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Previously Homescreen was just a view and couldn't handle action.