Skip to content

Commit 42d67c6

Browse files
committed
fix(project): restore project config settings synchronization
Fixes project configuration not being applied from settings by: - Restoring project options update in DataflowOrchestrator settings handler - Passing full project config options when initializing ProjectConfigManager - Ensuring detection methods and all config flags are properly propagated
1 parent 39bd038 commit 42d67c6

File tree

3 files changed

+215
-56
lines changed

3 files changed

+215
-56
lines changed

src/dataflow/Orchestrator.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,36 @@ export class DataflowOrchestrator {
826826
);
827827
}
828828

829+
// Update ProjectResolver / ProjectConfigManager options from settings
830+
try {
831+
const pc = settings?.projectConfig;
832+
if (pc) {
833+
this.updateProjectOptions({
834+
configFileName: pc?.configFile?.fileName || "project.md",
835+
searchRecursively:
836+
pc?.configFile?.searchRecursively ?? true,
837+
metadataKey: pc?.metadataConfig?.metadataKey || "project",
838+
pathMappings: pc?.pathMappings || [],
839+
metadataMappings: pc?.metadataMappings || [],
840+
defaultProjectNaming: pc?.defaultProjectNaming || {
841+
strategy: "filename",
842+
stripExtension: true,
843+
enabled: false,
844+
},
845+
enhancedProjectEnabled: pc?.enableEnhancedProject ?? false,
846+
metadataConfigEnabled: pc?.metadataConfig?.enabled ?? false,
847+
configFileEnabled: pc?.configFile?.enabled ?? false,
848+
detectionMethods:
849+
pc?.metadataConfig?.detectionMethods || [],
850+
});
851+
}
852+
} catch (e) {
853+
console.warn(
854+
"[DataflowOrchestrator] Failed to update project config options on settings update",
855+
e
856+
);
857+
}
858+
829859
// Update TimeParsingService configuration
830860
if (settings.timeParsing && this.timeParsingService) {
831861
this.timeParsingService.updateConfig(settings.timeParsing);

src/index.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,37 @@ export default class TaskProgressBarPlugin extends Plugin {
390390
this.app.metadataCache,
391391
this,
392392
{
393-
// ProjectConfigManagerOptions is narrower; pass only known properties
393+
configFileName:
394+
this.settings.projectConfig?.configFile?.fileName ||
395+
"project.md",
396+
searchRecursively:
397+
this.settings.projectConfig?.configFile
398+
?.searchRecursively ?? true,
399+
metadataKey:
400+
this.settings.projectConfig?.metadataConfig
401+
?.metadataKey || "project",
402+
pathMappings:
403+
this.settings.projectConfig?.pathMappings || [],
404+
metadataMappings:
405+
this.settings.projectConfig?.metadataMappings || [],
406+
defaultProjectNaming: this.settings.projectConfig
407+
?.defaultProjectNaming || {
408+
strategy: "filename",
409+
stripExtension: true,
410+
enabled: false,
411+
},
412+
enhancedProjectEnabled:
413+
this.settings.projectConfig
414+
?.enableEnhancedProject ?? false,
415+
metadataConfigEnabled:
416+
this.settings.projectConfig?.metadataConfig
417+
?.enabled ?? false,
418+
configFileEnabled:
419+
this.settings.projectConfig?.configFile?.enabled ??
420+
false,
421+
detectionMethods:
422+
this.settings.projectConfig?.metadataConfig
423+
?.detectionMethods || [],
394424
}
395425
);
396426
console.timeEnd("[TPB] createDataflow");

0 commit comments

Comments
 (0)