Commit Graph

829 Commits

Author SHA1 Message Date
Mauro
173b39a07f Swift Testing for Unit Tests PART 1 (#5119)
* migrated a lot of unit tests to Swift Testing and added a new implementation for deferred fulfillment

more tests migration

Cleaned the code manually to establish some good patterns

more code improvements

some more code improvements

removed empty tests

update project

* more pr suggestions and cleanups

* removed the TestSetup pattern

* fixing claude not reusing tests

* pr suggestion + added indent rule to swiftformat so that we can prevent AIs to change that
2026-02-19 16:20:47 +01:00
Mauro
77c88a817a Compound - Swift 6.2 and Main actor isolation (#5109)
* compound is now using 6.2 and main actor isolation + some tweaks to make it build tests and EX

* better handling of the nonisolated context for CompoundUIColors

* improving docs

* fix comment

* remove unused Sendable conformance
2026-02-16 10:19:12 +00:00
Doug
46be78bc75 Define the notification sound name in AppSettings. (#5106) 2026-02-13 16:36:45 +00:00
Stefan Ceriu
4ec2516d55 Update the RustSDK and adopt the new tracing configuration that allows maximum size and age limits on all logs.
Set that 100Mb and a week and remove previous rageshake uploading checks as they are no longer required.
2026-02-13 18:00:23 +02:00
Skye Elliot
293f99d5bc Add history sharing badges to room details (#5043)
* chore: Add dependency `SwiftFlow` for use in avatar header badges.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>

* feat: Display history sharing pill in room details.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>

* tests: Add tests for history sharing room details pill.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>

* tests: Update screenshots for RoomDetailsScreen preview tests.

* fix: Use Localazy translations for room details badges

* fix: Address review comments

* fix: Remove line limit from room details badges

---------

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-02-11 12:22:39 +00:00
Doug
6dc66ec777 Remove the global UserIndicatorController.alertInfo, replacing it with local alertInfo usage. (#5087) 2026-02-10 17:16:11 +00:00
Mauro Romito
3a499e44eb always present the space selection even for pre selected spaces 2026-02-10 13:28:55 +01:00
Doug
6e42071cbe Automatically dismiss UserDetailsEditScreen when saving changes. (#5073) 2026-02-09 15:07:50 +00:00
Doug
77496934ce Use our own JoinRule type which doesn't include the reserved .private case. (#5056)
* Stop using Rust's JoinRule.private in mocks.

It isn't used anywhere else (see MSC4413 for more context).

* Use our own JoinRule (and AllowRule) types.

* Update ElementX/Sources/Services/Room/JoinRule.swift

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>

---------

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
2026-02-06 13:54:53 +00:00
Stefan Ceriu
53e1cf4ad5 Fix a couple of warnings 2026-02-02 10:37:21 +02:00
Skye Elliot
fdcf14f282 Display an icon in the room header for rooms with shared history (#5016)
* feat: Display an icon in the room header for rooms with shared history

* fix: Apply suggestions from code review

- Simplifies `isRoomHistoryShared` expressions using type inferrence.
- Adds failure messages to unit test.

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

* fix: Remove extension method in favour of field on configuration.

* fix: Distinguish between `shared` and `worldReadable` icons.

* refactor: Use `RoomHistorySharingState` enum with extension methods

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2026-01-30 13:11:10 +00:00
Doug
97048b750a Fix inline code being rendered as blocks. (#5017)
* Fix inline code being rendered as blocks.

And make blocks non-greedy as well as only scrolling when needed.

* Rename the bubble layout priorities.

* Add an InlineCode attribute so that the builder also strips links from these too.

* Split up the snapshot tests into individual cases.

This should make it much easier to see *what* has changed when regenerating.
2026-01-28 11:46:13 +00:00
Stefan Ceriu
04053ae69b Update files following swiftformat upgrade 2026-01-27 12:50:57 +02:00
Skye Elliot
67497408b4 Remove "history may be shared banner" (#4999)
* Revert "Do not show history visible banner when the user cannot send messages. (#4892)"

This reverts commit 6117ee3a2b.

* Revert "Add a banner to encrypted rooms with visible history. (#4851)"

This reverts commit ae38dc54d4.
2026-01-26 14:59:48 +00:00
Stefan Ceriu
11af2bb0ca Horizontally scrollable code blocks (#5001)
* Remove attributed string backed codeblock background color

* Add code block support to attributed string componentization

* Render code blocks within their own custom horizontal scroll view within the timeline

* Update preview test snapshots

* Introduce a attributed string component type instead of a 2 different booleans.
2026-01-26 12:39:55 +02:00
Doug
cdf615ae5f Remove the protocol for SpaceServiceRoom given its a struct type. (#5000)
* Remove the protocol for SpaceServiceRoom given its a struct type.

* Fix a few missed mocks in the unit tests.
2026-01-26 09:45:46 +00:00
Doug
06e1a71098 Make sure the selected/available rooms are updated when adding space children fails part way through. (#4997)
* Make sure the available rooms are updated if adding space children fails part way through.

* Additionally handle the case where removing rooms fails part way through.
2026-01-23 17:36:26 +00:00
Mauro Romito
8090c4a078 added the create button in the empty state of the space screen and refactored some code 2026-01-23 15:18:55 +01:00
Stefan Ceriu
0ede9fffa0 Fix #4856, fix #4431 - Normalise HTML whitespaces using SwiftSoup's own text()/TextNode.normaliseWhitespace methods 2026-01-22 20:11:45 +02:00
Mauro Romito
d08f843c94 pr suggestions + await PLs of the room to be ready before adding it to the space 2026-01-22 16:40:25 +01:00
Mauro Romito
24f1c0c27f Implemented adding the room to the space after selection, and the editableSpace proxied API. Also updated and added tests. 2026-01-22 16:40:25 +01:00
Mauro Romito
99258a81cd implemented the logic that displays the space selection CTA 2026-01-22 16:40:25 +01:00
Doug
ed892fee94 Add the empty state to SpaceScreen. (#4985)
* Rename PaginationState.timelineEndReached to PaginationState.endReached.

* Rename PaginationState to TimelinePaginationState.

Also renames PaginationStatus to PaginationState so that a TimelinePaginationState consists of the forward and backward pagination states.

* Add the empty state to SpaceScreen.

Only has 1 of the 2 buttons for now.
2026-01-22 12:37:34 +00:00
Stefan Ceriu
d1f1a598d5 Space filters (#4977)
* Add support for SpaceFilters on the SpaceServiceProxy level and a screen that renders them

* Add aliases to a couple of space room mocks

* Update translations and related snapshots

* Add a feature flag for space filters

* Add a new room summary provider filter that takes a list of room identifiers next to the normal state filters

This will take the SpaceFilter's descendants and combine it with the normal filters to reduce the rooms shown

* Add a new space filter button to the home screen and link it to the SpaceFiltersScreen and the actual RoomSummaryProvider room list filters

* Bump the RustSDK to v26.01.20-2 for SpaceFilter support.

* Add a cancellation button to the space filters screen

* Make the filter presentation mode liquidy, move the sheet to within the home screen.

* Address PR comments
2026-01-21 20:19:39 +00:00
Doug
8da856e620 Add space management to the flows. (#4978)
* Add the menu entries to add/remove rooms to/from a space.

* Add a user indicator to SpaceAddRoomsScreen.

* Reset the SpaceRoomListProxy after adding/removing any children.

* Calm the animations down a bit when entering EditMode on the SpaceScreen.
2026-01-21 12:46:02 +00:00
Doug
e4d961225a Silence some warnings. (#4969) 2026-01-19 15:16:16 +00:00
Skye Elliot
d52d0f03a1 Display a badge for messages decrypted using shared keys. (#4937)
* feat: Show info badge for messages decrypted with shared keys

* tests: Add snapshots and tests for forwarder icon.

* fix: Update `EventBasedTimelineItemProtocol.hasStatusIcon`

* fix: Address review comments.

* fix: Use two translations for key forwarded dialog content.

* refactor: Rename `TimelineItemForwarder` to `TimelineItemKeyForwarder`.

Additionally adds a `[weak self]` guard to `encryptionForwarder` alert
handler.

* tests: Add `previewLayout` directive to `encryptionForwarder` previews

* refactor: Remove unused translations, use short-circuiting condition.
2026-01-19 14:27:49 +00:00
Doug
b009b8ed66 Add the initial implementation for managing spaces. (#4963)
This isn't hooked up into the flows yet.
2026-01-16 15:29:27 +00:00
Mauro
56f6fd294a Create space flow (#4957)
* create space flow implementation

# Conflicts:
#	ElementX/Sources/FlowCoordinators/SpacesTabFlowCoordinator.swift

* create space flow fully implemented and working

* updated tests and updated the create room camera button UI

* updated the avatar button in the create room screen, and added power level overrides for spaces

* update power level content overrides to behave just as EW, and removed ask to join when creating a space regardless of the FF

* updated UI tests snapshots

* invite for a public space should always be forced to 50

* pr suggestions + PL override fix

* fix a missed code change
2026-01-15 13:52:18 +00:00
Doug
ce53a7a5c2 Tidy up the naming of spaces a bit more. (#4955)
* Rename SpaceListScreen to SpacesScreen

To avoid confusion with the SpaceRoomListProxy.

* Rename SpaceExplorerFlowCoordinator to SpacesTabFlowCoordinator and ChatsFlowCoordinator to ChatsTabFlowCoordinator.
2026-01-14 13:45:25 +00:00
Doug
9b03ceb7c6 Implement the SpaceAddRoomsScreen. (#4951)
* Update proxies ready for adding rooms to a space.

- ClientProxy.recentlyVisitedRooms to take a filter and to return room proxies.
- Expose SpaceServiceProxy.addChildToSpace.

* Implement the SpaceAddRoomsScreen.

* Fix the designs of the selected carousels.

Add more snapshot tests for inviting users.

* Fix for screen using wrong avatar size.
2026-01-14 12:07:57 +00:00
Doug
a19c7fff1f Rename SpaceRoomProxy to SpaceServiceRoom and stop proxying the struct. (#4952)
* Rename SpaceRoomProxy to SpaceServiceRoom.

The underlying type is a struct, we don't need to proxy it.

* Actually stop proxying the SpaceRoom.
2026-01-13 12:00:20 +00:00
Stefan Ceriu
ed126bf2b7 Fix #4913 - Email addresses are detected as URLs 2026-01-12 20:49:31 +02:00
Stefan Ceriu
b38480e1e7 Fix #4946 - Linkification strips trailing brackets from URLs 2026-01-12 20:49:31 +02:00
Mauro
2b28b70871 Create room redesign and refactor (#4942) 2026-01-12 17:49:31 +00:00
Doug
082a2f850e Handle OIDC cancellation and workaround missing progress when linking a new device. (#4935)
* Fix a bug where the link device flow wasn't dismissed when complete.

* Listen for cancellation of the WAS when linking a device (dismissing the QR screen when it happens).

* Add CustomStringConvertible conformances to QRCodeLoginScreen actions.
2026-01-09 14:08:05 +00:00
Doug
15eae621b2 Add tests for linking a new device. (#4934)
* Replace GrantLoginWithQrCodeHandlerSDKMock with LinkNewDeviceServiceMock.

Add tests for all initial states on the QRCodeLoginScreen.

* Add tests for linking both mobile and desktop devices.

* Add UI tests for linking a new device.

* Don't show the Link Desktop Computer button when running on macOS.

This mirrors the decision to hide the Sign In With QR Code button on the start screen.
2026-01-09 13:10:14 +00:00
Doug
7c839efffc Add support for linking new devices in the QRCodeLoginScreen. (#4891)
* Adds the remaining parts for showing/scanning a QR code to link a new device.

* Refactor the QRCodeLoginService to work the same way as the LinkNewDeviceService.
2026-01-07 12:18:39 +00:00
Skye Elliot
6117ee3a2b Do not show history visible banner when the user cannot send messages. (#4892) 2026-01-06 16:36:19 +00:00
Doug
a78a923b0d Add a dedicated target for SDK mocks to avoid type name conflicts on the generated code. 2026-01-06 10:57:37 +00:00
Doug
9304c3cc65 Refactor SpaceServiceProxy.joinedSpaces to topLevelSpaces. 2026-01-06 10:57:37 +00:00
ElementRobot
e95b00746b Translations update (#4894)
* Translations update

* Fix (and disable) broken test.

* Update snapshots.

---------

Co-authored-by: Doug <douglase@element.io>
2026-01-05 12:43:05 +00:00
Skye Elliot
ae38dc54d4 Add a banner to encrypted rooms with visible history. (#4851)
* Add a banner to encrypted rooms with visible history. (#4738)

* feat: Add history visible alert.

- Adds a dismissable alert that is displayed whenever the user
  opens a room with `history_visibility` != `joined`. When cleared,
  this is recorded in the app's data store.
- When opening a room with `history_visibility` = `joined`, this
  flag is cleared.

Issue: element-hq/element-meta#2875

* tests: Add unit tests for history sharing in `RoomScreenFooterView`.

* feat: Rename flag to `hasSeenHistoryVisibleBannerRooms`, document.

* refactor: Merge enum variants, use function for banner description.

* feat: Use `AppSettings.historyVisibleDetailsURL` over hard-coded value.

* tests: Correct potential race condition with deferred assertion.

* chore: Use Localazy translation string over project-defined.

* fix: Final tweaks and review comments.

* chore: Checkout `Enterprise` submodule.

* tests: Final fixes.

* fix: Condition banner visibility on feature flag state.

* fix: Prioritise identity violations over history visibility banner.

* tests: Add snapshots for history visible banner.

* tests: Use deferred failure timeout for improved test power.

* chore: Tweaks to spelling, simplify state logic.

* fix: Remove "g".

* fix: Show banner for shared/world-readable rooms, not invited.

* refactor: Use `else-if` instead of `if`.
2025-12-19 15:26:45 +00:00
Mauro Romito
3626f94289 implemented a way to filter out roles that can't be assigned to permission, and disable permissions that are above the current power level of the user. 2025-12-19 11:34:21 +01:00
Stefan Ceriu
b762ce4fc0 Update history visible settings (#4861)
* Fixes #4852 - Update history visible settings

* Address PR comments and move attributed strings to the view state
2025-12-17 15:04:02 +02:00
Doug
046cf6c120 General tidy-up related to QR codes. (#4865)
* Tidy-up Rust to Swift mapping.

* Refactor out a dedicated QRCodeErrorView.

* Use the new QRCodeErrorView for most error state snapshots.

* Simplify QRCodeErrorView structure.

Also updates the background to match the designs.

* Fix a small compile error in the unit tests.
2025-12-16 15:59:59 +00:00
Doug
e9d6116c5f Revert "Add a banner to encrypted rooms with visible history. (#4738)" (#4850)
This reverts commit 1e0bbce3c4.
2025-12-12 11:44:13 +00:00
Mauro Romito
df742ea53d handle the case where a non parent joined space is already available in the existing restricted join rule 2025-12-12 12:13:58 +01:00
Skye Elliot
1e0bbce3c4 Add a banner to encrypted rooms with visible history. (#4738)
* feat: Add history visible alert.

- Adds a dismissable alert that is displayed whenever the user
  opens a room with `history_visibility` != `joined`. When cleared,
  this is recorded in the app's data store.
- When opening a room with `history_visibility` = `joined`, this
  flag is cleared.

Issue: element-hq/element-meta#2875

* tests: Add unit tests for history sharing in `RoomScreenFooterView`.

* feat: Rename flag to `hasSeenHistoryVisibleBannerRooms`, document.

* refactor: Merge enum variants, use function for banner description.

* feat: Use `AppSettings.historyVisibleDetailsURL` over hard-coded value.

* tests: Correct potential race condition with deferred assertion.

* chore: Use Localazy translation string over project-defined.

* fix: Final tweaks and review comments.

* chore: Checkout `Enterprise` submodule.

* tests: Final fixes.
2025-12-11 17:07:57 +00:00
Mauro Romito
c82732ec98 pr suggestions 2025-12-04 16:23:34 +01:00