An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Let new custom entry profiles inherit visibility defaults https://github.com/siyuan-note/siyuan/issues/20432
Daniel934cd1c24c6b
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.syindex 4352c5aa94..449ee3c504 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy@@ -10266,7 +10266,7 @@"Children": [{"Type": "NodeText",- "Data": "In custom profiles, use the category selector to switch between the toolbar and slash menu. Drag the six-dot handle on the left of an item to change its order, or use its switch to change visibility. Drag near the list edge to scroll. Clear the search before sorting, and confirm to save the profile. Built-in profiles are read-only; duplicate one to customize it, then activate the saved profile. Profiles are stored on this device and are not synced across devices. New profiles based on Simple or Full follow the default order as versions change until you customize a level. Based on Current and duplicate preserve existing custom orders. Clear the search and use the reset icon in a column or dock group title to reset that level. To reset every level, use the refresh icon labeled Reset all orders on the right of the Position column title on desktop, or the Reset all orders button at the bottom on mobile. Confirm to save; Cancel discards the changes. Resetting order preserves visibility and dock placement, and reset levels continue to follow future default order changes."+ "Data": "In custom profiles, use the category selector to switch between the toolbar and slash menu. Drag the six-dot handle on the left of an item to change its order, or use its switch to change visibility. Drag near the list edge to scroll. Clear the search before sorting, and confirm to save the profile. Built-in profiles are read-only; duplicate one to customize it, then activate the saved profile. Profiles are stored on this device and are not synced across devices. New custom profiles based on Simple or Full follow future visibility defaults for entries you have not changed. An entry you toggle remains an explicit choice. Existing profiles retain their original visibility behavior; copying a profile or creating one based on Current preserves its inheritance and explicit choices. New profiles based on Simple or Full follow the default order as versions change until you customize a level. Based on Current and duplicate preserve existing custom orders. Clear the search and use the reset icon in a column or dock group title to reset that level. To reset every level, use the refresh icon labeled Reset all orders on the right of the Position column title on desktop, or the Reset all orders button at the bottom on mobile. Confirm to save; Cancel discards the changes. Resetting order preserves visibility and dock placement, and reset levels continue to follow future default order changes."}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.syindex 42c0c8b26c..180be2a269 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy@@ -10254,7 +10254,7 @@"Children": [{"Type": "NodeText",- "Data": "编辑自定义方案时,可通过分类选择框切换工具栏与斜杠菜单。拖动项目左侧的六点手柄调整顺序,使用项目开关调整显隐;拖至列表边缘可滚动。排序前需清空搜索,修改后确认保存方案。内置方案只读,可复制后自定义,再启用保存的方案。方案保存在本设备,不跨设备同步。基于简洁或完整创建的新方案,其未自定义的层级排序会随版本默认顺序更新;基于当前创建或复制方案会保留已有自定义排序。清空搜索后,可点击列标题或停靠栏分组标题上的重置图标重置该层级。重置全部排序时,桌面端可点击“位置”列标题右侧的刷新图标,提示为“重置全部排序”;移动端可点击底部的重置全部排序按钮。确认后保存,取消则放弃修改。重置排序会保留显隐和停靠栏入口所在位置,重置后的层级持续跟随后续版本的默认排序。"+ "Data": "编辑自定义方案时,可通过分类选择框切换工具栏与斜杠菜单。拖动项目左侧的六点手柄调整顺序,使用项目开关调整显隐;拖至列表边缘可滚动。排序前需清空搜索,修改后确认保存方案。内置方案只读,可复制后自定义,再启用保存的方案。方案保存在本设备,不跨设备同步。基于简洁或完整创建的新自定义方案,未修改过的入口显隐会跟随后续版本的默认值;手动切换过的入口保留用户选择。旧方案保持原有显隐行为,复制方案或基于当前方案创建时保留其继承方式和明确选择。基于简洁或完整创建的新方案,其未自定义的层级排序会随版本默认顺序更新;基于当前创建或复制方案会保留已有自定义排序。清空搜索后,可点击列标题或停靠栏分组标题上的重置图标重置该层级。重置全部排序时,桌面端可点击“位置”列标题右侧的刷新图标,提示为“重置全部排序”;移动端可点击底部的重置全部排序按钮。确认后保存,取消则放弃修改。重置排序会保留显隐和停靠栏入口所在位置,重置后的层级持续跟随后续版本的默认排序。"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.syindex 0a0b745008..b8727505ed 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy@@ -10243,7 +10243,7 @@"Children": [{"Type": "NodeText",- "Data": "編輯自訂方案時,可透過分類選擇框切換工具列與斜線選單。拖曳項目左側的六點把手調整順序,使用項目開關調整顯隱;拖至清單邊緣可捲動。排序前需清空搜尋,修改後確認儲存方案。內建方案唯讀,可複製後自訂,再啟用儲存的方案。方案儲存在本裝置,不跨裝置同步。基於簡潔或完整建立的新方案,其未自訂的層級排序會隨版本預設順序更新;基於目前方案建立或複製方案會保留既有自訂排序。清空搜尋後,可點擊欄標題或停靠欄分組標題上的重設圖示重設該層級。重設全部排序時,桌面端可點擊「位置」欄標題右側的重新整理圖示,提示為「重設全部排序」;行動端可點擊底部的重設全部排序按鈕。確認後儲存,取消則放棄修改。重設排序會保留顯隱和停靠欄入口所在位置,重設後的層級持續跟隨後續版本的預設排序。"+ "Data": "編輯自訂方案時,可透過分類選擇框切換工具列與斜線選單。拖曳項目左側的六點把手調整順序,使用項目開關調整顯隱;拖至清單邊緣可捲動。排序前需清空搜尋,修改後確認儲存方案。內建方案唯讀,可複製後自訂,再啟用儲存的方案。方案儲存在本裝置,不跨裝置同步。基於簡潔或完整建立的新自訂方案,未修改過的入口顯隱會跟隨後續版本的預設值;手動切換過的入口保留使用者選擇。舊方案保持原有顯隱行為,複製方案或基於目前方案建立時保留其繼承方式和明確選擇。基於簡潔或完整建立的新方案,其未自訂的層級排序會隨版本預設順序更新;基於目前方案建立或複製方案會保留既有自訂排序。清空搜尋後,可點擊欄標題或停靠欄分組標題上的重設圖示重設該層級。重設全部排序時,桌面端可點擊「位置」欄標題右側的重新整理圖示,提示為「重設全部排序」;行動端可點擊底部的重設全部排序按鈕。確認後儲存,取消則放棄修改。重設排序會保留顯隱和停靠欄入口所在位置,重設後的層級持續跟隨後續版本的預設排序。"}]},diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.syindex 4a871bd756..d317d6050c 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy@@ -10179,7 +10179,7 @@"Children": [{"Type": "NodeText",- "Data": "カスタムプロファイルでは、分類の選択欄でツールバーとスラッシュメニューを切り替えます。項目の左側にある6つの点のハンドルをドラッグして順序を変更し、スイッチで表示・非表示を設定します。リストの端までドラッグするとスクロールします。並べ替える前に検索欄を空にし、変更後は確認してプロファイルを保存します。組み込みプロファイルは読み取り専用です。複製してカスタマイズし、保存したプロファイルを有効にしてください。プロファイルはこの端末に保存され、端末間では同期されません。シンプルまたは完全を基に作成した新しいプロファイルでは、カスタマイズしていない階層の並び順はバージョンごとの初期順序に従います。現在の設定を基に作成する場合や複製する場合は、既存のカスタム順序を引き継ぎます。検索欄を空にし、列またはドックグループの見出しにあるリセットアイコンを押すと、その階層をリセットできます。全階層をリセットするには、デスクトップでは「位置」列の見出し右側にある更新アイコン(「すべての並び順をリセット」)、モバイルでは下部の「すべての並び順をリセット」ボタンを押します。確認すると保存され、キャンセルすると変更を破棄します。並び順のリセットでは表示設定とドック項目の配置場所は維持され、リセットした階層は今後の初期順序の変更にも従います。"+ "Data": "カスタムプロファイルでは、分類の選択欄でツールバーとスラッシュメニューを切り替えます。項目の左側にある6つの点のハンドルをドラッグして順序を変更し、スイッチで表示・非表示を設定します。リストの端までドラッグするとスクロールします。並べ替える前に検索欄を空にし、変更後は確認してプロファイルを保存します。組み込みプロファイルは読み取り専用です。複製してカスタマイズし、保存したプロファイルを有効にしてください。プロファイルはこの端末に保存され、端末間では同期されません。シンプルまたは完全を基に作成した新しいカスタムプロファイルでは、変更していない項目の表示・非表示は今後のバージョンの初期値に従います。手動で切り替えた項目は、その選択を維持します。既存のプロファイルは従来の表示動作を維持し、複製または現在の設定を基に作成する場合は、継承方法と明示的な選択を引き継ぎます。シンプルまたは完全を基に作成した新しいプロファイルでは、カスタマイズしていない階層の並び順はバージョンごとの初期順序に従います。現在の設定を基に作成する場合や複製する場合は、既存のカスタム順序を引き継ぎます。検索欄を空にし、列またはドックグループの見出しにあるリセットアイコンを押すと、その階層をリセットできます。全階層をリセットするには、デスクトップでは「位置」列の見出し右側にある更新アイコン(「すべての並び順をリセット」)、モバイルでは下部の「すべての並び順をリセット」ボタンを押します。確認すると保存され、キャンセルすると変更を破棄します。並び順のリセットでは表示設定とドック項目の配置場所は維持され、リセットした階層は今後の初期順序の変更にも従います。"}]},diff --git a/app/src/config/entryVisibility/frequentSlashUi.test.ts b/app/src/config/entryVisibility/frequentSlashUi.test.tsindex 2f711ca12c..fe3d3b3e9a 100644--- a/app/src/config/entryVisibility/frequentSlashUi.test.ts+++ b/app/src/config/entryVisibility/frequentSlashUi.test.ts@@ -31,7 +31,7 @@ const loadEditor = (id = "custom", initialEnabled = true, mobile = false) => {const entries = [{key: "frequent", label: () => "Frequently used"}, {key: "template", label: () => "Template"}, {key: "heading1", label: () => "Heading 1"}];const rootEntry = {key: "menu", label: () => "Slash menu", displayChildrenDirectly: true, children: entries};const sections = [{key: "editor.slash", label: () => "Slash menu", children: [rootEntry]}];- const config = {active: "custom", profiles: [{id: "custom", name: "Custom", entries: {[frequentPath]: initialEnabled, [rootPath]: !mobile},+ const config: Config.IEntryVisibility = {version: 7, active: "custom", profiles: [{id: "custom", name: "Custom", entries: {[frequentPath]: initialEnabled, [rootPath]: !mobile},orders: {[rootPath]: ["heading1", "template", "frequent"]}},{id: "other", name: "Other", entries: {[frequentPath]: initialEnabled}, orders: {}}]};const siyuan = {languages: new Proxy({slashMenuFrequent: "Frequently used"}, {@@ -71,6 +71,10 @@ const loadEditor = (id = "custom", initialEnabled = true, mobile = false) => {getEntryCatalogChildren: () => entries,getEntryCatalogPathChain: (_section: string, path: string) => [path],getEntryCatalogCustomDefaultVisibility: () => true,+ getActiveEntryProfile: () => siyuan.config.appearance.entryVisibility.profiles.find(profile =>+ profile.id === siyuan.config.appearance.entryVisibility.active),+ getEntryProfileDefaultVisibility: (profile: Config.IEntryVisibilityProfile, path: string) =>+ profile.defaults ? path === frequentPath ? profile.defaults === "full" : !mobile : true,isEntryCatalogNodeConfigurable: () => true,isEntryOrderSortable: () => true,escapeAttr: (value: string) => value,@@ -172,9 +176,12 @@ for (const mobile of [false, true]) {test(`copy and template choices preserve frequent semantics on ${mobile ? "mobile" : "desktop"}`, () => {const fixture = loadEditor("custom", true, mobile);- assert.equal(fixture.create("simple").entries[frequentPath], false);- assert.equal(fixture.create("full").entries[frequentPath], true);+ assert.equal(fixture.create("simple").defaults, "simple");+ assert.equal(fixture.create("simple").entries[frequentPath], undefined);+ assert.equal(fixture.create("full").defaults, "full");+ assert.equal(fixture.create("full").entries[frequentPath], undefined);assert.equal(fixture.create("full", true).entries[frequentPath], true);+ assert.equal(fixture.create("full", true).defaults, undefined);const copy = fixture.duplicate(fixture.config().profiles[0]);assert.equal(copy.entries[frequentPath], true);copy.entries[frequentPath] = false;@@ -187,6 +194,14 @@ for (const mobile of [false, true]) {assert.match(frequentRow(fixture.browser.innerHTML), / checked/);fixture.action("cancel");assert.equal(fixture.enabled(), true);+ fixture.config().profiles[0].defaults = "simple";+ delete fixture.config().profiles[0].entries[frequentPath];+ const inheritedCopy = fixture.create("full", true);+ assert.equal(inheritedCopy.defaults, "simple");+ assert.equal(inheritedCopy.entries[frequentPath], undefined);+ const inheritedDuplicate = fixture.duplicate(fixture.config().profiles[0]);+ assert.equal(inheritedDuplicate.defaults, "simple");+ assert.equal(inheritedDuplicate.entries[frequentPath], undefined);});}diff --git a/app/src/config/entryVisibility/mobileUi.test.ts b/app/src/config/entryVisibility/mobileUi.test.tsindex 4602ecfc13..c845855dc4 100644--- a/app/src/config/entryVisibility/mobileUi.test.ts+++ b/app/src/config/entryVisibility/mobileUi.test.ts@@ -32,10 +32,21 @@ const browserCases = async (sources: Record<string, string>, languages: Record<s}if (id === "config/entryVisibility/runtime") {return {- ENTRY_PROFILE_FULL: "full", ENTRY_PROFILE_SIMPLE: "simple", ENTRY_VISIBILITY_VERSION: 1,+ ENTRY_PROFILE_FULL: "full", ENTRY_PROFILE_SIMPLE: "simple", ENTRY_VISIBILITY_VERSION: 7,createEntryProfileSnapshot: (template: string) => ({"editor.slash.menu": !mobile,[frequentPath]: template === "full"}), createEntryOrderSnapshot: () => ({}),getConfiguredEntryVisibility: () => true,+ getActiveEntryProfile: () => window.siyuan.config.appearance.entryVisibility.profiles.find(profile =>+ profile.id === window.siyuan.config.appearance.entryVisibility.active),+ getEntryProfileDefaultVisibility: (profile: Config.IEntryVisibilityProfile, path: string) => {+ const catalog = load("config/entryVisibility/catalog");+ if (!profile.defaults) {+ return catalog.getEntryCatalogCustomDefaultVisibility(path);+ }+ const node = catalog.getEntryCatalogNode(path);+ return load("config/entryVisibility/profile").getBuiltinProfileEntryVisibility(profile.defaults,+ node?.simple !== false, catalog.getEntryCatalogDefaultVisibility(path), node?.simpleDefaultVisible);+ },saveEntryVisibility: (config: Config.IEntryVisibility) => {window.siyuan.config.appearance.entryVisibility = config;},diff --git a/app/src/config/entryVisibility/profile.test.ts b/app/src/config/entryVisibility/profile.test.tsindex 5b273e7af3..e34c4001f0 100644--- a/app/src/config/entryVisibility/profile.test.ts+++ b/app/src/config/entryVisibility/profile.test.ts@@ -22,6 +22,25 @@ import {mergeEntryOrderPreservingUnknown, resolveEntryOrder} from "./order";const frequentPath = "editor.slash.menu.frequent";+test("version 7 profiles preserve sparse defaults and old profiles remain independent", () => {+ for (const defaults of ["simple", "full"] as const) {+ const input: Pick<Config.IEntryVisibilityProfile, "name" | "defaults" | "entries" | "orders"> = {+ name: "Inherited", defaults, entries: {"plugin:disabled:item": false}, orders: {dock: ["plugin:disabled:dock"]},+ };+ const imported = normalizeEntryVisibilityImportProfile(input, 7, {});+ assert.deepEqual(imported, input);+ assert.deepEqual(normalizeEntryVisibilityImportProfile(JSON.parse(JSON.stringify(imported)), 7, {}), input);+ assert.equal(imported.entries[frequentPath], undefined);+ const legacy = normalizeEntryVisibilityImportProfile({...input, base: defaults}, 6, {});+ assert.equal(legacy.defaults, undefined);+ assert.equal(legacy.entries[frequentPath], true);+ }+ assert.equal(normalizeEntryVisibilityImportProfile({name: "Invalid", defaults: "unknown", entries: {}}, 7, {}), undefined);+ assert.equal(normalizeEntryVisibilityImportProfile({name: "Legacy", entries: {}}, 7, {}).defaults, undefined);+ assert.equal(isEntryVisibilityImportVersionSupported(7, 7), true);+ assert.equal(isEntryVisibilityImportVersionSupported(7, 6), false);+});+test("mobile toolbar contexts expose relevant entries and hide caret references by default", () => {const input = getMobileToolbarContextPath(false);const selection = getMobileToolbarContextPath(true);diff --git a/app/src/config/entryVisibility/profile.ts b/app/src/config/entryVisibility/profile.tsindex 42f004f064..e079d87255 100644--- a/app/src/config/entryVisibility/profile.ts+++ b/app/src/config/entryVisibility/profile.ts@@ -44,6 +44,7 @@ export const resetEntryProfileOrder = (profile: Pick<Config.IEntryVisibilityProfexport type TEntryVisibilityImportProfile = {name?: unknown;base?: unknown;+ defaults?: unknown;entries?: unknown;orders?: unknown;};@@ -116,10 +117,11 @@ export const normalizeEntryVisibilityImportProfile = (profile: TEntryVisibilityImportProfile,version: number,defaultOrders: Record<string, string[]>,-): Pick<Config.IEntryVisibilityProfile, "name" | "entries" | "orders"> | undefined => {+): Pick<Config.IEntryVisibilityProfile, "name" | "defaults" | "entries" | "orders"> | undefined => {if (!profile || typeof profile.name !== "string" || !profile.name.trim() || !profile.entries ||typeof profile.entries !== "object" || Array.isArray(profile.entries) ||- (version < 3 && profile.base !== "simple" && profile.base !== "full")) {+ (version < 3 && profile.base !== "simple" && profile.base !== "full") ||+ (version >= 7 && profile.defaults !== undefined && profile.defaults !== "simple" && profile.defaults !== "full")) {return;}const entries = Object.entries(profile.entries)@@ -175,6 +177,10 @@ export const normalizeEntryVisibilityImportProfile = (migrateTaskStatusMenu({entries, orders});}migrateChartHeightMenu({entries, orders});- entries["editor.slash.menu.frequent"] ??= true;- return {name: profile.name, entries, orders};+ const defaults = version >= 7 && (profile.defaults === "simple" || profile.defaults === "full")+ ? profile.defaults : undefined;+ if (!defaults) {+ entries["editor.slash.menu.frequent"] ??= true;+ }+ return {name: profile.name, ...(defaults ? {defaults} : {}), entries, orders};};diff --git a/app/src/config/entryVisibility/runtime.test.ts b/app/src/config/entryVisibility/runtime.test.tsindex 8a9a671d04..3a9981877f 100644--- a/app/src/config/entryVisibility/runtime.test.ts+++ b/app/src/config/entryVisibility/runtime.test.ts@@ -16,6 +16,39 @@ import {mergeDockEntryOrderSnapshot,} from "./dockOrder";+test("new profiles follow changed catalog defaults while explicit and legacy values stay fixed", () => {+ const source = readFileSync(resolve(process.cwd(), "src/config/entryVisibility/runtime.ts"), "utf8");+ const compiled = transpileModule(source + "\nexports.writable = getWritableEntryProfile;", {+ compilerOptions: {module: ModuleKind.CommonJS},+ }).outputText;+ for (const mobile of [false, true]) {+ const path = mobile ? "editor.toolbar.mobile-selection.strong" : "editor.toolbar.strong";+ const node = {simple: true};+ const config: Config.IEntryVisibility = {version: 7, active: "simple", profiles: []};+ const window = {siyuan: {config: {appearance: {entryVisibility: config}}, languages: {entryCustomProfile: "Custom"}}};+ const runtime = {} as typeof import("./runtime") & {writable: (config: Config.IEntryVisibility) => Config.IEntryVisibilityProfile};+ runInNewContext(compiled, {exports: runtime, window, require: () => ({+ ...catalog, ...profileVisibility, TOOLBAR_ENTRY_ROOT_PATH, genUUID: () => "custom",+ getEntryCatalogNode: () => node,+ getEntryParentPath: (): undefined => undefined,+ getEntryCatalogDefaultVisibility: () => true,+ getEntryCatalogCustomDefaultVisibility: () => true,+ })});+ const custom = runtime.writable(config);+ assert.equal(runtime.getConfiguredEntryVisibility(path), true);+ node.simple = false;+ assert.equal(runtime.getConfiguredEntryVisibility(path), false);+ custom.entries[path] = true;+ assert.equal(runtime.getConfiguredEntryVisibility(path), true);+ delete custom.entries[path];+ delete custom.defaults;+ assert.equal(runtime.getConfiguredEntryVisibility(path), true);+ custom.entries[path] = false;+ node.simple = true;+ assert.equal(runtime.getConfiguredEntryVisibility(path), false);+ }+});+test("frequent slash defaults and snapshots follow profiles on desktop and mobile", () => {const source = readFileSync(resolve(process.cwd(), "src/config/entryVisibility/runtime.ts"), "utf8");const compiled = transpileModule(source + "\nexports.writable = getWritableEntryProfile;", {@@ -45,7 +78,9 @@ test("frequent slash defaults and snapshots follow profiles on desktop and mobilassert.equal(runtime.getConfiguredEntryVisibility(path), enabled && !mobile);assert.equal(runtime.createEntryProfileSnapshot(template)[path], enabled);const custom = runtime.writable(config);- assert.equal(custom.entries[path], enabled);+ assert.equal(custom.defaults, template);+ assert.equal(custom.entries[path], undefined);+ assert.equal(runtime.getConfiguredEntryVisibility(path, root), enabled);custom.entries[root] = false;for (const visible of [false, true]) {custom.entries[path] = visible;@@ -61,7 +96,7 @@ test("frequent slash defaults and snapshots follow profiles on desktop and mobilassert.equal(JSON.stringify(custom), saved);assert.equal(runtime.getConfiguredEntryVisibility(path, root), true);delete custom.entries[path];- assert.equal(runtime.getConfiguredEntryVisibility(path, root), true);+ assert.equal(runtime.getConfiguredEntryVisibility(path, root), enabled);}}} finally {@@ -107,13 +142,14 @@ test("daily note and flashcard presets preserve custom choices and mobile defaulconfig.active = "full";const custom = runtime.writable(config);for (const path of paths) {- assert.equal(custom.entries[path], !mobile);+ assert.equal(custom.entries[path], undefined);+ assert.equal(runtime.getConfiguredEntryVisibility(path), !mobile);for (const visible of [false, true]) {custom.entries[path] = visible;assert.equal(runtime.getConfiguredEntryVisibility(path), visible);}delete custom.entries[path];- assert.equal(runtime.getConfiguredEntryVisibility(path), false);+ assert.equal(runtime.getConfiguredEntryVisibility(path), !mobile);}// 使用完整模板重置时采用当前默认值,不改写其他已保存方案。custom.entries = runtime.createEntryProfileSnapshot("full");@@ -180,7 +216,8 @@ test("simple formatting defaults preserve color and full and custom toolbar choiconst custom = runtime.writable(config);for (const key of [...advanced, "text"]) {const path = `${root}.${key}`;- assert.equal(custom.entries[path], key === "text");+ assert.equal(custom.entries[path], undefined);+ assert.equal(runtime.isEntryVisible(path), key === "text");for (const visible of [false, true]) {custom.entries[path] = visible;assert.equal(runtime.isEntryVisible(path), visible);@@ -194,7 +231,7 @@ test("simple formatting defaults preserve color and full and custom toolbar choi}delete custom.entries[legacy];}- assert.equal(runtime.isEntryVisible(path), true);+ assert.equal(runtime.isEntryVisible(path), key === "text");custom.entries[path] = false;}const saved = JSON.stringify(custom);diff --git a/app/src/config/entryVisibility/runtime.ts b/app/src/config/entryVisibility/runtime.tsindex 737a6e9b56..c00b166ecd 100644--- a/app/src/config/entryVisibility/runtime.ts+++ b/app/src/config/entryVisibility/runtime.ts@@ -41,7 +41,7 @@ import {mergeDockEntryOrderSnapshot,} from "./dockOrder";-export const ENTRY_VISIBILITY_VERSION = 6;+export const ENTRY_VISIBILITY_VERSION = 7;export const ENTRY_PROFILE_SIMPLE = "simple";export const ENTRY_PROFILE_FULL = "full";export type TEntryVisibilityTemplate = typeof ENTRY_PROFILE_SIMPLE | typeof ENTRY_PROFILE_FULL;@@ -63,6 +63,11 @@ const getTemplateVisibility = (path: string, template: TEntryVisibilityTemplate));};+export const getEntryProfileDefaultVisibility = (profile: Config.IEntryVisibilityProfile | undefined, path: string) =>+ profile?.defaults === ENTRY_PROFILE_SIMPLE || profile?.defaults === ENTRY_PROFILE_FULL+ ? getTemplateVisibility(path, profile.defaults)+ : getEntryCatalogCustomDefaultVisibility(path);+export const isEntryVisible = (path: string): boolean => {/// #if MOBILEif (!path.startsWith(`${TOOLBAR_ENTRY_ROOT_PATH}.`) &&@@ -87,7 +92,8 @@ export const getConfiguredEntryVisibility = (path: string, stopAt?: string): boo} else if (active === ENTRY_PROFILE_SIMPLE) {visible = getTemplateVisibility(path, ENTRY_PROFILE_SIMPLE);} else {- visible = getProfileEntryVisibility(getActiveEntryProfile(), path, getEntryCatalogCustomDefaultVisibility(path));+ const profile = getActiveEntryProfile();+ visible = getProfileEntryVisibility(profile, path, getEntryProfileDefaultVisibility(profile, path));}if (!visible) {return false;@@ -154,7 +160,8 @@ const getWritableEntryProfile = (config: Config.IEntryVisibility) => {const profile: Config.IEntryVisibilityProfile = {id: genUUID(),name: uniqueEntryProfileName(window.siyuan.languages.entryCustomProfile, config.profiles),- entries: createEntryProfileSnapshot(template),+ defaults: template,+ entries: {},orders: {},};config.profiles.push(profile);@@ -212,6 +219,7 @@ const flushEntryVisibility = () => {};export const saveEntryVisibility = (config: Config.IEntryVisibility) => {+ config.version = ENTRY_VISIBILITY_VERSION;applyEntryVisibilityLocal(config);savePending = config;flushEntryVisibility();diff --git a/app/src/config/entryVisibility/ui.ts b/app/src/config/entryVisibility/ui.tsindex 2577a38169..c79eb46626 100644--- a/app/src/config/entryVisibility/ui.ts+++ b/app/src/config/entryVisibility/ui.ts@@ -5,9 +5,7 @@ import {genUUID} from "../../util/genID";import {entryCatalog,getEntryCatalogChildren,- getEntryCatalogCustomDefaultVisibility,getEntryCatalogPathChain,- getEntryPaths,IEntryCatalogNode,IEntryCatalogSection,isEntryCatalogNodeConfigurable,@@ -16,7 +14,6 @@ import {refreshSlashMenuCatalog,refreshTopBarCatalog,refreshToolbarCatalogEntries,- SLASH_MENU_ROOT_PATH,SLASH_MENU_FREQUENT_PATH,TOP_BAR_ROOT_PATH,STATUS_BAR_ROOT_PATH,@@ -27,7 +24,8 @@ import {ENTRY_PROFILE_FULL,ENTRY_PROFILE_SIMPLE,ENTRY_VISIBILITY_VERSION,- getConfiguredEntryVisibility as isEntryVisible,+ getActiveEntryProfile,+ getEntryProfileDefaultVisibility,saveEntryVisibility,TEntryVisibilityTemplate,} from "./runtime";@@ -137,13 +135,15 @@ const createProfile = (template: TEntryVisibilityTemplate, current = false, nameconst profile: Config.IEntryVisibilityProfile = {id: genUUID(),name: uniqueName(name || window.siyuan.languages.entryCustomProfile),- entries: createEntryProfileSnapshot(template),+ defaults: template,+ entries: {},orders: createEntryOrderSnapshot(current),};if (current) {- getEntryPaths().forEach((path) => {- profile.entries[path] = isEntryVisible(path, path === SLASH_MENU_FREQUENT_PATH ? SLASH_MENU_ROOT_PATH : undefined);- });+ const active = getActiveEntryProfile();+ profile.defaults = active?.defaults || (active ? undefined :+ window.siyuan.config.appearance.entryVisibility.active === ENTRY_PROFILE_SIMPLE ? ENTRY_PROFILE_SIMPLE : ENTRY_PROFILE_FULL);+ profile.entries = {...active?.entries};}return profile;};@@ -271,7 +271,7 @@ const renderEntrySwitch = (profile: Config.IEntryVisibilityProfile, path: stringreturn `<input class="b3-switch" type="checkbox"aria-label="${escapeAttr(label)}" data-entry-path="${escapeAttr(path)}"${readOnly ? ' data-entry-readonly aria-disabled="true"' : ""}${!parentEnabled && !readOnly ? " disabled" : ""}${getProfileEntryVisibility(profile, path,- getEntryCatalogCustomDefaultVisibility(path)) ? " checked" : ""}>`;+ getEntryProfileDefaultVisibility(profile, path)) ? " checked" : ""}>`;};const renderEntryRows = (profile: Config.IEntryVisibilityProfile, prefix: string,@@ -493,7 +493,7 @@ const renderEntryColumns = (profile: Config.IEntryVisibilityProfile, sectionKey:let title = directDisplayRoot?.label() || section.label();let parentEnabled = directDisplayRoot? getProfileEntryVisibility(profile, directDisplayRootPath,- getEntryCatalogCustomDefaultVisibility(directDisplayRootPath))+ getEntryProfileDefaultVisibility(profile, directDisplayRootPath)): true;let depth = 0;while (nodes.length > 0) {@@ -512,7 +512,7 @@ const renderEntryColumns = (profile: Config.IEntryVisibilityProfile, sectionKey:break;}parentEnabled = parentEnabled && getProfileEntryVisibility(profile, selectedPath,- getEntryCatalogCustomDefaultVisibility(selectedPath));+ getEntryProfileDefaultVisibility(profile, selectedPath));nodes = selectedNode.children;prefix = selectedPath;title = selectedNode.label();@@ -928,15 +928,11 @@ const openProfileEditor = (root: HTMLElement, profileID?: string) => {return;}selectedTemplate = target.value as TEntryVisibilityTemplate | "current";- draft.entries = createEntryProfileSnapshot(selectedTemplate === "current"- ? ENTRY_PROFILE_FULL- : selectedTemplate);- draft.orders = createEntryOrderSnapshot(selectedTemplate === "current");- if (selectedTemplate === "current") {- getEntryPaths().forEach((path) => {- draft.entries[path] = isEntryVisible(path, path === SLASH_MENU_FREQUENT_PATH ? SLASH_MENU_ROOT_PATH : undefined);- });- }+ const template = createProfile(selectedTemplate === "current" ? ENTRY_PROFILE_FULL : selectedTemplate,+ selectedTemplate === "current");+ draft.defaults = template.defaults;+ draft.entries = template.entries;+ draft.orders = template.orders;renderBrowser();});view.addEventListener("click", (event) => {diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.tsindex b5bd07e112..4acb5938e5 100644--- a/app/src/types/api/index.d.ts+++ b/app/src/types/api/index.d.ts@@ -2006,9 +2006,9 @@ export type SettingEntryVisibility = { "active": string; "profiles": Array<Settiexport type SettingEntryVisibilityInput = { "active"?: string | null; "profiles"?: Array<SettingEntryVisibilityProfileInput | null> | null; "version"?: number | null; };-export type SettingEntryVisibilityProfile = { "entries": Record<string, boolean> | null; "id": string; "name": string; "orders": Record<string, Array<string> | null> | null; };+export type SettingEntryVisibilityProfile = { "defaults"?: "simple" | "full"; "entries": Record<string, boolean> | null; "id": string; "name": string; "orders": Record<string, Array<string> | null> | null; };-export type SettingEntryVisibilityProfileInput = { "entries"?: Record<string, boolean> | null; "id"?: string | null; "name"?: string | null; "orders"?: Record<string, Array<string> | null> | null; };+export type SettingEntryVisibilityProfileInput = { "defaults"?: "simple" | "full"; "entries"?: Record<string, boolean> | null; "id"?: string | null; "name"?: string | null; "orders"?: Record<string, Array<string> | null> | null; };export type SettingExport = { "addTitle": boolean; "blockEmbedMode": number; "blockRefMode": number; "blockRefTextLeft": string; "blockRefTextRight": string; "docxTemplate": string; "fileAnnotationRefMode": number; "imageWatermarkDesc": string; "imageWatermarkStr": string; "includeRelatedDocs": boolean; "includeSubDocs": boolean; "inlineMemo": boolean; "markdownYFM": boolean; "pandocBin": string; "pandocParams": string; "paragraphBeginningSpace": boolean; "pdfFooter": string; "pdfWatermarkDesc": string; "pdfWatermarkStr": string; "removeAssetsID": boolean; "tagCloseMarker": string; "tagOpenMarker": string; };@@ -6685,6 +6685,10 @@ export interface APIPOSTRoutes {/** 服务器路由要求;资源权限与笔记本租约仍由内核校验 */authorization?: readonly ["authenticated","admin","writable"];};+ /**+ * 的版本 7 方案可用 defaults 指定 simple 或 full,未覆盖的显隐跟随该内置方案。+ * 省略 defaults 的方案及旧版本方案保留独立显隐语义;entries 中的布尔值始终优先,未知入口和插件排序保留。+ */"/api/setting/setEntryVisibility": {request: SetEntryVisibilityRequestInput;response: { "code": 0; "data": SettingEntryVisibility | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.tsindex f2eb1e8aac..ab23ba663f 100644--- a/app/src/types/config.d.ts+++ b/app/src/types/config.d.ts@@ -407,6 +407,7 @@ declare namespace Config {export interface IEntryVisibilityProfile {id: string;name: string;+ defaults?: "simple" | "full";entries: Record<string, boolean>;orders: Record<string, string[]>;}diff --git a/kernel/api/contract_entry_visibility_defaults_test.go b/kernel/api/contract_entry_visibility_defaults_test.gonew file mode 100644index 0000000000..c88c3fbf3f--- /dev/null+++ b/kernel/api/contract_entry_visibility_defaults_test.go@@ -0,0 +1,43 @@+package api++import (+ "encoding/json"+ "fmt"+ "testing"++ "github.com/siyuan-note/siyuan/kernel/conf"+ "github.com/siyuan-note/siyuan/kernel/model"+ "github.com/siyuan-note/siyuan/kernel/util"+)++func TestAPIContractEntryVisibilityDefaults(t *testing.T) {+ previous, readOnly := model.Conf, util.ReadOnly+ util.ReadOnly = true+ t.Cleanup(func() { model.Conf, util.ReadOnly = previous, readOnly })+ for _, version := range []int{6, 7} {+ model.Conf = model.NewAppConf()+ model.Conf.Appearance = conf.NewAppearance()+ body := fmt.Sprintf(`{"version":%d,"active":"custom","profiles":[{"id":"custom","name":"Custom","defaults":"simple","entries":{"editor.toolbar.strong":false},"orders":{"dock":["plugin:unavailable:dock"]}}]}`, version)+ code, message, data := settingContractRequest(t, "setEntryVisibility", setEntryVisibility, body)+ if code != 0 {+ t.Fatal(message)+ }+ var response struct {+ Version int `json:"version"`+ Profiles []struct {+ Defaults *string `json:"defaults"`+ Entries map[string]bool `json:"entries"`+ Orders map[string][]string `json:"orders"`+ } `json:"profiles"`+ }+ if err := json.Unmarshal(data, &response); err != nil {+ t.Fatal(err)+ }+ profile := response.Profiles[0]+ if response.Version != 7 || (version == 6 && profile.Defaults != nil) ||+ (version == 7 && (profile.Defaults == nil || *profile.Defaults != "simple")) ||+ len(profile.Entries) != 1 || profile.Entries["editor.toolbar.strong"] || profile.Orders["dock"][0] != "plugin:unavailable:dock" {+ t.Fatalf("profile semantics changed: %s", data)+ }+ }+}diff --git a/kernel/api/contract_setting_test.go b/kernel/api/contract_setting_test.goindex 4636ec473a..865c961bf7 100644--- a/kernel/api/contract_setting_test.go+++ b/kernel/api/contract_setting_test.go@@ -245,6 +245,9 @@ func fillSettingPayload(value reflect.Value) {fillSettingPayload(value.Field(i))}}+ if value.Type() == reflect.TypeFor[conf.EntryVisibilityProfile]() {+ value.FieldByName("Defaults").SetString(conf.EntryVisibilityProfileSimple)+ }case reflect.Slice:value.Set(reflect.MakeSlice(value.Type(), 2, 2))fillSettingPayload(value.Index(0))diff --git a/kernel/api/setting_contract.go b/kernel/api/setting_contract.goindex 95301aa99a..69aaf51ddd 100644--- a/kernel/api/setting_contract.go+++ b/kernel/api/setting_contract.go@@ -715,6 +715,7 @@ func settingEntryVisibilityProfilePayload(value *conf.EntryVisibilityProfile) *aresult := &apicontract.SettingEntryVisibilityProfile{}result.ID = value.IDresult.Name = value.Name+ result.Defaults = value.Defaultsresult.Entries = value.Entriesresult.Orders = value.Ordersreturn resultdiff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.goindex 2e8adc43d7..d4be774b21 100644--- a/kernel/apicontract/contracts.go+++ b/kernel/apicontract/contracts.go@@ -1090,6 +1090,9 @@ var SetFiletree = define[SetFiletreeRequest, *SettingFileTree]("setFiletree", "/// 省略汉字敏感、自定义块和脑图选项时保留当前值;反链提及关键词上限小于 1 回退 512。var SetSearch = define[SetSearchRequest, *SettingSearch]("setSearch", "/api/setting/setSearch", AuthenticatedAccess|AdminAccess|WritableAccess, JSONBody, ResponseOptions{}, "POST")var SetAppearance = define[SetAppearanceRequest, *SettingAppearance]("setAppearance", "/api/setting/setAppearance", AuthenticatedAccess|AdminAccess|WritableAccess, JSONBody, ResponseOptions{}, "POST")++// SetEntryVisibility 的版本 7 方案可用 defaults 指定 simple 或 full,未覆盖的显隐跟随该内置方案。+// 省略 defaults 的方案及旧版本方案保留独立显隐语义;entries 中的布尔值始终优先,未知入口和插件排序保留。var SetEntryVisibility = define[SetEntryVisibilityRequest, *SettingEntryVisibility]("setEntryVisibility", "/api/setting/setEntryVisibility", AuthenticatedAccess|AdminAccess|WritableAccess, JSONBody, ResponseOptions{}, "POST")var SetPublish = define[SetPublishRequest, SettingPublishData]("setPublish", "/api/setting/setPublish", AuthenticatedAccess|AdminAccess|WritableAccess, JSONBody, ResponseOptions{}, "POST")var GetBootAppearances = define[EmptyRequest, SettingBootAppearancesData]("getBootAppearances", "/api/setting/getBootAppearances", AuthenticatedAccess, NoBody, ResponseOptions{}, "POST")diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.jsonindex cb13bffc4c..e9e06b0f3a 100644--- a/kernel/apicontract/schema.json+++ b/kernel/apicontract/schema.json@@ -45380,6 +45380,13 @@"SettingEntryVisibilityProfile": {"type": "object","properties": {+ "defaults": {+ "type": "string",+ "enum": [+ "simple",+ "full"+ ]+ },"entries": {"anyOf": [{@@ -45434,6 +45441,20 @@"SettingEntryVisibilityProfileInput": {"type": "object","properties": {+ "defaults": {+ "enum": [+ "simple",+ "full"+ ],+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },"entries": {"anyOf": [{diff --git a/kernel/apicontract/setting.go b/kernel/apicontract/setting.goindex 7a254d0189..b3cc0b9ea1 100644--- a/kernel/apicontract/setting.go+++ b/kernel/apicontract/setting.go@@ -463,10 +463,11 @@ type SettingEntryVisibility struct {}type SettingEntryVisibilityProfile struct {- ID string `json:"id" api:"optional,nullable"`- Name string `json:"name" api:"optional,nullable"`- Entries map[string]bool `json:"entries" api:"optional,nullable"`- Orders map[string][]string `json:"orders" api:"optional,nullable"`+ ID string `json:"id" api:"optional,nullable"`+ Name string `json:"name" api:"optional,nullable"`+ Defaults string `json:"defaults,omitempty" api:"optional,nullable,enum=simple|full"`+ Entries map[string]bool `json:"entries" api:"optional,nullable"`+ Orders map[string][]string `json:"orders" api:"optional,nullable"`}type SettingPublish struct {diff --git a/kernel/conf/appearance.go b/kernel/conf/appearance.goindex 29011ec0e9..ab4bb88487 100644--- a/kernel/conf/appearance.go+++ b/kernel/conf/appearance.go@@ -80,7 +80,7 @@ func (appearance *Appearance) NormalizeGlobalFontFamilies() {}const (- EntryVisibilityVersion = 6+ EntryVisibilityVersion = 7EntryVisibilityProfileSimple = "simple"EntryVisibilityProfileFull = "full")@@ -92,10 +92,11 @@ type EntryVisibility struct {}type EntryVisibilityProfile struct {- ID string `json:"id"`- Name string `json:"name"`- Entries map[string]bool `json:"entries"`- Orders map[string][]string `json:"orders"`+ ID string `json:"id"`+ Name string `json:"name"`+ Defaults string `json:"defaults,omitempty"` // 新方案未覆盖的显隐跟随指定内置方案;旧方案留空。+ Entries map[string]bool `json:"entries"`+ Orders map[string][]string `json:"orders"`}func NewEntryVisibility(active string) *EntryVisibility {@@ -128,6 +129,9 @@ func NormalizeEntryVisibility(entryVisibility *EntryVisibility, fallback string)if nil == profile.Entries {profile.Entries = map[string]bool{}}+ if version < 7 || (profile.Defaults != EntryVisibilityProfileSimple && profile.Defaults != EntryVisibilityProfileFull) {+ profile.Defaults = ""+ }if nil == profile.Orders {profile.Orders = map[string][]string{}}diff --git a/kernel/conf/appearance_test.go b/kernel/conf/appearance_test.goindex df9cd40d53..9307fb9a48 100644--- a/kernel/conf/appearance_test.go+++ b/kernel/conf/appearance_test.go@@ -72,6 +72,29 @@ func TestNormalizeEntryVisibilityDefaults(t *testing.T) {}}+func TestNormalizeEntryVisibilityDefaultsCompatibility(t *testing.T) {+ for _, version := range []int{6, 7} {+ for _, defaults := range []string{"", "simple", "full", "invalid"} {+ profile := &EntryVisibilityProfile{ID: "custom", Name: "Custom", Defaults: defaults,+ Entries: map[string]bool{"editor.toolbar.strong": false, "plugin:unavailable:item": true},+ Orders: map[string][]string{"dock": {"plugin:unavailable:dock"}}}+ config := NormalizeEntryVisibility(&EntryVisibility{Version: version, Active: "custom", Profiles: []*EntryVisibilityProfile{profile}}, EntryVisibilityProfileFull)+ want := defaults+ if version < 7 || defaults == "invalid" {+ want = ""+ }+ if profile.Defaults != want || len(profile.Entries) != 2 || profile.Entries["editor.toolbar.strong"] ||+ !profile.Entries["plugin:unavailable:item"] || profile.Orders["dock"][0] != "plugin:unavailable:dock" {+ t.Fatalf("profile compatibility lost for version %d defaults %q: %+v", version, defaults, profile)+ }+ NormalizeEntryVisibility(config, EntryVisibilityProfileFull)+ if profile.Defaults != want || len(profile.Entries) != 2 {+ t.Fatal("normalization changed a normalized profile")+ }+ }+ }+}+func TestNormalizeEntryVisibilityProfiles(t *testing.T) {entryVisibility := NormalizeEntryVisibility(&EntryVisibility{Version: 99,diff --git a/kernel/model/slash_frequent.go b/kernel/model/slash_frequent.goindex 0c926548ff..bc72ac3d5f 100644--- a/kernel/model/slash_frequent.go+++ b/kernel/model/slash_frequent.go@@ -11,7 +11,8 @@ func migrateSlashFrequent(entryVisibility *conf.EntryVisibility, loadStorage fun}for _, profile := range entryVisibility.Profiles {if nil == profile || "" == profile.ID || "" == profile.Name ||- conf.EntryVisibilityProfileSimple == profile.ID || conf.EntryVisibilityProfileFull == profile.ID {+ conf.EntryVisibilityProfileSimple == profile.ID || conf.EntryVisibilityProfileFull == profile.ID ||+ conf.EntryVisibilityProfileSimple == profile.Defaults || conf.EntryVisibilityProfileFull == profile.Defaults {continue}if _, exists := profile.Entries[key]; !exists {diff --git a/kernel/model/slash_frequent_test.go b/kernel/model/slash_frequent_test.goindex 8d9e022dab..7ae3609624 100644--- a/kernel/model/slash_frequent_test.go+++ b/kernel/model/slash_frequent_test.go@@ -8,6 +8,22 @@ import ("github.com/siyuan-note/siyuan/kernel/conf")+func TestMigrateSlashFrequentPreservesInheritedDefaults(t *testing.T) {+ for _, defaults := range []string{conf.EntryVisibilityProfileSimple, conf.EntryVisibilityProfileFull} {+ profile := &conf.EntryVisibilityProfile{ID: "custom", Name: "Custom", Defaults: defaults, Entries: map[string]bool{}}+ config := &conf.EntryVisibility{Version: conf.EntryVisibilityVersion, Active: "custom", Profiles: []*conf.EntryVisibilityProfile{profile}}+ for range 2 {+ migrateSlashFrequent(config, func() (map[string]any, error) {+ t.Fatal("inherited profiles must not read legacy storage")+ return nil, nil+ })+ }+ if len(profile.Entries) != 0 || profile.Defaults != defaults {+ t.Fatal("startup migration replaced inherited visibility")+ }+ }+}+func TestMigrateSlashFrequent(t *testing.T) {const key = "editor.slash.menu.frequent"for _, test := range []struct {