-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
SwiftUI contact list #1205
SwiftUI contact list #1205
Conversation
} | ||
} | ||
.swipeActions(allowsFullSwipe: false) { | ||
// We do not use a Button with destructive role here as we would like to display the confirmation dialog first. |
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.
That's very nice! could you add that behaviour to the group members list, too?
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.
Don't forget this one :)
Monal/Classes/ContactsView.swift
Outdated
} | ||
} | ||
.sheet(isPresented: $addContactIsPresented) { | ||
NavigationStack { |
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.
Would be nicer to not open a new navigation stack here, but use the current one (that would look nice even on ipad/macos, I guess) and let the user return to the contact list by using the back button.
68452f7
to
5454976
Compare
7a2db25
to
63cdd0f
Compare
PopoverHere's how it looks now: full-example.mp4.compressed.mp4.rotated.mp4There is one edge case: if the view size changes from regular to compact (or vice versa) while the view is open, the button doesn't get added or removed: button.mp4.compressed.mp4.rotated.mp4I'm looking into this now, but it might take some time to work out. It may be easier to wait until the ActiveChatsViewController is also SwiftUI. Group list swipe actionSwipe action now doesn't allow full swipe, and users joining and leaving are now animated (presence changes are not animated yet). group-swipe-action.mp4.compressed.mp4Here's how the sheet looks on the iPhone: (sheet looks the same as before in both cases, just wanted to show it) |
Regarding the back button stuff: have a look at This should allow you to trigger an event if the split view type (compact/expanded) changes and react accordingly in swiftui. It will allow you to remove the code passing in the state ( |
63cdd0f
to
77e7070
Compare
GitHub is getting stuck uploading the video. So here's a blurry gif instead :) https://github.com/user-attachments/assets/9af4f125-b06f-4377-a179-231c8479e18b |
I feel like Is the |
This convenience method is also not available in iOS 16, so we redefine it making use of our existing shim. The signature does not exactly match Apple's, but it's sufficiently similar that we can drop in the real version without changes when needed, simply by renaming the class being called.
This is a reusable badge designed to be overlaid on top of Buttons when they have notifications.
Sorting is done via the contact's display name first, and by jid second.
This view was shown incorrectly in certain situations when inside a popover. This commit introduces a workaround so that SwiftUI uses consistent spacing, whether the popover is presented as a popover or a sheet.
This can be used to tell us whether we should display back buttons in popovers.
This makes sure the sizeClass in ActiveChatsViewController is always kept in sync with changes to the size class (e.g. when the size changes in split view).
Apple guidelines state that we should only display a close button on a popover for confirmation or guidance. Therefore, there are some situations where we would like to display a popover without a close button. This commit allows us to only display the close button inside AddTopLevelNavigation when it is needed. Unfortunately, we have to retrieve the size class from the active chats view controller. It doesn't work to use @Environment(\.horizontalSizeClass) within AddTopLevelNavigation, since this will always display as compact within the popover itself.
We only animate additions and removals from the group here. Animating presence changes (e.g. fading the opacity in and out) and affiliation changes is still to do, as it requires a larger refactor.
77e7070
to
8ff851d
Compare
Here's how the back-button-applied-everywhere-rotated.mp4.compressed.mp4 |
Introduction
This PR implements the first part of #1094
To do in (if it's ok) future PRs:
ObservableKVOWrapper<MLContact>
everywhere for live updatesContactEntry
to match the old contacts screenContactsViewController.m
etc.Videos
iPhone
1094-iphone-full.mp4
iPad
At 2:22, the contact gets deleted from another device.
1094-ipad-full.mp4
Animated notification badge
Just before raising this PR, I noticed the contact request notification badge wasn't animated.
I didn't want to re-record everything, so here's a recording of just that animation.
1094-notification-animation.mp4