Compare commits

..
Author SHA1 Message Date
l0ng-ai 3fb02a09d7 Merge remote-tracking branch 'origin/main' into fix/editor-parameter-info-layout 2026-11-20 05:25:23 +08:00
l0ng-ai d1cc3cf68a fix(vcs): make merge panes resizable and keep actions visible (#4597)
The merge editor's three panes had fixed widths with decorative dividers, so in narrow windows they could not be resized and the toolbar actions overflowed. The panes are now a SplitGroup whose two handles carry the connector bands, each pane has its own title (branch and side), and the toolbar status is announced.
2026-11-20 05:25:12 +08:00
Mr0Bread 7c00ce4fa1 test(e2e): enforce TypeScript contract checking (#4610)
The e2e TypeScript project was never type checked: its tsconfig didn't inherit the app's settings, so @/ imports didn't resolve and hundreds of diagnostics went unnoticed. e2e/tsconfig.json now extends the root config (plus Node/Vite types and ES2024), pnpm typecheck runs tsrs -p e2e, and the remaining real type errors in the specs and fixtures are fixed; the code-style docs list the new project.

Co-authored-by: Mr0Bread <[email protected]>
2026-11-20 05:19:07 +08:00
l0ng-ai 6539a95cb8 fix(vcs): keep push review readable in narrow windows (#4594)
The Push dialog's commits, changed files and diff panes had pixel minimums and fixed options rows, so narrow or short windows clipped the review and the target controls. The commits and changes now stack vertically below 640px with their own remembered split, the changed files come before the commit details, panes use relative minimums, and the target bar, options and tag options wrap.
2026-11-20 05:07:24 +08:00
l0ng-ai 08613ca800 fix(debugger): keep evaluation results readable in short dialogs (#4592)
The Evaluate dialog's result had a 220px minimum height, so in short windows the dialog overflowed and the result and buttons were cut off. The dialog now caps its height to the window, the expression field scrolls within half of it, imports wrap, and the result takes the remaining space; the expression uses the editor font and its label is tied to the field.
2026-11-20 04:49:29 +08:00
l0ng-ai 1091283b8e fix(editor): keep parameter info readable in narrow panes 2026-11-20 03:35:21 +08:00
36 changed files with 862 additions and 379 deletions

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ Conventions:
| ---------- | --------------------------------------- | --------------------------------------------------------------------------------------- |
| oxfmt | `pnpm format` (CI: `pnpm format:check`) | `.oxfmtrc.json`: print width 120, double quotes, semicolons, trailing commas everywhere |
| oxlint | `pnpm lint` | `.oxlintrc.json`: TypeScript and React plugins |
| Type check | `pnpm typecheck` | `tsconfig.json` and the configs of `perf/`, `scripts/`, `smoke/` |
| Type check | `pnpm typecheck` | `tsconfig.json` and the configs of `e2e/`, `evals/`, `perf/`, `scripts/`, `smoke/` |
| knip | `pnpm knip` | `knip.ts`: unused files, exports and dependencies |
`pnpm knip` fails on an export nobody imports, a file nobody reaches or a dependency nobody uses. Delete dead code rather than suppressing it; exports used only inside their own file are allowed.
+6 -6
View File
@@ -25,12 +25,12 @@ description: "Rust 与 TypeScript 的格式化、lint 和死代码检查,以
## TypeScript 与 React
| 工具 | 命令 | 配置 |
| -------- | ---------------------------------------- | --------------------------------------------------------- |
| oxfmt | `pnpm format`(CI:`pnpm format:check`) | `.oxfmtrc.json`:行宽 120、双引号、分号、处处尾逗号 |
| oxlint | `pnpm lint` | `.oxlintrc.json`:TypeScript 和 React 插件 |
| 类型检查 | `pnpm typecheck` | `tsconfig.json` 以及 `perf/`、`scripts/`、`smoke/` 的配置 |
| knip | `pnpm knip` | `knip.ts`:未使用的文件、导出和依赖 |
| 工具 | 命令 | 配置 |
| -------- | ---------------------------------------- | --------------------------------------------------------------------------- |
| oxfmt | `pnpm format`(CI:`pnpm format:check`) | `.oxfmtrc.json`:行宽 120、双引号、处处尾逗号 |
| oxlint | `pnpm lint` | `.oxlintrc.json`:TypeScript 和 React 插件 |
| 类型检查 | `pnpm typecheck` | `tsconfig.json` 以及 `e2e/`、`evals/`、`perf/`、`scripts/`、`smoke/` 的配置 |
| knip | `pnpm knip` | `knip.ts`:未使用的文件、导出和依赖 |
`pnpm knip` 发现没人 import 的导出、没人引用的文件或没人用的依赖时会失败。请删掉死代码,而不是屏蔽检查;只在本文件内使用的导出是允许的。
+1 -1
View File
@@ -26,7 +26,7 @@ const firstTask: AgentTask = {
const secondTask: AgentTask = { ...firstTask, id: "focus-second", title: "Second focus task" };
const draft = "draft keep this unsent";
const reboundShortcut = "Control+Meta+Shift+J";
const subagent: AgentEntry = {
const subagent: Extract<AgentEntry, { type: "subagent" }> = {
type: "subagent",
id: "focus-child",
title: "Inspect focus behavior",
+1 -1
View File
@@ -149,7 +149,7 @@ test("opens slash-prefixed Windows Markdown links with preview content and hover
for (const [label, path, heading] of [
["Specification", spec, "Windows specification"],
["Work skill", skill, "Work specification skill"],
]) {
] as const) {
const link = reply.getByRole("link", { name: label, exact: true });
await link.hover();
await expect(link).toHaveAttribute("title", path);
+7 -7
View File
@@ -1,5 +1,7 @@
import { expect, test } from "./fixtures";
import type { AgentQuestion, AgentTask } from "../src/bindings";
import type * as AgentStore from "../src/features/agents/store";
import type * as Ipc from "../src/platform/ipc";
const task: AgentTask = {
id: "questions",
@@ -49,14 +51,12 @@ for (const status of ["running", "ready"] as const) {
const key = JSON.stringify(["request_user_input_async", "call-1", 0]);
await page.evaluate(
async ({ task, status, key }) => {
// Keep the workbench imports in the browser's Vite realm.
const storePath = "/src/features/agents/store.ts";
const ipcPath = "/src/platform/ipc.ts";
const store = await import(storePath);
(await import(ipcPath)).commands.agentAnswerQuestion = async (
id: string,
question: string,
answer: string | null,
) => {
const store: typeof AgentStore = await import(storePath);
const { commands }: typeof Ipc = await import(ipcPath);
commands.agentAnswerQuestion = async (id, question, answer) => {
document.documentElement.dataset.asyncAnswer = JSON.stringify({ id, question, answer });
const entries = store.useAgents.getState().entries.get(id)!;
store.useAgents.setState({
@@ -111,7 +111,7 @@ for (const status of ["running", "ready"] as const) {
if (status === "running") {
await page.evaluate(async (id) => {
const storePath = "/src/features/agents/store.ts";
const { useAgents } = await import(storePath);
const { useAgents }: typeof AgentStore = await import(storePath);
useAgents.setState((s) => ({ tasks: new Map(s.tasks).set(id, { ...s.tasks.get(id)!, status: "ready" }) }));
}, task.id);
await expect(card.getByRole("radio", { name: /^Read latest content/ })).toBeChecked();
+7 -4
View File
@@ -1,3 +1,4 @@
import type * as ProjectStore from "../src/platform/project";
import { expect, ipcCalls, openFromTree, stubDesktop, test } from "./fixtures";
test.use({ video: "on" });
@@ -114,9 +115,11 @@ test("restricting an attached folder leaves the current project untouched", asyn
test("restricted attachments can be trusted individually from the banner", async ({ workbench: page }) => {
await stubDesktop(page);
await page.evaluate(async () => {
const m = "/src/platform/project.ts";
const { useProject } = await import(/* @vite-ignore */ m);
// Load the running workbench's store in the browser.
const projectPath = "/src/platform/project.ts";
const { useProject }: typeof ProjectStore = await import(/* @vite-ignore */ projectPath);
const primary = useProject.getState().project;
if (!primary) throw new Error("Expected the sample project to be open");
let current = {
...primary,
trusted: false,
@@ -126,11 +129,11 @@ test("restricted attachments can be trusted individually from the banner", async
const trusted = new Set([primary.root]);
window.__ipc.handlers.project_trust_status = ({ path }) => ({
root: path,
trusted: trusted.has(path),
trusted: typeof path === "string" && trusted.has(path),
decided: true,
});
window.__ipc.handlers.project_trust_set = ({ path, trusted: allow }) => {
if (allow) trusted.add(path);
if (allow && typeof path === "string") trusted.add(path);
current = { ...current, trusted: current.workspace.projects.every((path) => trusted.has(path)) };
};
window.__ipc.handlers.project_current = () => current;
+1 -1
View File
@@ -559,7 +559,7 @@ test("indexed single-file rename previews all anchors and applies only after con
}
await expect.poll(() => ipcCalls(page, "apply_workspace_edit")).toHaveLength(1);
const [apply] = await ipcCalls(page, "apply_workspace_edit");
expect(apply.edit).toMatchObject({ preconditions: [{ path: FILE, hash: "indexed-snapshot" }] });
expect(apply?.edit).toMatchObject({ preconditions: [{ path: FILE, hash: "indexed-snapshot" }] });
});
test("rename keeps the typed name, uses the editor font and shows long preview names in a narrow dialog", async ({
+2 -2
View File
@@ -6,7 +6,7 @@ for (const [id, selector] of [
["keymap", "[class*='presetLabel']"],
["editor.inspections", "[class*='profileRow'] > span:first-child"],
["vcs.issueNavigation", "[class*='pageBody'] button:not([aria-label])"],
]) {
] as const) {
test(`${id} keeps compact labels inside their controls`, async ({ workbench: page }) => {
await page.keyboard.press("Meta+,");
const dialog = page.getByRole("dialog");
@@ -41,7 +41,7 @@ for (const [id, selector] of [
for (const [id, selector] of [
["general", "[class*='fontRow'] > label"],
["build.console", "[class*='inlineRow'] > label"],
]) {
] as const) {
test(`${id} keeps a readable width for inline text`, async ({ workbench: page }) => {
await page.keyboard.press("Meta+,");
await expect(page.getByRole("dialog", { name: "Settings", exact: true })).toBeVisible();
+1 -1
View File
@@ -49,7 +49,7 @@ commands.lspHover = async () => {
};
commands.lspDocumentLinks = async () => ({ status: "ok", data: [] });
commands.lspDocumentHighlights = async () => ({ status: "ok", data: [] });
commands.cancelRequest = async () => ({ status: "ok", data: null });
commands.cancelRequest = async () => {};
const java = new EditorView({
parent: javaHost,
state: EditorState.create({
+1 -1
View File
@@ -10,7 +10,7 @@ test("data source tabs share a stable layout and scroll within a short window",
const dialog = page.getByRole("dialog", { name: "New Data Source" });
const panel = dialog.getByRole("tabpanel");
const dialogSize = () => dialog.evaluate((element) => [element.offsetWidth, element.offsetHeight]);
const dialogSize = () => dialog.evaluate((element: HTMLElement) => [element.offsetWidth, element.offsetHeight]);
await expect(panel.getByRole("textbox", { name: "Host:" })).toBeVisible();
const size = await dialogSize();
await dialog.getByRole("tab", { name: "SSH/SSL" }).click();
+1 -1
View File
@@ -187,7 +187,7 @@ test("result context menu fits the viewport, responds to hover and keyboard, and
for (const [theme, label] of [
["solarized-light", "Solarized Light"],
["solarized-dark", "Solarized Dark"],
]) {
] as const) {
test(`${label}: retains the inactive context-menu target's hover until dismissal without selecting it`, async ({
workbench: page,
}, info) => {
+3 -4
View File
@@ -45,11 +45,10 @@ POST https://example.test/messages
const json = document.createElement("div");
json.id = "json";
document.body.append(json);
const jsonSupport = await loadSupport(findLanguageDescription("JSON", "body.json")!);
if (!jsonSupport) throw new Error("Failed to load JSON support for the highlighting fixture");
new EditorView({
parent: json,
doc: '{"name": "World", "count": 12, "enabled": true, "ready": false, "empty": null, "items": [1]}',
extensions: [
await loadSupport(findLanguageDescription("JSON", "body.json")!),
syntaxHighlighting(openideaHighlightStyle),
],
extensions: [jsonSupport, syntaxHighlighting(openideaHighlightStyle)],
});
+7 -4
View File
@@ -1,4 +1,5 @@
import { readFileSync } from "node:fs";
import type * as EditorBackend from "../src/editor/core/backend";
import { expect, test } from "./fixtures";
const xml = readFileSync(
@@ -10,13 +11,14 @@ test("imported PHP colours stay separate from Java and preserve regular text on
workbench: page,
}, info) => {
await page.evaluate(async (xml) => {
// Load the workbench modules in the browser's Vite realm.
const iclsPath = "/src/platform/icls.ts";
const projectPath = "/src/platform/project.ts";
const backendPath = "/src/editor/core/backend.ts";
const contributionsPath = "/src/workbench/contributions.ts";
const { parseIcls } = await import(iclsPath);
const { useProject } = await import(projectPath);
const { docBackend } = await import(backendPath);
const { docBackend }: typeof EditorBackend = await import(backendPath);
const { editorService } = await import(contributionsPath);
const previous = useProject.getState().settings ?? {};
useProject.setState({
@@ -31,10 +33,11 @@ test("imported PHP colours stay separate from Java and preserve regular text on
},
});
const backend = docBackend();
if (!("files" in backend) || !(backend.files instanceof Map)) throw new Error("Expected the in-memory backend");
const open = backend.open.bind(backend);
backend.open = async (...args: Parameters<typeof open>) => {
const result = await open(...args);
return args[0].endsWith(".php") ? { ...result, language: "php", uiMode: "PHP" } : result;
backend.open = async (path) => {
const result = await open(path);
return path.endsWith(".php") ? { ...result, language: "php", uiMode: "PHP" } : result;
};
backend.files.set(
"/dev/acme-api/palette.php",
+2 -1
View File
@@ -1,5 +1,6 @@
import { EditorView } from "@codemirror/view";
import { commands, type InlayHint, type Range } from "../src/platform/ipc";
import type { InlayHint, Range } from "../src/bindings";
import { commands } from "../src/platform/ipc";
import { setInvokeRoute } from "../src/platform/tauriCore";
import { lspDoc } from "../src/editor/lsp/lsp";
import { inlayExtension } from "../src/editor/lsp/inlay";
+16 -11
View File
@@ -1,3 +1,4 @@
import type { DataSource_Deserialize, DbJdbcDriver } from "../src/bindings";
import { expect, ipcCalls, stubDesktop, test } from "./fixtures";
test("configures a local JDBC profile and a source through mocked IPC", async ({ workbench: page }, info) => {
@@ -102,21 +103,25 @@ test("configures a local JDBC profile and a source through mocked IPC", async ({
await source.getByLabel("Property value", { exact: true }).fill("true");
await test.click();
await expect(source.getByRole("status")).toHaveText("Succeeded: Mock JDBC database");
const [{ source: tested, password }] = await ipcCalls(page, "db_test");
expect(password).toBe("mock secret");
const [tested] = await ipcCalls(page, "db_test");
expect(tested).toMatchObject({
driver: "jdbc",
url,
user: "example-user",
readOnly: true,
properties: [{ name: "ssl", value: "true" }],
password: "mock secret",
source: {
driver: "jdbc",
url,
user: "example-user",
readOnly: true,
properties: [{ name: "ssl", value: "true" }],
},
});
await source.getByRole("button", { name: "OK", exact: true }).click();
await expect(source).not.toBeVisible();
const [{ sources }] = await ipcCalls(page, "db_save_sources");
const [saved] = sources as Record<string, unknown>[];
const [{ driver }] = await ipcCalls(page, "db_save_jdbc_driver");
const [save] = await ipcCalls(page, "db_save_sources");
const saved = (save?.sources as DataSource_Deserialize[] | undefined)?.[0];
const [profile] = await ipcCalls(page, "db_save_jdbc_driver");
const driver = profile?.driver as DbJdbcDriver | undefined;
if (!saved || !driver) throw new Error("Expected the JDBC source and driver to be saved");
expect(saved.readOnly).toBe(true);
expect(saved.jdbcDriver).toBe((driver as Record<string, unknown>).id);
expect(saved.jdbcDriver).toBe(driver.id);
for (const key of ["jars", "className", "classpath", "exec", "password"]) expect(saved).not.toHaveProperty(key);
});
+3 -3
View File
@@ -1,5 +1,5 @@
/** Linked Gradle builds use isolated native stubs; no real builds or files are touched. */
import type { GradleModel, RunConfig } from "../src/platform/ipc";
import type { GradleModel, RunConfig_Deserialize } from "../src/bindings";
import { expect, ipcCalls, stubDesktop, test } from "./fixtures";
const build = (dir: string): GradleModel => ({
@@ -46,7 +46,7 @@ test("links independent Gradle roots, runs identical task paths in their own bui
};
h["plugin:dialog|open"] = () => ["/dev/acme-api/second/settings.gradle"];
h.run_start = (args) => {
const config = args.config as RunConfig;
const config = args.config as RunConfig_Deserialize;
const id = ++runId;
setTimeout(() => window.__ipc.emit({ type: "runExited", run: id, code: 0 }), 50);
return { id, configId: config.id, name: config.name, pid: 4242 + id, running: true, pty: false };
@@ -89,7 +89,7 @@ test("links independent Gradle roots, runs identical task paths in their own bui
await expect.poll(async () => (await ipcCalls(page, "run_start")).length).toBe(1);
await tasks.nth(1).dblclick();
await expect.poll(async () => (await ipcCalls(page, "run_start")).length).toBe(2);
const runs = (await ipcCalls(page, "run_start")).map((args) => args.config as RunConfig);
const runs = (await ipcCalls(page, "run_start")).map((args) => args.config as RunConfig_Deserialize);
expect(runs[0]!.id).not.toBe(runs[1]!.id);
for (const [index, dir] of ["first", "second"].entries()) {
expect(runs[index]).toMatchObject({
+38
View File
@@ -63,6 +63,44 @@ const result = (page: Page) => page.getByRole("region", { name: "Result" });
const text = async (pane: Locator) => (await pane.locator(".cm-content").innerText()).replace(/​/g, "");
const status = (page: Page) => page.locator("#merge-host [class*=status]").first();
test("merge controls and pane titles fit while resizing the result", async ({ page }) => {
await page.setViewportSize({ width: 400, height: 600 });
await mountMerge(page);
const host = page.locator("#merge-host");
for (const name of ["Accept Yours", "Accept Theirs", "Cancel", "Apply"])
await expect(host.getByRole("button", { name, exact: true })).toBeInViewport({ ratio: 1 });
await expect(status(page)).toHaveText("3 changes left, 2 conflicts");
await expect(status(page)).toBeInViewport({ ratio: 1 });
const ours = page.getByRole("region", { name: "Your version" });
await expect(ours.getByText("Your version", { exact: true })).toBeVisible();
await expect(
page.getByRole("region", { name: "Their version" }).getByText("Their version", { exact: true }),
).toBeVisible();
await ours.locator(".cm-merge-accept").nth(1).focus();
await page.keyboard.press("Enter");
await expect.poll(() => text(result(page))).toContain("\nmine\n");
await page.setViewportSize({ width: 980, height: 660 });
const resultWidth = async () => (await result(page).boundingBox())!.width;
const initial = await resultWidth();
const left = host.getByRole("separator", { name: "Resize left merge pane" });
await left.press("ArrowLeft");
await expect.poll(resultWidth).toBeGreaterThan(initial + 1);
const right = host.getByRole("separator", { name: "Resize right merge pane" });
const grip = (await right.boundingBox())!;
const withLeftResized = await resultWidth();
await page.mouse.move(grip.x + grip.width / 2, grip.y + grip.height / 2);
await page.mouse.down();
await page.mouse.move(grip.x + grip.width / 2 + 36, grip.y + grip.height / 2, { steps: 4 });
await page.mouse.up();
await expect.poll(resultWidth).toBeGreaterThan(withLeftResized + 20);
await expect(result(page).getByText("Result", { exact: true })).toBeVisible();
await expect(ours.getByText("Changes from main", { exact: true })).toBeVisible();
await expect.poll(() => text(result(page))).toContain("\nmine\n");
});
/** Capture the save boundary, keeping real editor state, dialogs and Apply behavior. */
async function captureWrites(page: Page) {
await page.evaluate(async () => {
+76
View File
@@ -0,0 +1,76 @@
import type { Page } from "@playwright/test";
import type { SignatureHelp } from "../src/bindings";
import { expect, openFromTree, stubDesktop, test } from "./fixtures";
function signature(name: string, parameters: string[]) {
let offset = name.length + 1;
const ranges: [number, number][] = parameters.map((parameter) => {
const range: [number, number] = [offset, offset + parameter.length];
offset = range[1] + 2;
return range;
});
return { label: `${name}(${parameters.join(", ")}): Invoice`, parameters: ranges, documentation: null };
}
async function openParameterInfo(page: Page, help: SignatureHelp) {
const editor = await openFromTree(page, "build.gradle.kts");
await stubDesktop(page);
await page.evaluate((help) => {
window.__ipc.handlers.lsp_signature_help = () => help;
}, help);
await editor.locator(".cm-line", { hasText: "return order.toDto()" }).click();
await page.keyboard.press("End");
await page.keyboard.press("ArrowLeft");
await page.keyboard.press("Meta+p");
const popup = page.locator(".cm-lsp-signature");
await expect(popup).toBeVisible();
return { editor, popup };
}
test("parameter info wraps long parameters and follows the editor width", async ({ workbench: page }) => {
await page.setViewportSize({ width: 1120, height: 700 });
const parameter = "roundingPolicyForThirdPartyPaymentsWithMultipleSettlementCurrencies: RoundingPolicy";
const { editor, popup } = await openParameterInfo(page, {
signatures: [signature("formatInvoice", ["order: Cart", parameter, "currency: string"])],
activeSignature: 0,
activeParameter: 1,
});
await page.setViewportSize({ width: 560, height: 650 });
await expect
.poll(async () => {
const [pane, hint] = await Promise.all([editor.boundingBox(), popup.boundingBox()]);
return !!pane && !!hint && hint.x >= pane.x - 1 && hint.x + hint.width <= pane.x + pane.width + 1;
})
.toBe(true);
await expect.poll(() => popup.evaluate((el) => el.scrollWidth - el.clientWidth)).toBeLessThanOrEqual(1);
await expect(popup.locator("b")).toHaveText(parameter);
const fontSize = await editor.locator(".cm-content").evaluate((el) => getComputedStyle(el).fontSize);
await expect(popup).toHaveCSS("font-size", fontSize);
await page.keyboard.press("Escape");
await expect(popup).toBeHidden();
});
test("parameter info keeps the active overload visible and scrolls to the others", async ({ workbench: page }) => {
const signatures = Array.from({ length: 20 }, (_, i) =>
signature("formatInvoice", [`order: Cart${i}`, "currency: string"]),
);
const { popup } = await openParameterInfo(page, { signatures, activeSignature: 16, activeParameter: 1 });
await expect(popup.locator(".cm-lsp-signature-row")).toHaveCount(signatures.length);
const active = popup.locator(".cm-lsp-signature-active b");
await expect(active).toHaveText("currency: string");
await expect
.poll(async () => {
const [frame, parameter] = await Promise.all([popup.boundingBox(), active.boundingBox()]);
return (
!!frame && !!parameter && parameter.y >= frame.y && parameter.y + parameter.height <= frame.y + frame.height
);
})
.toBe(true);
expect(await popup.evaluate((el) => el.scrollTop)).toBeGreaterThan(0);
await popup.hover();
await page.mouse.wheel(0, -1200);
await expect.poll(() => popup.evaluate((el) => el.scrollTop)).toBe(0);
await expect(
popup.getByText("formatInvoice(order: Cart0, currency: string): Invoice", { exact: true }),
).toBeInViewport();
});
+120 -42
View File
@@ -9,50 +9,75 @@ import { expect, stubDesktop, test } from "./fixtures";
const ROOT = "/dev/acme-api";
const HUGE = `feature/wrap-${"x".repeat(140)}`;
async function openPushDialog(page: Page) {
const OUTGOING = "Apply order-level discounts before calculating checkout taxes";
async function openPushDialog(page: Page, { outgoing = false, multi = false } = {}) {
await stubDesktop(page);
await page.evaluate(async (root) => {
const h = window.__ipc.handlers;
h.vcs_roots = () => [{ root, operation: null, head: "main", headCommit: "1111111" }];
h.vcs_branch_info = () => ({
head: "main",
headCommit: "1111111",
upstream: "origin/main",
ahead: 0,
behind: 0,
operation: null,
});
h.vcs_status = () => [];
h.vcs_log = () => [];
h.vcs_remotes = () => [{ name: "origin", url: "[email protected]:acme/api.git" }];
const branch = (name: string, remote: boolean, upstream: string | null = null) => ({
name,
remote,
current: !remote,
upstream,
ahead: 0,
behind: 0,
lastCommitMs: 0,
});
h.vcs_branches = () => [
branch("main", false, "origin/main"),
branch("feature/login", false),
branch("origin/main", true),
branch("origin/feature/login", true),
branch("origin/fix/error-auth", true),
branch("origin/feature/PLATFORM-12345-order-history-export", true),
branch(`origin/feature/wrap-${"x".repeat(140)}`, true),
];
const vcsModule = "/src/features/vcs/store.ts";
const { useVcs, refreshNow } = await import(/* @vite-ignore */ vcsModule);
useVcs.setState({ available: true, root, repo: root, branchesLoaded: false, stashesLoaded: false });
await refreshNow();
const actionsModule = "/src/platform/actions.ts";
const { executeAction } = await import(/* @vite-ignore */ actionsModule);
void executeAction("vcs.push");
}, ROOT);
await page.evaluate(
async ({ root, outgoing, multi, subject }) => {
const h = window.__ipc.handlers;
const head = multi ? "feature/refine-checkout-pricing-and-order-summary-for-regional-release" : "main";
const roots = multi ? [root, `${root}/billing-and-refunds`] : [root];
h.vcs_roots = () => roots.map((root) => ({ root, operation: null, head, headCommit: "1111111" }));
h.vcs_branch_info = () => ({
head,
headCommit: "1111111",
upstream: `origin/${head}`,
ahead: outgoing ? 1 : 0,
behind: 0,
operation: null,
});
h.vcs_status = () => [];
h.vcs_log = () =>
outgoing
? [
{
id: "2222222",
shortId: "2222222",
parents: ["1111111"],
summary: subject,
message: subject + "\n\nKeep the new totals consistent with receipts.",
author: "Sam Rivera",
email: "[email protected]",
timeMs: 1795100000000,
},
]
: [];
h.vcs_commit_files = () => [{ path: "checkout.ts", oldPath: null, kind: "modified" }];
h.vcs_has_hook = () => false;
h.vcs_remotes = () => [{ name: "origin", url: "[email protected]:acme/api.git" }];
const branch = (name: string, remote: boolean, upstream: string | null = null) => ({
name,
remote,
current: !remote,
upstream,
ahead: 0,
behind: 0,
lastCommitMs: 0,
});
h.vcs_branches = () => [
branch("main", false, "origin/main"),
branch("feature/login", false),
branch("origin/main", true),
branch("origin/feature/login", true),
branch("origin/fix/error-auth", true),
branch("origin/feature/PLATFORM-12345-order-history-export", true),
branch(`origin/feature/wrap-${"x".repeat(140)}`, true),
];
const vcsModule = "/src/features/vcs/store.ts";
const { useVcs, refreshNow } = await import(/* @vite-ignore */ vcsModule);
useVcs.setState({ available: true, root, repo: root, branchesLoaded: false, stashesLoaded: false });
await refreshNow();
const actionsModule = "/src/platform/actions.ts";
const { executeAction } = await import(/* @vite-ignore */ actionsModule);
void executeAction("vcs.push");
},
{ root: ROOT, outgoing, multi, subject: OUTGOING },
);
const dialog = page.getByRole("dialog", { name: /Push/ });
const input = dialog.getByRole("combobox", { name: "Target branch" });
const input = multi
? dialog.getByRole("textbox", { name: "Target branch of acme-api" })
: dialog.getByRole("combobox", { name: "Target branch" });
await expect(input).toBeVisible();
return { dialog, input };
}
@@ -127,3 +152,56 @@ test("Escape closes the list but keeps the dialog", async ({ workbench: page })
await expect(page.getByRole("listbox", { name: "Remote branches" })).toHaveCount(0);
await expect(dialog).toBeVisible();
});
test("Push keeps commit subjects and changed files readable in a narrow window", async ({ workbench: page }) => {
await page.setViewportSize({ width: 1140, height: 760 });
const { dialog, input } = await openPushDialog(page, { outgoing: true });
const outgoing = dialog.getByRole("listbox", { name: "Outgoing commits" });
const files = dialog.getByRole("tree", { name: "Changed files" });
const commit = outgoing.getByRole("option", { name: new RegExp(OUTGOING) });
await commit.click();
await expect(files.getByText("checkout.ts")).toBeVisible();
const filesBelowCommits = async () => {
const [list, tree] = await Promise.all([outgoing.boundingBox(), files.boundingBox()]);
return !!list && !!tree && tree.y >= list.y + list.height;
};
await expect.poll(filesBelowCommits).toBe(false);
await page.setViewportSize({ width: 540, height: 630 });
await expect.poll(filesBelowCommits).toBe(true);
await expect(commit).toHaveAttribute("aria-selected", "true");
const subject = commit.getByText(OUTGOING, { exact: true });
await expect(subject).toHaveAttribute("title", /Sam Rivera/);
await expect.poll(() => subject.evaluate((el) => el.scrollWidth <= el.clientWidth)).toBe(true);
await expect(input).toHaveValue("main");
await expect(dialog.getByRole("button", { name: "Push", exact: true })).toBeInViewport();
const details = dialog.getByRole("region", { name: "Commit details" });
await expect(details).toContainText("Keep the new totals consistent with receipts.");
await expect
.poll(async () => {
const [tree, message] = await Promise.all([files.boundingBox(), details.boundingBox()]);
return !!tree && !!message && message.y >= tree.y + tree.height;
})
.toBe(true);
});
test("Push keeps per-repository targets editable with long source branches", async ({ workbench: page }) => {
await page.setViewportSize({ width: 475, height: 620 });
const { dialog, input } = await openPushDialog(page, { outgoing: true, multi: true });
const other = dialog.getByRole("textbox", { name: "Target branch of billing-and-refunds" });
for (const field of [input, other]) {
await expect
.poll(() =>
field.evaluate((target) => {
const row = target.closest('[role="treeitem"]')!.getBoundingClientRect();
const bounds = target.getBoundingClientRect();
return bounds.width >= 42 && bounds.left >= row.left && bounds.right <= row.right;
}),
)
.toBe(true);
}
await input.fill("release/checkout");
await expect(input).toHaveValue("release/checkout");
await expect(other).toHaveValue(/^feature\//);
await expect(dialog.getByRole("checkbox", { name: "acme-api" })).toBeChecked();
});
+8 -4
View File
@@ -1,3 +1,4 @@
import type { SearchQuery } from "../src/bindings";
import { doubleShift, expect, ipcCalls, openFromTree, stubDesktop, test } from "./fixtures";
test("double Shift opens Search Everywhere with its tabs; Escape closes it", async ({ workbench: page }) => {
@@ -100,11 +101,14 @@ test("Find in Files streams matches by file and opens the chosen one at its line
await expect
.poll(
async () =>
(await ipcCalls(page, "search_start")).filter((c) => !/\bTODO\b/.test(c.query?.pattern ?? "")).at(-1)?.query,
(await ipcCalls(page, "search_start"))
.filter(({ query }) => {
const pattern = query && typeof query === "object" && "pattern" in query ? query.pattern : undefined;
return typeof pattern !== "string" || !/\bTODO\b/.test(pattern);
})
.at(-1)?.query,
)
.toMatchObject({
pattern: "OrderService",
});
.toMatchObject({ pattern: "OrderService" } satisfies Pick<SearchQuery, "pattern">);
const preview = dialog.getByRole("region", { name: "Preview", exact: true }).locator(".cm-content");
await expect(preview).toHaveAttribute("contenteditable", "true");
// Matches take the editor scheme's search result background (IDEA's SEARCH_RESULT_ATTRIBUTES) and keep the syntax colours.
+1 -1
View File
@@ -79,7 +79,7 @@ test.describe("search popups at the minimum window width", () => {
[400, 500],
[600, 700],
[1120, 750],
]) {
] as const) {
await page.setViewportSize({ width, height });
await expectControlsFit(page);
// Room enough for the title and the reporter's count: shown whole, on one line.
+2 -2
View File
@@ -9,9 +9,9 @@ test("semantic roles honor all Color Scheme attributes and keep modifier styles"
[".cm-sem-function:not(.cm-sem-static)", "rgb(102, 136, 170)"],
[".cm-sem-parameter", "rgb(119, 153, 187)"],
[".cm-sem-constant", "rgb(136, 170, 204)"],
]) {
] as const) {
const role = page.locator(selector);
await expect(role).toHaveCSS("color", color!);
await expect(role).toHaveCSS("color", color);
await expect(role).toHaveCSS("background-color", "rgb(221, 238, 255)");
}
await expect(page.locator(".cm-sem-namespace")).toHaveCSS("font-style", "italic");
+1 -1
View File
@@ -6,7 +6,7 @@ for (const [id, selector] of [
["languages.servers", "[class*='body'] > [class*='language'][aria-label]"],
["plugins", "[class*='body'] > [class*='details']"],
["agents.list", "section[aria-label='Codex']"],
]) {
] as const) {
test(`${id} keeps its details usable beside the list`, async ({ workbench: page }) => {
await page.keyboard.press("Meta+,");
const dialog = page.getByRole("dialog", { name: "Settings", exact: true });
+4 -8
View File
@@ -1,12 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"types": ["node"]
"lib": ["ES2024", "DOM", "DOM.Iterable"],
"types": ["node", "vite/client"]
},
"include": ["./**/*.ts", "../playwright.config.ts"]
"include": [".", "../playwright.config.ts", "../src/**/*.d.ts"]
}
+1 -1
View File
@@ -17,7 +17,7 @@
"format": "oxfmt",
"format:check": "oxfmt --check",
"knip": "knip",
"typecheck": "tsrs --noEmit && tsrs -p tsconfig.node.json --noEmit && tsrs -p perf --noEmit && tsrs -p evals --noEmit && tsrs -p scripts --noEmit && tsrs -p smoke --noEmit",
"typecheck": "tsrs --noEmit && tsrs -p tsconfig.node.json --noEmit && tsrs -p perf --noEmit && tsrs -p evals --noEmit && tsrs -p scripts --noEmit && tsrs -p smoke --noEmit && tsrs -p e2e --noEmit",
"gen:bindings": "cargo test -p openidea --test export_bindings",
"gen:windows-icons": "node scripts/gen-windows-icons.ts",
"gen:angular-grammar": "lezer-generator src/editor/core/cm/angular/angular.grammar --typeScript -o src/editor/core/cm/angular/parser.ts",
+51 -10
View File
@@ -6,8 +6,17 @@
*/
import { EditorSelection, Prec, StateEffect, StateField, type Extension } from "@codemirror/state";
import { completionStatus, hasNextSnippetField, hasPrevSnippetField } from "@codemirror/autocomplete";
import { EditorView, ViewPlugin, keymap, showTooltip, type Tooltip, type ViewUpdate } from "@codemirror/view";
import {
EditorView,
ViewPlugin,
keymap,
repositionTooltips,
showTooltip,
type Tooltip,
type ViewUpdate,
} from "@codemirror/view";
import { commands, type SignatureHelp } from "@/platform/ipc";
import { tooltipBounds } from "@/editor/core/cm/setup";
import { docOf, lspRequest, reportLspError, debounce } from "./lsp";
import { offsetToPos } from "./positions";
import { showHint } from "./hint";
@@ -40,8 +49,6 @@ export function splitSignature(label: string, params: ReadonlyArray<[number, num
return { before: label.slice(0, s), param: label.slice(s, e), after: label.slice(e) };
}
const MAX_ROWS = 12;
/** Whether an overload can take an argument at `index` (varargs take any number). */
export function acceptsParameter(sig: { label: string; parameters: ReadonlyArray<[number, number]> }, index: number) {
if (index < sig.parameters.length) return true;
@@ -54,23 +61,27 @@ function signatureTooltip(s: SigState): Tooltip {
pos: s.pos,
above: true,
strictSide: false,
create: () => {
create: (view) => {
const dom = document.createElement("div");
dom.className = "cm-lsp-signature";
dom.setAttribute("role", "tooltip");
const { signatures, activeSignature, activeParameter } = s.help;
const start = Math.max(0, Math.min(activeSignature - 6, signatures.length - MAX_ROWS));
signatures.slice(start, start + MAX_ROWS).forEach((sig, j) => {
const i = start + j;
let active: HTMLElement | null = null;
signatures.forEach((sig, i) => {
const row = document.createElement("div");
row.className = "cm-lsp-signature-row";
if (i === activeSignature) row.classList.add("cm-lsp-signature-active");
else if (!acceptsParameter(sig, activeParameter)) row.classList.add("cm-lsp-signature-disabled");
if (i === activeSignature) {
row.classList.add("cm-lsp-signature-active");
row.setAttribute("aria-current", "true");
active = row;
} else if (!acceptsParameter(sig, activeParameter)) row.classList.add("cm-lsp-signature-disabled");
const parts = splitSignature(sig.label, sig.parameters, activeParameter);
row.append(parts.before);
if (parts.param) {
const b = document.createElement("b");
b.textContent = parts.param;
row.appendChild(b);
if (i === activeSignature) active = b;
}
row.append(parts.after);
dom.appendChild(row);
@@ -81,7 +92,37 @@ function signatureTooltip(s: SigState): Tooltip {
d.classList.add("cm-lsp-signature-doc");
dom.appendChild(d);
}
return { dom };
const fit = ({ left, right }: { left: number; right: number }) => {
const width = `${Math.max(0, Math.floor(right - left))}px`;
const fontSize = getComputedStyle(view.contentDOM).fontSize;
const changed = dom.style.getPropertyValue("--cm-signature-width") !== width || dom.style.fontSize !== fontSize;
if (changed) {
dom.style.setProperty("--cm-signature-width", width);
dom.style.fontSize = fontSize;
}
return changed;
};
// Reveal the current parameter after wrapping or a vertical clamp. Leave manual scrolling alone.
let fittedWidth = 0;
let fittedHeight = 0;
return {
dom,
mount: () => void fit(tooltipBounds(view)),
positioned: (space) => {
if (fit(space)) {
repositionTooltips(view);
return;
}
if (!active || (fittedWidth === dom.clientWidth && fittedHeight === dom.clientHeight)) return;
fittedWidth = dom.clientWidth;
fittedHeight = dom.clientHeight;
const top = dom.getBoundingClientRect().top + dom.clientTop;
const parameter = active.getBoundingClientRect();
const below = parameter.bottom - (top + fittedHeight);
if (parameter.top < top || parameter.height >= fittedHeight) dom.scrollTop += parameter.top - top;
else if (below > 0) dom.scrollTop += below;
},
};
},
};
}
+17 -10
View File
@@ -270,28 +270,35 @@ export const lspTheme = EditorView.theme({
cursor: "pointer",
},
".cm-lsp-link-button:hover": { color: "var(--link-hover)", textDecoration: "underline" },
".cm-lsp-signature": {
".cm-tooltip.cm-lsp-signature": {
fontFamily: "var(--openidea-editor-font, var(--font-mono))",
fontWeight: "var(--fw-code, 400)",
fontSize: "var(--openidea-editor-font-size, var(--fs-code))",
padding: "6px 10px",
maxWidth: "640px",
maxWidth: "min(640px, var(--cm-signature-width, 100%))",
maxHeight: "min(380px, 65vh)",
paddingBlock: "var(--space-0-5)",
overflow: "auto",
overscrollBehavior: "contain",
},
".cm-lsp-signature-row": {
color: "var(--fg-secondary)",
whiteSpace: "pre-wrap",
overflowWrap: "anywhere",
lineHeight: "1.5",
padding: "var(--space-0-5) var(--space-2)",
paddingInlineStart: "calc(var(--space-2) + 2ch)",
textIndent: "-2ch",
},
".cm-lsp-signature-row": { color: "var(--fg-subtle)", whiteSpace: "pre-wrap", lineHeight: "max(20px, 1.5em)" },
".cm-lsp-signature-active": {
color: "var(--fg-strong)",
backgroundColor: "var(--bg-identifier-under-caret, color-mix(in srgb, var(--accent) 14%, transparent))",
margin: "0 -10px",
padding: "0 10px",
},
".cm-lsp-signature-disabled": { opacity: "0.55" },
".cm-lsp-signature b": { fontWeight: "var(--fw-code-bold, 700)", color: "var(--fg-strong)" },
".cm-lsp-signature-doc": {
borderTop: "1px solid var(--border-popup)",
marginTop: "6px",
paddingTop: "6px",
maxHeight: "160px",
overflow: "auto",
marginTop: "var(--space-1)",
padding: "var(--space-2)",
},
".cm-tooltip:has(> .cm-lsp-hint)": { background: "none", border: "none", boxShadow: "none" },
".cm-lsp-hint": {
+92 -24
View File
@@ -1,6 +1,9 @@
.root {
--merge-band-width: 30px;
container: merge-editor / inline-size;
flex: 1;
height: 100%;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
@@ -9,14 +12,16 @@
}
.toolbar {
flex: none;
height: var(--h-header);
min-height: var(--h-header);
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1);
padding: 0 6px;
padding: var(--space-0-5) var(--space-1-5);
border-bottom: 1px solid var(--border);
}
.sep {
flex: none;
width: 1px;
height: 14px;
margin: 0 4px;
@@ -24,59 +29,96 @@
}
.status {
margin-left: auto;
padding: 0 8px;
padding: 0 var(--space-2);
max-width: 100%;
color: var(--vcs-conflict);
font-size: var(--fs-small);
text-align: end;
}
.statusDone {
color: var(--fg-muted);
}
.labels {
.paneTitle,
.resultTitle {
flex: none;
height: var(--h-row);
display: grid;
/* The panes' columns, so each title sits over its pane. */
grid-template-columns: 1fr 30px 1fr 30px 1fr;
padding: 0 var(--space-2);
border-bottom: 1px solid var(--border);
color: var(--fg-secondary);
font-size: var(--fs-small);
line-height: var(--h-row);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.labels > span {
display: flex;
align-items: center;
padding: 0 12px;
.resultTitle {
color: var(--fg-strong);
font-weight: 500;
text-align: center;
}
.labels > span:nth-child(2) {
grid-column: 3;
.sideColumn {
container: merge-side / inline-size;
}
.labels > span:nth-child(3) {
grid-column: 5;
.sideTitle {
display: none;
}
@container merge-side (max-width: 180px) {
.branchTitle {
display: none;
}
.sideTitle {
display: inline;
}
}
.panes {
flex: 1;
min-height: 0;
display: grid;
grid-template-columns: 1fr 30px 1fr 30px 1fr;
display: flex;
}
.panes[hidden] {
display: none;
}
.paneGroup {
flex: 1;
}
.pane {
flex: 1;
min-width: 0;
min-height: 0;
display: flex;
overflow: hidden;
}
/* Between two panes, as the diff viewer's divider: the bands of the changes on either side. */
.divider {
position: relative;
min-height: 0;
overflow: hidden;
.divider[data-separator] {
width: var(--merge-band-width);
background: var(--bg-app);
}
.divider[data-separator]:is([data-separator="hover"], [data-separator="active"]) {
background: var(--bg-toolbar-hover);
}
.divider[data-separator]:focus-visible {
outline: 1px solid var(--focus-ring);
outline-offset: -1px;
}
.divider::before {
content: "";
position: absolute;
inset-block-start: calc((var(--h-row) - 12px) / 2);
inset-inline-start: calc(50% - 1px);
height: 12px;
width: 2px;
border-radius: var(--radius-small);
background: var(--border-strong);
}
/* The headings share the splitter geometry. The curves start below them. */
.band {
position: absolute;
inset: var(--h-row) 0 0;
overflow: hidden;
pointer-events: none;
border-left: 1px solid var(--border);
border-right: 1px solid var(--border);
}
.divider > svg {
.band > svg {
position: absolute;
inset: 0;
}
@@ -103,16 +145,42 @@
.footer {
flex: none;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding: 8px 12px;
padding: var(--space-2) var(--space-3);
border-top: 1px solid var(--border);
}
.footerGroup {
display: flex;
flex-wrap: wrap;
min-width: 0;
gap: var(--space-2);
}
.footerGroup:last-child {
margin-inline-start: auto;
justify-content: flex-end;
}
@container merge-editor (max-width: 680px) {
.divider[data-separator] {
width: 20px;
}
}
@container merge-editor (max-width: 440px) {
.divider[data-separator] {
width: 14px;
}
.toolbar > .sep {
display: none;
}
.status {
flex-basis: 100%;
order: 1;
padding: 0;
text-align: start;
}
}
.message {
flex: 1;
outline: none;
+58 -32
View File
@@ -1,5 +1,5 @@
/** Three-pane merge editor: Yours | Result | Theirs, after IntelliJ's merge tool. */
import { useCallback, useEffect, useRef, useState } from "react";
import { useCallback, useEffect, useId, useRef, useState } from "react";
import { Transaction, type EditorState, type Extension, type TransactionSpec } from "@codemirror/state";
import { EditorView, keymap } from "@codemirror/view";
import { history, historyKeymap, undoDepth } from "@codemirror/commands";
@@ -11,7 +11,7 @@ import { setContext } from "@/platform/context";
import { tx, useTxTemplate } from "@/platform/i18n";
import { call, commands } from "@/platform/ipc";
import { copyText } from "@/ui/selectableText";
import { Button, Spinner, T } from "@/ui";
import { Button, Spinner, SplitGroup, SplitHandle, SplitPanel, T } from "@/ui";
import { editorService, type EditorInput } from "@/workbench/contributions";
import { blameSlot, toggleAnnotations } from "./blame";
import { firstLineOf, languageFor, viewerBase } from "./cm";
@@ -114,6 +114,7 @@ export function MergeEditor({ input }: { input: EditorInput }) {
const [summary, setSummary] = useState<MergeSummary>(NOTHING_LEFT);
const [autoApply, setAutoApply] = useState(readAutoApply);
const [resolved, setResolved] = useState(false);
const paneId = useId();
const rootRef = useRef<HTMLDivElement>(null);
const paneRef = useRef<MergeSide | "result">("result");
const [actionHost] = useState<MergeActionHost>(() => ({
@@ -607,45 +608,70 @@ export function MergeEditor({ input }: { input: EditorInput }) {
</div>
);
const yourTitle = txt(titles.yours);
const resultTitle = tx("Result");
const theirTitle = txt(titles.theirs);
return (
<div ref={rootRef} className={styles.root} {...focusProps}>
<MergeToolbar summary={summary} step={goto} run={(c) => void runAction(c)} />
<div className={styles.labels}>
<span>{txt(titles.yours)}</span>
<span>
<T>Result</T>
</span>
<span>{txt(titles.theirs)}</span>
</div>
{!state || lang === null ? (
<div className={styles.message}>
<Spinner size={14} />
</div>
) : null}
<div className={styles.panes} hidden={!state || lang === null}>
<div
ref={oursRef}
className={styles.pane}
aria-label={tx("Your version")}
role="region"
onContextMenu={(e) => oursView.current && showSideMenu(e, oursView.current, "left")}
/>
<div ref={leftDividerRef} className={styles.divider} aria-hidden />
<div
ref={resultRef}
className={styles.pane}
aria-label={tx("Result")}
role="region"
onContextMenu={(e) => resultView.current && showResultMenu(e, resultView.current)}
/>
<div ref={rightDividerRef} className={styles.divider} aria-hidden />
<div
ref={theirsRef}
className={styles.pane}
aria-label={tx("Their version")}
role="region"
onContextMenu={(e) => theirsView.current && showSideMenu(e, theirsView.current, "right")}
/>
<SplitGroup className={styles.paneGroup} orientation="horizontal">
<SplitPanel
id={`${paneId}-yours`}
role="region"
aria-label={tx("Your version")}
className={styles.sideColumn}
minSize="18%"
defaultSize="30%"
>
<div className={styles.paneTitle} title={yourTitle}>
<span className={styles.branchTitle}>{yourTitle}</span>
<span className={styles.sideTitle}>{tx("Your version")}</span>
</div>
<div
ref={oursRef}
className={styles.pane}
onContextMenu={(e) => oursView.current && showSideMenu(e, oursView.current, "left")}
/>
</SplitPanel>
<SplitHandle className={styles.divider} aria-label={tx("Resize left merge pane")}>
<div ref={leftDividerRef} className={styles.band} aria-hidden />
</SplitHandle>
<SplitPanel id={`${paneId}-result`} role="region" aria-label={resultTitle} minSize="24%" defaultSize="40%">
<div className={styles.resultTitle}>{resultTitle}</div>
<div
ref={resultRef}
className={styles.pane}
onContextMenu={(e) => resultView.current && showResultMenu(e, resultView.current)}
/>
</SplitPanel>
<SplitHandle className={styles.divider} aria-label={tx("Resize right merge pane")}>
<div ref={rightDividerRef} className={styles.band} aria-hidden />
</SplitHandle>
<SplitPanel
id={`${paneId}-theirs`}
role="region"
aria-label={tx("Their version")}
className={styles.sideColumn}
minSize="18%"
defaultSize="30%"
>
<div className={styles.paneTitle} title={theirTitle}>
<span className={styles.branchTitle}>{theirTitle}</span>
<span className={styles.sideTitle}>{tx("Their version")}</span>
</div>
<div
ref={theirsRef}
className={styles.pane}
onContextMenu={(e) => theirsView.current && showSideMenu(e, theirsView.current, "right")}
/>
</SplitPanel>
</SplitGroup>
</div>
<MergeFooter run={(c) => void runAction(c)} />
</div>
+3 -1
View File
@@ -97,7 +97,9 @@ export function MergeToolbar({ summary, step, run }: ToolbarProps) {
onClick={direct(() => run("compare"))}
data-merge-menu="compare"
/>
<span className={clsx(styles.status, !summary.pending && styles.statusDone)}>{statusText(summary)}</span>
<span className={clsx(styles.status, !summary.pending && styles.statusDone)} role="status">
{statusText(summary)}
</span>
<IconButton
icon="refresh"
title="Reload from Disk"
+4 -4
View File
@@ -134,12 +134,12 @@ export function PushChanges({
</div>
{count === 1 ? (
<SplitGroup orientation="vertical" storageKey={DETAILS_SPLIT_KEY} className={styles.pushDetailsSplit}>
<SplitPanel id="details" minSize="40px" defaultSize="25%" className={styles.pushDetailsPanel}>
<PushCommitDetails commit={commits[0]!} />
<SplitPanel id="files" minSize="40%" defaultSize="67%" className={styles.pushDetailsPanel}>
{files}
</SplitPanel>
<SplitHandle />
<SplitPanel id="files" minSize="80px" className={styles.pushDetailsPanel}>
{files}
<SplitPanel id="details" minSize="24%" className={styles.pushDetailsPanel}>
<PushCommitDetails commit={commits[0]!} />
</SplitPanel>
</SplitGroup>
) : (
+49 -7
View File
@@ -1,4 +1,5 @@
import { useState, type ReactNode } from "react";
import { useLayoutEffect, useRef, useState, type ReactNode } from "react";
import type { GroupImperativeHandle } from "react-resizable-panels";
import { tx } from "@/platform/i18n";
import { IconButton, SplitGroup, SplitHandle, SplitPanel, lazyComponent } from "@/ui";
import { diffInput } from "./diffInput";
@@ -8,6 +9,10 @@ import styles from "./common.module.css";
const DiffEditor = lazyComponent(() => import("./DiffEditor").then((m) => m.DiffEditor));
const PUSH_DIFF_SPLIT_KEY = "openidea.vcs.push.diffSplit";
const PUSH_SIDES_SPLIT_KEY = "openidea.vcs.pushSides";
const PUSH_STACKED_SPLIT_KEY = "openidea.vcs.push.stackedSplit";
const SIDE_LAYOUT = { commits: 50, changes: 50 };
const STACKED_LAYOUT = { commits: 34, changes: 66 };
export function usePushDiff(shownKey: string) {
const [state, setState] = useState<{ key: string; change: LogChange } | null>(null);
@@ -18,22 +23,59 @@ export function usePushDiff(shownKey: string) {
};
}
interface PushDiffSplitProps {
interface PushReviewProps {
diff: LogChange | null;
onClose: () => void;
children: ReactNode;
commits: ReactNode;
changes: ReactNode;
}
export function PushDiffSplit({ diff, onClose, children }: PushDiffSplitProps) {
export function PushReview({ diff, onClose, commits, changes }: PushReviewProps) {
const summary = useRef<HTMLDivElement>(null);
const group = useRef<GroupImperativeHandle>(null);
const [stacked, setStacked] = useState(false);
const previous = useRef(stacked);
const layout = stacked ? STACKED_LAYOUT : SIDE_LAYOUT;
useLayoutEffect(() => {
const el = summary.current;
if (!el) return;
const measure = () => setStacked(el.clientWidth < 640);
measure();
if (typeof ResizeObserver === "undefined") return;
const observer = new ResizeObserver(measure);
observer.observe(el);
return () => observer.disconnect();
}, []);
useLayoutEffect(() => {
if (previous.current === stacked) return;
previous.current = stacked;
group.current?.setLayout(layout);
}, [stacked, layout]);
return (
<SplitGroup orientation="vertical" storageKey={diff ? PUSH_DIFF_SPLIT_KEY : undefined} className={styles.pushSplit}>
<SplitPanel id="sides" minSize="120px" defaultSize="50%" className={styles.pushSplitPanel}>
{children}
<SplitPanel id="sides" minSize="32%" defaultSize="58%" className={styles.pushSplitPanel}>
<SplitGroup
elementRef={summary}
groupRef={group}
orientation={stacked ? "vertical" : "horizontal"}
storageKey={stacked ? PUSH_STACKED_SPLIT_KEY : PUSH_SIDES_SPLIT_KEY}
defaultLayout={layout}
className={styles.pushSides}
>
<SplitPanel id="commits" minSize={stacked ? "24%" : "240px"} className={styles.pushSplitPanel}>
{commits}
</SplitPanel>
<SplitHandle />
<SplitPanel id="changes" minSize={stacked ? "32%" : "240px"} className={styles.pushSplitPanel}>
{changes}
</SplitPanel>
</SplitGroup>
</SplitPanel>
{diff && (
<>
<SplitHandle />
<SplitPanel id="diff" minSize="120px" defaultSize="50%" className={styles.pushSplitPanel}>
<SplitPanel id="diff" minSize="25%" className={styles.pushSplitPanel}>
<PushDiff change={diff} onClose={onClose} />
</SplitPanel>
</>
+84 -14
View File
@@ -150,22 +150,58 @@
display: flex;
flex-direction: column;
}
.pushOptions,
.pushTagOptions {
display: flex;
align-items: center;
gap: var(--space-2);
}
.pushOptions {
flex-wrap: wrap;
max-width: 100%;
font-size: var(--fs-ui);
}
.pushTargetBar {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1) var(--space-2);
padding: var(--space-2) var(--space-3) 0;
}
.pushTargetSource {
max-width: 100%;
overflow-wrap: anywhere;
color: var(--fg-secondary);
}
.pushTargetControls {
display: flex;
align-items: center;
flex: 1 1 240px;
min-width: 0;
gap: var(--space-1);
}
.pushTargetControls .targetInput {
flex: 0 1 330px;
min-width: 8ch;
width: auto;
margin: 0;
}
.pushTreeWrap {
flex: 1;
min-height: 220px;
display: flex;
flex-direction: column;
padding: 14px;
padding: var(--space-2) var(--space-3) var(--space-3);
}
.pushListWrap {
flex: 1;
min-height: 180px;
display: flex;
flex-direction: column;
padding: 0 14px 14px;
padding: var(--space-2) var(--space-3) var(--space-3);
}
.pushSplit {
flex: 1 1 min(540px, 60vh);
flex: 1 1 min(450px, 65vh);
min-height: 0;
}
/* The panel's own `height: 100%` doesn't resolve against a flex-basis height in WebKit: stretch instead. */
@@ -209,8 +245,8 @@
.pushSplitPanel > .pushTreeWrap {
min-height: 0;
}
.pushTreeWrap .commitRow[data-idle],
.pushTreeWrap .commitRow[data-idle] label {
.pushRepoRow[data-idle],
.pushRepoRow[data-idle] label {
color: var(--fg-subtle);
}
.pushChanges {
@@ -218,21 +254,23 @@
display: flex;
flex-direction: column;
min-height: 0;
padding-top: 8px;
padding-top: var(--space-2);
}
.pushChanges .comparison {
flex: 1;
height: auto;
min-height: 0;
padding: 0 14px 14px;
padding: 0 var(--space-3) var(--space-2);
}
.pushChangesTitle {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-2);
min-height: 24px;
padding: 0 14px 6px;
min-height: var(--h-control);
padding: 0 var(--space-3) var(--space-1);
color: var(--fg-subtle);
font-size: var(--fs-small);
}
.pushGrouping {
margin-left: auto;
@@ -250,8 +288,8 @@
display: flex;
flex-direction: column;
gap: var(--space-1);
margin: 0 14px 8px;
padding: 6px 8px;
margin: var(--space-1) var(--space-3);
padding: var(--space-1) var(--space-2);
overflow: auto;
border: 1px solid var(--border);
border-radius: var(--radius-small);
@@ -416,23 +454,55 @@
white-space: nowrap;
}
/* Fits the remote and target fields into a 22px tree row. */
.pushRepoRow {
display: flex;
align-items: center;
gap: var(--space-1);
flex: 1;
min-width: 0;
}
.pushRepoName {
min-width: 20px;
}
.pushRepoLabel,
.pushSourceBranch,
.pushRemoteName {
display: block;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pushSourceBranch,
.pushRemoteName {
color: var(--fg-subtle);
font-size: var(--fs-small);
}
.pushRemoteName {
flex: none;
max-width: 14ch;
}
.pushRowTarget {
--h-field: var(--h-control-small);
--h-control: var(--h-control-small);
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
min-width: 0;
min-width: 10ch;
font-size: var(--fs-small);
}
.pushRowTarget button {
.pushTargetControls > button,
.pushRowTarget > button {
min-width: 0;
max-width: 18ch;
font-size: var(--fs-small);
}
.pushRowSeparator {
flex: none;
color: var(--fg-faint);
}
.pushRowInput {
min-width: 0;
min-width: 7ch;
font-size: var(--fs-small);
}
.pushRowInput[data-changed]:not(:focus-visible) {
+187 -167
View File
@@ -5,27 +5,14 @@ import { call, commands } from "@/platform/ipc";
import { tx } from "@/platform/i18n";
import { workflowSettings, type UpdateMethod } from "@/platform/workflowSettings";
import { notifications } from "@/workbench/contributions";
import {
Button,
Checkbox,
Dialog,
Input,
List,
Select,
Spinner,
SplitGroup,
SplitHandle,
SplitPanel,
T,
Tree,
} from "@/ui";
import { Button, Checkbox, Dialog, Input, List, Select, Spinner, T, Tree } from "@/ui";
import { ask } from "@/workbench/messages";
import { openDialog } from "./dialogs";
import { saveVcsSetting } from "./settingsUi";
import { formatTime } from "./model";
import { allRepos, lastRemoteFailure, runRemote, saveAll } from "./ops";
import { PushChanges, pushChangesKey } from "./PushChanges";
import { PushDiffSplit, usePushDiff } from "./PushDiff";
import { PushReview, usePushDiff } from "./PushDiff";
import { pushOperation, splitTracked, type PushChoice } from "./pushTarget";
import { currentRepo, currentRepoRoot, loadBranches, refreshNow, repoName, useVcs } from "./store";
import { stripRemotePrefix, TargetBranchInput } from "./TargetBranchInput";
@@ -246,10 +233,18 @@ interface PushNode {
children?: PushNode[];
}
// A long outgoing list scrolls inside the dialog instead of growing it to the screen (IDEA: 800×450 centre panel).
const PUSH_DIALOG_MAX_HEIGHT = 720;
const PUSH_DIALOG_WIDTH = 960;
const PUSH_SPLIT_KEY = "openidea.vcs.pushSides";
const PUSH_DIALOG_WIDTH = 800;
const PUSH_DIALOG_MIN_WIDTH = 420;
function PushCommitSubject({ commit }: { commit: Commit }) {
const metadata = [commit.shortId, commit.author, formatTime(commit.timeMs)].filter(Boolean).join(" · ");
return (
<span className={styles.commitSubject} title={`${metadata}\n${commit.message.trimEnd() || commit.summary}`}>
{commit.summary}
</span>
);
}
interface MultiPushDialogProps {
only?: string;
@@ -412,15 +407,17 @@ function MultiPushDialog({ only, onClose }: MultiPushDialogProps) {
title={only === undefined ? "Push Commits" : tx`Push Commits to ${repoName(only)}`}
onClose={onClose}
width={PUSH_DIALOG_WIDTH}
minWidth={PUSH_DIALOG_MIN_WIDTH}
minHeight={340}
maxHeight={PUSH_DIALOG_MAX_HEIGHT}
className={styles.pushDialog}
resizable="both"
footerStart={
<>
<div className={styles.pushOptions}>
<Checkbox checked={force} onChange={setForce} label="Force (with lease)" />
{hasHook && <Checkbox checked={runHooks} onChange={setRunHooks} label="Run Git hooks" />}
{!retargeted && (
<>
<span className={styles.pushTagOptions}>
<Checkbox checked={pushTags} onChange={setPushTags} label="Push tags:" />
<Select<PushTags>
value={tagsMode}
@@ -432,9 +429,9 @@ function MultiPushDialog({ only, onClose }: MultiPushDialogProps) {
{ value: "currentBranch", label: "Current Branch" },
]}
/>
</>
</span>
)}
</>
</div>
}
buttons={[
{
@@ -447,107 +444,114 @@ function MultiPushDialog({ only, onClose }: MultiPushDialogProps) {
{ label: "Cancel", role: "cancel" },
]}
>
<PushDiffSplit diff={diff} onClose={closeDiff}>
<SplitGroup orientation="horizontal" storageKey={PUSH_SPLIT_KEY} className={styles.pushSides}>
<SplitPanel id="commits" minSize="240px" defaultSize="50%" className={styles.pushSplitPanel}>
<div className={styles.pushTreeWrap}>
{error ? (
<div className={styles.error}>{error}</div>
) : !repos ? (
<div className={styles.empty}>
<Spinner size={14} />
</div>
) : (
<Tree<PushNode>
roots={nodes}
getKey={(n) => n.key}
getLabel={(n) => (n.commit ? n.commit.summary : repoName(n.repo.root))}
getChildren={(n) => n.children}
isExpandable={(n) => !!n.children?.length}
expanded={expanded}
onExpandedChange={(_next, node, open) =>
setExpanded((e) => {
const s = new Set(e);
if (open) s.add(node.key);
else s.delete(node.key);
return s;
})
}
selected={new Set(shown ? [shown.key] : [])}
multiSelect={false}
onSelectionChange={(_sel, lead) => setShown(lead)}
rowHeight={rowHeight}
aria-label="Outgoing commits"
className={styles.boxList}
empty={
<span>
<T>Everything is up to date</T>
</span>
}
renderNode={(n) =>
n.commit ? (
<span className={styles.commitRow} style={{ flex: 1, padding: 0 }}>
<span className={styles.commitHash}>{n.commit.shortId}</span>
<span className={styles.commitSubject}>{n.commit.summary}</span>
<span className={styles.commitMeta}>{n.commit.author}</span>
<span className={styles.commitMeta}>{formatTime(n.commit.timeMs)}</span>
</span>
) : (
<span
className={styles.commitRow}
data-idle={hasNothingToPush(n.repo) || undefined}
style={{ flex: 1, padding: 0 }}
// A row click toggles the checkbox, like before; only the chevron collapses.
onClick={(e) => {
if (only === undefined && !(e.target as HTMLElement | null)?.closest?.("label"))
toggle(n.repo.root);
}}
>
{only === undefined ? (
<Checkbox
checked={checked.has(n.repo.root)}
onChange={() => toggle(n.repo.root)}
label={repoName(n.repo.root)}
/>
) : (
<span className={styles.commitSubject}>{repoName(n.repo.root)}</span>
)}
<span className={styles.commitMeta}>{n.repo.branch.head} →</span>
<PushRowTarget
name={repoName(n.repo.root)}
remotes={remotesOf[n.repo.root] ?? []}
remote={shownRemoteOf(n.repo)}
onRemote={(remote) => edit(n.repo.root, { remote })}
target={edits[n.repo.root]?.target ?? targetOf(n.repo)}
onTarget={(target) => edit(n.repo.root, { target })}
changed={pushOperation(choiceOf(n.repo, null)).op === "pushBranch"}
onEnter={() => {
if (picked.length) void push();
}}
<PushReview
diff={diff}
onClose={closeDiff}
commits={
<div className={styles.pushTreeWrap}>
{error ? (
<div className={styles.error}>{error}</div>
) : !repos ? (
<div className={styles.empty}>
<Spinner size={14} />
</div>
) : (
<Tree<PushNode>
roots={nodes}
getKey={(n) => n.key}
getLabel={(n) => (n.commit ? n.commit.summary : repoName(n.repo.root))}
getChildren={(n) => n.children}
isExpandable={(n) => !!n.children?.length}
expanded={expanded}
onExpandedChange={(_next, node, open) =>
setExpanded((e) => {
const s = new Set(e);
if (open) s.add(node.key);
else s.delete(node.key);
return s;
})
}
selected={new Set(shown ? [shown.key] : [])}
multiSelect={false}
onSelectionChange={(_sel, lead) => setShown(lead)}
rowHeight={rowHeight}
aria-label="Outgoing commits"
className={styles.boxList}
empty={
<span>
<T>Everything is up to date</T>
</span>
}
renderNode={(n) =>
n.commit ? (
<PushCommitSubject commit={n.commit} />
) : (
<span
className={styles.pushRepoRow}
data-idle={hasNothingToPush(n.repo) || undefined}
// A row click toggles the checkbox, like before; only the chevron collapses.
onClick={(e) => {
if (only === undefined && !(e.target as HTMLElement | null)?.closest?.("label"))
toggle(n.repo.root);
}}
>
{only === undefined ? (
<Checkbox
checked={checked.has(n.repo.root)}
onChange={() => toggle(n.repo.root)}
className={styles.pushRepoName}
label={
<span className={styles.pushRepoLabel} title={repoName(n.repo.root)}>
{repoName(n.repo.root)}
</span>
}
/>
{!n.repo.branch.upstream && (
<span className={styles.commitMeta}>{tx("new remote branch")}</span>
)}
) : (
<span className={styles.pushRepoLabel} title={repoName(n.repo.root)}>
{repoName(n.repo.root)}
</span>
)}
<span className={styles.pushSourceBranch} title={n.repo.branch.head ?? undefined}>
{n.repo.branch.head}
</span>
)
}
/>
)}
</div>
</SplitPanel>
<SplitHandle />
<SplitPanel id="changes" minSize="240px" className={styles.pushSplitPanel}>
{shownRepo && (
<PushChanges
key={pushChangesKey(shownRepo.root, shownCommits)}
repo={shownRepo.root}
commits={shownCommits}
onSelectFile={showDiff}
<span className={styles.pushRowSeparator} aria-hidden>
→
</span>
<PushRowTarget
name={repoName(n.repo.root)}
remotes={remotesOf[n.repo.root] ?? []}
remote={shownRemoteOf(n.repo)}
onRemote={(remote) => edit(n.repo.root, { remote })}
target={edits[n.repo.root]?.target ?? targetOf(n.repo)}
onTarget={(target) => edit(n.repo.root, { target })}
changed={pushOperation(choiceOf(n.repo, null)).op === "pushBranch"}
onEnter={() => {
if (picked.length) void push();
}}
/>
{!n.repo.branch.upstream && (
<span className={styles.pushSourceBranch} title={tx("new remote branch")}>
{tx("new remote branch")}
</span>
)}
</span>
)
}
/>
)}
</SplitPanel>
</SplitGroup>
</PushDiffSplit>
</div>
}
changes={
shownRepo && (
<PushChanges
key={pushChangesKey(shownRepo.root, shownCommits)}
repo={shownRepo.root}
commits={shownCommits}
onSelectFile={showDiff}
/>
)
}
/>
</Dialog>
);
}
@@ -583,7 +587,11 @@ function PushRowTarget(props: {
options={props.remotes.map((r) => ({ value: r, label: r }))}
/>
) : (
props.remote && <span className={styles.commitMeta}>{props.remote}</span>
props.remote && (
<span className={styles.pushRemoteName} title={props.remote}>
{props.remote}
</span>
)
)}
{props.remote && <span className={styles.pushRowSeparator}>/</span>}
<Input
@@ -744,14 +752,7 @@ function PushDialog({ target: pushTarget, onClose }: { target: PushTarget; onClo
aria-label="Outgoing commits"
className={styles.boxList}
empty={<span>{upstream ? tx("Everything is up to date") : tx("No commits")}</span>}
renderItem={(c) => (
<span className={styles.commitRow} style={{ flex: 1, padding: 0 }}>
<span className={styles.commitHash}>{c.shortId}</span>
<span className={styles.commitSubject}>{c.summary}</span>
<span className={styles.commitMeta}>{c.author}</span>
<span className={styles.commitMeta}>{formatTime(c.timeMs)}</span>
</span>
)}
renderItem={(c) => <PushCommitSubject commit={c} />}
/>
)}
</div>
@@ -762,11 +763,13 @@ function PushDialog({ target: pushTarget, onClose }: { target: PushTarget; onClo
title={head ? tx`Push Commits to ${upstream ?? "remote"}` : "Push"}
onClose={onClose}
width={commits?.length ? PUSH_DIALOG_WIDTH : 620}
minWidth={PUSH_DIALOG_MIN_WIDTH}
minHeight={340}
maxHeight={PUSH_DIALOG_MAX_HEIGHT}
className={styles.pushDialog}
resizable="both"
footerStart={
<>
<div className={styles.pushOptions}>
<span title={protectedTarget ? `Force push to protected branch '${target}' is prohibited` : undefined}>
<Checkbox
checked={force && !protectedTarget}
@@ -785,7 +788,7 @@ function PushDialog({ target: pushTarget, onClose }: { target: PushTarget; onClo
/>
)}
{!explicit && !retarget && !remoteChanged && (
<>
<span className={styles.pushTagOptions}>
<Checkbox checked={pushTags} onChange={setPushTags} label="Push tags:" />
<Select<PushTags>
value={tagsMode}
@@ -797,9 +800,9 @@ function PushDialog({ target: pushTarget, onClose }: { target: PushTarget; onClo
{ value: "currentBranch", label: "Current Branch" },
]}
/>
</>
</span>
)}
</>
</div>
}
buttons={[
{
@@ -812,45 +815,62 @@ function PushDialog({ target: pushTarget, onClose }: { target: PushTarget; onClo
{ label: "Cancel", role: "cancel" },
]}
>
<div className={styles.section}>
{!head
? tx("HEAD is detached; check out a branch to push.")
: trackedBranch
? `${head}${revision ? ` up to ${revision.slice(0, 8)}` : ""} → ${remote ?? trackedRemote ?? ""}/`
: revision
? tx`${head} has no upstream: commits up to ${revision.slice(0, 8)} will be pushed as a new branch:`
: tx`${head} has no upstream: it will be pushed as a new branch and tracked:`}
{head && remotes.length > 1 && (
<Select<string>
value={remote ?? ""}
aria-label="Remote"
onChange={setRemote}
options={remotes.map((r) => ({ value: r, label: r }))}
/>
)}
<div className={styles.pushTargetBar}>
<span className={styles.pushTargetSource}>
{!head
? tx("HEAD is detached; check out a branch to push.")
: trackedBranch
? `${head}${revision ? ` up to ${revision.slice(0, 8)}` : ""} →`
: revision
? tx`${head} has no upstream: commits up to ${revision.slice(0, 8)} will be pushed as a new branch:`
: tx`${head} has no upstream: it will be pushed as a new branch and tracked:`}
</span>
{head && (
<TargetBranchInput value={targetName} onChange={setTargetName} branches={remoteBranchNames} remote={remote} />
<div className={styles.pushTargetControls}>
{remotes.length > 1 ? (
<Select<string>
value={remote ?? ""}
aria-label="Remote"
onChange={setRemote}
options={remotes.map((r) => ({ value: r, label: r }))}
/>
) : (
remote && (
<span className={styles.pushRemoteName} title={remote}>
{remote}
</span>
)
)}
{remote && (
<span className={styles.pushRowSeparator} aria-hidden>
/
</span>
)}
<TargetBranchInput
value={targetName}
onChange={setTargetName}
branches={remoteBranchNames}
remote={remote}
/>
{retarget && !remoteBranchNames.includes(edited) && <span className={styles.hint}>{tx("New")}</span>}
</div>
)}
{retarget && !remoteBranchNames.includes(edited) && <span className={styles.hint}> {tx("New")}</span>}
</div>
{commits?.length && !error ? (
<PushDiffSplit diff={diff} onClose={closeDiff}>
<SplitGroup orientation="horizontal" storageKey={PUSH_SPLIT_KEY} className={styles.pushSides}>
<SplitPanel id="commits" minSize="240px" defaultSize="50%" className={styles.pushSplitPanel}>
{commitList}
</SplitPanel>
<SplitHandle />
<SplitPanel id="changes" minSize="240px" className={styles.pushSplitPanel}>
<PushChanges
key={pushChangesKey(repo, shownCommits)}
repo={repo}
commits={shownCommits}
onShowAll={shownCommit >= 0 && commits.length > 1 ? () => setShownCommit(-1) : undefined}
onSelectFile={showDiff}
/>
</SplitPanel>
</SplitGroup>
</PushDiffSplit>
<PushReview
diff={diff}
onClose={closeDiff}
commits={commitList}
changes={
<PushChanges
key={pushChangesKey(repo, shownCommits)}
repo={repo}
commits={shownCommits}
onShowAll={shownCommit >= 0 && commits.length > 1 ? () => setShownCommit(-1) : undefined}
onSelectFile={showDiff}
/>
}
/>
) : (
commitList
)}
+3 -1
View File
@@ -2738,5 +2738,7 @@
"{count} hover actions": "{count} hover actions",
"{description}; JVM options: {flags}": "{description}; JVM options: {flags}",
"Sorting Options": "Sorting Options",
"Sort by Duration": "Sort by Duration"
"Sort by Duration": "Sort by Duration",
"Resize left merge pane": "Resize left merge pane",
"Resize right merge pane": "Resize right merge pane"
}
+3 -1
View File
@@ -9108,5 +9108,7 @@
"{count} hover actions": "{count} 个悬停操作",
"{description}; JVM options: {flags}": "{description};JVM 选项:{flags}",
"Sorting Options": "排序选项",
"Sort by Duration": "按持续时间排序"
"Sort by Duration": "按持续时间排序",
"Resize left merge pane": "调整左侧合并窗格宽度",
"Resize right merge pane": "调整右侧合并窗格宽度"
}