fix(settings): default scope to selected folders

中文: 将插件运行范围默认值改为仅在指定文件夹,并同步旧配置加载测试与构建产物。

English: Change the plugin run scope default to selected folders only, update persistence/default tests, and refresh the production bundle.
This commit is contained in:
Dusk 2026-04-26 22:42:38 +08:00
parent dfccdcbfc5
commit c0c2551753
4 changed files with 6 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -80,6 +80,7 @@ describe("PluginSettings", () => {
expect(DEFAULT_SETTINGS.obsidianBacklinkPlacement).toBe("answer-last-line");
expect(DEFAULT_SETTINGS.syncObsidianTagsToAnki).toBe(true);
expect(DEFAULT_SETTINGS.keepPureTagLinesInCardBody).toBe(true);
expect(DEFAULT_SETTINGS.scopeMode).toBe("include");
expect(DEFAULT_SETTINGS.ankiNoteTypeCache).toEqual([]);
expect(DEFAULT_SETTINGS.ankiModelFieldCache).toEqual({});
expect(DEFAULT_SETTINGS.cardTypeConfigs).toEqual({

View file

@ -91,7 +91,7 @@ export const DEFAULT_SETTINGS: PluginSettings = {
fileDeckTemplate: "obsidian::filename",
fileDeckInsertLocation: "body",
folderDeckMode: "folder-and-file",
scopeMode: "all",
scopeMode: "include",
includeFolders: [],
excludeFolders: [],
addObsidianBacklink: true,

View file

@ -18,7 +18,7 @@ class InMemoryPluginDataStore implements PluginDataStore<PluginDataSnapshot> {
}
describe("DataJsonPluginConfigRepository", () => {
it("loads legacy settings snapshots without noteFieldMappings and defaults scopeMode to all", async () => {
it("loads legacy settings snapshots without noteFieldMappings and defaults scopeMode to include", async () => {
const repository = new DataJsonPluginConfigRepository(
new InMemoryPluginDataStore({
settings: {
@ -34,7 +34,7 @@ describe("DataJsonPluginConfigRepository", () => {
expect(settings.qaNoteType).toBe("Legacy Basic");
expect(settings.clozeNoteType).toBe("Legacy Cloze");
expect(settings.noteFieldMappings).toEqual({});
expect(settings.scopeMode).toBe("all");
expect(settings.scopeMode).toBe("include");
expect(settings.includeFolders).toEqual(["cards"]);
expect(settings.fileDeckEnabled).toBe(false);
expect(settings.fileDeckMarker).toBe("TARGET DECK");
@ -195,4 +195,4 @@ describe("DataJsonPluginConfigRepository", () => {
},
});
});
});
});