Commit Graph

88 Commits

Author SHA1 Message Date
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
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
Stefan Ceriu ab82068740 Make the AnalyticsServiceMock default a variable as well, for consistency. 2026-05-21 12:37:52 +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
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
Doug f23b77a481 Bold the room cell when highlighted if not showing all activity. (#5468) 2026-04-22 16:04:33 +01: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
Mauro bbbb2e9dee Refactor and redesign Location Sharing Screen (#5155)
* refactored the static location screen to the location sharing screen

# Conflicts:
#	UnitTests/Sources/LocationSharingScreenViewModelTests.swift

# Conflicts:
#	ElementX.xcodeproj/project.pbxproj

* implemented a custom pin with an overlayable view

* implemented the render of the user when the location is sender instead of the pin type

* removed description and body they are not used at all.

* reimplemented single button for sharing this or user location + implemented an experimental way to update annotations

* removed unnecessary @Suite description

* implemented a way to display the alert on top of the sheet and added a spinner to the center user location button

* fixed alerts strings

* fixed a failing test

* improved preview tests
2026-03-06 12:51:16 +01:00
Stefan Ceriu 23062901c0 Update files following swiftformat upgrade 2026-01-27 12:50:57 +02:00
Doug a53b9137ef Add a dedicated target for SDK mocks to avoid type name conflicts on the generated code. 2026-01-06 10:57:37 +00:00
Stefan Ceriu cdc77a0cd1 Tweakity tweak tweaks 2025-12-11 15:42:17 +02:00
Stefan Ceriu 8518e67426 Move the room list sending state icons to the front of the latest event. 2025-12-11 15:42:17 +02:00
Doug 3b42a784c8 Add accessibility hints for the send state in the room list. (#4804) 2025-12-01 13:28:48 +00:00
Doug 62930968f8 Show the last message state in the room list. 2025-11-27 16:43:48 +00:00
Mauro f7dd9cdcf8 Update copyright holding and dates (#4640)
* Update copyright holding and dates

* compound IDE Macros updated

* update copyright

* update copyrights done

* update templates and README
2025-10-21 14:34:56 +02:00
Doug 2f2e6f6226 Revert weak media provider (#4483)
* Revert "Address the real lifetime issue of the SDK's `Client` by making `Context.mediaProvider` weak. (#4466)"

This reverts commit c794144ef1.

* Better docs.
2025-09-08 17:48:58 +01:00
Doug c794144ef1 Address the real lifetime issue of the SDK's Client by making Context.mediaProvider weak. (#4466)
This reverts commit 927aea4bfe.
2025-09-05 17:18:14 +00:00
Doug 441f5ae975 Tweaks discovered when using Compound overrides. (#4456)
- Fixes a bug where gradients wouldn't use the latest tokens after first use.
- Makes the bloom aware of colour overrides (and discovers a bug with dark mode).
- Decouples HomeScreenCell from the HomeScreenViewModel.Context (so it can be previewed with colour overrides).
2025-09-02 09:40:03 +01:00
Doug 3dc6d73899 Add SpaceRoomCell & Space…ProxyProtocols and use them on the SpaceListScreen. (#4404) 2025-08-13 12:06:29 +01:00
Mauro Romito 5c030f6682 hide accessibility when the home screen cell is in placeholder mode 2025-07-21 20:11:18 +02:00
Mauro 4d87612f21 a11y labels added to the home screen cell symbols (#4298) 2025-07-07 15:09:54 +02:00
Mauro Romito 26a7d5ac82 pr suggestions 2025-06-06 10:49:29 +02:00
Mauro Romito 155b47e849 tombstoned and upgraded rooms implementation
added tests

tombstoned room avatar
2025-06-06 10:49:29 +02:00
Doug e14672e1f6 Dismiss room invite notifications when rejecting them from the home screen. (#4074) 2025-04-28 16:33:49 +01:00
manuroe 3950cac085 Dual licensing: AGPL + Element Commercial (#3657)
* New LICENSE-COMMERCIAL file

* Apply dual licenses: AGPL + Element Commercial to file headers

* Update README with dual licensing
2025-01-06 11:27:37 +01:00
Stefan Ceriu 664e87fe87 Switch license to AGPL (#3237)
* Switch license file to AGPL

* Update file copyright headers

* Update the default project file header
2024-09-06 16:34:30 +03:00
Stefan Ceriu f89c3e54b4 Automatically try reloading failed images on network changes (#3170)
* Add the networkMonitor to the NSE and delete the old MockMediaLoader

* Generate a MediaLoaderMock through AutoMockable and use it in the MediaProviderTests

* Implement an ImageProvider mechanism that automatically tries reloading images when connectivity is established again and use it for LoadableImages

* Merge the ImageProvider protocol back into the MediaProvider

* Address PR review comments

* Provide a default sdk client request configuration

* Address tasks not automatically cancelling themselves when views get deallocated
2024-08-15 18:20:19 +03:00
Stefan Ceriu d71c8c4e83 Use local room list sorting from Rust. (#2978)
* Switch to the new local room list sorting API

* Get rid of the RoomSummary enum, replace it by the inner RoomSummaryDetails

* And finally, rename RoomSummaryDetails to RoomSummary

* Fix a bunch of warnings

* Small tidy up post rebase/review.

- Remove unused invalidated property.
- Rename some RoomSummary instances to summary instead of details.
- Fix tests with missing roomListItem's.

* Update snapshots

---------

Co-authored-by: Doug <douglase@element.io>
2024-07-05 10:10:53 +01:00
Doug 834260c144 Use the room heroes when computing a DM avatar. (#2900)
* Use room heroes for DM avatar content ID.

* Use RoomAvatar.heroes for the DM Details stack.
2024-06-19 10:27:10 +00:00
Stefan Ceriu 3a904ebc9d Replace the old MockUserSession with the generated UserSessionMock 2024-05-27 17:05:01 +03:00
Stefan Ceriu 932ba75550 Replace the existing RoomSummaryProviderMock with a generated one 2024-02-29 10:14:37 +02:00
Stefan Ceriu c8f728ca23 Replace the existing MockClientProxy with a generated one + special configuration options 2024-02-28 17:18:01 +02:00
Stefan Ceriu 6d9271ce59 Fixes #2320 - Implement support for (un)marking rooms as favourite from the room list and room detail screens 2024-02-19 17:51:43 +02:00
Stefan Ceriu d7a190ba23 Fix room list cell highlighting issues, add unit tests 2024-02-09 14:05:12 +02:00
Doug d0c835a9bf Add a setting to hide unread messages badges. (#2412)
* Add a setting to hide grey unread messages badges.

* Move room badge logic to be built in the view model instead of in the view.

* Move setting into DeveloperOptions.
2024-02-07 13:00:35 +00:00
Stefan Ceriu 9915a33964 Fixes #2360 - Add support for manually marking rooms as unread (#2408)
* Fixes #2360 - Add support for manually marking rooms as unread

* Add analytics for marking rooms as (un)read

* Remove unnecessary analytics abstraction levels

* Fix breaking API changes following SDK bump

* Add changelog

* Handle PR comments

* Fix unit tests
2024-02-05 18:06:50 +02:00
Doug e80612b968 Update compound and remove all of the temporary icons (#2419)
* Update compound and fix breaking changes.

* Replace a lot of temporary icon assets with Compound versions.

* Replace temporary composer icon assets with Compound versions.

* Remove old icon asset from EI.

* Use Compound icons where possible for hero images.

* Snapshots
2024-02-05 16:03:13 +00:00
Mauro 550db5e377 Fix: Grey dot appears when you have unread messages that do not trigger a notification (#2371) 2024-01-23 15:14:53 +00:00
Mauro dd28261e1f Bump SDK + Mention Badge fix (#2367) 2024-01-22 17:43:39 +00:00
Mauro f844cd1a2f MentionBadge FF (#2281) 2023-12-22 17:57:07 +01:00
Mauro b4538b759f Revert "Mention badge + badge behaviour redesign" (#2283) 2023-12-22 09:44:10 +00:00
Mauro d148827eae Mention badge + badge behaviour redesign (#2276) 2023-12-21 15:05:39 +00:00
Mauro d99d26fcdc Removing Dead Code part 1 (#2234) 2023-12-13 09:51:57 +01:00
Doug 2c1e61a1bc Add SwiftLint rule to enforce stack spacing. (#2080)
Xcode 15 changes the default behaviour and given we're always working from designs, we shouldn't rely on it for our layout.
2023-11-14 12:38:38 +00:00
Stefan Ceriu bc46c48b2e Update room summary provider mock room details and snapshots 2023-11-13 17:02:02 +02:00
Stefan Ceriu 5c4e0bd76d Display whether a call is ongoing in any particular room on the room list 2023-11-13 17:02:02 +02:00
Mauro 0b31446817 Resizable Composer With Completion Suggestion View (#1971)
* resizable composer with suggestions view

* FF cleanup

* removing the view when the vertical size is compact

* merge conflict fix

* done

* solving a conflict

* Update ElementX/Sources/Screens/ComposerToolbar/View/CompletionSuggestionView.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* pr suggestion

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2023-10-27 13:54:30 +00:00
Nicolas Mauri 2f0b5a42f5 Prevent multiple conversion of the same voice message audio file. (#1887) 2023-10-13 09:48:11 +00:00
Mauro 7bde419e85 Pill View (#1797)
* provider can now check the current session

* More testable code

* created the test condition

* it works but not always not sure why, need to dig deeper

* sadly we need to use textkit 1 to solve this issue

* removed developer option screen test

* this experimental solution kinda works but I need a way to pill recomputation is weird

* format

* display improvement

* better and faster solution

* pilished the code

* better coloring

* swift format

* just need to solve the caching issue

* fix caching issue

* tests done!

* changelog

* pr comments addressed

* all pr comments addressed

* docs

* line lenght

* updated tests and fixed a parsing permalink issue

* MentionBuilder

* pr comments

* swiftformat

* code blocks should not have links

* Update ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update ElementX/Sources/Services/Client/ClientProxy.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update UnitTests/Sources/AttributedStringBuilderTests.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update ElementX/Sources/UITests/UITestsAppCoordinator.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update ElementX/Sources/Other/Pills/MentionBuilder.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* pr comments

* swiftformat

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2023-09-27 17:27:07 +00:00