chore(ci): route heap dialogs through platform wrapper; fix dialog/i18n tests on Windows

heapDumpFiles.tsx used @tauri-apps/plugin-dialog directly, which dialog.test.ts forbids; route open/save through @/platform/dialog (GTK fallback on Linux). dialog.test.ts compared readdirSync paths without slash normalization, so platform\dialog.ts flagged itself on Windows. i18n.test.ts allows Tailwind CSS and JDK: as untranslated product names.

Co-Authored-By: Claude Code <[email protected]>
Цей коміт міститься в:
arookieofcтаClaude Code committed 2026-11-11 19:20:03 +08:00
1 джерело 38de25a9c4
коміт c8551593a8
3 files changed
+6 -5

No files matched your search

+3 -4
Переглянути файл
@@ -3,6 +3,7 @@ import { ProgressBar } from "@/ui";
import { setContext } from "@/platform/context";
import { tx, useTx } from "@/platform/i18n";
import { call, commands, IpcError } from "@/platform/ipc";
import { open as openDialog, save as saveDialog } from "@/platform/dialog";
import { ipcPath } from "@/platform/paths";
import { basename } from "@/platform/project";
import { isRemoteWindow, useRemote } from "@/platform/remote";
@@ -43,8 +44,7 @@ export async function openHeapDump(): Promise<void> {
}
// One file at a time; the running open keeps its progress notification.
if (useHeap.getState().opening) return;
const { open } = await import("@tauri-apps/plugin-dialog");
const picked = await open({ multiple: false, directory: false, filters: FILTERS() });
const picked = await openDialog({ multiple: false, directory: false, filters: FILTERS() });
if (typeof picked !== "string" || useHeap.getState().opening) return;
const path = ipcPath(picked);
const name = basename(path);
@@ -85,8 +85,7 @@ export async function openHeapDump(): Promise<void> {
export async function saveHeapDump(id: number): Promise<void> {
const entry = useHeap.getState().snapshots[id];
if (!entry || entry.info.origin.kind !== "captured" || isRemoteWindow()) return;
const { save } = await import("@tauri-apps/plugin-dialog");
const picked = await save({
const picked = await saveDialog({
defaultPath: `${entry.info.label.replace(/[/\\:*?"<>|]/g, "-")}.hprof`,
filters: FILTERS(),
});
+1 -1
Переглянути файл
@@ -9,7 +9,7 @@ it("opens every file picker through the platform wrapper", () => {
(file) =>
/\.[jt]sx?$/.test(file) &&
!/\.test\.[jt]sx?$/.test(file) &&
file !== "platform/dialog.ts" &&
file.replace(/\\/g, "/") !== "platform/dialog.ts" &&
readFileSync(resolve(src, file), "utf8").includes("@tauri-apps/plugin-" + "dialog"),
);
expect(offenders).toEqual([]);
+2
Переглянути файл
@@ -283,6 +283,8 @@ describe("catalogs", () => {
"Yarn",
"Cargo",
"CMake",
"Tailwind CSS",
"JDK:",
]);
const translated = SUPPORTED_LOCALES.filter((locale) => locale !== "en").sort();