From dfe478487447f664a461327f4e9a6e5ef20eb680 Mon Sep 17 00:00:00 2001 From: Orca <301901286+og-orca@users.noreply.github.com> Date: Thu, 3 Dec 2026 07:30:15 +0100 Subject: [PATCH] fix(plugins): give the truncated navigation notice its own title (#7685) When plugin navigation stops at its file limit, the notice used the title of a failed index, so a working but truncated index looked broken. It is now titled "Plugin navigation indexing truncated"; the failure notice keeps its title. Closes #7635 Co-authored-by: og-orca <301901286+og-orca@users.noreply.github.com> --- src/features/plugins/navigation.test.ts | 5 +++-- src/features/plugins/navigation.ts | 2 +- src/platform/locales/text/en.json | 1 + src/platform/locales/text/ru.json | 1 + src/platform/locales/text/zh-TW.json | 1 + src/platform/locales/text/zh.json | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/plugins/navigation.test.ts b/src/features/plugins/navigation.test.ts index f7965754d..4339d9589 100644 --- a/src/features/plugins/navigation.test.ts +++ b/src/features/plugins/navigation.test.ts @@ -6,7 +6,7 @@ import { usePlugins } from "./store"; import { useEditorRegistry } from "@/editor/api"; import { lspDoc } from "@/editor/lsp/lsp"; import { notifications, provideNotificationService, synchronizeDocumentIndexes } from "@/workbench/contributions"; -import { setLocale, txTemplate, useI18n } from "@/platform/i18n"; +import { setLocale, tx, txTemplate, useI18n } from "@/platform/i18n"; const mocks = vi.hoisted(() => ({ files: vi.fn(), @@ -233,7 +233,8 @@ it("indexes the first files of a large project and says how many it covers, in o await vi.advanceTimersByTimeAsync(250); expect(mocks.index.mock.calls[0]?.[0]).toEqual(["/project/A.java"]); expect(notify).toHaveBeenCalledTimes(1); - const body = notify.mock.calls[0]![0].body; + const { title, body } = notify.mock.calls[0]![0]; + expect(tx(title)).toBe("插件导航索引已截断"); expect(body).toBe("插件导航仅覆盖 big-demo 中 28,684 个文件里的 1 个;可排除文件夹以缩小范围"); // The balloon and the OS toast look the text up again: it stays whole. expect(txTemplate(body)).toBe(body); diff --git a/src/features/plugins/navigation.ts b/src/features/plugins/navigation.ts index ca455d93a..0868d7311 100644 --- a/src/features/plugins/navigation.ts +++ b/src/features/plugins/navigation.ts @@ -56,7 +56,7 @@ export function startPluginNavigation(): () => void { notifications().notify({ group: "plugins", level: "warning", - title: "Plugin navigation indexing incomplete", + title: "Plugin navigation indexing truncated", body: tx`Plugin navigation covers ${count.toLocaleString()} of ${total.toLocaleString()} files in ${name}; exclude folders to narrow it`, }); } diff --git a/src/platform/locales/text/en.json b/src/platform/locales/text/en.json index 62b5b26ef..36ff90703 100644 --- a/src/platform/locales/text/en.json +++ b/src/platform/locales/text/en.json @@ -5130,6 +5130,7 @@ "Imported {imported} recent projects and {groups} project groups, skipped {missing} whose folder is missing.": "Imported {imported} recent projects and {groups} project groups, skipped {missing} whose folder is missing.", "{imported} new, {groups} new project groups, {missing} skipped (folder missing)": "{imported} new, {groups} new project groups, {missing} skipped (folder missing)", "Plugin navigation covers {count} of {total} files in {project}; exclude folders to narrow it": "Plugin navigation covers {count} of {total} files in {project}; exclude folders to narrow it", + "Plugin navigation indexing truncated": "Plugin navigation indexing truncated", "Add as Library…": "Add as Library…", "Open Library Settings": "Open Library Settings", "Create Library": "Create Library", diff --git a/src/platform/locales/text/ru.json b/src/platform/locales/text/ru.json index d870d666a..c82961294 100644 --- a/src/platform/locales/text/ru.json +++ b/src/platform/locales/text/ru.json @@ -7780,6 +7780,7 @@ "Session parameters set after connecting (ALTER SESSION SET name = value). connect_timeout is in seconds.": "Параметры сеанса, устанавливаемые после подключения (ALTER SESSION SET name = value). connect_timeout задаётся в секундах.", "Choose Mapping Target": "Выберите цель сопоставления", "Plugin navigation indexing incomplete": "Индексирование навигации плагина не завершено", + "Plugin navigation indexing truncated": "Индекс навигации плагина усечён", "Choose Declaration": "Выберите объявление", "Go to mapping: {target}": "Перейти к сопоставлению: {target}", "Untracked files prevent checkout": "Неотслеживаемые файлы препятствуют переключению", diff --git a/src/platform/locales/text/zh-TW.json b/src/platform/locales/text/zh-TW.json index 7b6fceaef..ece308c23 100644 --- a/src/platform/locales/text/zh-TW.json +++ b/src/platform/locales/text/zh-TW.json @@ -7388,6 +7388,7 @@ "Session parameters set after connecting (ALTER SESSION SET name = value). connect_timeout is in seconds.": "連線後設定的工作階段參數(ALTER SESSION SET name = value)。connect_timeout 以秒為單位。", "Choose Mapping Target": "選擇對映目標", "Plugin navigation indexing incomplete": "外掛導覽索引未完成", + "Plugin navigation indexing truncated": "外掛導覽索引已截斷", "Choose Declaration": "選擇宣告", "Go to mapping: {target}": "跳轉到對映:{target}", "Untracked files prevent checkout": "未跟蹤的檔案阻止了簽出", diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index 5c30770e2..8d0092586 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -11862,6 +11862,7 @@ "Empty: the project's path under /mnt, such as /mnt/c/work/app.": "留空:使用项目在 /mnt 下的路径,例如 /mnt/c/work/app。", "WSL targets run in the chosen distribution through wsl.exe, with the project read through /mnt. Debugging, coverage and profiling stay on this machine.": "WSL 目标通过 wsl.exe 在所选发行版中运行,项目通过 /mnt 读取。调试、覆盖率和性能分析仍在本机进行。", "Plugin navigation covers {count} of {total} files in {project}; exclude folders to narrow it": "插件导航仅覆盖 {project} 中 {total} 个文件里的 {count} 个;可排除文件夹以缩小范围", + "Plugin navigation indexing truncated": "插件导航索引已截断", "Source Definition": "源定义", "Go to Source Definition": "转到源定义", "Go to Project Configuration": "转到项目配置",