Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Move complex part of room sorting to a dedicated function #2716

Merged
merged 3 commits into from
Feb 28, 2019

Conversation

turt2live
Copy link
Member

Pretty much cut/pasting it in, as there's not really a whole much to help make the code more understandable here.

This also includes a comment block longer than the code it describes in hopes it explains away the problem of understanding what it does.

Should fix element-hq/element-web#8861

Pretty much cut/pasting it in, as there's not really a whole much to help make the code more understandable here.

This also includes a comment block longer than the code it describes in hopes it explains away the problem of understanding what it does.

Should fix element-hq/element-web#8861
@turt2live turt2live requested a review from a team February 27, 2019 22:56
@bwindels bwindels self-assigned this Feb 28, 2019
Copy link
Contributor

@bwindels bwindels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one small comment, but otherwise looks good. I also re-read "The Sorting Problem" again, and realized I had slightly misunderstood the proposed algorithm before. Thanks for the explanatory comments.

const targetCategoryIndex = CATEGORY_ORDER.indexOf(category);

// The slotting algorithm works by trying to position the room in the most relevant
// section of the list (red > grey > etc). To accomplish this, we need to consider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The terms section and category seem to be used interchangeably. Can we settle on either of them?

@turt2live turt2live assigned turt2live and unassigned bwindels Feb 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RoomListStore#_setRoomCategory is hard to understand and maintain
2 participants