Commit Graph

1130 Commits

Author SHA1 Message Date
Doug fa67713726 Run SwiftFormat. 2026-05-27 17:11:42 +01:00
Quentin Gliech 2082e71888 Recognise dragged iOS screenshots as images instead of raw data
When dragging the floating screenshot preview into a room, iOS hands us
a provider whose `suggestedName` is e.g. `Screenshot 2026-05-22 at
14.49.40`. `NSString.pathExtension` returns `"40"`, so the previous
`!pathExtension.isEmpty` check treated the timestamp's trailing segment
as a real extension. The file got written without `.jpg`/`.png`, and the
`MediaUploadingPreprocessor` then fell back to `application/octet-stream`
which is why screenshots showed up as a "data" tile.
2026-05-25 11:01:28 +03:00
Doug 08d02001bf Tidy up mock creation. (#5627)
* Use our standard XYZMock(.init()) pattern everywhere instead of XYZMock.default.

* Remove the configuration parameter label on mock convenience inits.

* Update the enterprise submodule.
2026-05-22 17:34:35 +01:00
Stefan Ceriu 77c5aba326 Forward current composer text to the new poll form to serve as the question/topic 2026-05-22 16:46:42 +03:00
Stefan Ceriu ac20ff0fc3 Forward current composer text to the media upload preview screen as captions 2026-05-22 16:46:42 +03:00
Michael 22d14ff8e4 AppSettings are Mockable (#5589)
* create DependenciesProtocol and replace ServiceLocator registration with it

replace mocking calls for ServiceLocator to Dependencies

replace ServiceLocator with instance level calls

replace ServiceLocator configs with TestDependencies config in Tests

replace servicelocator usage in analytics service

replace remaining ServiceLocator calls in unit tests

that depended on the UnitTestAppCoordinator configuration with per suite dependencies instances

fix swiftlint warning

remove remaining references to ServiceLocator

make dependencies properties consistent in tests

delete Dependencies and DependenciesProtocol

fix whitespace modifications

updates from PR feedback

a pass over converting AppSettings and AnalyticsService test instance properties to per test instantiation

fix a missed PR feedback

Sync up after rebase

create DependenciesProtocol and replace ServiceLocator registration with it

replace mocking calls for ServiceLocator to Dependencies

replace ServiceLocator with instance level calls

replace ServiceLocator configs with TestDependencies config in Tests

replace servicelocator usage in analytics service

replace remaining ServiceLocator calls in unit tests

that depended on the UnitTestAppCoordinator configuration with per suite dependencies instances

fix swiftlint warning

remove remaining references to ServiceLocator

make dependencies properties consistent in tests

delete Dependencies and DependenciesProtocol

* AppSettings is instance level mockable now

* replace mocked and preview usages of reset + AppSettings global init with

AppSettings(store: UserDefaultsMock())

* AppSettings.UserDefaultsKeys is now a RawRep struct, making it extensible

* update tests with new AppSettings so it builds

* update remaining AppSettings test/mock inits

* AppSettings.UserDefaultsKey conformed to ExpressibleByStringLiteral

* addressed issues found in first pass ai review

* update AppSettings instantiations after rebase

* fix accessibility tests coordinator after rebase

* Rename to VolatileUserDefaults

* AppSettings init uses mandatory parameter

* Revert UserDefaultsKey to enum

* Add TrackedUserDefaults to be able to reset the defaults object

* Added volatile static func to AppSettings

* Use .volatile() static func instead of full init

* review fixups

* Resolve build issues after rebase

* updated enterprise module

* remove the static reset settings call from the preview tests

---------

Co-authored-by: Mauro Romito <mauro.romito@element.io>
2026-05-22 15:14:08 +02:00
Michael dfebb4719c Compiler Warning Reductions (#5609)
* Reduce warnings in AttributedStringBuilderTests

(cherry picked from commit e1f32b2b1df147c93207e01df5c8fec4046b0f48)

* Fixed Sentry warning

(cherry picked from commit e45c3002b2331a6f2d363de61a12377316078602)

* JoinRule and AllowRule conform to Sendable

(cherry picked from commit 27c67c27b944df11adc17bdd405e442e8c50b0d6)

* AudioConverterProtocol conform to Sendable

(cherry picked from commit 352bdab15db424c632538eb3140858eae9fdfb15)

* TimelineControllerProtocol conform to Sendable

(cherry picked from commit 07a927745624db4bab3cf68842027e12177be70b)

* Resolved some AI review notes

(cherry picked from commit 8d3ac820754a6126785e639a98c8c1fcf86ef77f)

# Conflicts:
#	ElementX/Sources/Other/SendableConformance/SendableBox.swift
#	ElementX/Sources/Other/SendableConformance/WeakSendableBox.swift
2026-05-22 10:56:30 +02:00
Danny eae464ecd7 Timeline: add a Jump to Unread button and a new-message badge on the scroll-to-bottom button. (#5506)
* Timeline: add a Jump to Unread button and a new-message badge on the scroll-to-bottom button.

* Rename scrollToFirstUnread to scrollToReadMarker for consistency with isReadMarkerVisible.

* Cache readMarkerUniqueID and unreadMessageCount as stored properties on TimelineState.

* TimelineViewModel: rename newTimelineItems and drop redundant ordering comment.

* Use Compound chevron icons in TimelineScrollButton.

* Fix TimelineScrollButton layout at large dynamic type sizes.

* Add a trailingAccessory slot to topBanners and use it to dodge banners with the jump-to-read-marker button.

* Put jump-to-read-marker behind a developer-options feature flag.

* Fine-tune TimelineScrollButton sizing and badge colour.

* Remove TimelineScrollButton chevron offset that was compensating for SF Symbol centering.

* Drop the new-messages count, replace with a presence dot.

* Move both timeline scroll buttons to bottom-right and revert topBanners trailingAccessory slot.

* Position TimelineScrollButton badge above for up direction and below for down direction.

* Add long-press mark-as-read pill to the timeline scroll buttons

* Read isSwitchingTimelines from state in updateHasNewMessagesAtBottom.

* Use assertionFailure when scrollToReadMarker is called with no read marker.

* Add TimelineScrollButton preview snapshots.

* (fix) design and various self-review issues

* (fix) suppress scroll button tap after long-press

* (feat) fall back to RoomInfo.fullyReadEventID for jump-to-unread

* (fix) hide jump-to-unread immediately after mark-as-read

* (fix) align with newer matrix-rust-sdk surface

* Bump the RustSDK to v26.05.20

---------

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
2026-05-21 15:03:32 +03:00
Stefan Ceriu ab82068740 Make the AnalyticsServiceMock default a variable as well, for consistency. 2026-05-21 12:37:52 +03:00
Michael dd0de4d7b0 Custom Notification Tones (#5527)
* added foundation for custom notifications

* feat: add localizations for tone names

also, if available, include the pro sound in the element x sound list

* use a static file location to store the notification tone

and update the file at that location when selected

* if there's a problem previewing or setting the alert tone, toast the user with the error

* rename tone directory

* create NotificationToneManager to handle tone business logic

* conform to project formatting

* assign custom sound to actual notifications

* dry up notification generation in the nse

* add compilation condition for including notification alert tone and remove from share extension

* swift format had some opinions

* flatten the notification tone ui, removing system/elementx designations

* fix stored file url breaking due to sandbox path changes

* tone manager can import custom tones and provide a list of imported tones

* ui support for custom tones

* can delete custom imported tones

* sort the custom tones

* add additional preset sounds

* can choose caf files for custom sounds and fix location persistence issues

* store sound locations with relative links

this is a better solution than storing bookmarks since bookmark resolution can be variable and differ from freshly derived urls

* add docs for new notification features

* run tone conversion in background

* resolved several ai found issues

* added protocol and mocks for notification tone manager

* added tests for notification settings screen vm interactions with the tone manager

* add tests for notification tone manager

* rename element tone names per feedback

* move custom tone option to the top of the notification tone list

* rename Tone to Sound for consistency with Android

* remove additional bundled tones

* restore accidentally deleted Element Default sound file

* system alert tones are filtered by what's available on the system prior to finalizing the collection

* Add a couple more caf file conversion log statements

* Simplify the notification sound conversion logic

* Update notification sound strings in sync with Android

* update xcodeproj after rebase

* remove conditional compilation and include NotificationAlertSound in share extension

* Use AudioPlayer instead of custom tone previewer and remove the previewer

* rename NotificationTone

* Consolidate and move errors to top of NotificationToneManager

* tone manager no longer depends on userinterfacecontroller

* Move static Tone properties to NotificationToneManager

* resolve view model initializer feedback

* update xcodeproj

* fatalerror when tone manager cannot init

* Remove banner icon on alert tone error

* fixup review feedback

* Moved URL handling to NotificationToneManager
2026-05-20 15:40:34 +03:00
Michael 5a07c98afc Make AnalyticsService mockable via `AnalyticsServiceProtocol (#5599)
* Create AnalyticsServiceProtocol and conform AnalyticsService

* Replace AnalyticsService properties and arguments with AnalyticsServiceProtocol

* Inline AnalyticsServiceMock replacing old mock

* handle more complex AnalyticsServiceMock callsites

* move documentation from AnalyticsService to AnalyticsServiceProtocol
2026-05-20 08:23:58 +03:00
Mauro 6c0aaa7a58 Invite the DM recipient to a new room (#5588)
* handle the details to invite users flow.

* implemented the room creation in the invite screen, and its dismissal + navigaton to the newly created room

* updated preview and unit tests

* pr suggestions
2026-05-18 10:08:07 +02:00
Michael ff5dcb040d Replace the ServiceLocator with direct dependency injection (#5548)
Removes the ServiceLocator singleton and instead directly injects the dependencies it was holding for more control over instantiation of the various component subtrees and better visibility over how they're being used.
2026-05-14 09:45:49 +03:00
Mauro Romito 07fc022a65 prevent replies to LLS timeline items, and live location sharing in threads 2026-05-12 17:26:02 +02:00
Mauro Romito deac31e48d remove code related to the previous bidi usage implementation of whitespaces for the timestamp label 2026-05-12 14:46:18 +02:00
Doug e235e3ba81 Link new device with QR code tweaks. (#5563)
* Hook up Rust's InvalidCheckCode failure to the right state when linking a new device.

* Automatically regenerate a new QR code instead of ending the flow when it expires.
2026-05-11 14:22:34 +01:00
Valere Fedronic ba23153ab4 feat: Render declined calls in DM timeline (#5512)
* feat: Render declined calls in DM timeline

* Record preview snapshots

* review: Use CallIntent constant

* review: clean-up

* Record preview snapshots

* review: Move private field to the bottom with MARK: - Private

* review: Male CallIntent a string enum to use rawValue

---------

Co-authored-by: Element CI <ci@element.io>
2026-05-11 14:51:30 +03:00
Mauro Romito 53669a606c Add the setting to change live location permissions to the change permissions screen. 2026-05-06 13:53:36 +02:00
Mauro Romito 2ce32d00ef update SDK to 26.05.06 2026-05-06 13:04:11 +02:00
Mauro Romito 680a9a587c Show alert if user has not beacon and beaconInfo permissions in the room. 2026-05-05 15:10:38 +02:00
Doug 0acbc41432 Rename OIDC to OAuth. (#5525)
* Rename OIDC to OAuth.

* Update the enterprise submodule.
2026-05-05 14:07:06 +01:00
Doug fef942f529 Restore the .oidcCallback route for external authentication. (#5391)
* Restore the .oidcCallback route (partially reverts #3461) for external authentication.

* Make sure OIDC also works for non-http URLs.

* Remove oidcAuthentication from the state machine.

There isn't a reliable way to detect failure/cancellation when e.g. the user returns from an external app without interacting with the MAS page.
2026-05-05 12:47:07 +01:00
Mauro Romito d02459d9b8 limit knock FF only room creation and access type changes
# Conflicts:
#	ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift
2026-05-04 14:12:31 +03:00
Doug 9015c3e483 Fixes for multi-window support. (#5528)
* Correctly handle the re-opening of the main window.

Add an additional safe-guard to ensure only one main window exists.
Make sure all secondary windows use the correct tint colour.

* Fix a bug where the settings screen isn't shown on macOS when the AppLock feature is enabled.
2026-05-01 14:44:04 +01:00
Mauro 76f744b9c4 Live Location Sharing - handle server echoes (#5514)
* Track active live location sessions by ID instead of timeout.

# Conflicts:
#	ElementX/Sources/Services/Location/LiveLocationManager.swift

* implemented a system to promote starting session to active sesessions to send locations at the right time, and a system to remove a local session if it's handled by an external device.

* pr suggestions

---------

Co-authored-by: Doug <douglase@element.io>
2026-04-30 13:18:36 +00:00
Doug 63592e48c1 Remove support for handling SPA calls within the app. (#5515)
* Remove support for handling SPA call links.

They were a stop-gap solution whilst we were building support for embedded room calling.

* Simplify ElementCallConfiguration now that there is only 1 type of call to handle.

* Remove the unused overlayModule from NavigationRoomCoordinator.
2026-04-29 19:32:38 +01:00
Doug 7bce116d9e Update the SDK, handling OIDC/OAuth API breaks. (#5497)
Update the SDK handling API breaks.
2026-04-27 14:46:53 +01:00
Doug 0087b5a4e5 Fix a bug where the onboarding flow was dismissed by logging out. (#5481)
* Fix a bug where the onboarding flow was dismissed by logging out.

* Add some tests for the available actions while we're here.

---------

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
2026-04-27 14:33:09 +01:00
Mauro Romito 876109ef75 removed LLS feature flag 2026-04-27 15:13:07 +02:00
Mauro Romito c33cb5671c disabled the flaky test callIsTimingOut 2026-04-27 14:13:13 +02:00
Richard van der Hoff 9a2a852af3 Promote "history sharing on invite" out of developer options (#5480)
* Enable key-share-on-invite irrespective of feature flag

* Remove feature-flag dep: warning on starting chat with new people

* Remove feature-flag dep: invite from room member details

* Remove feature-flag dep: warning on new users in invite screen

* Remove feature-flag dep: from room details screen

* Remove feature-flag dep: starting chat from user profile screen

* Remove feature-flag dep: timeline info on forwarded keys

* Remove feature-flag dep: RoomScreenModel

* Remove `enableKeyShareOnInvite` from AppSettings

* Remove `enableKeyShareOnInvite` feature flag

* Remove outdated comments

* Update preview test room snapshots as their header now includes the history sharing icon
2026-04-27 14:43:18 +03:00
Mauro ef26796d98 Open Live Locations map on tapping on the banner (#5477)
* Implemented opening the LLS on our own user when tapping on the banner

* added a test for moving the map as soon as the first update arrives.

* updated preview tests
2026-04-24 13:19:07 +02:00
Mauro Romito b0fa1afe51 Force a stop before starting a new session and resend last location on new starts 2026-04-23 17:53:17 +02:00
Mauro 5e2210f1e8 LocationSharingScreen: fix indefinite loading on the center to location button in non picker mode (#5469) 2026-04-22 16:36:15 +00:00
Mauro Romito ad2143f334 use current value subject and current value publisher for LiveLocationShare updates 2026-04-22 16:43:18 +02:00
Mauro 55f82e69b1 Improve Live Location Sharing with reduced accuracy mode (#5461) 2026-04-22 13:12:03 +02:00
Mauro Romito 2250087cfe handle reduced accuracy authorization case 2026-04-21 13:51:40 +02:00
amshak 2a6f94ff48 Notification Decoration Revised (#5312)
1. I removed the grey dots for when there is activity in rooms set to mentions or mute.
2. For all unread rooms, I made the message preview text bold for better legibility
3. For rooms with no unreads, I made the font weight regular, again for legibility

We have also mergeg the new room list activity rendering with the existing feature hide unread badge feature flag and provide 3 variations: current production behavior, no badge but bolding, and no bolding and no badge
2026-04-21 14:12:07 +03:00
Valere Fedronic d49a6e5a5d Support for ongoing voice vs video call + joining (#5399) 2026-04-21 09:11:52 +00:00
Stefan Ceriu 354cd0f89b Fix session verification SAS flow not automatically starting
With #5116 removing the `verificationRequestAccepted` view state and its
`.startSasVerification` button action we now need another way of starting the SAS
flows whenever the verification requests gets accepted. As such a state machine
transition from `acceptingVerificationRequest` to `verificationRequestAccepted`
will now automatically call `startSasVerification` on the SessionVerificationProxy.
2026-04-20 18:19:27 +03:00
Stefan Ceriu 8f0f652420 Fix various warnings 2026-04-17 10:55:48 +03:00
Stefan Ceriu d43089ee59 Manually update project and resolved packages following Renovate XcodeGen update 2026-04-17 10:47:33 +03:00
Mauro 602d779e3a Render LiveLocations in the map (#5394) 2026-04-14 18:27:34 +02:00
Skye Elliot 78240ebdee Prompt user when inviting users with uncached identities (#5331)
If the user attempts to invite someone (to a room or creating a DM) whose identity is not cached, we prompt them to make sure this was their intention.
2026-04-14 14:51:58 +03:00
Mauro 8bfdc70b9c Fix LiveLocationManager flaky tests (#5389) 2026-04-13 18:05:47 +02:00
Doug 7c812201cb Verify Element X with an existing Element Classic account. (#5374)
* Read and import the secrets from ClassicAppAccounts.

* Record snapshots.

* Add some documentation, tidy up tests and fix the dismissal of the backup instructions.

* Workaround flakey tests (the fulfilments weren't always firing).

* Allow a custom Classic App deep link URL to be configured.
2026-04-13 15:30:09 +01:00
Doug 9590443aac Remove the Spaces Announcement sheet. (#5376) 2026-04-10 17:49:28 +01:00
Mauro 922fcafcd5 Live Location Sharing Banner (#5370)
* Live Location Sharing Banner

# Conflicts:
#	ElementX.xcodeproj/project.pbxproj

* updated the top banner modifier and the top banner views

# Conflicts:
#	ElementX/Resources/Localizations/en-US.lproj/Localizable.strings
#	ElementX/Resources/Localizations/en.lproj/Localizable.strings

* improved the stopping function from the timeline item

* stop live location sharing before starting a new one.

* added some tests for LiveLocationManager

* pr suggestions
2026-04-10 14:50:42 +02:00
Valere Fedronic 7434d531b2 Require video for callkit even if voice call only to workaround a bug answering calls on the lock screen (#5366) 2026-04-09 14:18:06 +00:00
Doug 1a5a709e27 Add a view to show the user's account from Element Classic. (#5361)
No presentation logic yet.
2026-04-08 21:18:03 +01:00