mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-23 08:49:33 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c981e28eb | ||
|
|
ae6324295b |
No files matched your search
@@ -98,59 +98,3 @@ test("commit message history opens above the message without an empty icon colum
|
||||
expect(Math.abs(menuBox!.x - messageBox!.x)).toBeLessThan(2);
|
||||
await expect(row.locator("span")).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("the Commit changes toolbar fits a narrow side pane", async ({ workbench: page }) => {
|
||||
await stubRepository(page);
|
||||
await page.keyboard.press("Meta+k");
|
||||
await page.evaluate(async () => {
|
||||
const path = "/src/workbench/toolwindows/store.ts";
|
||||
const layout = await import(/* @vite-ignore */ path);
|
||||
layout.moveToolWindow("commit", "left");
|
||||
layout.setToolWindowSize("left", 164);
|
||||
});
|
||||
const panel = page.getByRole("region", { name: "Commit", exact: true });
|
||||
const toolbar = panel.getByRole("toolbar", { name: "Changes" });
|
||||
await expect(toolbar).toBeVisible();
|
||||
const clipped = await toolbar.evaluate((bar) => {
|
||||
const bounds = bar.getBoundingClientRect();
|
||||
return [...bar.querySelectorAll("button")].flatMap((button) => {
|
||||
const box = button.getBoundingClientRect();
|
||||
return box.right > bounds.right + 1 || box.bottom > bounds.bottom + 1 ? [button.ariaLabel] : [];
|
||||
});
|
||||
});
|
||||
expect(clipped).toEqual([]);
|
||||
const push = panel.getByRole("button", { name: "Commit and Push…" });
|
||||
const overflow = await push.locator("span").evaluate((label) => label.scrollWidth - label.clientWidth);
|
||||
expect(overflow).toBeLessThanOrEqual(1);
|
||||
await toolbar.getByRole("button", { name: "Collapse All" }).click();
|
||||
await expect(panel.getByRole("checkbox", { name: "Include build.gradle.kts in commit" })).toBeHidden();
|
||||
});
|
||||
|
||||
test("the commit message uses the configured editor typography", async ({ workbench: page }) => {
|
||||
await stubRepository(page);
|
||||
await page.keyboard.press("Meta+k");
|
||||
const message = page.getByRole("textbox", { name: "Commit message" });
|
||||
await expect(message).toBeFocused();
|
||||
await page.evaluate(async () => {
|
||||
const path = "/src/platform/project.ts";
|
||||
const { useProject } = await import(/* @vite-ignore */ path);
|
||||
const settings = useProject.getState().settings;
|
||||
useProject.setState({
|
||||
settings: {
|
||||
...settings,
|
||||
editor: {
|
||||
...settings?.editor,
|
||||
fontFamily: "Fira Code",
|
||||
fallbackFont: "Maple Mono NF CN",
|
||||
fontSize: 17,
|
||||
lineHeight: 28,
|
||||
fontWeight: 500,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
await expect(message).toHaveCSS("font-size", "17px");
|
||||
await expect(message).toHaveCSS("line-height", "28px");
|
||||
await expect(message).toHaveCSS("font-weight", "500");
|
||||
await expect(message).toHaveCSS("font-family", /"Fira Code".*"Maple Mono NF CN"/);
|
||||
});
|
||||
@@ -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),
|
||||
showLifecycle: kind === "run",
|
||||
...(kind === "services-run" ? { onRerun: null, onDebug: null } : {}),
|
||||
};
|
||||
} else if (kind === "debug" || kind === "services-debug") {
|
||||
const statePath = "/src/features/debugger/state.ts";
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
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");
|
||||
});
|
||||
@@ -94,30 +94,3 @@ 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();
|
||||
});
|
||||
@@ -81,39 +81,6 @@ 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,32 +13,6 @@ 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();
|
||||
@@ -68,7 +42,35 @@ 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 stubFindMatches(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 run(page, id);
|
||||
await page.getByRole("dialog").getByPlaceholder("Search").fill("http://localhost:8080");
|
||||
await expect(page.getByRole("dialog").locator("header [aria-live]")).toContainText(/match/);
|
||||
@@ -93,19 +95,6 @@ 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",
|
||||
@@ -122,31 +111,3 @@ 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);
|
||||
});
|
||||
@@ -72,7 +72,6 @@ test("settings sidebar resizes with mouse and keyboard and remembers its width",
|
||||
await expect(handle).toBeVisible();
|
||||
const sidebar = dialog.locator("#navigation");
|
||||
const initial = (await sidebar.boundingBox())!.width;
|
||||
expect(initial / (await dialog.getByTestId("settings").boundingBox())!.width).toBeCloseTo(0.225, 2);
|
||||
const box = (await handle.boundingBox())!;
|
||||
await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
|
||||
await page.mouse.down();
|
||||
|
||||
@@ -19,28 +19,20 @@
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
min-height: 32px;
|
||||
height: 32px;
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
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;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
padding: 0 8px 0 4px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tool {
|
||||
width: var(--h-control);
|
||||
height: var(--h-control);
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
@@ -54,21 +46,17 @@
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
min-width: 0;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.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,7 +16,6 @@ import {
|
||||
SplitHandle,
|
||||
SplitPanel,
|
||||
Tabs,
|
||||
Toolbar,
|
||||
showContextMenu,
|
||||
type MenuItem,
|
||||
type TabItem,
|
||||
@@ -219,43 +218,43 @@ export function DebugToolWindow() {
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<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 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 role="tablist" aria-label={tx("Debug views")} className={styles.tabs}>
|
||||
{(
|
||||
[
|
||||
|
||||
@@ -51,10 +51,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.topToolbarSession {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
flex: none;
|
||||
width: 32px;
|
||||
@@ -73,36 +69,12 @@
|
||||
.toolbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.toolbarGroup {
|
||||
display: flex;
|
||||
flex: none;
|
||||
flex-direction: inherit;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
max-width: 100%;
|
||||
}
|
||||
.toolbarGroup + .toolbarGroup::before {
|
||||
content: "";
|
||||
.toolbarSep {
|
||||
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,5 +1,4 @@
|
||||
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";
|
||||
@@ -182,15 +181,10 @@ export function SessionPanel({
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={clsx(styles.session, showLifecycle && styles.topToolbarSession)}>
|
||||
<div
|
||||
className={styles.toolbar}
|
||||
role="toolbar"
|
||||
aria-orientation={showLifecycle ? "horizontal" : "vertical"}
|
||||
aria-label={tx("Run actions")}
|
||||
>
|
||||
<div className={styles.session}>
|
||||
<div className={styles.toolbar} role="toolbar" aria-orientation="vertical" aria-label={tx("Run actions")}>
|
||||
{showLifecycle && (
|
||||
<div className={styles.toolbarGroup}>
|
||||
<>
|
||||
<IconButton
|
||||
icon="rerun"
|
||||
title="Rerun"
|
||||
@@ -248,36 +242,34 @@ export function SessionPanel({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.toolbarSep} />
|
||||
</>
|
||||
)}
|
||||
<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>
|
||||
{!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>
|
||||
<div className={styles.sessionBody}>
|
||||
{rt.tests ? (
|
||||
|
||||
@@ -106,22 +106,18 @@
|
||||
--border-tab-selected: transparent;
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-1) var(--space-3);
|
||||
gap: var(--space-3);
|
||||
padding: 8px 14px 4px 20px;
|
||||
}
|
||||
.scopeDetail {
|
||||
flex: 1 1 200px;
|
||||
flex: 1;
|
||||
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,7 +67,6 @@ 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,
|
||||
@@ -83,7 +82,9 @@ import {
|
||||
resolveFindScope,
|
||||
setFindPopupCommandHandler,
|
||||
loadFindPopupSize,
|
||||
loadFindPopupSplit,
|
||||
saveFindPopupSize,
|
||||
saveFindPopupSplit,
|
||||
setFindPopupNewTab,
|
||||
setFindPopupPinned,
|
||||
useFindPopup,
|
||||
@@ -164,6 +165,11 @@ 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);
|
||||
@@ -863,8 +869,8 @@ function FindInFilesDialog() {
|
||||
</div>
|
||||
<div className={styles.split}>
|
||||
{rows.length ? (
|
||||
<SplitGroup orientation="vertical" id="find-popup-split" storageKey={FIND_POPUP_SPLIT_KEY}>
|
||||
<SplitPanel id="results" minSize={ROW * 3} defaultSize="33%">
|
||||
<SplitGroup orientation="vertical" id="find-popup-split" defaultLayout={split} onLayoutChanged={keepSplit}>
|
||||
<SplitPanel id="results" minSize={ROW * 3} defaultSize="48%">
|
||||
{resultsBox}
|
||||
</SplitPanel>
|
||||
<SplitHandle hairline={false} />
|
||||
|
||||
@@ -98,8 +98,9 @@ export function setFindPopupNewTab(newTab: boolean) {
|
||||
}
|
||||
|
||||
const SIZE_KEY = "openidea.search.findPopupSize.v1";
|
||||
export const FIND_POPUP_SPLIT_KEY = "openidea.search.findPopupSplit.v1";
|
||||
const 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;
|
||||
@@ -109,6 +110,17 @@ 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
|
||||
|
||||
@@ -321,7 +321,7 @@ export function SettingsLayout() {
|
||||
|
||||
return (
|
||||
<SplitGroup id="settings" orientation="horizontal" storageKey="openidea.settings.layout" className={styles.layout}>
|
||||
<SplitPanel id="navigation" defaultSize="22.5%" minSize="160px" maxSize="40%" className={styles.sidebar}>
|
||||
<SplitPanel id="navigation" defaultSize="240px" minSize="160px" maxSize="40%" className={styles.sidebar}>
|
||||
<SearchField
|
||||
data-autofocus
|
||||
className={styles.search}
|
||||
|
||||
@@ -26,20 +26,6 @@
|
||||
gap: var(--space-0-5);
|
||||
padding: 0 6px;
|
||||
}
|
||||
.changesToolbar {
|
||||
height: auto;
|
||||
min-height: 32px;
|
||||
flex-wrap: wrap;
|
||||
column-gap: var(--space-2);
|
||||
padding-block: var(--space-0-5);
|
||||
}
|
||||
.changesTools {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5);
|
||||
max-width: 100%;
|
||||
}
|
||||
.sep {
|
||||
width: 1px;
|
||||
height: 16px;
|
||||
@@ -120,12 +106,13 @@
|
||||
}
|
||||
.commitBar {
|
||||
flex: none;
|
||||
min-height: 32px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-0-5) var(--space-1);
|
||||
padding: var(--space-0-5) 6px var(--space-0-5) 12px;
|
||||
gap: var(--space-1);
|
||||
padding: 0 6px 0 12px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.grow {
|
||||
flex: 1;
|
||||
@@ -134,7 +121,6 @@
|
||||
color: var(--fg-faint);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-tiny);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.lineLenWarn {
|
||||
color: var(--warning);
|
||||
@@ -150,6 +136,8 @@
|
||||
border-top: 1px solid var(--border);
|
||||
outline: none;
|
||||
color: var(--fg-strong);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-code);
|
||||
line-height: var(--lh-code);
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
@@ -176,6 +164,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
/* A narrow panel moves Commit and Push… to its own row rather than cutting its label. */
|
||||
flex-wrap: wrap;
|
||||
padding: 8px 6px 10px 10px;
|
||||
white-space: nowrap;
|
||||
@@ -186,14 +175,10 @@
|
||||
.commitActions > .pushButton {
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
min-height: var(--h-button, 28px);
|
||||
height: auto;
|
||||
padding: var(--space-1) var(--space-3);
|
||||
line-height: 1.3;
|
||||
}
|
||||
.pushButton > span {
|
||||
white-space: normal;
|
||||
overflow-wrap: anywhere;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.stashList {
|
||||
flex: 1;
|
||||
|
||||
@@ -18,9 +18,7 @@ import {
|
||||
import { tx, txTemplate } from "@/platform/i18n";
|
||||
import clsx from "clsx";
|
||||
import { executeAction } from "@/platform/actions";
|
||||
import { fontWeightOf } from "@/platform/editorSettings";
|
||||
import { resolveMonoFont } from "@/platform/fonts";
|
||||
import { basename, dirname, useProject } from "@/platform/project";
|
||||
import { basename, dirname } from "@/platform/project";
|
||||
import { isTestFile, useEffectiveRoots } from "@/platform/projectRoots";
|
||||
import {
|
||||
Button,
|
||||
@@ -765,79 +763,68 @@ export function ChangesTree({ mode }: { mode: "commit" | "local" | "dialog" }) {
|
||||
|
||||
return (
|
||||
<div className={styles.changes}>
|
||||
<div className={clsx(styles.toolbar, styles.changesToolbar)} role="toolbar" aria-label={tx("Changes")}>
|
||||
<div className={styles.changesTools}>
|
||||
<IconButton icon="refresh" title="Refresh" size="small" onClick={() => void refreshNow()} />
|
||||
{mode === "local" && <IconButton icon="commit" action="vcs.commit" size="small" />}
|
||||
<IconButton icon="undo" action="vcs.rollback" size="small" />
|
||||
{mode === "local" && <IconButton icon="changelist" action="vcs.changelist.new" size="small" />}
|
||||
{mode !== "dialog" && <IconButton icon="git-pull" action="vcs.update" size="small" />}
|
||||
<div className={styles.toolbar} role="toolbar" aria-label={tx("Changes")}>
|
||||
<IconButton icon="refresh" title="Refresh" size="small" onClick={() => void refreshNow()} />
|
||||
{mode === "local" && <IconButton icon="commit" action="vcs.commit" size="small" />}
|
||||
<IconButton icon="undo" action="vcs.rollback" size="small" />
|
||||
{mode === "local" && <IconButton icon="changelist" action="vcs.changelist.new" size="small" />}
|
||||
{mode !== "dialog" && <IconButton icon="git-pull" action="vcs.update" size="small" />}
|
||||
<IconButton
|
||||
ref={viewRef}
|
||||
icon="eye"
|
||||
title="View Options"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={() =>
|
||||
viewRef.current &&
|
||||
showContextMenu(bottomLeft(viewRef.current), [
|
||||
{ kind: "header", label: "Group By" },
|
||||
{ label: "Directory", checked: groupByDir, run: () => setGroupByDir(!groupByDir) },
|
||||
// IDEA offers it once the project has several repositories.
|
||||
...(repos.length > 1
|
||||
? [{ label: "Repository", checked: groupByRepo, run: () => setGroupByRepo(!groupByRepo) }]
|
||||
: []),
|
||||
...(staging
|
||||
? []
|
||||
: [{ label: "Staging State", checked: groupByStaging, run: () => setGroupByStaging(!groupByStaging) }]),
|
||||
{ kind: "separator" },
|
||||
{
|
||||
label: "Show Unversioned Files Separately",
|
||||
checked: showUnversionedSeparately,
|
||||
run: () => setShowUnversionedSeparately(!showUnversionedSeparately),
|
||||
},
|
||||
...(mode === "local"
|
||||
? [
|
||||
{ kind: "separator" } as const,
|
||||
{ label: "Show Diff Preview", checked: diffPreview, run: () => setDiffPreview(!diffPreview) },
|
||||
]
|
||||
: []),
|
||||
// Not in the Commit dialog, whose files always open as source.
|
||||
...(mode === "dialog" ? [] : doubleClickMenu(doubleClickOpensDiff)),
|
||||
])
|
||||
}
|
||||
/>
|
||||
{/* WebStorm's Preview Diff: an embedded diff of the selection beside the changes (#1599). */}
|
||||
{mode === "commit" && (
|
||||
<IconButton
|
||||
ref={viewRef}
|
||||
icon="eye"
|
||||
title="View Options"
|
||||
icon="editor-preview"
|
||||
title="Preview Diff"
|
||||
size="small"
|
||||
aria-haspopup="menu"
|
||||
onClick={() =>
|
||||
viewRef.current &&
|
||||
showContextMenu(bottomLeft(viewRef.current), [
|
||||
{ kind: "header", label: "Group By" },
|
||||
{ label: "Directory", checked: groupByDir, run: () => setGroupByDir(!groupByDir) },
|
||||
// IDEA offers it once the project has several repositories.
|
||||
...(repos.length > 1
|
||||
? [{ label: "Repository", checked: groupByRepo, run: () => setGroupByRepo(!groupByRepo) }]
|
||||
: []),
|
||||
...(staging
|
||||
? []
|
||||
: [
|
||||
{
|
||||
label: "Staging State",
|
||||
checked: groupByStaging,
|
||||
run: () => setGroupByStaging(!groupByStaging),
|
||||
},
|
||||
]),
|
||||
{ kind: "separator" },
|
||||
{
|
||||
label: "Show Unversioned Files Separately",
|
||||
checked: showUnversionedSeparately,
|
||||
run: () => setShowUnversionedSeparately(!showUnversionedSeparately),
|
||||
},
|
||||
...(mode === "local"
|
||||
? [
|
||||
{ kind: "separator" } as const,
|
||||
{ label: "Show Diff Preview", checked: diffPreview, run: () => setDiffPreview(!diffPreview) },
|
||||
]
|
||||
: []),
|
||||
// Not in the Commit dialog, whose files always open as source.
|
||||
...(mode === "dialog" ? [] : doubleClickMenu(doubleClickOpensDiff)),
|
||||
])
|
||||
}
|
||||
pressed={commitDiffPreview}
|
||||
onClick={() => setCommitDiffPreview(!commitDiffPreview)}
|
||||
/>
|
||||
{/* WebStorm's Preview Diff: an embedded diff of the selection beside the changes (#1599). */}
|
||||
{mode === "commit" && (
|
||||
<IconButton
|
||||
icon="editor-preview"
|
||||
title="Preview Diff"
|
||||
size="small"
|
||||
pressed={commitDiffPreview}
|
||||
onClick={() => setCommitDiffPreview(!commitDiffPreview)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.changesTools}>
|
||||
{mode !== "dialog" && (
|
||||
<IconButton icon="locate" title="Select Opened File" size="small" onClick={selectOpened} />
|
||||
)}
|
||||
<IconButton icon="expand-all" title="Expand All" size="small" onClick={() => setCollapsed(new Set())} />
|
||||
<IconButton
|
||||
icon="collapse-all"
|
||||
title="Collapse All"
|
||||
size="small"
|
||||
onClick={() =>
|
||||
setCollapsed(new Set([...byKey.values()].filter((n) => n.type !== "file").map((n) => n.key)))
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<span className={styles.sep} />
|
||||
{mode !== "dialog" && (
|
||||
<IconButton icon="locate" title="Select Opened File" size="small" onClick={selectOpened} />
|
||||
)}
|
||||
<IconButton icon="expand-all" title="Expand All" size="small" onClick={() => setCollapsed(new Set())} />
|
||||
<IconButton
|
||||
icon="collapse-all"
|
||||
title="Collapse All"
|
||||
size="small"
|
||||
onClick={() => setCollapsed(new Set([...byKey.values()].filter((n) => n.type !== "file").map((n) => n.key)))}
|
||||
/>
|
||||
</div>
|
||||
{mode !== "dialog" && <OperationBanner />}
|
||||
<div
|
||||
@@ -1146,8 +1133,6 @@ export function CommitMessageField({
|
||||
}
|
||||
|
||||
const cfg = useWorkflowSettings((s) => s.vcs.commit);
|
||||
const editor = useProject((s) => s.settings?.editor);
|
||||
const { family, size } = resolveMonoFont(undefined, editor);
|
||||
const first = message.split("\n")[0] ?? "";
|
||||
const tooLong = cfg.limitSubject && first.length > cfg.subjectLimit;
|
||||
const problems = messageProblems(message, cfg).filter((p) => !p.startsWith("Subject line"));
|
||||
@@ -1197,13 +1182,7 @@ export function CommitMessageField({
|
||||
data-autofocus={autoFocus ? "" : undefined}
|
||||
className={clsx(styles.message, !showMargin && styles.noMargin, emptyError && styles.messageError)}
|
||||
aria-invalid={emptyError || undefined}
|
||||
style={{
|
||||
["--guide" as string]: `${margin}ch`,
|
||||
fontFamily: family,
|
||||
fontSize: size,
|
||||
fontWeight: fontWeightOf(editor?.fontWeight, 400),
|
||||
lineHeight: editor?.lineHeight ? `${editor.lineHeight}px` : undefined,
|
||||
}}
|
||||
style={{ ["--guide" as string]: `${margin}ch` }}
|
||||
value={message}
|
||||
placeholder={tx("Commit Message")}
|
||||
aria-label={tx("Commit message")}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
min-height: 0;
|
||||
}
|
||||
.log {
|
||||
container: git-log / inline-size;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
@@ -76,32 +75,14 @@
|
||||
|
||||
/* filters */
|
||||
.filters {
|
||||
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;
|
||||
}
|
||||
.filterControls,
|
||||
.filterActions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
.filterControls {
|
||||
flex: 1 1 260px;
|
||||
padding: 0 8px 0 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
.filterActions {
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.textFilter {
|
||||
flex: 0 1 260px;
|
||||
min-width: min(100px, 60%);
|
||||
min-width: 100px;
|
||||
}
|
||||
.filterGroup {
|
||||
position: relative;
|
||||
@@ -115,20 +96,6 @@
|
||||
.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;
|
||||
|
||||
+128
-131
@@ -293,57 +293,55 @@ export function FilterBar() {
|
||||
|
||||
return (
|
||||
<div className={styles.filters} role="toolbar" aria-label={tx("Log filters")}>
|
||||
<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 }),
|
||||
},
|
||||
]}
|
||||
{!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),
|
||||
})),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<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
|
||||
@@ -358,89 +356,88 @@ export function FilterBar() {
|
||||
onSelectMany={() => void selectBranches()}
|
||||
/>
|
||||
)}
|
||||
<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}`);
|
||||
},
|
||||
<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);
|
||||
},
|
||||
{
|
||||
label: "In Editor",
|
||||
run: () => {
|
||||
openLogTab("log", `Log ${useGitLog.getState().logTabs.length + 1}`, "editor");
|
||||
},
|
||||
})),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<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: "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>
|
||||
},
|
||||
{
|
||||
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" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user