From a1f99632a6476a1383979d9d9f17fd12057d9e03 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Sat, 6 Dec 2025 01:47:46 +0800 Subject: [PATCH] fix: review --- .../watchFileSystemAdaptor/FileSystemAdaptor.ts | 12 ++++++++---- src/services/workspaces/interface.ts | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/services/wiki/plugin/watchFileSystemAdaptor/FileSystemAdaptor.ts b/src/services/wiki/plugin/watchFileSystemAdaptor/FileSystemAdaptor.ts index 4cc017c7..a9ca3169 100644 --- a/src/services/wiki/plugin/watchFileSystemAdaptor/FileSystemAdaptor.ts +++ b/src/services/wiki/plugin/watchFileSystemAdaptor/FileSystemAdaptor.ts @@ -130,9 +130,9 @@ export class FileSystemAdaptor { * For draft tiddlers, check the original tiddler's tags. * * Priority: - * 1. If fileSystemPathFilterEnable is enabled, use custom filterExpression - * 2. Direct tag match with sub-wiki tagNames - * 3. If includeTagTree is enabled, use in-tagtree-of filter for recursive tag matching + * 1. Direct tag match with sub-wiki tagNames + * 2. If includeTagTree is enabled, use in-tagtree-of filter for recursive tag matching + * 3. If fileSystemPathFilterEnable is enabled, use custom filterExpression * 4. Fall back to TiddlyWiki's FileSystemPaths logic * * IMPORTANT: We check if the target directory has changed. Only when directory changes @@ -233,7 +233,11 @@ export class FileSystemAdaptor { // Tag tree match if enabled - check all tagNames if (wiki.includeTagTree && wiki.tagNames.length > 0) { for (const tagName of wiki.tagNames) { - const result = $tw.wiki.filterTiddlers(`[in-tagtree-of:inclusive[${tagName}]]`, undefined, $tw.wiki.makeTiddlerIterator([title])); + const result = $tw.wiki.filterTiddlers( + `[in-tagtree-of:inclusive]`, + $tw.rootWidget.makeFakeWidgetWithVariables({ tagName }), + $tw.wiki.makeTiddlerIterator([title]), + ); if (result.length > 0) { return wiki; } diff --git a/src/services/workspaces/interface.ts b/src/services/workspaces/interface.ts index de25e4e4..beb9a9d6 100644 --- a/src/services/workspaces/interface.ts +++ b/src/services/workspaces/interface.ts @@ -146,7 +146,7 @@ export interface IWikiWorkspace extends IDedicatedWorkspace { */ includeTagTree: boolean; /** - * When enabled, use fileSystemPathFilter instead of tagName/includeTagTree to match tiddlers. + * When enabled, also use fileSystemPathFilter expressions to match tiddlers, in addition to tagName/includeTagTree matching. * This allows more complex matching logic using TiddlyWiki filter expressions. */ fileSystemPathFilterEnable: boolean;