-
Notifications
You must be signed in to change notification settings - Fork 340
Track data for channel folders! #1894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
It'll be useful to have this encapsulated for when we implement the UI (zulip#1765).
fc0b7d9
to
84604e0
Compare
(Fixed |
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.
Thanks @chrisbobbe. LGTM, moving over to Greg's review.
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.
Thanks! Just small comments; otherwise all looks good.
final UnreadMessagesSnapshot unreadMsgs; | ||
|
||
final List<ChannelFolder>? channelFolders; |
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.
nit: docs have these in opposite order
|
||
final UnreadMessagesSnapshot unreadMsgs; | ||
|
||
final List<ChannelFolder>? channelFolders; |
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.
TODO(server-11), right?
|
||
final UnreadMessagesSnapshot unreadMsgs; | ||
|
||
final List<ChannelFolder>? channelFolders; |
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.
nit: commit-message prefixes, similar to #1869 (comment) ; the current revision has
63b5b83 initial_snapshot: Add channelFolders
36e7c96 model: Add ZulipStream.folderId
3da70bc api: Add channel_folder event
3ff64be store: Add channelFolders
84604e0 channel: Add ChannelStore.compareChannelFolders
and I think the first three should all say "api:".
// TODO(server-11) delete TODO but keep optional, for channels not in folders | ||
int? folderId; |
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.
This is equivalent to not having a TODO, right? That seems simpler 🙂
ChannelPostPolicy? channelPostPolicy; // TODO(server-10) remove | ||
// TODO(server-11) delete TODO but keep optional, for channels not in folders | ||
int? folderId; | ||
// final bool isAnnouncementOnly; // deprecated for `channelPostPolicy`; ignore |
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.
nit: this stanza is all various kinds of permission settings; let's pull this field out separately, earlier.
(We already have this class's fields in a different order from the docs in order to be more logical, in particular grouping description
with renderedDescription
.)
channelFolders[newChannelFolder.id] = newChannelFolder; | ||
case ChannelFolderUpdateEvent(): |
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.
nit: bit easier to read if each case is its own new stanza (since they're each nontrivial):
channelFolders[newChannelFolder.id] = newChannelFolder; | |
case ChannelFolderUpdateEvent(): | |
channelFolders[newChannelFolder.id] = newChannelFolder; | |
case ChannelFolderUpdateEvent(): |
final orderA = a.order; | ||
final orderB = b.order; | ||
return switch ((orderA, orderB)) { |
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.
nit: since the switch
already means these are consumed just once, can inline them for I think a bit more clarity:
final orderA = a.order; | |
final orderB = b.order; | |
return switch ((orderA, orderB)) { | |
return switch ((a.order, b.order)) { |
This PR aims to add all the data we'll need to show channel folders in the inbox, i.e.: