mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-22 09:39:27 -10:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18bdd908ca | ||
|
|
af281341b1 | ||
|
|
313a5f3a14 | ||
|
|
18cd2ef63b | ||
|
|
4fc55f7520 | ||
|
|
795413c366 | ||
|
|
dd3c9c7b0a | ||
|
|
a4ee6110e8 |
No files matched your search
@@ -30,7 +30,7 @@ for (const kind of ["run", "debug", "services-run", "services-debug", "stacktrac
|
||||
component = SessionPanel;
|
||||
props = {
|
||||
session: run.useRun.getState().sessions.find((s: { id: string }) => s.id === id),
|
||||
...(kind === "services-run" ? { onRerun: null, onDebug: null } : {}),
|
||||
showLifecycle: kind === "run",
|
||||
};
|
||||
} else if (kind === "debug" || kind === "services-debug") {
|
||||
const statePath = "/src/features/debugger/state.ts";
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
test("keeps debug actions and views accessible when the Debug window is docked at the side", async ({
|
||||
workbench: page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 900, height: 760 });
|
||||
await page.evaluate(async () => {
|
||||
const debugModule = "/src/features/debugger/state.ts";
|
||||
const layoutModule = "/src/workbench/toolwindows/store.ts";
|
||||
const servicesModule = "/src/workbench/contributions.ts";
|
||||
const { adoptSession } = await import(/* @vite-ignore */ debugModule);
|
||||
const { moveToolWindow, setToolWindowSize } = await import(/* @vite-ignore */ layoutModule);
|
||||
const { toolWindowService } = await import(/* @vite-ignore */ servicesModule);
|
||||
adoptSession(91, { name: "Checkout service", adapter: "java-debug", status: "starting" });
|
||||
moveToolWindow("debug", "right");
|
||||
setToolWindowSize("right", 300);
|
||||
toolWindowService().show("debug", true);
|
||||
});
|
||||
|
||||
const pane = page.getByRole("region", { name: "Debug", exact: true });
|
||||
const toolbar = pane.getByRole("toolbar", { name: "Debugger actions" });
|
||||
const views = pane.getByRole("tablist", { name: "Debug views" });
|
||||
await expect(toolbar.getByRole("button", { name: "More", exact: true })).toBeInViewport();
|
||||
await expect(views.getByRole("tab", { name: "Console", exact: true })).toBeInViewport();
|
||||
await views.getByRole("tab", { name: "Memory", exact: true }).click();
|
||||
await expect(views.getByRole("tab", { name: "Memory", exact: true })).toHaveAttribute("aria-selected", "true");
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { expect, openFromTree, test } from "./fixtures";
|
||||
|
||||
test("fits a long wrapped tab and its close button inside a narrow editor group", async ({ workbench: page }) => {
|
||||
const filename = "QuarterlyReconciliationAndCheckoutAllocation.test.ts";
|
||||
await page.setViewportSize({ width: 720, height: 760 });
|
||||
await openFromTree(page, "README.md");
|
||||
await page.evaluate(async (filename) => {
|
||||
const projectModule = "/src/platform/project.ts";
|
||||
const projectFilesModule = "/src/features/project-tree/fs.ts";
|
||||
const editorModule = "/src/editor/core/controller.ts";
|
||||
const { useProject } = await import(/* @vite-ignore */ projectModule);
|
||||
const { projectFs } = await import(/* @vite-ignore */ projectFilesModule);
|
||||
const { editorController, useTabs } = await import(/* @vite-ignore */ editorModule);
|
||||
const { project, settings } = useProject.getState();
|
||||
useProject.setState({
|
||||
settings: {
|
||||
...settings,
|
||||
editor: { ...settings?.editor, tabs: { ...settings?.editor?.tabs, multipleRows: true } },
|
||||
},
|
||||
});
|
||||
const path = `${project.root}/${filename}`;
|
||||
await projectFs(project.root).createFile(path);
|
||||
await editorController().openFilesIn([path], useTabs.getState().activePane, "right");
|
||||
}, filename);
|
||||
|
||||
const tab = page.getByRole("tab", { name: filename, exact: true });
|
||||
await expect(tab).toHaveAttribute("aria-selected", "true");
|
||||
await expect
|
||||
.poll(() =>
|
||||
tab.evaluate((element) => {
|
||||
const close = element.parentElement?.querySelector("[data-tab-close]");
|
||||
const strip = element.closest('[role="tablist"]');
|
||||
return !!close && !!strip && close.getBoundingClientRect().right <= strip.getBoundingClientRect().right;
|
||||
}),
|
||||
)
|
||||
.toBe(true);
|
||||
await tab.locator("..").getByRole("button", { name: "Close Tab", exact: true }).click();
|
||||
await expect(tab).toBeHidden();
|
||||
});
|
||||
@@ -94,3 +94,30 @@ test("a second click on a Git Log toolbar button closes its popup", async ({ wor
|
||||
await expect(row).toBeHidden();
|
||||
}
|
||||
});
|
||||
|
||||
test("Git Log keeps filters and actions inside the commit pane at the minimum window width", async ({
|
||||
workbench: page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 400, height: 500 });
|
||||
const toolbar = page.getByRole("toolbar", { name: "Log filters" });
|
||||
const clippedButtons = () =>
|
||||
toolbar.evaluate((el) => {
|
||||
const bar = el.getBoundingClientRect();
|
||||
return Array.from(el.querySelectorAll("button"))
|
||||
.filter((button) => {
|
||||
if (getComputedStyle(button).visibility === "hidden") return false;
|
||||
const box = button.getBoundingClientRect();
|
||||
return box.width > 0 && (box.right > bar.right + 1 || box.bottom > bar.bottom + 1);
|
||||
})
|
||||
.map((button) => button.getAttribute("aria-label"));
|
||||
});
|
||||
await expect.poll(clippedButtons).toEqual([]);
|
||||
const search = toolbar.getByRole("textbox", { name: "Filter by message" });
|
||||
await expect(search).toBeVisible();
|
||||
expect((await search.boundingBox())!.width).toBeGreaterThan(12);
|
||||
await toolbar.getByRole("button", { name: "View Options" }).click();
|
||||
await expect(page.getByRole("menuitemcheckbox", { name: "Tag Names" })).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await toolbar.getByRole("button", { name: "More Filters" }).click();
|
||||
await expect(page.getByRole("menuitem", { name: "Paths" })).toBeVisible();
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
test("keeps diagnostic text and file counts visible in a narrow Problems pane", async ({ workbench: page }) => {
|
||||
await page.setViewportSize({ width: 720, height: 760 });
|
||||
await page.evaluate(async () => {
|
||||
const projectModule = "/src/platform/project.ts";
|
||||
const problemsModule = "/src/features/code-insight/problemsStore.ts";
|
||||
const { useProject } = await import(/* @vite-ignore */ projectModule);
|
||||
const { applyDiagnosticsEvent } = await import(/* @vite-ignore */ problemsModule);
|
||||
const root = useProject.getState().project.root;
|
||||
const path = `${root}/src/features/checkout/shared/services/with-a-long-directory-name/for-order-processing/orders.ts`;
|
||||
const source = "typescript-eslint-application-rules-with-a-very-long-source-label";
|
||||
applyDiagnosticsEvent(path, source, [
|
||||
{
|
||||
range: { start: { line: 2, col: 2 }, end: { line: 2, col: 9 } },
|
||||
severity: "error",
|
||||
source,
|
||||
message: "Invalid order total",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
await page.getByRole("button", { name: "Problems", exact: true }).click();
|
||||
const pane = page.locator('[data-toolwindow="problems"]');
|
||||
await pane.getByRole("tab", { name: /Project Errors/ }).click();
|
||||
await expect(pane.getByRole("toolbar", { name: "Problems actions" })).toHaveAttribute("aria-orientation", "vertical");
|
||||
const tree = pane.getByRole("tree", { name: "Problems" });
|
||||
const count = tree.getByText("1 error", { exact: true });
|
||||
const message = tree.getByText("Invalid order total", { exact: true });
|
||||
await expect(count).toBeVisible();
|
||||
await expect(message).toBeVisible();
|
||||
await expect.poll(() => message.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||
await expect.poll(() => tree.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
test("gives the project name room before its path in a narrow tree", async ({ workbench: page }) => {
|
||||
await page.evaluate(async () => {
|
||||
const storeModule = "/src/features/project-tree/store.ts";
|
||||
const { useProjectTree } = await import(/* @vite-ignore */ storeModule);
|
||||
useProjectTree.setState({ name: "checkout-order-processing" });
|
||||
});
|
||||
|
||||
const pane = page.getByRole("region", { name: "Project", exact: true });
|
||||
await pane.getByRole("button", { name: "Options", exact: true }).click();
|
||||
await page.getByRole("menuitemcheckbox", { name: "Horizontal Scrolling" }).click();
|
||||
|
||||
const tree = pane.getByRole("tree", { name: "Project" });
|
||||
const name = tree.getByText("checkout-order-processing", { exact: true });
|
||||
await expect(name).toBeVisible();
|
||||
await expect.poll(() => name.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||
await expect.poll(() => tree.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||
});
|
||||
@@ -81,6 +81,39 @@ test("⌘F2 stops a running process", async ({ workbench: page }) => {
|
||||
await expect(run.getByRole("tab", { name: "dev" })).toHaveAttribute("data-tooltip", /exit code 143$/);
|
||||
});
|
||||
|
||||
test("a short Run pane has room for the full toolbar above the output", async ({ workbench: page }) => {
|
||||
await page.setViewportSize({ width: 400, height: 500 });
|
||||
const output = "Watching for changes…";
|
||||
await stubRun(page, [{ kind: "stdout", text: `${output}\n` }], null);
|
||||
await page.keyboard.press("Control+r");
|
||||
const run = page.getByRole("region", { name: "Run", exact: true });
|
||||
await expect(run.getByText(output)).toBeVisible();
|
||||
await page.evaluate(async () => {
|
||||
const path = "/src/workbench/toolwindows/store.ts";
|
||||
const { setToolWindowSize } = await import(/* @vite-ignore */ path);
|
||||
setToolWindowSize("bottom", 160);
|
||||
});
|
||||
const toolbar = run.getByRole("toolbar", { name: "Run actions" });
|
||||
const clipped = await toolbar.evaluate((el) => {
|
||||
const bar = el.getBoundingClientRect();
|
||||
return Array.from(el.querySelectorAll("button")).flatMap((button) => {
|
||||
const box = button.getBoundingClientRect();
|
||||
return box.left < bar.left - 1 || box.right > bar.right + 1 || box.bottom > bar.bottom + 1
|
||||
? [button.getAttribute("aria-label")]
|
||||
: [];
|
||||
});
|
||||
});
|
||||
expect(clipped).toEqual([]);
|
||||
await expect(toolbar).toHaveAttribute("aria-orientation", "horizontal");
|
||||
const toolbarBox = (await toolbar.boundingBox())!;
|
||||
const consoleBox = (await run.getByRole("log").boundingBox())!;
|
||||
expect(consoleBox.y).toBeGreaterThanOrEqual(toolbarBox.y + toolbarBox.height - 1);
|
||||
await toolbar.getByRole("button", { name: "Clear All" }).click();
|
||||
await expect(run.getByText(output)).toBeHidden();
|
||||
await toolbar.getByRole("button", { name: "Stop" }).click();
|
||||
await expect.poll(() => ipcCalls(page, "run_stop")).toEqual([{ id: RUN_ID }]);
|
||||
});
|
||||
|
||||
test("Go reruns keep each package's exact failures and the original configuration", async ({ workbench: page }) => {
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(async () => {
|
||||
|
||||
@@ -13,6 +13,32 @@ async function run(page: Page, id: string) {
|
||||
}, id);
|
||||
}
|
||||
|
||||
async function stubFindMatches(page: Page) {
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(() => {
|
||||
window.__ipc.handlers.search_validate = () => null;
|
||||
window.__ipc.handlers.search_start = (args) => {
|
||||
const send = (event: unknown) => window.__ipc.send(args.onEvent, event);
|
||||
const text = "base=http://localhost:8080";
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < 12; i++) {
|
||||
const relPath = `config/endpoint-${i}.txt`;
|
||||
const matches = [{ line: 0, text, ranges: [[5, text.length]], textOffset: 0 }];
|
||||
send({
|
||||
type: "file",
|
||||
file: { path: `/dev/acme-api/${relPath}`, relPath, matches },
|
||||
});
|
||||
}
|
||||
send({
|
||||
type: "done",
|
||||
summary: { files: 12, matches: 12, limitHit: false, cancelled: false, elapsedMs: 4 },
|
||||
});
|
||||
}, 20);
|
||||
return null;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function expectControlsFit(page: Page) {
|
||||
const dialog = page.getByRole("dialog");
|
||||
await expect(dialog).toBeVisible();
|
||||
@@ -42,35 +68,7 @@ test.describe("search popups at the minimum window width", () => {
|
||||
|
||||
for (const id of ["find.inPath", "find.replaceInPath"]) {
|
||||
test(`${id} keeps its title, count and buttons visible`, async ({ workbench: page }) => {
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(() => {
|
||||
window.__ipc.handlers.search_validate = () => null;
|
||||
window.__ipc.handlers.search_start = (args) => {
|
||||
const send = (event: unknown) => window.__ipc.send(args.onEvent, event);
|
||||
const text = "base=http://localhost:8080";
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < 12; i++) {
|
||||
const relPath = `config/endpoint-${i}.txt`;
|
||||
const matches = [{ line: 0, text, ranges: [[5, text.length]], textOffset: 0 }];
|
||||
send({
|
||||
type: "file",
|
||||
file: { path: `/dev/acme-api/${relPath}`, relPath, matches },
|
||||
});
|
||||
}
|
||||
send({
|
||||
type: "done",
|
||||
summary: {
|
||||
files: 12,
|
||||
matches: 12,
|
||||
limitHit: false,
|
||||
cancelled: false,
|
||||
elapsedMs: 4,
|
||||
},
|
||||
});
|
||||
}, 20);
|
||||
return null;
|
||||
};
|
||||
});
|
||||
await stubFindMatches(page);
|
||||
await run(page, id);
|
||||
await page.getByRole("dialog").getByPlaceholder("Search").fill("http://localhost:8080");
|
||||
await expect(page.getByRole("dialog").locator("header [aria-live]")).toContainText(/match/);
|
||||
@@ -95,6 +93,19 @@ test.describe("search popups at the minimum window width", () => {
|
||||
});
|
||||
}
|
||||
|
||||
test("directory scope gives the path field room at the minimum width", async ({ workbench: page }) => {
|
||||
await stubDesktop(page);
|
||||
await run(page, "find.inPath");
|
||||
const dialog = page.getByRole("dialog", { name: "Find in Files" });
|
||||
await dialog.getByRole("tab", { name: "Directory", exact: true }).click();
|
||||
const input = dialog.getByRole("textbox", { name: "Directory", exact: true });
|
||||
await expect(input).toBeVisible();
|
||||
const { width } = (await input.boundingBox())!;
|
||||
expect(width).toBeGreaterThan(200);
|
||||
await expectControlsFit(page);
|
||||
await dialog.getByRole("button", { name: /Browse/ }).click({ trial: true });
|
||||
});
|
||||
|
||||
for (const id of [
|
||||
"navigate.searchEverywhere",
|
||||
"navigate.searchText",
|
||||
@@ -111,3 +122,31 @@ test.describe("search popups at the minimum window width", () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test("Find in Files prioritizes the preview and remembers an adjusted split", async ({ workbench: page }) => {
|
||||
await stubFindMatches(page);
|
||||
await run(page, "find.inPath");
|
||||
const dialog = page.getByRole("dialog", { name: "Find in Files" });
|
||||
await dialog.getByPlaceholder("Search").fill("http://localhost:8080");
|
||||
const results = dialog.locator("[data-panel][id=results]");
|
||||
const preview = dialog.locator("[data-panel][id=preview]");
|
||||
const handle = dialog.getByTestId("find-popup-split").getByRole("separator");
|
||||
const resultsShare = async () => {
|
||||
const resultHeight = (await results.boundingBox())!.height;
|
||||
const previewHeight = (await preview.boundingBox())!.height;
|
||||
return resultHeight / (resultHeight + previewHeight);
|
||||
};
|
||||
await expect(handle).toBeAttached();
|
||||
await expect.poll(resultsShare).toBeCloseTo(0.33, 2);
|
||||
await handle.press("ArrowUp");
|
||||
await expect.poll(resultsShare).toBeLessThan(0.31);
|
||||
const adjusted = await resultsShare();
|
||||
await page.setViewportSize({ width: 400, height: 500 });
|
||||
await expect.poll(resultsShare).toBeGreaterThan(adjusted + 0.02);
|
||||
await dialog.getByPlaceholder("Search").press("Escape");
|
||||
await expect(dialog).toBeHidden();
|
||||
await page.setViewportSize({ width: 1400, height: 900 });
|
||||
await run(page, "find.inPath");
|
||||
await expect(handle).toBeAttached();
|
||||
await expect.poll(resultsShare).toBeCloseTo(adjusted, 2);
|
||||
});
|
||||
@@ -14,6 +14,24 @@
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
.results {
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
}
|
||||
.toolbar {
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
border-inline-end: 1px solid var(--border);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.tree {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.tabs {
|
||||
min-width: 0;
|
||||
border: 0;
|
||||
@@ -38,10 +56,21 @@
|
||||
flex: none;
|
||||
color: var(--fg-muted);
|
||||
}
|
||||
.fileLocation {
|
||||
display: flex;
|
||||
gap: var(--space-1-5);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.fileName {
|
||||
flex: none;
|
||||
max-inline-size: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--fg-strong);
|
||||
}
|
||||
.fileError {
|
||||
padding-block: var(--space-0-5);
|
||||
text-decoration-line: underline;
|
||||
text-decoration-style: wavy;
|
||||
text-decoration-color: var(--danger);
|
||||
@@ -51,18 +80,25 @@
|
||||
.selectedText {
|
||||
color: var(--fg-strong);
|
||||
}
|
||||
.muted {
|
||||
flex: none;
|
||||
.directory {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--fg-subtle);
|
||||
}
|
||||
.count {
|
||||
flex: none;
|
||||
max-inline-size: 50%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--fg-subtle);
|
||||
margin-left: 4px;
|
||||
}
|
||||
.source {
|
||||
flex: none;
|
||||
margin-left: auto;
|
||||
padding-right: 8px;
|
||||
min-width: 0;
|
||||
max-inline-size: 25%;
|
||||
margin-inline-start: auto;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--fg-faint);
|
||||
}
|
||||
.message {
|
||||
@@ -77,6 +113,7 @@
|
||||
.position {
|
||||
flex: none;
|
||||
color: var(--fg-subtle);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.sev-error {
|
||||
flex: none;
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
SplitHandle,
|
||||
SplitPanel,
|
||||
Tabs,
|
||||
Toolbar,
|
||||
Tree,
|
||||
fileIconName,
|
||||
showContextMenu,
|
||||
@@ -213,11 +214,11 @@ function useCurrentPath(): string | null {
|
||||
return currentProblemsPath(text, useSyncExternalStore(subscribeActiveInput, activeInput));
|
||||
}
|
||||
|
||||
export function ProblemsHeaderActions() {
|
||||
function ProblemsToolbar() {
|
||||
const show = useProblemsView((s) => s.show);
|
||||
const toggle = useProblemsView((s) => s.toggle);
|
||||
return (
|
||||
<>
|
||||
<Toolbar aria-label="Problems actions" orientation="vertical" className={styles.toolbar}>
|
||||
<IconButton icon="arrow-up" action="navigate.prevOccurrence" size="small" />
|
||||
<IconButton icon="arrow-down" action="navigate.nextOccurrence" size="small" />
|
||||
<IconButton icon="error" title="Show Errors" size="small" pressed={show.error} onClick={() => toggle("error")} />
|
||||
@@ -235,7 +236,7 @@ export function ProblemsHeaderActions() {
|
||||
pressed={show.info}
|
||||
onClick={() => toggle("info")}
|
||||
/>
|
||||
</>
|
||||
</Toolbar>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -337,33 +338,44 @@ export function ProblemsView() {
|
||||
|
||||
const renderNode = (n: Node, state: TreeRowState) => {
|
||||
if (n.kind === "file") {
|
||||
const name = basename(n.path);
|
||||
const directory = relativeDir(root, n.path);
|
||||
const c = countSeverities(n.items);
|
||||
const parts = [plural(c.error, "error"), plural(c.warning, "warning"), plural(c.info + c.hint, "info")].filter(
|
||||
Boolean,
|
||||
);
|
||||
const counts = [plural(c.error, "error"), plural(c.warning, "warning"), plural(c.info + c.hint, "info")]
|
||||
.filter(Boolean)
|
||||
.join(", ");
|
||||
return (
|
||||
<span className={styles.row}>
|
||||
<Icon name={fileIconName(basename(n.path), n.path)} size={16} className={styles.fileIcon} />
|
||||
<span
|
||||
className={clsx(styles.fileName, c.error > 0 && styles.fileError, state.selected && styles.selectedText)}
|
||||
>
|
||||
{basename(n.path)}
|
||||
<Icon name={fileIconName(name, n.path)} size={16} className={styles.fileIcon} />
|
||||
<span className={styles.fileLocation}>
|
||||
<span
|
||||
className={clsx(styles.fileName, c.error > 0 && styles.fileError, state.selected && styles.selectedText)}
|
||||
title={name}
|
||||
>
|
||||
{name}
|
||||
</span>
|
||||
{directory && (
|
||||
<span className={styles.directory} title={directory}>
|
||||
{directory}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
<span className={styles.count} title={counts}>
|
||||
{counts}
|
||||
</span>
|
||||
<span className={styles.muted}>{relativeDir(root, n.path)}</span>
|
||||
<span className={styles.count}>{parts.join(", ")}</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
const d = n.d;
|
||||
const source = d.source && (d.code ? `${d.source}(${d.code})` : d.source);
|
||||
return (
|
||||
<span className={styles.row} title={d.message}>
|
||||
<Icon name={SEVERITY_ICON[d.severity]} size={14} className={styles[`sev-${d.severity}`]} />
|
||||
<span className={clsx(styles.message, d.deprecated && styles.deprecated)}>{d.message.split("\n")[0]}</span>
|
||||
<span className={styles.position}>:{d.range.start.line + 1}</span>
|
||||
{d.source && (
|
||||
<span className={styles.source}>
|
||||
{d.source}
|
||||
{d.code ? `(${d.code})` : ""}
|
||||
{source && (
|
||||
<span className={styles.source} title={source}>
|
||||
{source}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
@@ -378,9 +390,10 @@ export function ProblemsView() {
|
||||
);
|
||||
|
||||
const selected = target(lead);
|
||||
const list = (
|
||||
const treeView = (
|
||||
<Tree<Node>
|
||||
aria-label="Problems"
|
||||
className={styles.tree}
|
||||
handleRef={tree}
|
||||
roots={roots}
|
||||
getKey={(n) => n.key}
|
||||
@@ -428,7 +441,11 @@ export function ProblemsView() {
|
||||
run: () => copy(n),
|
||||
},
|
||||
...inspectionMenu(n.kind === "diag" ? diagInspection(map, n.path, n.d) : null),
|
||||
...menuGroupItems("problems", { paths: [t.path], line: t.d.range.start.line, column: t.d.range.start.col }),
|
||||
...menuGroupItems("problems", {
|
||||
paths: [t.path],
|
||||
line: t.d.range.start.line,
|
||||
column: t.d.range.start.col,
|
||||
}),
|
||||
]);
|
||||
}}
|
||||
activateExpandable={false}
|
||||
@@ -436,6 +453,12 @@ export function ProblemsView() {
|
||||
empty={empty}
|
||||
/>
|
||||
);
|
||||
const list = (
|
||||
<div className={styles.results}>
|
||||
<ProblemsToolbar />
|
||||
{treeView}
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={styles.view}>
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { getContext } from "@/platform/context";
|
||||
import { clearProblems, installProblemsEvents, problemsReport, useProblems } from "./problemsStore";
|
||||
import { installProblemDecorations } from "./decorations";
|
||||
import { ProblemsHeaderActions, ProblemsTabs, ProblemsView, useProblemsHeaderMenu } from "./ProblemsView";
|
||||
import { ProblemsTabs, ProblemsView, useProblemsHeaderMenu } from "./ProblemsView";
|
||||
import { UsagesTabs, UsagesView, useUsagesHeaderMenu } from "./UsagesView";
|
||||
import { UsagesPopup } from "./UsagesPopup";
|
||||
import { findUsages, rerunActiveUsages, resetUsages, showUsageResults, showUsagesPopup } from "./usages";
|
||||
@@ -79,7 +79,6 @@ export function activate(): () => void {
|
||||
order: 30,
|
||||
component: ProblemsView,
|
||||
headerContent: ProblemsTabs,
|
||||
headerActions: ProblemsHeaderActions,
|
||||
headerMenu: useProblemsHeaderMenu,
|
||||
useBadge: useErrorBadge,
|
||||
}),
|
||||
|
||||
@@ -19,20 +19,28 @@
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
padding: 0 8px 0 4px;
|
||||
gap: var(--space-0-5) var(--space-2);
|
||||
padding: var(--space-0-5) var(--space-2) var(--space-0-5) var(--space-1);
|
||||
border-bottom: 1px solid var(--border);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.tool {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
width: var(--h-control);
|
||||
height: var(--h-control);
|
||||
flex: none;
|
||||
}
|
||||
|
||||
@@ -46,17 +54,21 @@
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
flex: none;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.tab {
|
||||
height: 24px;
|
||||
max-inline-size: 100%;
|
||||
padding: 0 8px;
|
||||
border-radius: var(--radius-small);
|
||||
color: var(--fg);
|
||||
font-size: var(--fs-ui);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tab:hover {
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
SplitHandle,
|
||||
SplitPanel,
|
||||
Tabs,
|
||||
Toolbar,
|
||||
showContextMenu,
|
||||
type MenuItem,
|
||||
type TabItem,
|
||||
@@ -218,43 +219,43 @@ export function DebugToolWindow() {
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<div className={styles.toolbar} role="toolbar" aria-label={tx("Debugger actions")}>
|
||||
{/* IDEA's XDebugger.ToolWindow.TopToolbar3 (+ its "More" group), then the views. */}
|
||||
<ToolButton action="debug.rerun" icon="rerun" />
|
||||
<ToolButton action="debug.stop" icon="stop" tone="danger" />
|
||||
<span className={styles.sep} aria-hidden />
|
||||
<ToolButton action="debug.resume" icon="resume" />
|
||||
<ToolButton action="debug.pause" icon="pause" />
|
||||
<ToolButton action="debug.stepOver" icon="step-over" />
|
||||
<ToolButton action="debug.stepInto" icon="step-into" />
|
||||
<ToolButton action="debug.stepOut" icon="step-out" />
|
||||
<span className={styles.sep} aria-hidden />
|
||||
{rootOf(active).adapter === "dart" && (
|
||||
<>
|
||||
<ToolButton action="debug.hotReload" icon="hot-reload" />
|
||||
<ToolButton action="debug.hotRestart" icon="refresh" />
|
||||
{rootOf(active).vmServiceUri && <ToolButton action="debug.openDevTools" icon="external-link" />}
|
||||
<span className={styles.sep} aria-hidden />
|
||||
</>
|
||||
)}
|
||||
<IconButton
|
||||
icon="view-breakpoints"
|
||||
action="debug.viewBreakpoints"
|
||||
size="small"
|
||||
iconSize={16}
|
||||
className={styles.tool}
|
||||
/>
|
||||
<IconButton
|
||||
icon="mute-breakpoint"
|
||||
title={muted ? "Unmute Breakpoints" : "Mute Breakpoints"}
|
||||
pressed={muted}
|
||||
size="small"
|
||||
iconSize={16}
|
||||
className={styles.tool}
|
||||
onClick={() => setMuted(!muted)}
|
||||
/>
|
||||
<MoreActions />
|
||||
<span className={styles.sep} aria-hidden />
|
||||
<div className={styles.toolbar}>
|
||||
<Toolbar className={styles.actions} aria-label="Debugger actions">
|
||||
<ToolButton action="debug.rerun" icon="rerun" />
|
||||
<ToolButton action="debug.stop" icon="stop" tone="danger" />
|
||||
<span className={styles.sep} aria-hidden />
|
||||
<ToolButton action="debug.resume" icon="resume" />
|
||||
<ToolButton action="debug.pause" icon="pause" />
|
||||
<ToolButton action="debug.stepOver" icon="step-over" />
|
||||
<ToolButton action="debug.stepInto" icon="step-into" />
|
||||
<ToolButton action="debug.stepOut" icon="step-out" />
|
||||
<span className={styles.sep} aria-hidden />
|
||||
{rootOf(active).adapter === "dart" && (
|
||||
<>
|
||||
<ToolButton action="debug.hotReload" icon="hot-reload" />
|
||||
<ToolButton action="debug.hotRestart" icon="refresh" />
|
||||
{rootOf(active).vmServiceUri && <ToolButton action="debug.openDevTools" icon="external-link" />}
|
||||
<span className={styles.sep} aria-hidden />
|
||||
</>
|
||||
)}
|
||||
<IconButton
|
||||
icon="view-breakpoints"
|
||||
action="debug.viewBreakpoints"
|
||||
size="small"
|
||||
iconSize={16}
|
||||
className={styles.tool}
|
||||
/>
|
||||
<IconButton
|
||||
icon="mute-breakpoint"
|
||||
title={muted ? "Unmute Breakpoints" : "Mute Breakpoints"}
|
||||
pressed={muted}
|
||||
size="small"
|
||||
iconSize={16}
|
||||
className={styles.tool}
|
||||
onClick={() => setMuted(!muted)}
|
||||
/>
|
||||
<MoreActions />
|
||||
</Toolbar>
|
||||
<div role="tablist" aria-label={tx("Debug views")} className={styles.tabs}>
|
||||
{(
|
||||
[
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
gap: var(--space-1);
|
||||
border-radius: var(--radius-row);
|
||||
}
|
||||
|
||||
@@ -41,9 +41,16 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.rootName {
|
||||
.labelGroup {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.labelGroup .label {
|
||||
flex: none;
|
||||
max-width: 60%;
|
||||
max-inline-size: 100%;
|
||||
}
|
||||
.rootLabel {
|
||||
color: var(--fg-strong);
|
||||
@@ -60,6 +67,7 @@
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
.error {
|
||||
padding-block: var(--space-0-5);
|
||||
text-decoration-line: underline;
|
||||
text-decoration-style: wavy;
|
||||
text-decoration-color: var(--danger);
|
||||
@@ -88,7 +96,7 @@
|
||||
}
|
||||
.detail {
|
||||
min-width: 0;
|
||||
margin-left: 4px;
|
||||
margin-inline-start: var(--space-1);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -338,26 +338,29 @@ const Row = memo(function Row({
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<HighlightedText
|
||||
className={clsx(
|
||||
styles.label,
|
||||
node.root && styles.rootName,
|
||||
// Only the project itself is bold (IDEA); contributed roots like Scratches are not.
|
||||
node.root && !node.icon && styles.rootLabel,
|
||||
// Maven / Gradle module folders are bold too, as in IDEA.
|
||||
moduleFolder && styles.moduleLabel,
|
||||
faded && !deco.color && styles.excluded,
|
||||
// IDEA strikes out deprecated classes.
|
||||
file?.deprecated && styles.deprecated,
|
||||
deco.error && styles.error,
|
||||
<span className={styles.labelGroup}>
|
||||
<HighlightedText
|
||||
className={clsx(
|
||||
styles.label,
|
||||
// Project and module roots use semibold labels.
|
||||
node.root && !node.icon && styles.rootLabel,
|
||||
moduleFolder && styles.moduleLabel,
|
||||
faded && !deco.color && styles.excluded,
|
||||
file?.deprecated && styles.deprecated,
|
||||
deco.error && styles.error,
|
||||
)}
|
||||
style={deco.color ? { color: deco.color } : undefined}
|
||||
text={node.label}
|
||||
indices={matches}
|
||||
tone="accent"
|
||||
/>
|
||||
{deco.suffix && <DecorationSuffix segments={deco.suffix} color={deco.suffixColor} />}
|
||||
{detail && (
|
||||
<span className={styles.detail} title={detail}>
|
||||
{detail}
|
||||
</span>
|
||||
)}
|
||||
style={deco.color ? { color: deco.color } : undefined}
|
||||
text={node.label}
|
||||
indices={matches}
|
||||
tone="accent"
|
||||
/>
|
||||
{deco.suffix && <DecorationSuffix segments={deco.suffix} color={deco.suffixColor} />}
|
||||
{detail && <span className={styles.detail}>{detail}</span>}
|
||||
</span>
|
||||
{deco.badge && <span className={styles.badge}>{deco.badge}</span>}
|
||||
</>
|
||||
)}
|
||||
@@ -421,8 +424,14 @@ const MemberRow = memo(function MemberRow({
|
||||
onPointerDown={(e) => onPointerDown(node, e)}
|
||||
>
|
||||
<SymbolBadge kind={badgeKind(item.kind)} className={styles.icon} />
|
||||
<HighlightedText className={styles.label} text={item.name} indices={matches} tone="accent" />
|
||||
{item.detail && <span className={styles.detail}>{item.detail}</span>}
|
||||
<span className={styles.labelGroup}>
|
||||
<HighlightedText className={styles.label} text={item.name} indices={matches} tone="accent" />
|
||||
{item.detail && (
|
||||
<span className={styles.detail} title={item.detail}>
|
||||
{item.detail}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.topToolbarSession {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
flex: none;
|
||||
width: 32px;
|
||||
@@ -69,12 +73,36 @@
|
||||
.toolbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.toolbarSep {
|
||||
.toolbarGroup {
|
||||
display: flex;
|
||||
flex: none;
|
||||
flex-direction: inherit;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
max-width: 100%;
|
||||
}
|
||||
.toolbarGroup + .toolbarGroup::before {
|
||||
content: "";
|
||||
width: 16px;
|
||||
height: 1px;
|
||||
margin: 3px 0;
|
||||
background: var(--border-strong);
|
||||
}
|
||||
.topToolbarSession .toolbar {
|
||||
width: auto;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-0-5) var(--space-2);
|
||||
padding: var(--space-0-5) var(--space-1);
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.topToolbarSession .toolbarGroup {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.topToolbarSession .toolbarGroup::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sessionBody {
|
||||
flex: 1;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import type { RunConfig } from "@/platform/ipc";
|
||||
import type { RunTargetValid } from "@/platform/remoteSettings";
|
||||
import { useAgentRunSettings, useWorkflowSettings } from "@/platform/workflowSettings";
|
||||
@@ -181,10 +182,15 @@ export function SessionPanel({
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={styles.session}>
|
||||
<div className={styles.toolbar} role="toolbar" aria-orientation="vertical" aria-label={tx("Run actions")}>
|
||||
<div className={clsx(styles.session, showLifecycle && styles.topToolbarSession)}>
|
||||
<div
|
||||
className={styles.toolbar}
|
||||
role="toolbar"
|
||||
aria-orientation={showLifecycle ? "horizontal" : "vertical"}
|
||||
aria-label={tx("Run actions")}
|
||||
>
|
||||
{showLifecycle && (
|
||||
<>
|
||||
<div className={styles.toolbarGroup}>
|
||||
<IconButton
|
||||
icon="rerun"
|
||||
title="Rerun"
|
||||
@@ -242,34 +248,36 @@ export function SessionPanel({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div className={styles.toolbarSep} />
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
{!rt.terminal && (
|
||||
<>
|
||||
<IconButton
|
||||
icon="search"
|
||||
title="Find…"
|
||||
shortcut={formatBinding(hostBinding("Meta+F"))}
|
||||
pressed={findOpen}
|
||||
onClick={() => setFindOpen((v) => !v)}
|
||||
/>
|
||||
<IconButton
|
||||
icon="scroll-to-end"
|
||||
title="Scroll to End"
|
||||
pressed={follow}
|
||||
onClick={() => setFollow((v) => !v)}
|
||||
/>
|
||||
<IconButton icon="soft-wrap" title="Soft-Wrap" pressed={softWrap} onClick={toggleWrap} />
|
||||
</>
|
||||
)}
|
||||
<IconButton icon="trash" title="Clear All" onClick={() => clearConsole(session.id)} />
|
||||
<div className={styles.toolbarSep} />
|
||||
<IconButton
|
||||
icon="settings"
|
||||
title="Edit Configurations…"
|
||||
onClick={() => void executeAction("run.editConfigs", session.config.id)}
|
||||
/>
|
||||
<div className={styles.toolbarGroup}>
|
||||
{!rt.terminal && (
|
||||
<>
|
||||
<IconButton
|
||||
icon="search"
|
||||
title="Find…"
|
||||
shortcut={formatBinding(hostBinding("Meta+F"))}
|
||||
pressed={findOpen}
|
||||
onClick={() => setFindOpen((v) => !v)}
|
||||
/>
|
||||
<IconButton
|
||||
icon="scroll-to-end"
|
||||
title="Scroll to End"
|
||||
pressed={follow}
|
||||
onClick={() => setFollow((v) => !v)}
|
||||
/>
|
||||
<IconButton icon="soft-wrap" title="Soft-Wrap" pressed={softWrap} onClick={toggleWrap} />
|
||||
</>
|
||||
)}
|
||||
<IconButton icon="trash" title="Clear All" onClick={() => clearConsole(session.id)} />
|
||||
</div>
|
||||
<div className={styles.toolbarGroup}>
|
||||
<IconButton
|
||||
icon="settings"
|
||||
title="Edit Configurations…"
|
||||
onClick={() => void executeAction("run.editConfigs", session.config.id)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.sessionBody}>
|
||||
{rt.tests ? (
|
||||
|
||||
@@ -106,18 +106,22 @@
|
||||
--border-tab-selected: transparent;
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
gap: var(--space-1) var(--space-3);
|
||||
padding: 8px 14px 4px 20px;
|
||||
}
|
||||
.scopeDetail {
|
||||
flex: 1;
|
||||
flex: 1 1 200px;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
.scopeDetail:empty {
|
||||
display: none;
|
||||
}
|
||||
.dirInput {
|
||||
width: 100%;
|
||||
max-width: 420px;
|
||||
|
||||
@@ -67,6 +67,7 @@ import {
|
||||
import { SINGLE_FIRST, isRowSelected, selectRow, selectedRows, type RowSelection } from "./rowSelection";
|
||||
import { FindSession, IDLE, matchRows, type FindState, type MatchRow } from "./session";
|
||||
import {
|
||||
FIND_POPUP_SPLIT_KEY,
|
||||
SEARCH_CONTEXTS,
|
||||
buildQuery,
|
||||
customScopeName,
|
||||
@@ -82,9 +83,7 @@ import {
|
||||
resolveFindScope,
|
||||
setFindPopupCommandHandler,
|
||||
loadFindPopupSize,
|
||||
loadFindPopupSplit,
|
||||
saveFindPopupSize,
|
||||
saveFindPopupSplit,
|
||||
setFindPopupNewTab,
|
||||
setFindPopupPinned,
|
||||
useFindPopup,
|
||||
@@ -165,11 +164,6 @@ function FindInFilesDialog() {
|
||||
const [previewMode, setPreviewMode] = useState(false);
|
||||
const [diffPreview, setDiffPreview] = useState<{ key: string; lines: PreviewLine[] } | null>(null);
|
||||
const [initialSize] = useState(loadFindPopupSize);
|
||||
const [split, setSplit] = useState(loadFindPopupSplit);
|
||||
const keepSplit = (layout: Record<string, number>) => {
|
||||
setSplit(layout);
|
||||
saveFindPopupSplit(layout);
|
||||
};
|
||||
const [marks, setMarks] = useState<ReplaceMarks>(NO_MARKS);
|
||||
const [running, setRunning] = useState<ReplaceRun | null>(null);
|
||||
const [progress, setProgress] = useState<ReplaceProgress | null>(null);
|
||||
@@ -869,8 +863,8 @@ function FindInFilesDialog() {
|
||||
</div>
|
||||
<div className={styles.split}>
|
||||
{rows.length ? (
|
||||
<SplitGroup orientation="vertical" id="find-popup-split" defaultLayout={split} onLayoutChanged={keepSplit}>
|
||||
<SplitPanel id="results" minSize={ROW * 3} defaultSize="48%">
|
||||
<SplitGroup orientation="vertical" id="find-popup-split" storageKey={FIND_POPUP_SPLIT_KEY}>
|
||||
<SplitPanel id="results" minSize={ROW * 3} defaultSize="33%">
|
||||
{resultsBox}
|
||||
</SplitPanel>
|
||||
<SplitHandle hairline={false} />
|
||||
|
||||
@@ -98,9 +98,8 @@ export function setFindPopupNewTab(newTab: boolean) {
|
||||
}
|
||||
|
||||
const SIZE_KEY = "openidea.search.findPopupSize.v1";
|
||||
const SPLIT_KEY = "openidea.search.findPopupSplit.v1";
|
||||
export const FIND_POPUP_SPLIT_KEY = "openidea.search.findPopupSplit.v1";
|
||||
|
||||
/** The popup's size and its results / preview split, remembered like IDEA's. */
|
||||
export function loadFindPopupSize(): { w: number; h: number } | null {
|
||||
const v = loadJson<{ w?: unknown; h?: unknown } | null>(SIZE_KEY, null);
|
||||
return typeof v?.w === "number" && typeof v.h === "number" ? { w: v.w, h: v.h } : null;
|
||||
@@ -110,17 +109,6 @@ export function saveFindPopupSize(size: { w: number; h: number }) {
|
||||
saveJson(SIZE_KEY, size);
|
||||
}
|
||||
|
||||
export function loadFindPopupSplit(): Record<string, number> | undefined {
|
||||
const v = loadJson<unknown>(SPLIT_KEY, null);
|
||||
return v && typeof v === "object" && Object.values(v).every((n) => typeof n === "number")
|
||||
? (v as Record<string, number>)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
export function saveFindPopupSplit(layout: Record<string, number>) {
|
||||
saveJson(SPLIT_KEY, layout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Keys the popup handles that are also global shortcuts (⌘G / ⇧⌘G, F4 / ⌘↓, ⌥↓):
|
||||
* hidden actions bound later in the keymap win while the popup is open and
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
min-height: 0;
|
||||
}
|
||||
.log {
|
||||
container: git-log / inline-size;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
@@ -75,14 +76,32 @@
|
||||
|
||||
/* filters */
|
||||
.filters {
|
||||
gap: var(--space-1);
|
||||
padding: 0 8px 0 6px;
|
||||
height: auto;
|
||||
min-height: 32px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
gap: var(--space-0-5) var(--space-1);
|
||||
padding: var(--space-0-5) 8px var(--space-0-5) 6px;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.filterControls,
|
||||
.filterActions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
.filterControls {
|
||||
flex: 1 1 260px;
|
||||
min-width: 0;
|
||||
}
|
||||
.filterActions {
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
max-width: 100%;
|
||||
}
|
||||
.textFilter {
|
||||
flex: 0 1 260px;
|
||||
min-width: 100px;
|
||||
min-width: min(100px, 60%);
|
||||
}
|
||||
.filterGroup {
|
||||
position: relative;
|
||||
@@ -96,6 +115,20 @@
|
||||
.filterHidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
@container git-log (max-width: 320px) {
|
||||
.filterControls,
|
||||
.filterActions {
|
||||
display: contents;
|
||||
}
|
||||
.textFilter {
|
||||
flex: 1 0 100%;
|
||||
}
|
||||
/* Keep the filters measurable for the overflow menu. */
|
||||
.filterGroup {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
.filterButton {
|
||||
flex: none;
|
||||
height: 24px;
|
||||
|
||||
+131
-128
@@ -293,55 +293,57 @@ export function FilterBar() {
|
||||
|
||||
return (
|
||||
<div className={styles.filters} role="toolbar" aria-label={tx("Log filters")}>
|
||||
{!showBranches && (
|
||||
<IconButton icon="chevron-right" title="Show Branches" size="small" action="vcs.log.showBranches" />
|
||||
)}
|
||||
<SearchField
|
||||
className={styles.textFilter}
|
||||
value={text}
|
||||
onChange={setText}
|
||||
placeholder="Text or hash"
|
||||
aria-label="Filter by message"
|
||||
toggles={[
|
||||
{
|
||||
id: "regex",
|
||||
icon: "regex",
|
||||
title: "Regex",
|
||||
pressed: filters.regex,
|
||||
onToggle: (regex) => setLogFilters({ regex }),
|
||||
},
|
||||
{
|
||||
id: "case",
|
||||
icon: "case",
|
||||
title: "Match Case",
|
||||
pressed: filters.matchCase,
|
||||
onToggle: (matchCase) => setLogFilters({ matchCase }),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<span ref={groupRef} className={styles.filterGroup}>
|
||||
{logFilters.map((f, i) => (
|
||||
<FilterButton key={f.label} {...f} hidden={i >= hiddenFrom} />
|
||||
))}
|
||||
</span>
|
||||
{hiddenFrom < logFilters.length && (
|
||||
<IconButton
|
||||
icon="chevron-right"
|
||||
title="More Filters"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={(e) => {
|
||||
const anchor = e.currentTarget;
|
||||
menuBelow(
|
||||
anchor,
|
||||
logFilters.slice(hiddenFrom).map((f) => ({
|
||||
label: f.value ? `${tx(f.label)}: ${f.value}` : f.label,
|
||||
run: () => f.onOpen(anchor),
|
||||
})),
|
||||
);
|
||||
}}
|
||||
<div className={styles.filterControls}>
|
||||
{!showBranches && (
|
||||
<IconButton icon="chevron-right" title="Show Branches" size="small" action="vcs.log.showBranches" />
|
||||
)}
|
||||
<SearchField
|
||||
className={styles.textFilter}
|
||||
value={text}
|
||||
onChange={setText}
|
||||
placeholder="Text or hash"
|
||||
aria-label="Filter by message"
|
||||
toggles={[
|
||||
{
|
||||
id: "regex",
|
||||
icon: "regex",
|
||||
title: "Regex",
|
||||
pressed: filters.regex,
|
||||
onToggle: (regex) => setLogFilters({ regex }),
|
||||
},
|
||||
{
|
||||
id: "case",
|
||||
icon: "case",
|
||||
title: "Match Case",
|
||||
pressed: filters.matchCase,
|
||||
onToggle: (matchCase) => setLogFilters({ matchCase }),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
<span ref={groupRef} className={styles.filterGroup}>
|
||||
{logFilters.map((f, i) => (
|
||||
<FilterButton key={f.label} {...f} hidden={i >= hiddenFrom} />
|
||||
))}
|
||||
</span>
|
||||
{hiddenFrom < logFilters.length && (
|
||||
<IconButton
|
||||
icon="chevron-right"
|
||||
title="More Filters"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={(e) => {
|
||||
const anchor = e.currentTarget;
|
||||
menuBelow(
|
||||
anchor,
|
||||
logFilters.slice(hiddenFrom).map((f) => ({
|
||||
label: f.value ? `${tx(f.label)}: ${f.value}` : f.label,
|
||||
run: () => f.onOpen(anchor),
|
||||
})),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{dropdown}
|
||||
{branchAnchor && (
|
||||
<BranchFilterPopup
|
||||
@@ -356,88 +358,89 @@ export function FilterBar() {
|
||||
onSelectMany={() => void selectBranches()}
|
||||
/>
|
||||
)}
|
||||
<span className={styles.grow} />
|
||||
<IconButton
|
||||
icon="bookmark"
|
||||
title="Bookmarked Commits"
|
||||
size="small"
|
||||
disabled={!Object.keys(bookmarks).length}
|
||||
onClick={(e) =>
|
||||
menuBelow(
|
||||
e,
|
||||
Object.entries(bookmarks).map(([key, summary]) => ({
|
||||
label: summary,
|
||||
run: () => {
|
||||
const split = key.lastIndexOf("\0");
|
||||
void goToRef(key.slice(split + 1), split >= 0 ? key.slice(0, split) : undefined);
|
||||
<div className={styles.filterActions}>
|
||||
<IconButton
|
||||
icon="bookmark"
|
||||
title="Bookmarked Commits"
|
||||
size="small"
|
||||
disabled={!Object.keys(bookmarks).length}
|
||||
onClick={(e) =>
|
||||
menuBelow(
|
||||
e,
|
||||
Object.entries(bookmarks).map(([key, summary]) => ({
|
||||
label: summary,
|
||||
run: () => {
|
||||
const split = key.lastIndexOf("\0");
|
||||
void goToRef(key.slice(split + 1), split >= 0 ? key.slice(0, split) : undefined);
|
||||
},
|
||||
})),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<IconButton
|
||||
icon="plus"
|
||||
title="Open Another Log Tab"
|
||||
size="small"
|
||||
onClick={(e) =>
|
||||
menuBelow(e, [
|
||||
{
|
||||
label: "In Tool Window",
|
||||
run: () => {
|
||||
openLogTab("log", `Log ${useGitLog.getState().logTabs.length + 1}`);
|
||||
},
|
||||
},
|
||||
})),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<IconButton
|
||||
icon="plus"
|
||||
title="Open Another Log Tab"
|
||||
size="small"
|
||||
onClick={(e) =>
|
||||
menuBelow(e, [
|
||||
{
|
||||
label: "In Tool Window",
|
||||
run: () => {
|
||||
openLogTab("log", `Log ${useGitLog.getState().logTabs.length + 1}`);
|
||||
{
|
||||
label: "In Editor",
|
||||
run: () => {
|
||||
openLogTab("log", `Log ${useGitLog.getState().logTabs.length + 1}`, "editor");
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "In Editor",
|
||||
run: () => {
|
||||
openLogTab("log", `Log ${useGitLog.getState().logTabs.length + 1}`, "editor");
|
||||
},
|
||||
},
|
||||
{ label: "External Repository…", run: openExternalLog },
|
||||
])
|
||||
}
|
||||
/>
|
||||
<IconButton
|
||||
icon="clock"
|
||||
title="Recent Filters"
|
||||
size="small"
|
||||
onClick={(e) =>
|
||||
menuBelow(
|
||||
e,
|
||||
recentLogFilters().map((filters) => ({
|
||||
label:
|
||||
[
|
||||
filters.range,
|
||||
filters.branches.join(", "),
|
||||
filters.authors.join(", "),
|
||||
filters.text,
|
||||
filters.path,
|
||||
filters.paths?.join(", "),
|
||||
filters.date?.label,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" · ") || tx("All commits"),
|
||||
run: () => setLogFilters(filters),
|
||||
})),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<IconButton icon="refresh" title="Refresh" size="small" onClick={() => void reloadLog({ preserve: true })} />
|
||||
<IconButton
|
||||
icon="sort"
|
||||
title="Graph Options"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={(e) => menuBelow(e, graphOptionsMenu(useLogOptions.getState()))}
|
||||
/>
|
||||
<IconButton
|
||||
icon="eye"
|
||||
title="View Options"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={(e) => menuBelow(e, viewOptionsMenu(useLogOptions.getState()))}
|
||||
/>
|
||||
<IconButton icon="search" title="Go to Hash/Branch/Tag" size="small" action="vcs.log.goToRef" />
|
||||
{ label: "External Repository…", run: openExternalLog },
|
||||
])
|
||||
}
|
||||
/>
|
||||
<IconButton
|
||||
icon="clock"
|
||||
title="Recent Filters"
|
||||
size="small"
|
||||
onClick={(e) =>
|
||||
menuBelow(
|
||||
e,
|
||||
recentLogFilters().map((filters) => ({
|
||||
label:
|
||||
[
|
||||
filters.range,
|
||||
filters.branches.join(", "),
|
||||
filters.authors.join(", "),
|
||||
filters.text,
|
||||
filters.path,
|
||||
filters.paths?.join(", "),
|
||||
filters.date?.label,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" · ") || tx("All commits"),
|
||||
run: () => setLogFilters(filters),
|
||||
})),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<IconButton icon="refresh" title="Refresh" size="small" onClick={() => void reloadLog({ preserve: true })} />
|
||||
<IconButton
|
||||
icon="sort"
|
||||
title="Graph Options"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={(e) => menuBelow(e, graphOptionsMenu(useLogOptions.getState()))}
|
||||
/>
|
||||
<IconButton
|
||||
icon="eye"
|
||||
title="View Options"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={(e) => menuBelow(e, viewOptionsMenu(useLogOptions.getState()))}
|
||||
/>
|
||||
<IconButton icon="search" title="Go to Hash/Branch/Tag" size="small" action="vcs.log.goToRef" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"Problems actions": "Problems actions",
|
||||
"TODO actions": "TODO actions",
|
||||
"Same as the existing configuration '{existing}'": "Same as the existing configuration '{existing}'",
|
||||
"Windows file and folder names cannot end with a period or space": "Windows file and folder names cannot end with a period or space",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"Problems actions": "问题操作",
|
||||
"Windows file and folder names cannot end with a period or space": "Windows 文件和文件夹名称不能以句点或空格结尾",
|
||||
"Use URL template": "使用 URL 模板",
|
||||
"Use Driver": "使用驱动程序",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
}
|
||||
/* Islands tabs: the selected tab is a rounded pill (tab-selected-bg / -border); no underline, no separators. */
|
||||
.editor {
|
||||
--tab-inline-padding: var(--space-2);
|
||||
height: var(--h-header);
|
||||
padding: 0 4px;
|
||||
}
|
||||
@@ -76,7 +77,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1-5);
|
||||
padding: 0 10px;
|
||||
padding: 0 var(--tab-inline-padding, 10px);
|
||||
border-radius: inherit;
|
||||
white-space: nowrap;
|
||||
color: inherit;
|
||||
@@ -207,6 +208,12 @@
|
||||
.wrap .tab {
|
||||
height: calc(var(--h-header) - 6px);
|
||||
}
|
||||
.editor.wrap .tab {
|
||||
max-inline-size: 100%;
|
||||
}
|
||||
.editor.wrap .tabButton {
|
||||
min-inline-size: 0;
|
||||
}
|
||||
|
||||
/* Vertical strip (editor tabs placed left / right): a scrolling column of full-width tabs. */
|
||||
.vertical {
|
||||
@@ -266,7 +273,7 @@
|
||||
margin: 0 0 0 4px;
|
||||
}
|
||||
.closeLeft .closable .tabButton {
|
||||
padding: 0 10px 0 2px;
|
||||
padding: 0 var(--tab-inline-padding, 10px) 0 2px;
|
||||
}
|
||||
|
||||
/* drag & drop: the dragged tab is an empty slot the other tabs make room for (IDEA) */
|
||||
|
||||
Reference in new issue
Block a user