feat: Add nesting of tags in a tree
- levels are joined by forward slashes in the keywords - behaviour is opt-in for now - long paths are shortened if there is not enough display room Closes #687.
This commit is contained in:
@@ -156,4 +156,19 @@ describe('settings-store keywords', () => {
|
||||
expect(kw?.label).toBe('Scarlet');
|
||||
});
|
||||
});
|
||||
|
||||
describe('nestedTags', () => {
|
||||
it('is off by default', () => {
|
||||
useSettingsStore.getState().resetToDefaults();
|
||||
expect(useSettingsStore.getState().nestedTags).toBe(false);
|
||||
});
|
||||
|
||||
it('is included in exported settings', () => {
|
||||
useSettingsStore.getState().updateSetting('nestedTags', true);
|
||||
const exported = JSON.parse(useSettingsStore.getState().exportSettings()) as {
|
||||
nestedTags?: boolean;
|
||||
};
|
||||
expect(exported.nestedTags).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -287,6 +287,7 @@ interface SettingsState {
|
||||
|
||||
// Keywords (labels/tags)
|
||||
emailKeywords: KeywordDefinition[];
|
||||
nestedTags: boolean; // Treat "/" in a tag id as a parent/child separator
|
||||
|
||||
// Attachment Reminder
|
||||
attachmentReminderEnabled: boolean;
|
||||
@@ -485,6 +486,7 @@ const DEFAULT_SETTINGS = {
|
||||
|
||||
// Keywords
|
||||
emailKeywords: DEFAULT_KEYWORDS,
|
||||
nestedTags: false,
|
||||
|
||||
// Attachment Reminder
|
||||
attachmentReminderEnabled: true,
|
||||
@@ -661,6 +663,7 @@ export const useSettingsStore = create<SettingsState>()(
|
||||
showFolderTotalCount: state.showFolderTotalCount,
|
||||
folderIcons: state.folderIcons,
|
||||
emailKeywords: state.emailKeywords,
|
||||
nestedTags: state.nestedTags,
|
||||
attachmentReminderEnabled: state.attachmentReminderEnabled,
|
||||
attachmentReminderKeywords: state.attachmentReminderKeywords,
|
||||
hideInlineImageAttachments: state.hideInlineImageAttachments,
|
||||
|
||||
Reference in New Issue
Block a user