Add per-account folder customization page (#855)
Introduce a dedicated settings page that lets users reorder, hide, and pin/unpin folders per account. Folders are organized into Pinned, Categories (Gmail only), and More sections with drag-to-reorder via ListView. New Order column on MailItemFolder persists the custom layout; the default sort falls back to alphabetic when no custom order is set. A reset action wipes all customization in a single transaction and restores system-folder stickiness. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,11 @@ public class MailItemFolder : IMailItemFolder
|
||||
public bool IsSynchronizationEnabled { get; set; }
|
||||
public bool IsHidden { get; set; }
|
||||
public bool ShowUnreadCount { get; set; }
|
||||
|
||||
// User-defined ordering within its navigation section (Pinned / Categories / More).
|
||||
// 0 means "no custom order set" — the folder falls back to the default sort
|
||||
// (alphabetic for More, canonical SpecialFolderType order as a tiebreak for Pinned).
|
||||
public int Order { get; set; }
|
||||
public DateTime? LastSynchronizedDate { get; set; }
|
||||
|
||||
// For IMAP
|
||||
|
||||
@@ -12,6 +12,7 @@ public enum WinoPage
|
||||
ContactsPage,
|
||||
MailRenderingPage,
|
||||
AccountDetailsPage,
|
||||
FolderCustomizationPage,
|
||||
MergedAccountDetailsPage,
|
||||
ManageAccountsPage,
|
||||
AccountManagementPage,
|
||||
|
||||
@@ -22,6 +22,25 @@ public interface IFolderService
|
||||
Task<int> GetFolderNotificationBadgeAsync(Guid folderId);
|
||||
Task ChangeStickyStatusAsync(Guid folderId, bool isSticky);
|
||||
|
||||
/// <summary>
|
||||
/// Toggles a folder's visibility in the navigation menu.
|
||||
/// Hidden folders are still synchronized if sync is enabled.
|
||||
/// </summary>
|
||||
Task ChangeFolderHiddenStatusAsync(Guid folderId, bool isHidden);
|
||||
|
||||
/// <summary>
|
||||
/// Persists a new custom ordering for the given folders.
|
||||
/// The first id becomes Order=1, second Order=2, etc.
|
||||
/// Caller is responsible for notifying the shell to refresh.
|
||||
/// </summary>
|
||||
Task UpdateFolderOrdersAsync(Guid accountId, IReadOnlyList<Guid> orderedFolderIds);
|
||||
|
||||
/// <summary>
|
||||
/// Wipes every user folder customization for the account: clears custom Order,
|
||||
/// un-hides folders, and restores IsSticky on system folders.
|
||||
/// </summary>
|
||||
Task ResetFolderCustomizationAsync(Guid accountId);
|
||||
|
||||
Task<MailAccount> UpdateSystemFolderConfigurationAsync(Guid accountId, SystemFolderConfiguration configuration);
|
||||
Task ChangeFolderSynchronizationStateAsync(Guid folderId, bool isSynchronizationEnabled);
|
||||
Task ChangeFolderShowUnreadCountStateAsync(Guid folderId, bool showUnreadCount);
|
||||
|
||||
@@ -176,6 +176,7 @@ public static class SettingsNavigationInfoProvider
|
||||
WinoPage.AccountDetailsPage => WinoPage.ManageAccountsPage,
|
||||
WinoPage.MergedAccountDetailsPage => WinoPage.ManageAccountsPage,
|
||||
WinoPage.AliasManagementPage => WinoPage.ManageAccountsPage,
|
||||
WinoPage.FolderCustomizationPage => WinoPage.ManageAccountsPage,
|
||||
WinoPage.MailCategoryManagementPage => WinoPage.ManageAccountsPage,
|
||||
WinoPage.SignatureManagementPage => WinoPage.ManageAccountsPage,
|
||||
WinoPage.ImapCalDavSettingsPage => WinoPage.ManageAccountsPage,
|
||||
|
||||
@@ -885,6 +885,21 @@
|
||||
"SettingsManageAliases_Title": "Aliases",
|
||||
"SettingsMailCategories_Description": "Manage synchronized and local categories for this account.",
|
||||
"SettingsMailCategories_Title": "Categories",
|
||||
"FolderCustomization_Title": "Customize folder list",
|
||||
"FolderCustomization_Description": "Reorder, hide, or pin folders for this account.",
|
||||
"FolderCustomization_EntryCardTitle": "Customize folder list",
|
||||
"FolderCustomization_EntryCardDescription": "Arrange pinned folders, hide folders you don't use, and reorder the More section.",
|
||||
"FolderCustomization_SectionPinned": "Pinned",
|
||||
"FolderCustomization_SectionCategories": "Categories",
|
||||
"FolderCustomization_SectionMore": "More",
|
||||
"FolderCustomization_Pin": "Pin to top",
|
||||
"FolderCustomization_Unpin": "Move to More",
|
||||
"FolderCustomization_Show": "Show in navigation",
|
||||
"FolderCustomization_Hide": "Hide from navigation",
|
||||
"FolderCustomization_Reset": "Reset to defaults",
|
||||
"FolderCustomization_ResetConfirmTitle": "Reset folder layout",
|
||||
"FolderCustomization_ResetConfirmMessage": "This will clear any custom folder order and restore the default alphabetic layout for this account. Hidden folders will become visible again. Continue?",
|
||||
"FolderCustomization_EmptySection": "Drag folders here to add them to this section.",
|
||||
"SettingsEditAccountDetails_Title": "Edit Account Details",
|
||||
"SettingsEditAccountDetails_Description": "Change account name, sender name and assign a new color if you like.",
|
||||
"SettingsAccountDetails_NavigationTitle": "{0} details",
|
||||
|
||||
Reference in New Issue
Block a user