Option to sort rooms by last active / unread #2867
Replies: 11 comments 1 reply
-
|
It is already possible if you collapse the category. |
Beta Was this translation helpful? Give feedback.
-
|
Kind of, yes, but then you don't see the full list of rooms, so you have to collapse the category, look through unread rooms, then uncollapse it every time, which is also not very convenient, especially when there's a bunch of subspaces in the space. |
Beta Was this translation helpful? Give feedback.
-
|
Seconding this. Currently there's no way to sort the rooms when expanded in any deterministic way, and they're stuck in the order I joined them. |
Beta Was this translation helpful? Give feedback.
-
|
I also would like to have most an option to get most recent chats listed at the top, or to list them in alphabetical order. This is for instance useful for signal bridged rooms, because right now they end up in one space in the order I joined them. With many rooms, having no sort option is not perfect. |
Beta Was this translation helpful? Give feedback.
This comment was marked as duplicate.
This comment was marked as duplicate.
-
|
there was some discussion similar to this in #54 and #585, maybe instead of having each type of list (DMs, spaces, other rooms without space) behaving differently, it could be unified and in each list have a dropdown menu to select how to sort them |
Beta Was this translation helpful? Give feedback.
-
|
We really need that and the option to close the rooms list to see unread ones is not satisfying at all as I often need to go back to some rooms, I use matrix at my work and I need to use element because of this, we have a lot of rooms, some old rooms, and I also use it for my personal and all of that leads to more than 200 rooms so yes, cinny is not usable for me which is sad since it's cleaner than element even discord, whatsapp, telegram, they sort rooms by activity (except in discord servers which is up to admin will) I don't think #585 should have been closed as it doesn't answer this completely |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
why my comment was "off-topic", it does exactly what the title says "sort by last activity" |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Posting links to file downloads is unsafe practice. I would not recommend anyone to open such links, hence it's hidden. If you want to discuss this further, please open a Q&A discussion at this is not appropriate place to do that. |
Beta Was this translation helpful? Give feedback.
-
|
the file is a .txt patch of less than 2k size, it's not an encrypted .exe, anyone who can apply a patch can read it, but, whatever, where can i post the code?, can i do this? index 2a7c619..425454b 100644
--- a/src/app/pages/client/space/Space.tsx
+++ b/src/app/pages/client/space/Space.tsx
@@ -378,6 +378,16 @@ export function SpaceTombstone({ roomId, replacementRoomId }: SpaceTombstoneProp
export function Space() {
const mx = useMatrixClient();
const space = useSpace();
+
+ // --- ESCUCHA DE ACTIVIDAD PARA RE-ORDENAR ---
+ const [actividad, setActividad] = React.useState(0);
+ React.useEffect(() => {
+ const refrescar = () => setActividad((a) => a + 1);
+ mx.on('Room.timeline' as any, refrescar);
+ return () => mx.off('Room.timeline' as any, refrescar);
+ }, [mx]);
+ // --------------------------------------------
+
useNavToActivePathMapper(space.roomId);
const spaceIdOrAlias = getCanonicalAliasOrRoomId(mx, space.roomId);
const scrollRef = useRef<HTMLDivElement>(null);
@@ -405,7 +415,7 @@ export function Space() {
[mx, allJoinedRooms]
);
- const hierarchy = useSpaceJoinedHierarchy(
+ const rawHierarchy = useSpaceJoinedHierarchy(
space.roomId,
getRoom,
useCallback(
@@ -425,6 +435,18 @@ export function Space() {
)
);
+ const hierarchy = useMemo(() => {
+ const lista = [...rawHierarchy];
+ return lista.sort((a, b) => {
+ const rA = mx.getRoom(a.roomId);
+ const rB = mx.getRoom(b.roomId);
+ if (!rA || !rB || rA.isSpaceRoom() || rB.isSpaceRoom()) return 0;
+ const tsA = rA.timeline.length > 0 ? rA.timeline[rA.timeline.length - 1].getTs() : 0;
+ const tsB = rB.timeline.length > 0 ? rB.timeline[rB.timeline.length - 1].getTs() : 0;
+ return tsB - tsA;
+ });
+ }, [rawHierarchy, mx, actividad]);
+
const virtualizer = useVirtualizer({
count: hierarchy.length,
getScrollElement: () => scrollRef.current, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem
It's hard to see which rooms have unread messages when you have a big space with lots of rooms, most of which are low traffic.
Describe the solution you'd like
A way to show rooms ordered by the time of last message, or maybe just a way to show unread rooms at the top of the list.
Alternatives considered
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions