Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai b7dc200763 fix(search): keep line numbers visible in text results 2026-11-23 06:53:58 +08:00
7 змінених файлів з 85 додано та 54 видалено

No files matched your search

+60
Переглянути файл
@@ -1,4 +1,64 @@
import { doubleShift, expect, stubDesktop, test } from "./fixtures";
test("Search Everywhere keeps line numbers visible beside long Text result filenames", async ({ workbench: page }) => {
const relPath = "config/InternationalSettlementReconciliationEndpointsForStagingEnvironments.ts";
const query = "settlementEndpoint";
const text = `const ${query} = "/staging/settlement";`;
await stubDesktop(page);
await page.evaluate(
({ relPath, text, query }) => {
window.__ipc.handlers.search_start = (args) => {
setTimeout(() => {
const matches = [12344, 12345].map((line) => ({
line,
text,
ranges: [[6, 6 + query.length]],
textOffset: 0,
}));
window.__ipc.send(args.onEvent, {
type: "file",
file: { path: `/dev/acme-api/${relPath}`, relPath, matches },
});
window.__ipc.send(args.onEvent, {
type: "done",
summary: { files: 1, matches: 2, limitHit: false, cancelled: false, elapsedMs: 4 },
});
}, 20);
return null;
};
},
{ relPath, text, query },
);
await doubleShift(page);
const dialog = page.getByRole("dialog", { name: "Search Everywhere" });
await dialog.getByRole("tab", { name: "Text", exact: true }).click();
const search = dialog.getByRole("combobox", { name: "Search query" });
await search.fill(query);
const rows = dialog.getByRole("option");
await expect(rows).toHaveCount(2);
for (const width of [920, 440]) {
await page.setViewportSize({ width, height: 640 });
for (const line of [12345, 12346]) {
const row = rows.filter({ hasText: String(line) });
await expect(row.locator("mark")).toHaveText(query);
expect(
await row.evaluate((el) => {
const location = el.lastElementChild!;
const lineText = location.lastChild!;
const range = document.createRange();
range.selectNodeContents(lineText);
const bounds = range.getBoundingClientRect();
const clip = location.getBoundingClientRect();
return bounds.width > 0 && bounds.left >= clip.left && bounds.right <= clip.right + 1;
}),
).toBe(true);
await expect(row.getByText(relPath.split("/").at(-1)!, { exact: true })).toHaveAttribute("title", relPath);
}
}
await search.press("ArrowDown");
await expect(rows.nth(1)).toHaveAttribute("aria-selected", "true");
});
import type { Page } from "@playwright/test";
test("action names stay readable beside shortcuts and categories", async ({ workbench: page }) => {
-36
Переглянути файл
@@ -1,41 +1,5 @@
import { expect, openFromTree, test } from "./fixtures";
test("the line separator menu has a heading and keeps the current choice visible", async ({ workbench: page }) => {
await openFromTree(page, "build.gradle.kts");
const status = page.locator('[data-status-item="editor.lineEnding"]').getByRole("button");
const menu = page.getByRole("menu", { name: /^Line Separator$/i });
const windows = "Windows (\\r\\n)";
const unix = "Unix and macOS (\\n)";
const classic = "Classic Mac OS (\\r)";
await expect(status).toHaveText("LF");
await status.click();
const heading = menu.locator("..").getByText("Line Separator", { exact: true });
expect(await heading.count()).toBe(1);
await expect(heading).toHaveCSS("font-size", "13px");
await expect(menu.locator('[role^="menuitem"]')).toHaveText([windows, unix, classic]);
await page.setViewportSize({ width: 540, height: 540 });
await expect(heading).toBeInViewport({ ratio: 1 });
await expect(menu.getByRole("menuitemcheckbox", { name: unix, checked: true })).toBeInViewport({ ratio: 1 });
await expect(menu.getByRole("menuitem", { name: windows })).toBeFocused();
await page.keyboard.press("Enter");
await expect(status).toHaveText("CRLF");
await status.click();
await expect(menu.getByRole("menuitemcheckbox", { name: windows, checked: true })).toBeFocused();
await page.keyboard.press("ArrowDown");
await page.keyboard.press("Enter");
await expect(status).toHaveText("LF");
await page.evaluate(async () => {
const path = "/src/platform/i18n.ts";
await (await import(/* @vite-ignore */ path)).setLocale("zh");
});
await status.click();
const translated = page.getByRole("menu", { name: "行分隔符", exact: true });
await expect(translated.getByRole("menuitem", { name: "Windows 换行 (\\r\\n)", exact: true })).toBeVisible();
});
test("status bar uses its row height and widget insets in both densities", async ({ workbench: page }) => {
const editor = await openFromTree(page, "build.gradle.kts");
const bar = page.locator('footer[aria-label="Status bar"]');
+6 -11
Переглянути файл
@@ -417,11 +417,6 @@ export function CaretStatus() {
}
const EOL_LABEL: Record<LineEnding, string> = { lf: "LF", crLf: "CRLF", cr: "CR" };
const EOL_CHOICES: { id: LineEnding; label: string }[] = [
{ id: "crLf", label: "Windows (\\r\\n)" },
{ id: "lf", label: "Unix and macOS (\\n)" },
{ id: "cr", label: "Classic Mac OS (\\r)" },
];
export function LineEndingStatus() {
const meta = useActiveMeta();
@@ -459,12 +454,12 @@ export function LineEndingStatus() {
onClose={() => setOpen(false)}
anchor={ref}
placement="top-end"
title="Line Separator"
items={EOL_CHOICES.map(({ id, label }) => ({
id,
label,
checked: meta.lineEnding === id ? true : undefined,
run: () => choose(id),
aria-label="Line separator"
items={(["lf", "crLf", "cr"] as LineEnding[]).map((le) => ({
id: le,
label: `${EOL_LABEL[le]} – ${le === "lf" ? "Unix and macOS (\\n)" : le === "crLf" ? "Windows (\\r\\n)" : "Classic Mac OS (\\r)"}`,
checked: meta.lineEnding === le ? true : undefined,
run: () => choose(le),
}))}
/>
</>
+14
Переглянути файл
@@ -248,6 +248,20 @@
.rightActive {
color: var(--fg-muted);
}
.textLocation {
display: inline-flex;
align-items: baseline;
gap: var(--space-1);
}
.textFile {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.textLine {
flex: none;
font-variant-numeric: tabular-nums;
}
.actionRow {
flex: 1;
min-width: 0;
+5 -2
Переглянути файл
@@ -934,8 +934,11 @@ function ResultRow({
<span className={styles.main}>
<CodeText path={row.path} text={row.text} indices={row.indices} />
</span>
<span className={clsx(styles.right, active && styles.rightActive)}>
<span className={clsx(repeat && !active && styles.repeat)}>{basename(row.rel)}</span> {row.line + 1}
<span className={clsx(styles.right, styles.textLocation, active && styles.rightActive)}>
<span className={clsx(styles.textFile, repeat && !active && styles.repeat)} title={row.rel}>
{basename(row.rel)}
</span>{" "}
<span className={styles.textLine}>{row.line + 1}</span>
</span>
</>
);
-4
Переглянути файл
@@ -965,10 +965,6 @@
"Tag value": "Tag value",
"Attribute": "Attribute",
"Contents differ only in line separators": "Contents differ only in line separators",
"Line Separator": "Line Separator",
"Windows (\\r\\n)": "Windows (\\r\\n)",
"Unix and macOS (\\n)": "Unix and macOS (\\n)",
"Classic Mac OS (\\r)": "Classic Mac OS (\\r)",
"Cannot remove a worktree containing the open project.": "Cannot remove a worktree containing the open project.",
"Delete Remote Branches": "Delete Remote Branches",
"Delete the {length} branches '{names}' on the remote? The remote-tracking branches are removed as well.": "Delete the {length} branches '{names}' on the remote? The remote-tracking branches are removed as well.",
-1
Переглянути файл
@@ -5141,7 +5141,6 @@
"Days on which files changed; older revisions are removed when a project opens.": "按文件有更改的天数计算;打开项目时会删除更早的修订。",
"Language of menus and dialogs; untranslated text stays in English.": "菜单和对话框的语言;未翻译的文本保持英文。",
"Unix and macOS (\\n)": "Unix 和 macOS (\\n)",
"Windows (\\r\\n)": "Windows 换行 (\\r\\n)",
"Classic Mac OS (\\r)": "经典 Mac OS (\\r)",
"Encoding of new files; decodes project files that are not valid UTF-8 and have no BOM.": "新文件的编码;也用于解码不是有效 UTF-8 且没有 BOM 的项目文件。",
"Stored in the IDE; used by projects without their own scheme.": "存储在 IDE 中;供没有自己方案的项目使用。",