Skip to content

Conversation

stefanceriu
Copy link
Member

@stefanceriu stefanceriu commented Aug 8, 2025

This series of patches introduces a top level UI oriented interface for interacting with spaces.

The SpaceService offers:

  • a method for retrieving one's top level joined_spaces and a subscribe_to_joined_spaces stream that automatically updates based on client activity
    • to do so the service builds a graph from all the m.space.parent and m.space.children state events it knows about, removing cycles and then only keeping parent spaces
  • a SpaceRoomList that can be used to interact with the rooms hierarchy endpoint and retrieve rooms referencing a certain parent
    • the room list is responsible for holding the pagination state as well as listening to client activity and automatically publishing room state updates through its subscribe_to_room_updates publisher (e.g. when joining one of the rooms)

I do appreciate this is a pretty chunky PR but it should be straight forward to review commit by commit.

@stefanceriu stefanceriu force-pushed the stefan/spaces branch 2 times, most recently from 655477a to f52ebdb Compare August 8, 2025 12:02
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 93.26347% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.66%. Comparing base (3ba31d1) to head (89f2483).
⚠️ Report is 35 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-ui/src/spaces/mod.rs 93.96% 16 Missing ⚠️
crates/matrix-sdk-ui/src/spaces/room_list.rs 91.70% 13 Missing and 3 partials ⚠️
crates/matrix-sdk-ui/src/spaces/graph.rs 95.16% 4 Missing and 2 partials ⚠️
crates/matrix-sdk/src/test_utils/mocks/mod.rs 91.48% 4 Missing ⚠️
crates/matrix-sdk-ui/src/spaces/room.rs 91.89% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5509      +/-   ##
==========================================
+ Coverage   88.62%   88.66%   +0.03%     
==========================================
  Files         341      345       +4     
  Lines       95466    96132     +666     
  Branches    95466    96132     +666     
==========================================
+ Hits        84606    85234     +628     
- Misses       6641     6673      +32     
- Partials     4219     4225       +6     

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

Copy link

codspeed-hq bot commented Aug 8, 2025

CodSpeed Performance Report

Merging #5509 will not alter performance

Comparing stefan/spaces (89f2483) with main (3ba31d1)

Summary

✅ 49 untouched benchmarks

@stefanceriu stefanceriu force-pushed the stefan/spaces branch 3 times, most recently from eab6c0c to 0b14496 Compare August 11, 2025 13:07
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

First fast review. Keep going!

@stefanceriu stefanceriu force-pushed the stefan/spaces branch 2 times, most recently from 5024faa to a2a4ef8 Compare August 11, 2025 16:14
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

This is only a review on the FFI layer, but looks great!. Can't wait to see it land 🔭

spacex-2-3537887872

@stefanceriu stefanceriu force-pushed the stefan/spaces branch 5 times, most recently from aff6435 to 8dc94da Compare August 12, 2025 13:06
@bnjbvr bnjbvr changed the title Spaces feat(sdk): Spaces Aug 14, 2025
@stefanceriu stefanceriu force-pushed the stefan/spaces branch 2 times, most recently from cde1a3d to e761648 Compare August 14, 2025 14:57
@pixlwave
Copy link
Member

Something weird is going on with the latest version, all of my joined_spaces have a children_count of 0.

There's a branch here if you want to test the updates with diffing:
https://github.com/element-hq/element-x-ios/tree/doug/sdk-space-service

@stefanceriu
Copy link
Member Author

Something weird is going on with the latest version, all of my joined_spaces have a children_count of 0.

There's a branch here if you want to test the updates with diffing: https://github.com/element-hq/element-x-ios/tree/doug/sdk-space-service

Went ahead and fixed the remaining issues with VectorDiffs, seems fine now on your branch. Thanks for testing!

@stefanceriu stefanceriu force-pushed the stefan/spaces branch 3 times, most recently from 8c7c25b to 71bbeb2 Compare August 19, 2025 07:40
@stefanceriu stefanceriu marked this pull request as ready for review August 19, 2025 08:35
@stefanceriu stefanceriu requested a review from a team as a code owner August 19, 2025 08:35
…ption methods so it can be retained on the client side
…` responses and `SpaceServiceRoomList` instances
…tead automatically setup a client subscription when requesting the joined services subscription
…d components on both the UI and the FFI crates
…ned spaces and space room list subscriptions
…ting up a subscription

- fixes values being reported only after the first sync update
…ice to reduce the number of iterations required
@stefanceriu stefanceriu enabled auto-merge (rebase) August 29, 2025 15:08
@poljar poljar dismissed Hywan’s stale review August 29, 2025 15:35

I took over while Ivan was away.

@stefanceriu stefanceriu merged commit f0c1c65 into main Aug 29, 2025
53 checks passed
@stefanceriu stefanceriu deleted the stefan/spaces branch August 29, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants