Skip to content

Feat spaces in discover - #15

Open
liviaUeno wants to merge 8 commits into
developfrom
feat-spaces-in-discover
Open

Feat spaces in discover#15
liviaUeno wants to merge 8 commits into
developfrom
feat-spaces-in-discover

Conversation

@liviaUeno

Copy link
Copy Markdown

Add organizational Spaces support

Summary

Adds support for Matrix Spaces as organizational containers across the room service backend and the Element frontend. Spaces are m.space rooms that group other rooms (like folders). They are organizational only: always free, and they do not gate access to the rooms inside them — space membership and child-room access stay independent, as in standard Matrix. This is separate from Bundles (which sell/package rooms); Spaces organize, Bundles sell.

Backend (room_service)

  • Create spaces via /create. The endpoint now accepts a room_kind field (default "group"). When "space" is passed, the room is created with creation_content: { type: "m.space" }. room_kind is persisted in the room business metadata.
  • Spaces appear in discover. get_visible_rooms returns rows where room_kind IN ('group', 'space'), so both rooms and spaces come back from /discover, each tagged with its room_kind so the frontend can separate them.
  • Space creation event unblocked. The check that rejected m.space creation events was removed so spaces can be created.
  • Delete works unchanged for spaces. Deleting a space tombstones it, kicks members and clears its metadata; the rooms that were inside it are untouched (they just lose the organizational parent), which is expected Matrix behavior.

Frontend (Element)

  • Create public spaces through the backend. When a public space is created, it goes through the room service (metadata, keyword, visibility) so it shows up in discover. Private spaces stay native.
  • room_kind sent on creation. Space creation sends room_kind: "space" (rooms keep "group").
  • Space creation error handling. The create dialog now surfaces backend errors (not admin / duplicate keyword / other) instead of failing silently, and keeps the dialog open on error.
  • Visibility sync. When a space's join rule changes (public/private), the change is synced to the backend so the space appears in or disappears from discover accordingly.
  • Spaces in Explore. Public spaces show up in the Explore dialog under a dedicated "Public spaces" section, separate from the rooms list and the bundles list, with an auto-enabled chip when Explore opens.

Notes

  • Scope of this PR: organizational (free) spaces only. Spaces here are free and used purely to organize rooms. Making spaces paid — so that a paid space grants access to the rooms inside it and replaces the Bundle concept entirely — has been approved as the next step, and will come in a follow-up PR built on top of this one. Keeping it separate keeps this PR focused and reviewable; the
    paid-space work reuses the bundle's existing access mechanism (join the user into each child room) rather than rebuilding it.
  • Requires the matching backend and frontend to be deployed together (the Explore section and visibility sync depend on room_kind coming back from discover).

Testing

  • Backend: unit tests for space creation and the create/delete paths.
  • Manual: created a public space, confirmed it appears in Explore under "Public spaces", toggled its visibility and confirmed it appears/disappears from discover, and confirmed deleting a space leaves its child rooms intact.

@liviaUeno
liviaUeno requested a review from zZMathSP August 25, 2026 15:09
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.

1 participant