Add an action to the newly introduced FloatingDateBadge that scrolls the timeline to that day. (#5350)

and replace the TimelnieTableViewController's `floatingDateText` with a pure date.
This commit is contained in:
Stefan Ceriu
2026-04-14 11:27:27 +03:00
committed by GitHub
parent 07b139b307
commit 7ff2cf618b
11 changed files with 73 additions and 37 deletions
@@ -56,6 +56,7 @@ enum TimelineViewAction {
case paginateBackwards
case paginateForwards
case scrollToBottom
case scrollToFirstItemForCurrentDate
case displayTimelineItemMenu(itemID: TimelineItemIdentifier)
case handleTimelineItemMenuAction(itemID: TimelineItemIdentifier, action: TimelineItemMenuAction)
@@ -152,8 +153,8 @@ struct TimelineViewState: BindableState {
struct TimelineViewStateBindings {
var isScrolledToBottom = true
/// The formatted date text for the floating date badge shown while scrolling.
var floatingDateText: String?
/// The timestamp of the topmost visible item, used to drive the floating date badge while scrolling.
var floatingDate: Date?
/// The state of wether reactions listed on the timeline are expanded/collapsed.
/// Key is itemID, value is the collapsed state.
@@ -247,6 +248,7 @@ struct TimelineState {
/// These can be removed when we have full swiftUI and moved as @State values in the view
var scrollToBottomPublisher = PassthroughSubject<Void, Never>()
var scrollToFirstItemForDatePublisher = PassthroughSubject<Void, Never>()
var itemsDictionary = OrderedDictionary<TimelineItemIdentifier.UniqueID, RoomTimelineItemViewState>()