feat(console): add sorting functionality for spaces list#665
feat(console): add sorting functionality for spaces list#665alikhere wants to merge 5 commits intostoracha:mainfrom
Conversation
|
@Dhruv-Varshney-developer @alanshaw Could you please review this PR whenever you get time. Thanks! |
| /** | ||
| * Sort spaces array based on the selected sort option | ||
| * | ||
| * Note: For 'newest' and 'oldest', we assume the array order from useW3() reflects creation order. |
There was a problem hiding this comment.
I think this ends up being true by virtue of JS engines retaining map insertion order, but the client API makes no guarantee, since it returns a map (which is spread as an array in the W3UI layer).
I'm not certain but if you login on another browser you might get a different ordering to your spaces due to them being added locally in a different order...
So at minimum, the language needs to be changed here as it's not "creation order" it's added order, but I think this will be hard to explain in the case where you login on different browsers/devices...my gut instinct is to just not include this functionality.
Also, a small note on "creation" order - if you import a space (a delegation from someone else) it'll be listed as the newest, but might actually have been created before all your others.
There was a problem hiding this comment.
Thanks for the detailed explanation. I agree the date-based sorting is misleading given the insertion order behavior. I've remove Newest/Oldest options and keep only Name A–Z / Z–A sorting
Summary
Adds sorting functionality to the Spaces list on the console home page, allowing users to sort their spaces by creation date or name.
Features
4 Sort Options:
Persistence:
UI:
Technical Details
useFilteredSpaceshookScreenshot
2026-02-09.20-41-50.mp4
Closes #648