From de784150372839b90101ad5d4e2f2a78d23af21f Mon Sep 17 00:00:00 2001 From: mjkatgithub Date: Sun, 10 May 2026 01:15:39 +0200 Subject: [PATCH] Implement Matrix space hierarchy and drag-and-drop functionality in chat sidebar - Added collapsible category headers for subspaces in the channel column, allowing rooms to be grouped under `m.space.child` order with a "General" segment for direct space children. - Introduced drag-and-drop reordering for category blocks and rooms, with persistence managed via `m.space.child` and `m.room.power_levels` checks. - Integrated `vue-draggable-plus` for enhanced drag-and-drop capabilities in the space channel sidebar. - Developed helpers and unit tests for space category mapping, state writes, and permission checks related to the new hierarchy features. - Updated internationalization support in `useAppI18n` to include new messages for category expansion and collapse actions. --- CHANGELOG.md | 14 +- app/components/Chat/RoomCategoryList.vue | 292 +++++++++++++++-- app/composables/matrix/spaceStateHelpers.ts | 198 ++++++++++++ app/composables/useAppI18n.ts | 8 +- app/composables/useMatrixClient.ts | 28 ++ app/pages/chat.vue | 190 +++++++++-- app/utils/matrixSpaceHierarchyPermissions.ts | 100 ++++++ app/utils/spaceRoomCategories.ts | 303 ++++++++++++++++++ package-lock.json | 24 ++ package.json | 1 + .../composables/spaceStateHelpers.spec.ts | 52 +++ .../matrixSpaceHierarchyPermissions.spec.ts | 62 ++++ tests/unit/utils/spaceRoomCategories.spec.ts | 207 ++++++++++++ 13 files changed, 1422 insertions(+), 57 deletions(-) create mode 100644 app/composables/matrix/spaceStateHelpers.ts create mode 100644 app/utils/matrixSpaceHierarchyPermissions.ts create mode 100644 app/utils/spaceRoomCategories.ts create mode 100644 tests/unit/composables/spaceStateHelpers.spec.ts create mode 100644 tests/unit/utils/matrixSpaceHierarchyPermissions.spec.ts create mode 100644 tests/unit/utils/spaceRoomCategories.spec.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c1b0e1..c8c51ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Matrix space hierarchy in the channel column: subspaces as collapsible + category headers (chevron toggle), rooms grouped under `m.space.child` + order, and a root-level "General" segment for direct space children (#5) +- Drag-and-drop reordering of category blocks and rooms (within and across + categories) with persistence via `m.space.child` / `order`, gated by + `m.room.power_levels` for `m.space.child` (no DnD when not allowed) +- `vue-draggable-plus` dependency for the space channel sidebar +- Helpers and unit tests for space category mapping, space state writes, and + hierarchy permission checks (`matrixSpaceHierarchyPermissions`) - reCAPTCHA UIA stage (`m.login.recaptcha`) in signup with consent-gated script load and optional iubenda hooks (#57) - Optional Synapse-backed E2E for registration captcha (`@recaptcha_signup`); @@ -104,10 +113,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Space rail (first column) lists only root spaces; nested subspaces appear + only as categories in the second channel column +- Room grouping under a selected space no longer uses `/` prefixes in room + names; ordering follows Matrix space state - Direct message resolution now consults `m.direct` account data before falling back to two-member heuristics for existing rooms - Global auth middleware now also protects the `/rooms` route prefix - - Chat timeline now opens with a bounded initial message window to reduce startup scroll depth and perceived room-load latency - Login page now shows a post-signup success banner (#52) diff --git a/app/components/Chat/RoomCategoryList.vue b/app/components/Chat/RoomCategoryList.vue index 292b84b..d3c230b 100644 --- a/app/components/Chat/RoomCategoryList.vue +++ b/app/components/Chat/RoomCategoryList.vue @@ -1,4 +1,5 @@