-
-
Notifications
You must be signed in to change notification settings - Fork 832
Show archived rooms and implement forgetting #62
Conversation
Call /forget when the forget button is clicked. Number of shortcomings: - We need to lazy load the historical list (atm we never get the list of left rooms; things only go into that list if you leave the room whilst running) - Once a room is forgotten we need to physically nuke it from the JS SDK. - Need icon for forget room.
…rooms. When the JS SDK encounters a new room it will emit a flurry of events for things like state and room members. Refreshing the room list on each event is bad for performance. This is okay initially because the room list is only shown after the first sync, but when getting archived rooms it locks up for 15-30s as it thrashes. Add a 1s cap to refreshRoomList() which means that it will refresh *AT MOST* once every second. If it has been >1s since the last refresh it will immediately refresh. If it has been <1s it will wait the difference.
…tion in room list This is so users can still find the room they've been expelled from, rather than have it drop to the Historical section.
MatrixClientPeg.get().forget(this.props.roomId).done(function() { | ||
dis.dispatch({ action: 'view_next_room' }); | ||
}, function(err) { | ||
console.error("Failed to forget room: %s", err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would we swallow this error msg? can we ErrorDialog it please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
LGTM, other than the fact that we've lost the "bottommost" CSS somehow for the Archived RoomSubList. This is meant to provide a whacking great margin on the bottom of the sublist to avoid the browser adjusting the scrollTop of the RoomList when users toggle sublists on and off (as otherwise if you hide the bottommost ones, it will scroll you upwards to make the bottommost list touch the bottom of the scroll area). It was also serving as a larger droptarget ,although this is less relevant given you can't currently dnd to archived (i assume). Would be nice to get it back - either by putting the margin on the overall roomlist or back on the bottommost roomsublist. |
PTAL |
lgtm, thanks. |
Show archived rooms and implement forgetting
there should be no translateable strings in getDefaultProp
Fix: only need 2 "Next" clicks, not 3, when setting a custom HS during registration
Part of fixing element-hq/element-web#348
Forget button:
leave
(and hides the "Leave Room" button)Archived rooms:
leave
orban
will now be dumped to the "Historical" section which was already in place. Listen for when rooms are deleted so we can update this list when people forget rooms.RoomSubList
show a spinner if we are currently loading left rooms. This is done via theshowSpinner
prop.RoomSubList
always display the archived section (because we don't know beforehand if there are archived rooms!). This is done via thealwaysShowHeader
prop.syncLeftRooms()
when the archived header is clicked. This required the propstartAsHidden
to be added to force the archived section to be hidden on start (so clicking it once will trigger the request).Performance:
When the JS SDK encounters a new room it will emit a flurry of events for things
like state and room members. Refreshing the room list on each event is bad for
performance. This is okay initially because the room list is only shown after
the first sync, but when getting archived rooms it locks up for 15-30s as it
thrashes. Add a 1s cap to refreshRoomList() which means that it will refresh
AT MOST once every second. If it has been >1s since the last refresh it will
immediately refresh. If it has been <1s it will wait the difference. This improves
performance and results in 3-5s lock. More optimisations can be done in future.
Manually tested and it all works.
See also: