fix(find): keep the usages popup size loader private and fix a knip import (#7049)

#7048 exported the size loader only its own file uses, and its e2e test imported usages.ts from a literal path; knip reported both. Unexport the loader and import through a variable like the other spec in the file.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-30 21:06:50 +08:00
1 джерело 72669a04c2
коміт 3eb6933644
2 files changed
+3 -2

No files matched your search

+2 -1
Переглянути файл
@@ -50,7 +50,8 @@ test("Show Usages resizes from its corner, the list fills it, and it reopens at
await page.setViewportSize({ width: 1200, height: 800 });
const show = () =>
page.evaluate(async () => {
const { useUsagesPopup } = await import(/* @vite-ignore */ "/src/features/code-insight/usages.ts");
const usages = "/src/features/code-insight/usages.ts";
const { useUsagesPopup } = await import(/* @vite-ignore */ usages);
const path = "/dev/app/src/Main.ts";
useUsagesPopup.setState({
open: true,
+1 -1
Переглянути файл
@@ -60,7 +60,7 @@ const MIN_WIDTH = 360;
const MIN_HEIGHT = 160;
/** The size the popup was last resized to, if any (IDEA remembers Show Usages' size). */
export function loadUsagesPopupSize(): { w: number; h: number } | null {
function loadUsagesPopupSize(): { w: number; h: number } | null {
try {
const saved = JSON.parse(localStorage.getItem(SIZE_KEY) ?? "null") as { w?: unknown; h?: unknown } | null;
return typeof saved?.w === "number" && typeof saved.h === "number" && Number.isFinite(saved.w + saved.h)