diff --git a/web/src/settings_folders.ts b/web/src/settings_folders.ts index 581d13be59..e1dbb0a28a 100644 --- a/web/src/settings_folders.ts +++ b/web/src/settings_folders.ts @@ -22,6 +22,13 @@ function update_folder_order(this: HTMLElement): void { $(".channel-folder-row").each(function () { order.push(Number.parseInt($(this).attr("data-channel-folder-id")!, 10)); }); + const archived_folders = channel_folders + .get_channel_folders(true) + .filter((folder) => folder.is_archived) + .sort((a, b) => util.strcmp(a.name.toLowerCase(), b.name.toLowerCase())); + for (const folder of archived_folders) { + order.push(folder.id); + } settings_ui.do_settings_change( channel.patch, "/json/channel_folders", diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index b4eda55f38..645eb1099d 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -24554,6 +24554,10 @@ paths: type: array description: | A list of channel folder IDs representing the new order. + + This list must include the IDs of all the + organization's channel folders, including archived + folders. items: type: integer encoding: