cinny icon indicating copy to clipboard operation
cinny copied to clipboard

`Ctrl+k` doesn't update sidebar

Open N-R-K opened this issue 3 years ago • 1 comments

Describe the bug

If you're inside space A in the sidebar, and use ctrl+k to go to a room on space B, then the sidebar still stays on space A.

Expected behavior

The sidebar should be in sync with the current room.

N-R-K avatar Mar 12 '22 15:03 N-R-K

I am interested in working on this issue. Is there any extra information I need to know before getting started?

Mapledv avatar Aug 06 '22 16:08 Mapledv

@Mapledv If we can create a mapping of selected space to selected room id(if that selected space has this room as child). We can call this map selectedSpaceToRoomId. When user select a space we can automatically select the selected room (by looking into mapping) or if there is not any we can select by activity. (This will fix #353)

Now that we have this mapping and whenever we open a room (lets say RoomA) (from ctrl+k or etc):

  1. we can get parents of RoomA using roomlist.roomIdToParents map;
  2. we will filter these parent spaces if selectedSpaceToRoomId point to RoomA.
  3. now if we have filtered array.length > 0 we can open the first.
  4. else we can open first from unfiltered parents.
  5. or if there is no parents we can open home or directs message tab

To make it more perfect we can add a timestamp in selectedSpaceToRoomId so we select the space which has latest timestamp (^ in point 3).

Let me know if you have any better ideas

ajbura avatar Aug 17 '22 14:08 ajbura