feat: allow hidden tags, either permanent or when there are no unread messages

This commit is contained in:
Mathy Vanvoorden
2026-07-29 17:18:42 +02:00
parent ca0ba818b7
commit 0c1e238223
10 changed files with 204 additions and 6 deletions
@@ -1,5 +1,5 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { useSettingsStore, DEFAULT_KEYWORDS, KEYWORD_PALETTE } from '../settings-store';
import { useSettingsStore, DEFAULT_KEYWORDS, KEYWORD_PALETTE, getKeywordVisibility } from '../settings-store';
import type { KeywordDefinition } from '../settings-store';
describe('settings-store keywords', () => {
@@ -157,6 +157,17 @@ describe('settings-store keywords', () => {
});
});
describe('getKeywordVisibility', () => {
it('treats a tag stored before visibility was configurable as always shown', () => {
expect(getKeywordVisibility({ id: 'red', label: 'Red', color: 'red' })).toBe('show');
});
it('returns the stored choice when there is one', () => {
expect(getKeywordVisibility({ id: 'red', label: 'Red', color: 'red', visibility: 'unread' })).toBe('unread');
expect(getKeywordVisibility({ id: 'red', label: 'Red', color: 'red', visibility: 'hide' })).toBe('hide');
});
});
describe('nestedTags', () => {
it('is off by default', () => {
useSettingsStore.getState().resetToDefaults();