mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-22 19:49:35 -10:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9415584b54 | ||
|
|
7e5a2cf051 | ||
|
|
c4e08a9676 | ||
|
|
2c0b76c9e6 |
No files matched your search
@@ -0,0 +1,110 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, ipcCalls, stubDesktop, test } from "./fixtures";
|
||||
|
||||
async function openTable(page: Page, columns: number) {
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(async (columns) => {
|
||||
window.__ipc.handlers.debug_evaluate_in = ({ expression }) => {
|
||||
const query = String(expression);
|
||||
const sliced = query.includes("totals.iloc[:2, :2]");
|
||||
const visibleColumns = sliced ? 2 : Math.min(30, columns);
|
||||
const columnsInFrame = sliced ? 2 : columns;
|
||||
const start = query.includes("100, 100,") ? 100 : 0;
|
||||
const rows = sliced ? 2 : 220;
|
||||
const count = sliced ? 2 : 100;
|
||||
const result = query.includes("missing_table")
|
||||
? { error: "NameError: missing_table" }
|
||||
: {
|
||||
kind: "frame",
|
||||
shape: [rows, columnsInFrame],
|
||||
rows,
|
||||
columns: columnsInFrame,
|
||||
headers: Array.from({ length: visibleColumns }, (_, i) => `Amount ${i + 1}`),
|
||||
dtypes: Array.from({ length: visibleColumns }, () => "int64"),
|
||||
index: Array.from({ length: count }, (_, i) => String(i + start)),
|
||||
cells: Array.from({ length: count }, (_, row) =>
|
||||
Array.from({ length: visibleColumns }, (_, column) => String((row + start + 1) * 10 + column)),
|
||||
),
|
||||
};
|
||||
return {
|
||||
name: "",
|
||||
value: JSON.stringify(JSON.stringify(result)),
|
||||
typeName: "str",
|
||||
variablesReference: 0,
|
||||
evaluateName: null,
|
||||
};
|
||||
};
|
||||
const stateModule = "/src/features/debugger/state.ts";
|
||||
const overlaysModule = "/src/features/debugger/ui/popoverStore.ts";
|
||||
const { adoptSession } = await import(/* @vite-ignore */ stateModule);
|
||||
const { openTableView } = await import(/* @vite-ignore */ overlaysModule);
|
||||
adoptSession(91, { name: "Settlement review", adapter: "debugpy", status: "paused", selectedFrame: 11 });
|
||||
openTableView("totals", 91);
|
||||
}, columns);
|
||||
const dialog = page.getByRole("dialog", { name: "Table view of totals", exact: true });
|
||||
await expect(dialog.getByRole("table")).toBeVisible();
|
||||
return dialog;
|
||||
}
|
||||
|
||||
test("View as Table gives the grid the dialog width and puts the expression below it", async ({ workbench: page }) => {
|
||||
await page.setViewportSize({ width: 1120, height: 760 });
|
||||
const dialog = await openTable(page, 3);
|
||||
const scroll = dialog.getByRole("region", { name: "Table", exact: true });
|
||||
const grid = dialog.getByRole("table");
|
||||
const expression = dialog.getByRole("textbox", { name: "Expression", exact: true });
|
||||
const shape = dialog.getByText("Shape (220, 3)", { exact: true });
|
||||
const body = (await scroll.boundingBox())!;
|
||||
const input = (await expression.boundingBox())!;
|
||||
expect(input.y).toBeGreaterThan(body.y + body.height);
|
||||
expect((await shape.boundingBox())!.y).toBeLessThan(body.y);
|
||||
expect(Math.abs((await grid.boundingBox())!.width - (await scroll.evaluate((el) => el.clientWidth)))).toBeLessThan(1);
|
||||
expect((await dialog.boundingBox())!.width).toBeCloseTo(700, 0);
|
||||
await expect(expression).toBeFocused();
|
||||
await expect(grid).toHaveCSS("font-family", /Inter/);
|
||||
await expect(grid.getByRole("columnheader").nth(1)).toHaveCSS("text-align", "center");
|
||||
await expect(grid.getByRole("rowheader").first()).toHaveCSS("text-align", "center");
|
||||
await expect(grid.getByRole("cell").first()).toHaveCSS("text-align", /^(start|left)$/);
|
||||
});
|
||||
|
||||
test("View as Table keeps paging, slice input and Close usable in a narrow window", async ({ workbench: page }) => {
|
||||
await page.setViewportSize({ width: 450, height: 620 });
|
||||
const dialog = await openTable(page, 36);
|
||||
const expression = dialog.getByRole("textbox", { name: "Expression", exact: true });
|
||||
const scroll = dialog.getByRole("region", { name: "Table", exact: true });
|
||||
const rows = dialog.getByRole("button", { name: "Next Rows", exact: true });
|
||||
const columns = dialog.getByRole("button", { name: "Next Columns", exact: true });
|
||||
const close = dialog.getByRole("button", { name: "Close", exact: true }).filter({ hasText: /^Close$/ });
|
||||
const input = (await expression.boundingBox())!;
|
||||
const grid = (await scroll.boundingBox())!;
|
||||
expect(input.y).toBeGreaterThan(grid.y + grid.height);
|
||||
expect(input.width).toBeCloseTo(grid.width, 0);
|
||||
for (const control of [expression, rows, columns, close]) await expect(control).toBeInViewport({ ratio: 0.98 });
|
||||
await scroll.evaluate((el) => {
|
||||
el.scrollLeft = 300;
|
||||
el.scrollTop = 150;
|
||||
});
|
||||
await expect(dialog.getByRole("rowheader").filter({ hasText: /^9$/ })).toBeInViewport({ ratio: 0.98 });
|
||||
await rows.click();
|
||||
await expect(dialog.getByText("Rows 101–200 of 220", { exact: true })).toBeVisible();
|
||||
await expect
|
||||
.poll(() => ipcCalls(page, "debug_evaluate_in"))
|
||||
.toContainEqual(expect.objectContaining({ expression: expect.stringContaining("100, 100, 0, 30") }));
|
||||
await expression.fill("totals.iloc[:2, :2]");
|
||||
await expression.press("Enter");
|
||||
const sliced = page.getByRole("dialog", { name: "Table view of totals.iloc[:2, :2]", exact: true });
|
||||
await expect(sliced.getByText("Shape (2, 2)", { exact: true })).toBeVisible();
|
||||
const slicedExpression = sliced.getByRole("textbox", { name: "Expression", exact: true });
|
||||
await slicedExpression.fill("missing_table");
|
||||
await slicedExpression.press("Enter");
|
||||
const failed = page.getByRole("dialog", { name: "Table view of missing_table", exact: true });
|
||||
const alert = failed.getByRole("alert");
|
||||
await expect(alert).toHaveText("NameError: missing_table");
|
||||
expect((await alert.boundingBox())!.y).toBeGreaterThan(
|
||||
(await failed.getByRole("textbox", { name: "Expression", exact: true }).boundingBox())!.y,
|
||||
);
|
||||
await failed
|
||||
.getByRole("button", { name: "Close", exact: true })
|
||||
.filter({ hasText: /^Close$/ })
|
||||
.click();
|
||||
await expect(failed).toHaveCount(0);
|
||||
});
|
||||
@@ -83,6 +83,10 @@ test("links independent Gradle roots, runs identical task paths in their own bui
|
||||
});
|
||||
const tasks = tree.getByRole("treeitem", { name: /^assemble\b/ });
|
||||
await expect(tasks).toHaveCount(2);
|
||||
expect(await tasks.allTextContents()).toEqual(["assemble", "assemble"]);
|
||||
for (const task of await tasks.all()) {
|
||||
await expect(task).toHaveAccessibleDescription("Assembles this project");
|
||||
}
|
||||
await page.screenshot({ path: info.outputPath("gradle-two-roots.png"), animations: "disabled" });
|
||||
|
||||
await tasks.nth(0).dblclick();
|
||||
|
||||
@@ -75,7 +75,7 @@ for (const locale of ["en", "zh"]) {
|
||||
const path = "/src/platform/i18n.ts";
|
||||
await (await import(/* @vite-ignore */ path)).setLocale(locale);
|
||||
}, locale);
|
||||
for (const id of ["appearance", "editor.font", "general", "general.httpProxy"]) {
|
||||
for (const id of ["appearance", "editor.font", "general", "general.httpProxy", "vcs.log"]) {
|
||||
await selectPage(page, id);
|
||||
const body = page.locator("[class*='pageBody']");
|
||||
for (const width of [1000, 784, 640, 520]) {
|
||||
@@ -108,6 +108,28 @@ test("keeps Open project in options within narrow System Settings", async ({ wor
|
||||
expect(overflow).toBeLessThanOrEqual(1);
|
||||
});
|
||||
|
||||
test("Git Log settings group display and column options with aligned checkboxes", async ({ workbench: page }) => {
|
||||
await page.keyboard.press("Meta+,");
|
||||
const dialog = page.getByRole("dialog", { name: "Settings", exact: true });
|
||||
await selectPage(page, "vcs.log");
|
||||
const view = dialog.getByRole("region", { name: "View Options" });
|
||||
const columns = dialog.getByRole("region", { name: "Visible columns" });
|
||||
const tagNames = view.getByRole("checkbox", { name: "Show tag names" });
|
||||
const hash = columns.getByRole("checkbox", { name: "Hash" });
|
||||
await expect(view.getByRole("checkbox")).toHaveCount(5);
|
||||
await expect(columns.getByRole("checkbox")).toHaveCount(4);
|
||||
|
||||
for (const width of [1000, 520]) {
|
||||
await page.setViewportSize({ width, height: 760 });
|
||||
expect((await tagNames.boundingBox())!.x).toBeCloseTo((await hash.boundingBox())!.x, 0);
|
||||
}
|
||||
|
||||
await expect(hash).not.toBeChecked();
|
||||
await hash.focus();
|
||||
await page.keyboard.press("Space");
|
||||
await expect(hash).toBeChecked();
|
||||
});
|
||||
|
||||
test("settings sidebar resizes with mouse and keyboard and remembers its width", async ({ workbench: page }) => {
|
||||
await page.keyboard.press("Meta+,");
|
||||
const dialog = page.getByRole("dialog", { name: "Settings", exact: true });
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
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"]');
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, ipcCalls, stubDesktop, test } from "./fixtures";
|
||||
|
||||
async function openDialog(page: Page, id: "find.structural" | "find.replaceStructural") {
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(async (id) => {
|
||||
window.__ipc.handlers.structural_languages = () => [
|
||||
{ id: "java", name: "Java" },
|
||||
{ id: "typescript", name: "TypeScript" },
|
||||
];
|
||||
window.__ipc.handlers.structural_validate = () => null;
|
||||
const actionsModule = "/src/platform/actions.ts";
|
||||
const { executeAction } = await import(/* @vite-ignore */ actionsModule);
|
||||
await executeAction(id);
|
||||
}, id);
|
||||
}
|
||||
|
||||
test("Structural Search puts language selection beside the taller template editor", async ({ workbench: page }) => {
|
||||
await page.setViewportSize({ width: 1080, height: 720 });
|
||||
await openDialog(page, "find.structural");
|
||||
const dialog = page.getByRole("dialog", { name: "Structural Search" });
|
||||
const editor = dialog.getByRole("textbox", { name: "Search template" });
|
||||
const label = dialog.locator("label").filter({ hasText: /^Search template$/ });
|
||||
const language = dialog.getByRole("button", { name: "Language", exact: true });
|
||||
await expect(editor).toBeFocused();
|
||||
await expect(language).toHaveText("Java");
|
||||
|
||||
const { x, y, width, height } = (await editor.boundingBox())!;
|
||||
const caption = (await label.boundingBox())!;
|
||||
const picker = (await language.boundingBox())!;
|
||||
expect(Math.abs(caption.y + caption.height / 2 - (picker.y + picker.height / 2))).toBeLessThanOrEqual(1);
|
||||
expect(Math.abs(caption.x - x)).toBeLessThanOrEqual(1);
|
||||
expect(Math.abs(picker.x + picker.width - (x + width))).toBeLessThanOrEqual(1);
|
||||
expect(y - (picker.y + picker.height)).toBeLessThanOrEqual(6);
|
||||
expect(Math.abs(height - 150)).toBeLessThanOrEqual(1);
|
||||
|
||||
await language.click();
|
||||
await page.getByRole("option", { name: "TypeScript" }).click();
|
||||
await editor.fill("console.log($value$)");
|
||||
await expect
|
||||
.poll(() => ipcCalls(page, "structural_validate"))
|
||||
.toContainEqual({
|
||||
query: { language: "typescript", pattern: "console.log($value$)", replacement: null, maxMatches: 0 },
|
||||
});
|
||||
await expect(dialog.getByRole("button", { name: "Find", exact: true })).toBeEnabled();
|
||||
});
|
||||
|
||||
test("Structural Replace uses editor typography and fits the template controls in a narrow window", async ({
|
||||
workbench: page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 400, height: 620 });
|
||||
await openDialog(page, "find.replaceStructural");
|
||||
const dialog = page.getByRole("dialog", { name: "Structural Replace" });
|
||||
const search = dialog.getByRole("textbox", { name: "Search template" });
|
||||
const replacement = dialog.getByRole("textbox", { name: "Replace template" });
|
||||
await expect(search).toBeFocused();
|
||||
await page.evaluate(async () => {
|
||||
const projectModule = "/src/platform/project.ts";
|
||||
const { useProject } = await import(/* @vite-ignore */ projectModule);
|
||||
const { settings, project } = useProject.getState();
|
||||
const current = settings ?? project?.settings;
|
||||
if (!current) throw new Error("Expected project settings");
|
||||
useProject.setState({
|
||||
settings: { ...current, editor: { ...current.editor, fontFamily: "Consolas", fontSize: 17, lineHeight: 26 } },
|
||||
});
|
||||
});
|
||||
|
||||
for (const template of [search, replacement]) {
|
||||
await expect(template).toHaveCSS("font-family", /^Consolas,/);
|
||||
await expect(template).toHaveCSS("font-size", "17px");
|
||||
await expect(template).toHaveCSS("line-height", "26px");
|
||||
const box = (await template.boundingBox())!;
|
||||
expect(box.x).toBeGreaterThanOrEqual(0);
|
||||
expect(box.x + box.width).toBeLessThanOrEqual(400);
|
||||
expect(Math.abs(box.height - 105)).toBeLessThanOrEqual(1);
|
||||
}
|
||||
await expect(dialog.getByRole("radio", { name: "Whole project" })).toBeInViewport();
|
||||
await replacement.fill("Objects.equals($a$, $b$)");
|
||||
await expect(replacement).toHaveValue("Objects.equals($a$, $b$)");
|
||||
await expect(dialog.getByRole("button", { name: "Cancel" })).toBeInViewport();
|
||||
});
|
||||
@@ -417,6 +417,11 @@ 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();
|
||||
@@ -454,12 +459,12 @@ export function LineEndingStatus() {
|
||||
onClose={() => setOpen(false)}
|
||||
anchor={ref}
|
||||
placement="top-end"
|
||||
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),
|
||||
title="Line Separator"
|
||||
items={EOL_CHOICES.map(({ id, label }) => ({
|
||||
id,
|
||||
label,
|
||||
checked: meta.lineEnding === id ? true : undefined,
|
||||
run: () => choose(id),
|
||||
}))}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -214,39 +214,21 @@
|
||||
flex: 1 1 12ch;
|
||||
min-width: 0;
|
||||
}
|
||||
.templateSection {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
color: var(--fg);
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
.templateHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
.languageSelect {
|
||||
max-width: 50%;
|
||||
min-width: 180px;
|
||||
}
|
||||
.template {
|
||||
width: 100%;
|
||||
height: clamp(96px, 24vh, 150px);
|
||||
min-height: 50px;
|
||||
min-height: 96px;
|
||||
resize: vertical;
|
||||
padding: var(--space-1-5) var(--space-2);
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-editor);
|
||||
background: var(--bg-input);
|
||||
color: var(--fg-editor);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-code);
|
||||
line-height: var(--lh-code);
|
||||
}
|
||||
.replaceForm .template {
|
||||
/* Leave room for the scope and dialog controls when both templates are shown. */
|
||||
height: clamp(96px, calc(50vh - 205px), 150px);
|
||||
line-height: 1.5;
|
||||
}
|
||||
.template:focus {
|
||||
outline: none;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/** Inspect Code, Locate Duplicates and Search / Replace Structurally dialogs. */
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import {
|
||||
call,
|
||||
commands,
|
||||
@@ -11,8 +10,6 @@ import {
|
||||
type WorkspaceEdit,
|
||||
} from "@/platform/ipc";
|
||||
import { executeAction } from "@/platform/actions";
|
||||
import { editorPrefs } from "@/platform/editorSettings";
|
||||
import { monoFontFamily } from "@/platform/fonts";
|
||||
import { activeProfileId, listProfiles, validateInspections, type ProfileId } from "@/platform/inspections";
|
||||
import { basename, relativePath, useProject } from "@/platform/project";
|
||||
import { Button, Checkbox, Dialog, Input, Select, Spinner, T } from "@/ui";
|
||||
@@ -322,15 +319,6 @@ function StructuralDialog({ replace, onClose }: { replace: boolean; onClose: ()
|
||||
const [form, setForm] = useState<StructuralForm>(loadStructuralForm);
|
||||
const [scope, setScope] = useState<ScopeChoice>(() => defaultScope());
|
||||
const [busy, setBusy] = useState(false);
|
||||
const settings = useProject((s) => s.settings);
|
||||
const font = settings?.editor;
|
||||
const fallback = editorPrefs(settings).fallbackFont;
|
||||
const templateFont = {
|
||||
fontFamily:
|
||||
font?.fontFamily || fallback ? monoFontFamily(font?.fontFamily, fallback, "var(--font-mono)") : undefined,
|
||||
fontSize: font?.fontSize ?? undefined,
|
||||
lineHeight: font?.lineHeight != null ? `${font.lineHeight}px` : undefined,
|
||||
};
|
||||
const languages = useStructuralLanguages();
|
||||
// The editor's language when it has a grammar, else the first supported one.
|
||||
const language =
|
||||
@@ -369,49 +357,47 @@ function StructuralDialog({ replace, onClose }: { replace: boolean; onClose: ()
|
||||
{ label: "Cancel", role: "cancel" },
|
||||
]}
|
||||
>
|
||||
<div className={clsx(styles.form, replace && styles.replaceForm)}>
|
||||
<div className={styles.templateSection}>
|
||||
<div className={styles.templateHeader}>
|
||||
<label htmlFor="ssr-template">
|
||||
<T>Search template</T>
|
||||
</label>
|
||||
<Select
|
||||
value={language || null}
|
||||
options={options}
|
||||
onChange={(language) => setForm({ ...form, language })}
|
||||
placeholder={languages ? "No languages" : "Loading…"}
|
||||
className={styles.languageSelect}
|
||||
variant="ghost"
|
||||
aria-label="Language"
|
||||
/>
|
||||
</div>
|
||||
<textarea
|
||||
id="ssr-template"
|
||||
className={styles.template}
|
||||
style={templateFont}
|
||||
spellCheck={false}
|
||||
value={form.pattern}
|
||||
placeholder="$a$.equals($b$)"
|
||||
onChange={(e) => setForm({ ...form, pattern: e.target.value })}
|
||||
data-autofocus=""
|
||||
<div className={styles.form}>
|
||||
<div className={styles.fieldRow}>
|
||||
<span>
|
||||
<T>Language</T>
|
||||
</span>
|
||||
<Select
|
||||
value={language || null}
|
||||
options={options}
|
||||
onChange={(language) => setForm({ ...form, language })}
|
||||
placeholder={languages ? "No languages" : "Loading…"}
|
||||
className={styles.languageSelect}
|
||||
aria-label="Language"
|
||||
/>
|
||||
{error && <div className={styles.error}>{error}</div>}
|
||||
</div>
|
||||
<label className={styles.fieldLabel} htmlFor="ssr-template">
|
||||
<T>Search template</T>
|
||||
</label>
|
||||
<textarea
|
||||
id="ssr-template"
|
||||
className={styles.template}
|
||||
spellCheck={false}
|
||||
value={form.pattern}
|
||||
placeholder="$a$.equals($b$)"
|
||||
onChange={(e) => setForm({ ...form, pattern: e.target.value })}
|
||||
data-autofocus=""
|
||||
/>
|
||||
{error && <div className={styles.error}>{error}</div>}
|
||||
{replace && (
|
||||
<div className={styles.templateSection}>
|
||||
<label htmlFor="ssr-replacement">
|
||||
<>
|
||||
<label className={styles.fieldLabel} htmlFor="ssr-replacement">
|
||||
<T>Replace template</T>
|
||||
</label>
|
||||
<textarea
|
||||
id="ssr-replacement"
|
||||
className={styles.template}
|
||||
style={templateFont}
|
||||
spellCheck={false}
|
||||
value={form.replacement}
|
||||
placeholder="Objects.equals($a$, $b$)"
|
||||
onChange={(e) => setForm({ ...form, replacement: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<div className={styles.hint}>
|
||||
<T>Placeholders:</T> <code>$name$</code> or <code>$NAME</code> <T>match one node,</T> <code>$$$NAME</code>{" "}
|
||||
|
||||
@@ -317,14 +317,12 @@ function NodeRow({ node, state }: { node: BuildNode; state: TreeRowState }) {
|
||||
? `(${node.dependency.scope}${node.dependency.optional ? ", optional" : ""})`
|
||||
: node.kind === "dependency" && node.dependency.optional
|
||||
? "(optional)"
|
||||
: node.kind === "task"
|
||||
? node.task.description
|
||||
: null;
|
||||
: null;
|
||||
const skipped =
|
||||
(mavenSkipTests && node.kind === "phase" && node.phase === "test") ||
|
||||
(gradleSkipTests && node.kind === "task" && node.task.name === "test");
|
||||
return (
|
||||
<span className={styles.row} title={node.kind === "task" ? (node.task.description ?? undefined) : undefined}>
|
||||
<span className={styles.row}>
|
||||
<Icon name={nodeIcon(node)} size={16} className={styles.icon} />
|
||||
<span className={clsx(styles.label, state.selected && styles.selectedLabel, skipped && styles.skippedGoal)}>
|
||||
{nodeLabel(node)}
|
||||
@@ -475,6 +473,7 @@ function BuildToolView({ tool }: { tool: BuildTool }) {
|
||||
roots={roots}
|
||||
getKey={(n) => n.key}
|
||||
getLabel={nodeLabel}
|
||||
getTooltip={(n) => (n.kind === "task" ? (n.task.description ?? undefined) : undefined)}
|
||||
getChildren={getChildren}
|
||||
isExpandable={(n) => !!getChildren(n)?.length}
|
||||
expanded={expanded}
|
||||
|
||||
@@ -12,11 +12,6 @@ export function isTableType(typeName: string | null | undefined): boolean {
|
||||
return !!typeName && TABLE_TYPES.has(typeName);
|
||||
}
|
||||
|
||||
/** Numbers are right-aligned, as in the database grid. */
|
||||
export function isNumericDtype(dtype: string | undefined): boolean {
|
||||
return !!dtype && /^(u?int|float|complex|Int|UInt|Float)\d*$/.test(dtype);
|
||||
}
|
||||
|
||||
export const ROW_PAGE = 100;
|
||||
export const COLUMN_PAGE = 30;
|
||||
|
||||
|
||||
@@ -1,39 +1,35 @@
|
||||
.dialog {
|
||||
height: clamp(320px, 60vh, 760px);
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
/* The table scrolls under a fixed bar, not the whole dialog body. */
|
||||
/* Scroll only the grid between the toolbar and the expression field. */
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--space-2) var(--space-3) 0;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.bar {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
padding-bottom: var(--space-2);
|
||||
justify-content: space-between;
|
||||
gap: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.expression {
|
||||
flex: 1 1 200px;
|
||||
min-width: 0;
|
||||
height: var(--h-list-row);
|
||||
padding: 0 6px;
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-ui);
|
||||
color: var(--fg);
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-small);
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.expression:focus {
|
||||
outline: none;
|
||||
border-color: var(--focus-ring);
|
||||
.pagers {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.summary,
|
||||
@@ -59,7 +55,8 @@
|
||||
.table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
font-family: var(--font-mono);
|
||||
min-width: 100%;
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--fs-ui);
|
||||
color: var(--fg);
|
||||
}
|
||||
@@ -77,7 +74,7 @@
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
color: var(--fg-secondary);
|
||||
background: var(--bg-island);
|
||||
@@ -86,7 +83,8 @@
|
||||
.table .index {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
text-align: right;
|
||||
text-align: center;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: normal;
|
||||
color: var(--fg-secondary);
|
||||
background: var(--bg-island);
|
||||
@@ -100,16 +98,22 @@
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.numeric {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dtype {
|
||||
margin-left: var(--space-1);
|
||||
color: var(--fg-subtle);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
.message {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: var(--space-3) 0;
|
||||
color: var(--fg-secondary);
|
||||
}
|
||||
|
||||
.error {
|
||||
max-height: 5em;
|
||||
overflow: auto;
|
||||
overflow-wrap: anywhere;
|
||||
color: var(--danger);
|
||||
}
|
||||
@@ -1,19 +1,10 @@
|
||||
/** View as Table: a DataFrame / Series / ndarray of the paused frame, one page of rows and columns at a time. */
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import type { DebugSessionId } from "@/platform/ipc";
|
||||
import { Dialog, IconButton } from "@/ui";
|
||||
import { Dialog, IconButton, Input } from "@/ui";
|
||||
import { formatMessage, tx } from "@/platform/i18n";
|
||||
import { evaluate, useDebug } from "../state";
|
||||
import {
|
||||
COLUMN_PAGE,
|
||||
ROW_PAGE,
|
||||
clampWindow,
|
||||
isNumericDtype,
|
||||
parseTableResult,
|
||||
tableExpression,
|
||||
type TableResult,
|
||||
} from "../tableView";
|
||||
import { COLUMN_PAGE, ROW_PAGE, clampWindow, parseTableResult, tableExpression, type TableResult } from "../tableView";
|
||||
import styles from "./TableViewDialog.module.css";
|
||||
|
||||
export function TableViewDialog({
|
||||
@@ -63,7 +54,7 @@ export function TableViewDialog({
|
||||
};
|
||||
}, [expression, win, session, stops, frame, paused]);
|
||||
|
||||
const page = result && "page" in result ? result.page : null;
|
||||
const page = paused && result && "page" in result ? result.page : null;
|
||||
const error = !paused
|
||||
? tx("Values are available while the program is paused")
|
||||
: result && "error" in result
|
||||
@@ -114,54 +105,37 @@ export function TableViewDialog({
|
||||
open
|
||||
onClose={onClose}
|
||||
// An element, not a string: Dialog would translate a variable named like a catalog text ("tasks").
|
||||
title={<span>{initial}</span>}
|
||||
width="clamp(520px, 70vw, 1100px)"
|
||||
title={<span>{expression}</span>}
|
||||
width={700}
|
||||
minWidth={420}
|
||||
minHeight={260}
|
||||
resizable="both"
|
||||
aria-label={formatMessage(tx("Table view of {label}"), { label: initial })}
|
||||
aria-label={formatMessage(tx("Table view of {label}"), { label: expression })}
|
||||
buttons={[{ label: "Close", role: "cancel" }]}
|
||||
className={styles.dialog}
|
||||
>
|
||||
<div className={styles.content}>
|
||||
<div className={styles.bar}>
|
||||
<input
|
||||
className={styles.expression}
|
||||
value={draft}
|
||||
spellCheck={false}
|
||||
autoComplete="off"
|
||||
aria-label={tx("Expression")}
|
||||
onChange={(e) => setDraft(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== "Enter" || !draft.trim()) return;
|
||||
e.preventDefault();
|
||||
setExpression(draft.trim());
|
||||
setWin({ row: 0, column: 0 });
|
||||
}}
|
||||
/>
|
||||
{page && (
|
||||
{page && (
|
||||
<div className={styles.bar}>
|
||||
<span className={styles.summary}>
|
||||
{formatMessage(tx("Shape ({shape})"), { shape: page.shape.join(", ") })}
|
||||
{page.kind !== "frame" ? ` · ${page.dtypes[0]}` : ""}
|
||||
</span>
|
||||
)}
|
||||
{page &&
|
||||
pager(win.row, ROW_PAGE, page.rows, (row) => setWin({ ...win, row }), {
|
||||
range: tx("Rows {from}–{to} of {total}"),
|
||||
previous: tx("Previous Rows"),
|
||||
next: tx("Next Rows"),
|
||||
})}
|
||||
{page &&
|
||||
pager(win.column, COLUMN_PAGE, page.columns, (column) => setWin({ ...win, column }), {
|
||||
range: tx("Columns {from}–{to} of {total}"),
|
||||
previous: tx("Previous Columns"),
|
||||
next: tx("Next Columns"),
|
||||
})}
|
||||
</div>
|
||||
{error ? (
|
||||
<div className={styles.message} role="alert">
|
||||
{error}
|
||||
<div className={styles.pagers}>
|
||||
{pager(win.row, ROW_PAGE, page.rows, (row) => setWin({ ...win, row }), {
|
||||
range: tx("Rows {from}–{to} of {total}"),
|
||||
previous: tx("Previous Rows"),
|
||||
next: tx("Next Rows"),
|
||||
})}
|
||||
{pager(win.column, COLUMN_PAGE, page.columns, (column) => setWin({ ...win, column }), {
|
||||
range: tx("Columns {from}–{to} of {total}"),
|
||||
previous: tx("Previous Columns"),
|
||||
next: tx("Next Columns"),
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
) : page ? (
|
||||
)}
|
||||
{page ? (
|
||||
<div className={styles.scroll} tabIndex={0} role="region" aria-label={tx("Table")}>
|
||||
<table className={styles.table}>
|
||||
<thead>
|
||||
@@ -182,14 +156,7 @@ export function TableViewDialog({
|
||||
{page.index[r]}
|
||||
</th>
|
||||
{row.map((cell, c) => (
|
||||
<td
|
||||
key={c}
|
||||
className={clsx(
|
||||
isNumericDtype(page.kind === "frame" ? page.dtypes[c] : page.dtypes[0]) && styles.numeric,
|
||||
)}
|
||||
>
|
||||
{cell}
|
||||
</td>
|
||||
<td key={c}>{cell}</td>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
@@ -197,7 +164,26 @@ export function TableViewDialog({
|
||||
</table>
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.message}>{tx("Loading…")}</div>
|
||||
<div className={styles.message}>{!error && tx("Loading…")}</div>
|
||||
)}
|
||||
<Input
|
||||
className={styles.expression}
|
||||
mono
|
||||
data-autofocus=""
|
||||
value={draft}
|
||||
aria-label="Expression"
|
||||
onChange={(e) => setDraft(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== "Enter" || !draft.trim()) return;
|
||||
e.preventDefault();
|
||||
setExpression(draft.trim());
|
||||
setWin({ row: 0, column: 0 });
|
||||
}}
|
||||
/>
|
||||
{error && (
|
||||
<div className={styles.error} role="alert">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Dialog>
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
.page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
color: var(--fg);
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
.section {
|
||||
|
||||
.heading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
margin-top: 6px;
|
||||
min-height: var(--h-field);
|
||||
margin: 0 0 var(--space-1);
|
||||
color: var(--fg-strong);
|
||||
font-size: inherit;
|
||||
font-weight: 500;
|
||||
}
|
||||
.header {
|
||||
color: var(--fg-muted);
|
||||
|
||||
.heading::after {
|
||||
content: "";
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: var(--border);
|
||||
}
|
||||
.columns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
padding-left: 18px;
|
||||
|
||||
.options {
|
||||
display: grid;
|
||||
gap: var(--space-1);
|
||||
padding-inline-start: var(--space-4);
|
||||
}
|
||||
|
||||
.options > label {
|
||||
min-height: var(--h-field);
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
/** Settings › Version Control › Log: how the Git Log shows references, dates and columns. */
|
||||
import { useId, type ReactNode } from "react";
|
||||
import { Checkbox, T } from "@/ui";
|
||||
import { setLogOptions, useLogOptions, type LogOptions } from "./logOptions";
|
||||
import styles from "./LogSettingsPage.module.css";
|
||||
import { tx } from "@/platform/i18n";
|
||||
|
||||
type Flag = { [K in keyof LogOptions]: LogOptions[K] extends boolean ? K : never }[keyof LogOptions];
|
||||
|
||||
@@ -21,6 +21,18 @@ const COLUMNS: { key: Flag; label: string }[] = [
|
||||
{ key: "showGitHubChecks", label: "GitHub Commit Checks" },
|
||||
];
|
||||
|
||||
function OptionGroup({ title, children }: { title: string; children: ReactNode }) {
|
||||
const heading = useId();
|
||||
return (
|
||||
<section aria-labelledby={heading}>
|
||||
<h2 id={heading} className={styles.heading}>
|
||||
<T>{title}</T>
|
||||
</h2>
|
||||
<div className={styles.options}>{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export function LogSettingsPage() {
|
||||
const o = useLogOptions();
|
||||
// Display options only: the log needs no reload.
|
||||
@@ -29,13 +41,8 @@ export function LogSettingsPage() {
|
||||
);
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
{OPTIONS.map(flag)}
|
||||
<section className={styles.section} aria-label={tx("Visible columns")}>
|
||||
<div className={styles.header}>
|
||||
<T>Visible columns:</T>
|
||||
</div>
|
||||
<div className={styles.columns}>{COLUMNS.map(flag)}</div>
|
||||
</section>
|
||||
<OptionGroup title="View Options">{OPTIONS.map(flag)}</OptionGroup>
|
||||
<OptionGroup title="Visible columns">{COLUMNS.map(flag)}</OptionGroup>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -970,6 +970,10 @@
|
||||
"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.",
|
||||
@@ -3703,5 +3707,7 @@
|
||||
"Previous Rows": "Previous Rows",
|
||||
"Next Rows": "Next Rows",
|
||||
"Previous Columns": "Previous Columns",
|
||||
"Next Columns": "Next Columns"
|
||||
"Next Columns": "Next Columns",
|
||||
"View Options": "View Options",
|
||||
"Visible columns": "Visible columns"
|
||||
}
|
||||
@@ -4751,7 +4751,6 @@
|
||||
"Show commit time rather than author time": "Mostrar fecha y hora de la confirmación en lugar de la del autor",
|
||||
"Show references on the left": "Mostrar referencias a la izquierda",
|
||||
"Visible columns": "Columnas visibles",
|
||||
"Visible columns:": "Columnas visibles:",
|
||||
"Get from Revision": "Obtener de la revisión",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "¿Reemplazar '{path}' con su contenido de la revisión? Los cambios locales se perderán.",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "¿Reemplazar {length} archivos con su contenido de la revisión? Los cambios locales en ellos se perderán.",
|
||||
|
||||
@@ -4606,7 +4606,6 @@
|
||||
"Show commit time rather than author time": "Afficher l'heure du commit plutôt que celle de l'auteur",
|
||||
"Show references on the left": "Afficher les références à gauche",
|
||||
"Visible columns": "Colonnes visibles",
|
||||
"Visible columns:": "Colonnes visibles :",
|
||||
"Get from Revision": "Récupérer depuis la révision",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "Remplacer '{path}' par son contenu de la révision ? Ses modifications locales seront perdues.",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "Remplacer {length} fichiers par leur contenu de la révision ? Leurs modifications locales seront perdues.",
|
||||
|
||||
@@ -4823,7 +4823,6 @@
|
||||
"Show commit time rather than author time": "작성자 시간 대신 커밋 시간 표시",
|
||||
"Show references on the left": "왼쪽에 참조 표시",
|
||||
"Visible columns": "표시할 열",
|
||||
"Visible columns:": "표시할 열:",
|
||||
"Get from Revision": "리비전에서 가져오기",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "'{path}'을(를) 리비전의 내용으로 바꾸시겠습니까? 해당 파일의 로컬 변경 사항은 손실됩니다.",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "파일 {length}개를 리비전의 내용으로 바꾸시겠습니까? 해당 파일의 로컬 변경 사항은 손실됩니다.",
|
||||
|
||||
@@ -4702,7 +4702,6 @@
|
||||
"Show commit time rather than author time": "Pokaż czas zatwierdzenia zamiast czasu autora",
|
||||
"Show references on the left": "Pokaż odnośniki po lewej stronie",
|
||||
"Visible columns": "Widoczne kolumny",
|
||||
"Visible columns:": "Widoczne kolumny:",
|
||||
"Get from Revision": "Pobierz z wersji",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "Zastąpić '{path}' zawartością z tej wersji? Lokalne zmiany w tym pliku zostaną utracone.",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "Zastąpić pliki w liczbie {length} ich zawartością z tej wersji? Lokalne zmiany w nich zostaną utracone.",
|
||||
|
||||
@@ -4717,7 +4717,6 @@
|
||||
"Show commit time rather than author time": "Mostrar data/hora do commit em vez da do autor",
|
||||
"Show references on the left": "Mostrar referências à esquerda",
|
||||
"Visible columns": "Colunas visíveis",
|
||||
"Visible columns:": "Colunas visíveis:",
|
||||
"Get from Revision": "Obter da revisão",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "Substituir '{path}' pelo seu conteúdo da revisão? Alterações locais nele serão perdidas.",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "Substituir {length} arquivos pelo seu conteúdo da revisão? Alterações locais neles serão perdidas.",
|
||||
|
||||
@@ -7428,7 +7428,6 @@
|
||||
"Show commit time rather than author time": "Yazar zamanı yerine commit zamanını göster",
|
||||
"Show references on the left": "Başvuruları solda göster",
|
||||
"Visible columns": "Görünür sütunlar",
|
||||
"Visible columns:": "Görünür sütunlar:",
|
||||
"Get from Revision": "Revizyondan Al",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "'{path}' dosyası revizyondaki içeriğiyle değiştirilsin mi? Yerel değişiklikleri kaybolacak.",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "{length} dosya revizyondaki içerikleriyle değiştirilsin mi? Yerel değişiklikleri kaybolacak.",
|
||||
|
||||
@@ -5736,7 +5736,6 @@
|
||||
"Show commit time rather than author time": "顯示提交時間而非作者時間",
|
||||
"Show references on the left": "在左側顯示引用",
|
||||
"Visible columns": "可見欄",
|
||||
"Visible columns:": "可見欄:",
|
||||
"Get from Revision": "從修訂取得",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "用修訂中的內容取代「{path}」?其本機更改將遺失。",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "用修訂中的內容取代 {length} 個檔案?它們的本機更改將遺失。",
|
||||
|
||||
@@ -5146,6 +5146,7 @@
|
||||
"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 中;供没有自己方案的项目使用。",
|
||||
@@ -6226,7 +6227,6 @@
|
||||
"Show commit time rather than author time": "显示提交时间而非作者时间",
|
||||
"Show references on the left": "在左侧显示引用",
|
||||
"Visible columns": "可见列",
|
||||
"Visible columns:": "可见列:",
|
||||
"Get from Revision": "从修订获取",
|
||||
"Replace '{path}' with its content from the revision? Local changes to it are lost.": "用修订中的内容替换“{path}”?其本地更改将丢失。",
|
||||
"Replace {length} files with their content from the revision? Local changes to them are lost.": "用修订中的内容替换 {length} 个文件?它们的本地更改将丢失。",
|
||||
|
||||
@@ -93,6 +93,8 @@ export interface TreeProps<T> {
|
||||
getIcon?: (node: T, expanded: boolean) => IconName | (string & {}) | undefined;
|
||||
/** Muted trailing detail (e.g. a path next to the project root); may include styled content. */
|
||||
getDetail?: (node: T) => ReactNode;
|
||||
/** Native tooltip and accessible description for a row. */
|
||||
getTooltip?: (node: T) => string | undefined;
|
||||
/** Label colour, e.g. VCS status. */
|
||||
getColor?: (node: T) => string | undefined;
|
||||
/** Filesystem directory for actions on the focused selection; groups return null. */
|
||||
@@ -800,6 +802,7 @@ export function Tree<T>(props: TreeProps<T>) {
|
||||
aria-setsize={positions[v.index]![1]}
|
||||
aria-expanded={row.expandable ? row.expanded : undefined}
|
||||
aria-selected={isSelected}
|
||||
title={props.getTooltip?.(row.node)}
|
||||
className={clsx(
|
||||
styles.row,
|
||||
props.horizontalScroll && styles.wideRow,
|
||||
|
||||
Reference in new issue
Block a user