Tag Folders: tag filters indicator and show settings

- Add an indicator if any tag filters are applied, so you can see if there are any filters even if the list is collapsed
- Save collapse state of the tag list
- Fix folders vanishing if tag filters are applied (now really)
This commit is contained in:
Wolfsblvt
2024-02-19 03:15:45 +01:00
parent 25b528ee4f
commit 25a0ea0cb6
4 changed files with 47 additions and 10 deletions

View File

@ -116,6 +116,7 @@ export class FilterHelper {
}
const getIsTagged = (entity) => {
const isTag = entity.type === 'tag';
const tagFlags = selected.map(tagId => this.isElementTagged(entity, tagId));
const trueFlags = tagFlags.filter(x => x);
const isTagged = TAG_LOGIC_AND ? tagFlags.length === trueFlags.length : trueFlags.length > 0;
@ -123,7 +124,9 @@ export class FilterHelper {
const excludedTagFlags = excluded.map(tagId => this.isElementTagged(entity, tagId));
const isExcluded = excludedTagFlags.includes(true);
if (isExcluded) {
if (isTag) {
return true;
} else if (isExcluded) {
return false;
} else if (selected.length > 0 && !isTagged) {
return false;