fix: review

This commit is contained in:
linonetwo 2025-12-06 01:47:46 +08:00
parent ed01ba8036
commit a1f99632a6
2 changed files with 9 additions and 5 deletions

View file

@ -130,9 +130,9 @@ export class FileSystemAdaptor {
* For draft tiddlers, check the original tiddler's tags. * For draft tiddlers, check the original tiddler's tags.
* *
* Priority: * Priority:
* 1. If fileSystemPathFilterEnable is enabled, use custom filterExpression * 1. Direct tag match with sub-wiki tagNames
* 2. Direct tag match with sub-wiki tagNames * 2. If includeTagTree is enabled, use in-tagtree-of filter for recursive tag matching
* 3. 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 * 4. Fall back to TiddlyWiki's FileSystemPaths logic
* *
* IMPORTANT: We check if the target directory has changed. Only when directory changes * 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 // Tag tree match if enabled - check all tagNames
if (wiki.includeTagTree && wiki.tagNames.length > 0) { if (wiki.includeTagTree && wiki.tagNames.length > 0) {
for (const tagName of wiki.tagNames) { 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<tagName>]`,
$tw.rootWidget.makeFakeWidgetWithVariables({ tagName }),
$tw.wiki.makeTiddlerIterator([title]),
);
if (result.length > 0) { if (result.length > 0) {
return wiki; return wiki;
} }

View file

@ -146,7 +146,7 @@ export interface IWikiWorkspace extends IDedicatedWorkspace {
*/ */
includeTagTree: boolean; 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. * This allows more complex matching logic using TiddlyWiki filter expressions.
*/ */
fileSystemPathFilterEnable: boolean; fileSystemPathFilterEnable: boolean;