Permalink Tweaks 2 (#2766)

* Missing changelog.

* Parse bare room aliases as permalinks.

Update the SDK.

* Fix tapping the same permalink twice.

Add a test.

Don't clear the focussed item when reaching the bottom of the timeline.

* Make sure sending a message returns to live.
This commit is contained in:
Doug
2024-04-29 17:32:16 +01:00
committed by GitHub
parent aaa8af2996
commit 7c94ed98a5
18 changed files with 111 additions and 52 deletions
@@ -85,6 +85,7 @@ enum RoomScreenViewAction {
case sendReadReceiptIfNeeded(TimelineItemIdentifier)
case paginateBackwards
case paginateForwards
case scrollToBottom
case timelineItemMenu(itemID: TimelineItemIdentifier)
case timelineItemMenuAction(itemID: TimelineItemIdentifier, action: TimelineItemMenuAction)
@@ -112,11 +113,8 @@ enum RoomScreenViewAction {
case focusOnEventID(String)
/// Switch back to a live timeline (from a detached one).
case focusLive
/// Remove the highlighted event without switching timeline.
///
/// This is useful when returning to the bottom of the live timeline
/// if `focusOnEventID` didn't use a detached timeline.
case clearFocussedEvent
/// The timeline scrolled to reveal the focussed item.
case scrolledToFocussedItem
}
enum RoomScreenComposerAction {
@@ -229,7 +227,10 @@ struct TimelineViewState {
var isLive = true
var paginationState = PaginationState.default
var focussedEventID: String?
/// The ID of the focussed event navigated to via a permalink.
var focussedEventID: String? { didSet { focussedEventNeedsDisplay = focussedEventID != nil } }
/// Whether the timeline should scroll to `focussedEventID` once its item has been built and added to the timeline.
var focussedEventNeedsDisplay: Bool
// These can be removed when we have full swiftUI and moved as @State values in the view
var scrollToBottomPublisher = PassthroughSubject<Void, Never>()