Skip to content

Commit 0eccb92

Browse files
authored
Merge pull request #663 from kevinaboos/space_lobby_screen_2
2 parents 044c0ab + 85353f9 commit 0eccb92

9 files changed

Lines changed: 907 additions & 91 deletions

File tree

src/home/navigation_tab_bar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
use makepad_widgets::*;
3232
use crate::{
3333
avatar_cache::{self, AvatarCacheEntry}, login::login_screen::LoginAction, logout::logout_confirm_modal::LogoutAction, profile::{
34-
user_profile::{AvatarState, UserProfile},
34+
user_profile::UserProfile,
3535
user_profile_cache::{self, UserProfileUpdate},
3636
}, shared::{
37-
avatar::AvatarWidgetExt,
37+
avatar::{AvatarState, AvatarWidgetExt},
3838
callout_tooltip::{CalloutTooltipOptions, TooltipAction, TooltipPosition},
3939
styles::*,
4040
verification_badge::VerificationBadgeWidgetExt,

src/home/room_screen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ use ruma::{OwnedUserId, events::{AnySyncMessageLikeEvent, AnySyncTimelineEvent,
2626

2727
use crate::{
2828
app::AppStateAction, avatar_cache, event_preview::{plaintext_body_of_timeline_item, text_preview_of_encrypted_message, text_preview_of_member_profile_change, text_preview_of_other_message_like, text_preview_of_other_state, text_preview_of_room_membership_change, text_preview_of_timeline_item}, home::{edited_indicator::EditedIndicatorWidgetRefExt, link_preview::{LinkPreviewCache, LinkPreviewRef, LinkPreviewWidgetRefExt}, loading_pane::{LoadingPaneState, LoadingPaneWidgetExt}, room_image_viewer::{get_image_name_and_filesize, populate_matrix_image_modal}, rooms_list::RoomsListRef, tombstone_footer::SuccessorRoomDetails}, media_cache::{MediaCache, MediaCacheEntry}, profile::{
29-
user_profile::{AvatarState, ShowUserProfileAction, UserProfile, UserProfileAndRoomId, UserProfilePaneInfo, UserProfileSlidingPaneRef, UserProfileSlidingPaneWidgetExt},
29+
user_profile::{ShowUserProfileAction, UserProfile, UserProfileAndRoomId, UserProfilePaneInfo, UserProfileSlidingPaneRef, UserProfileSlidingPaneWidgetExt},
3030
user_profile_cache,
3131
},
3232
room::{BasicRoomDetails, room_input_bar::RoomInputBarState, typing_notice::TypingNoticeWidgetExt},
3333
shared::{
34-
avatar::AvatarWidgetRefExt, callout_tooltip::{CalloutTooltipOptions, TooltipAction, TooltipPosition}, confirmation_modal::ConfirmationModalContent, html_or_plaintext::{HtmlOrPlaintextRef, HtmlOrPlaintextWidgetRefExt, RobrixHtmlLinkAction}, image_viewer::{ImageViewerAction, ImageViewerMetaData, LoadState}, jump_to_bottom_button::{JumpToBottomButtonWidgetExt, UnreadMessageCount}, popup_list::{PopupItem, PopupKind, enqueue_popup_notification}, restore_status_view::RestoreStatusViewWidgetExt, styles::*, text_or_image::{TextOrImageAction, TextOrImageRef, TextOrImageWidgetRefExt}, timestamp::TimestampWidgetRefExt
34+
avatar::{AvatarState, AvatarWidgetRefExt}, callout_tooltip::{CalloutTooltipOptions, TooltipAction, TooltipPosition}, confirmation_modal::ConfirmationModalContent, html_or_plaintext::{HtmlOrPlaintextRef, HtmlOrPlaintextWidgetRefExt, RobrixHtmlLinkAction}, image_viewer::{ImageViewerAction, ImageViewerMetaData, LoadState}, jump_to_bottom_button::{JumpToBottomButtonWidgetExt, UnreadMessageCount}, popup_list::{PopupItem, PopupKind, enqueue_popup_notification}, restore_status_view::RestoreStatusViewWidgetExt, styles::*, text_or_image::{TextOrImageAction, TextOrImageRef, TextOrImageWidgetRefExt}, timestamp::TimestampWidgetRefExt
3535
},
3636
sliding_sync::{BackwardsPaginateUntilEventRequest, MatrixRequest, PaginationDirection, TimelineEndpoints, TimelineRequestSender, UserPowerLevels, get_client, submit_async_request, take_timeline_endpoints}, utils::{self, ImageFormat, MEDIA_THUMBNAIL_FORMAT, RoomNameId, unix_time_millis_to_datetime}
3737
};

src/home/rooms_list.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ pub enum InviteState {
358358

359359
/// The value in the RoomsList's `space_map` that contains info about a space.
360360
#[derive(Default)]
361-
struct SpaceMapValue {
361+
struct SpaceMapValue {
362362
/// Whether this space is fully paginated, meaning that our client has obtained
363363
/// the full list of direct children within this space.
364364
///
@@ -1034,6 +1034,8 @@ impl RoomsList {
10341034
kind: PopupKind::Error,
10351035
});
10361036
}
1037+
// DetailedChildren is handled by SpaceLobbyScreen, not RoomsList.
1038+
SpaceRoomListAction::DetailedChildren { .. } => { }
10371039
}
10381040
}
10391041

@@ -1395,6 +1397,22 @@ impl RoomsListRef {
13951397
pub fn get_selected_space_id(&self) -> Option<OwnedRoomId> {
13961398
self.borrow()?.selected_space.as_ref().map(|ss| ss.room_id().clone())
13971399
}
1400+
1401+
/// Returns a clone of the space request sender channel, if available.
1402+
///
1403+
/// This allows other widgets to submit space-related requests directly
1404+
/// to the background space service.
1405+
pub fn get_space_request_sender(&self) -> Option<UnboundedSender<SpaceRequest>> {
1406+
self.borrow()?.space_request_sender.clone()
1407+
}
1408+
1409+
/// Returns the parent chain of the given space, if known.
1410+
pub fn get_space_parent_chain(&self, space_id: &OwnedRoomId) -> Option<ParentChain> {
1411+
self.borrow()?
1412+
.space_map
1413+
.get(space_id)
1414+
.map(|smv| smv.parent_chain.clone())
1415+
}
13981416
}
13991417

14001418
pub struct RoomsListScopeProps {

0 commit comments

Comments
 (0)