Skip to content

feat: Improve subspace nesting display#252

Draft
KaceCottam wants to merge 36 commits intoSableClient:devfrom
KaceCottam:improve-space
Draft

feat: Improve subspace nesting display#252
KaceCottam wants to merge 36 commits intoSableClient:devfrom
KaceCottam:improve-space

Conversation

@KaceCottam
Copy link

Description

Starter implemention of #47 and ensures it is compatible with Sable's codebase. This change is modified from cinnyapp/cinny#2385.

Documentation from the original pull request:

Improving the handling of sub-subspaces has been requested in cinnyapp/cinny#1855 and cinnyapp/cinny#2056. This PR aims to properly display sub-subspaces (and deeper) in a more intuitive tree structure, which better conveys relationships between spaces, as well as improves their organization and navigation.

Currently sub-subspaces and lower are simply flattened to the end of the subspaces, with no regard for their parent subspace. This can be confusing and difficult to navigate, especially in large organizations or bridges.

This PR:

De-flattens sub-subspaces and displays them under their parents with an indent
Sub-subspaces are treated as items under their parent space (are collapsed when their parents are collapsed)
Enables functionality for creating and reusing sub-subspaces (uses icon button for subspaces, since having two text buttons and an icon-button takes up half the screen on mobile devices)
Adds a check to prevent creating infinite loops
Fixes a bug where reordering a room could sometimes remove it from roomToParents

This PR is limited in scope, possible future improvements could be:

Adding a better way to easily reorganize subspaces in Lobby (drag subspaces into and out of spaces).
A new/reworked Lobby UI that is designed around nested spaces, as the current UI works but could definitely be improved)
Categories only closing when all parents are closed can be somewhat confusing, so being able to manage this per rendered instance would be nice.
Powerlevel propagation (i.e. default powerlevel for different members is copied from the parent space)

Additional Notes

There is some possible de-duplication that probably should be done, as the getInClosedCategories and getAllAncestorsCollapsed functions are very similar in Lobby.tsx and Space.tsx, do say if I should move them to a separate file, and if so where that file should be located. Related to this, merging makeLobbyCategoryId, makeNavCategoryId (and their new respective getXXXXCategoryIdParts) into a single makeCategoryId would simplify things quite a bit, as this is now also used in useSpaceHierarchy.tsx.

Example Image

image

Remaining To-Do Items

  • The "Add Space" or "Add Room" buttons do not request an update from the side bar nor the lobby page. Thus, it is required that we go to a different space and come back to see the lobby updated with new "Add Space"/"Add Room" buttons
  • Improve identification of nested subspace level (I was thinking of using vertical lines in addition to indentation)
  • Easily reorganizing subspaces in Lobby
  • Powerlevel propagation
  • On hovering a long space name in the sidebar, it should scroll such that we can see the full space name. This should be the case for channels as well (perhaps a separate PR?)
  • Create a knope documented changeset in markdown

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [o] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [o] This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@KaceCottam
Copy link
Author

Updated image for the latest set of commits, affecting the sidebar:
image

This limit is configurable in the settings, from "2" up to "10"
image

Next is the lobby view..

@KaceCottam KaceCottam changed the title Improve subspace nesting display feat: Improve subspace nesting display Mar 15, 2026
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.

2 participants