Bump Vite 8, matrix-js-sdk, and related deps; fix immer/vanilla-extract imports for new majors. Replace blocking sync error dialog with background recovery on wake/offline, and disable Vite auto-open in dev. Add feature handoff documentation index.
3.5 KiB
3.5 KiB
Sub-rooms — handoff
Summary
Sub-rooms let a parent room own an ordered list of child rooms, displayed nested in the home channel list and manageable in room settings. Hierarchy is stored in Matrix room state (im.paarrot.sub_rooms), not only m.space.child, so channels can nest under a room without full space semantics.
User-facing behavior
- Nested channels under a room in Home sidebar (indented tree)
- Add Sub-Room from room nav context menu (requires power level on
im.paarrot.sub_rooms) - Room settings → Sub-rooms to reorder/remove children
- Creating a sub-room from parent updates parent's
childrenarray - Unjoined sub-rooms show as
UnjoinedSubRoomItemwith join affordance
Architecture
Room state: im.paarrot.sub_rooms { children: string[] }
→ useRoomSubRooms hook
→ Home.tsx flatten tree (addRoomAndSubRooms)
→ RoomNavItem "Add Sub-Room" → CreateRoomModal
→ SubRooms.tsx settings editor
→ SpaceHierarchy.tsx (lobby) reads same state
Key files
| Path | Role |
|---|---|
cinny/src/app/hooks/useRoomSubRooms.ts |
Hook + PaarrotSubRoomsContent type |
cinny/src/types/matrix/room.ts |
StateEvent.PaarrotSubRooms |
cinny/src/app/pages/client/home/Home.tsx |
Renders nested list |
cinny/src/app/features/room-nav/RoomNavItem.tsx |
Add sub-room action |
cinny/src/app/features/room-nav/UnjoinedSubRoomItem.tsx |
Unjoined child UI |
cinny/src/app/features/room-settings/sub-rooms/SubRooms.tsx |
Settings page |
cinny/src/app/features/create-room/CreateRoomModal.tsx |
Appends new room to parent state |
cinny/src/app/features/lobby/SpaceHierarchy.tsx |
Lobby hierarchy integration |
Data model
| Event | State key | Content |
|---|---|---|
im.paarrot.sub_rooms |
"" (empty) |
{ children: string[] } — room IDs in display order |
Power levels: treat like other state events; editors need state_default or explicit level for im.paarrot.sub_rooms.
Dependencies
matrix-js-sdkstate events- Parent room must exist and user must have permission to send state
Integration points
- Home navigation: primary consumer of tree flattening
- Lobby/forums:
SpaceHierarchyreads sub-rooms for display - Create room flow: auto-updates parent on sub-room create
- Distinct from m.space.child space hierarchy (may coexist)
Testing
Manual
- In a room where you have admin, add sub-room from nav menu.
- Verify child appears indented under parent in Home.
- Reorder in Room settings → Sub-rooms.
- Leave child room; verify unjoined state UI.
- Check lobby view shows hierarchy when applicable.
Automated
- None
Known issues & gotchas
- Only joined sub-rooms appear in home tree; unjoined listed separately
- Top-level filter: rooms that appear in any parent's
childrenare excluded from root list - Creating sub-room sends state event on parent — failure leaves orphan room
StateEvent.PaarrotSubRooms as anycasts in sendStateEvent — typing debt
Future work
- Sync with
m.space.childfor federation-friendly hierarchy - Drag-and-drop reorder in nav (DnD exists in lobby, not necessarily sub-rooms settings)
- Depth limits / circular reference guards
Related docs
Add your extra things here
- Interface:
PaarrotSubRoomsContent { children: string[] }inuseRoomSubRooms.ts - Permission check pattern:
permissions.stateEvent(StateEvent.PaarrotSubRooms, userId)