Skip to content

Render the live location timeline item#5209

Open
Velin92 wants to merge 4 commits intodevelopfrom
mauroromito/lls_timeline_item
Open

Render the live location timeline item#5209
Velin92 wants to merge 4 commits intodevelopfrom
mauroromito/lls_timeline_item

Conversation

@Velin92
Copy link
Member

@Velin92 Velin92 commented Mar 13, 2026

This PR introduces a new timeline item to handle the Live Location sharing.

As of right now this PR only handles the rendering of such item, but doesn't provide any actions when it is tapped.
This includes:

  • 2 new location marker states, one for the live item, and one for the placeholder/stopped state
  • The LLS timeline model, which is used to translated the SDK content of the LLS timeline item into the data required to render the timeline item view.
  • the LLS timeline item view which either be in a loading, in a stopped or in a live state (which is rendered slightly differently between the outgoing and the received state, since in the outgoing state you are able to also stop it, but this action is still not implemented yet)
  • A way to hide the timestamp/sendinfo since we don't want to render it when in a both live and outgoing state
  • Updated preview tests to handle all the possible states
  • The FF is also used to filter or not the beacon info events from the timeline.
  • PreviewScrollView which is a nice way to keep the scrollable preview but have also a sizeThatFits preview snapshot.

NOTE: There are some bugs within the SDK that make the item no work properly sometimes like:

These are entirely SDK issues, so they will be fixed in a future update

@Velin92 Velin92 requested a review from a team as a code owner March 13, 2026 17:00
@Velin92 Velin92 requested review from stefanceriu and removed request for a team March 13, 2026 17:00
@Velin92 Velin92 marked this pull request as draft March 13, 2026 17:00
@Velin92 Velin92 force-pushed the mauroromito/lls_timeline_item branch from a4c466e to 64052ee Compare March 16, 2026 15:51
@Velin92 Velin92 marked this pull request as ready for review March 18, 2026 12:26
@Velin92 Velin92 force-pushed the mauroromito/lls_timeline_item branch from 51d8d0a to b962fc4 Compare March 18, 2026 12:26
@Velin92 Velin92 added the pr-wip for anything that isn't ready to ship and will be enabled at a later date label Mar 18, 2026
@Velin92 Velin92 force-pushed the mauroromito/lls_timeline_item branch 3 times, most recently from 1cb295d to 16553ba Compare March 18, 2026 12:56
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 83.98876% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.72%. Comparing base (a402d20) to head (0239707).
⚠️ Report is 4 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...meline/TimelineItems/RoomTimelineItemFactory.swift 0.00% 20 Missing ⚠️
...om/RoomSummary/RoomMessageEventStringBuilder.swift 0.00% 8 Missing ⚠️
...melineItemViews/LiveLocationRoomTimelineView.swift 95.62% 7 Missing ⚠️
.../LocationSharing/LocationSharingScreenModels.swift 78.57% 6 Missing ⚠️
.../Items/Messages/LiveLocationRoomTimelineItem.swift 14.28% 6 Missing ⚠️
...urces/Other/SwiftUI/Views/LocationMarkerView.swift 94.00% 3 Missing ⚠️
...entX/Sources/Other/SwiftUI/PreviewScrollView.swift 66.66% 2 Missing ⚠️
ElementX/Sources/Other/Extensions/Date.swift 93.33% 1 Missing ⚠️
...s/LocationSharing/View/LocationSharingScreen.swift 83.33% 1 Missing ⚠️
...ices/Room/RoomSummary/RoomEventStringBuilder.swift 50.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5209      +/-   ##
===========================================
+ Coverage    74.66%   74.72%   +0.05%     
===========================================
  Files          787      790       +3     
  Lines        52558    52865     +307     
===========================================
+ Hits         39244    39503     +259     
- Misses       13314    13362      +48     
Flag Coverage Δ
unittests 64.73% <83.98%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Velin92 Velin92 force-pushed the mauroromito/lls_timeline_item branch 4 times, most recently from 1c8a07d to 0b778ff Compare March 19, 2026 13:17
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's shaping up quite nicely 👍

// Live user with avatar
LocationMarkerView(kind: .liveUser(.mockDan),
mediaProvider: MediaProviderMock(configuration: .init()))
.colorScheme(.dark)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's worth automating dark scheme preview tests. We do have a lot of screenshots already though..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on this?

@stefanceriu
Copy link
Member

stefanceriu commented Mar 19, 2026

Oh, one more thing, please update the PR title: LLS Timeline Item doesn't mean anything to anybody when reaching the changelog and the release notes.

@Velin92 Velin92 changed the title LLS Timeline Item Render the live location timeline item Mar 19, 2026
Velin92 added 4 commits March 19, 2026 17:41
# Conflicts:
#	ElementX/Sources/Other/Logging/Tracing.swift
#	ElementX/Sources/Services/Authentication/AuthenticationService.swift
#	ElementX/Sources/Services/Authentication/LinkNewDeviceService.swift
@Velin92 Velin92 force-pushed the mauroromito/lls_timeline_item branch from 88f8fee to 0239707 Compare March 19, 2026 16:41
@Velin92 Velin92 requested a review from stefanceriu March 19, 2026 16:42
// Live user with avatar
LocationMarkerView(kind: .liveUser(.mockDan),
mediaProvider: MediaProviderMock(configuration: .init()))
.colorScheme(.dark)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on this?


import SwiftUI

struct PreviewScrollView<Content: View>: View {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should wrap it in a #if DEBUG so it enforces the Only use in Previews?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-wip for anything that isn't ready to ship and will be enabled at a later date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants