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

..
Автор SHA1 Повідомлення Дата
l0ng-ai b88aa70aff fix(run): keep configuration names distinct in gutter menus 2026-11-23 00:46:20 +08:00
11 змінених файлів з 124 додано та 38 видалено

No files matched your search

Створено
+4 -4
Переглянути файл
@@ -2361,9 +2361,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "form_urlencoded"
version = "1.2.3"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
dependencies = [
"percent-encoding",
]
@@ -10827,9 +10827,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
version = "2.5.9"
version = "2.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
dependencies = [
"form_urlencoded",
"idna",
+63
Переглянути файл
@@ -0,0 +1,63 @@
import { expect, ipcCalls, stubDesktop, test } from "./fixtures";
const prefix = "reconcile-regional-inventory-and-rebuild-order-settlement-cache-for-warehouse-";
const east = prefix + "east-stage";
const west = prefix + "west-stage";
const content = JSON.stringify(
{ name: "warehouse-tools", scripts: { [east]: "node east.js", [west]: "node west.js", build: "node build.js" } },
null,
2,
);
test("the npm gutter keeps distinct ends of long names and runs the selected script", async ({ workbench: page }) => {
await page.setViewportSize({ width: 440, height: 520 });
await stubDesktop(page);
await page.evaluate(async (text) => {
const backendPath = "/src/editor/core/backend.ts";
const servicePath = "/src/workbench/contributions.ts";
const { docBackend } = await import(/* @vite-ignore */ backendPath);
const { editorService } = await import(/* @vite-ignore */ servicePath);
const path = "/dev/acme-api/package.json";
docBackend().files.set(path, text);
const handlers = window.__ipc.handlers;
handlers.fs_probe = () => ({ size: text.length, binary: false, tooLarge: false });
handlers.fs_read_text = ({ path }) => docBackend().files.get(String(path)) ?? "";
handlers.fs_read_dir = () => [];
handlers.run_configs = () => [];
handlers.run_start = ({ config }) => ({
id: 7,
configId: (config as { id: string }).id,
name: (config as { name: string }).name,
pid: 4242,
running: true,
pty: false,
});
await editorService().openFile(path);
}, content);
const editor = page.locator(".cm-editor");
const menu = page.getByRole("menu", { name: "Context menu" });
for (const name of [east, west]) {
await editor.getByTitle("Run '" + name + "'", { exact: true }).click();
const label = "Run 'npm run " + name + "'";
const run = menu.getByRole("menuitem", { name: label, exact: true });
const end = run.getByText(label.slice(-12), { exact: true });
await expect(end).toBeVisible();
await expect(end.locator("..")).toHaveAttribute("title", label);
expect(await end.evaluate((node) => node.clientWidth >= node.scrollWidth)).toBe(true);
const start = end.locator("..").locator(":scope > span").first();
expect(await start.evaluate((node) => node.clientWidth < node.scrollWidth)).toBe(true);
await expect(start).toHaveCSS("text-overflow", "ellipsis");
const titleUnderPointer = await start.evaluate((node) => {
const { x, y, width, height } = node.getBoundingClientRect();
return document.elementFromPoint(x + width / 2, y + height / 2)?.getAttribute("title");
});
expect(titleUnderPointer).toBe(label);
await expect(run).toBeFocused();
if (name === east) await run.press("Escape");
else await run.press("Enter");
await expect(menu).toBeHidden();
}
await expect
.poll(async () => ipcCalls(page, "run_start"))
.toMatchObject([{ config: { args: ["run", west], kind: "npm" } }]);
});
+2 -2
Переглянути файл
@@ -26,12 +26,12 @@ describe("the Language smoke workflow", () => {
const { files, problems } = await smokeInputs(repo, workflow);
expect(problems).toEqual([]);
expect(describeUnselected(await unselected(workflow, [...files.keys()]), files)).toBe("");
}, 20000);
});
it("runs every language when a crate the smoke runs changes", async () => {
const crates = rustSmokeInputs(repo);
expect(describeUnselected(await unselected(workflow, [...crates.keys()]), crates)).toBe("");
}, 20000);
});
});
const dirs: string[] = [];
+1
Переглянути файл
@@ -262,6 +262,7 @@ export function choiceItems(choices: readonly Produced[], debug: boolean): MenuI
{ kind: "header", label: debug ? "Choose configuration to debug" : "Choose configuration to run" },
...choices.map((p): MenuItem => ({
label: debug ? tx`Debug '${p.name}'` : tx`Run '${p.name}'`,
preserveLabelEnd: true,
verbatim: true,
icon: debug ? "debug" : "run",
shortcut: p.detail,
+2
Переглянути файл
@@ -82,6 +82,7 @@ async function profileMenu(entry: ScriptEntry, path: string): Promise<MenuItem[]
return [
{
label: tx`Run '${config.name}'`,
preserveLabelEnd: true,
icon: "run",
shortcut: shortcutLabel("run.runContext"),
run: () =>
@@ -91,6 +92,7 @@ async function profileMenu(entry: ScriptEntry, path: string): Promise<MenuItem[]
},
{
label: tx`Debug '${config.name}'`,
preserveLabelEnd: true,
icon: "debug",
shortcut: shortcutLabel("run.debugContext"),
run: () => void executeAction("run.debugConfig", config),
+2
Переглянути файл
@@ -283,6 +283,7 @@ export async function scriptMenuItems(entry: ScriptEntry, path: string, content:
return [
{
label: tx`Run '${label}'`,
preserveLabelEnd: true,
icon: "run",
shortcut: shortcutLabel("run.runContext"),
run: () =>
@@ -292,6 +293,7 @@ export async function scriptMenuItems(entry: ScriptEntry, path: string, content:
},
{
label: tx`Debug '${label}'`,
preserveLabelEnd: true,
icon: "debug",
shortcut: shortcutLabel("run.debugContext"),
run: () => void executeAction("run.debugConfig", config),
+8 -1
Переглянути файл
@@ -109,11 +109,18 @@ export function targetMenuItems(target: RunTarget, path: string, content: string
: { run: () => void launch(target, path, debug, content) };
const debuggable = !p || canDebugProduced(p);
return [
{ label: tx`Run '${name}'`, icon: "run", shortcut: shortcutLabel("run.runContext"), ...pick(false) } as MenuItem,
{
label: tx`Run '${name}'`,
preserveLabelEnd: true,
icon: "run",
shortcut: shortcutLabel("run.runContext"),
...pick(false),
} as MenuItem,
...(debuggable
? [
{
label: tx`Debug '${name}'`,
preserveLabelEnd: true,
icon: "debug",
shortcut: shortcutLabel("run.debugContext"),
...pick(true),
+5 -6
Переглянути файл
@@ -703,16 +703,15 @@
padding-top: 10px;
border-top: 1px solid var(--border);
}
.detailRefGroup {
display: flex;
.meta .refs {
margin-left: 0;
max-width: none;
flex-wrap: wrap;
gap: var(--space-0-5) var(--space-2);
}
.detailRefGroup .ref {
align-items: baseline;
font-size: inherit;
.meta .ref {
max-width: 100%;
white-space: normal;
overflow-wrap: anywhere;
}
.hash {
font-family: var(--font-mono);
+8 -23
Переглянути файл
@@ -7,7 +7,7 @@ import { CommitMessageContent } from "../CommitMessageContent";
import styles from "../GitLog.module.css";
import { IssueText } from "../issueLinks";
import { useCommitDetails } from "../logDetails";
import { refLabels, type RefLabel } from "../logOptions";
import { refLabels } from "../logOptions";
import { goToRef } from "../logStore";
import { commitRepo } from "../multiRoot";
import { currentRepo } from "../store";
@@ -34,18 +34,9 @@ export function RefLabels({
remoteNames?: ReadonlySet<string>;
left?: boolean;
}) {
const labels = refLabels(refs, { compact, tagNames }, remoteNames);
return (
<RefGroup
labels={refLabels(refs, { compact, tagNames }, remoteNames)}
className={clsx(styles.refs, compact && styles.refsCompact, left && styles.refsLeft)}
/>
);
}
function RefGroup({ labels, className }: { labels: RefLabel[]; className: string | undefined }) {
if (!labels.length) return null;
return (
<span className={className}>
<span className={clsx(styles.refs, compact && styles.refsCompact, left && styles.refsLeft)}>
{labels.map((l) => (
<span key={`${l.kind}:${l.title}`} className={clsx(styles.ref, REF_KIND_CLASS[l.kind])} title={l.title}>
{l.text && <span className={styles.refText}>{l.text}</span>}
@@ -55,16 +46,6 @@ function RefGroup({ labels, className }: { labels: RefLabel[]; className: string
);
}
function CommitReferences({ refs }: { refs: string[] }) {
const labels = refLabels(refs, { compact: false, tagNames: true }, NO_REMOTES);
return (
<div className={styles.meta}>
<RefGroup labels={labels.filter((label) => label.kind !== "tag")} className={styles.detailRefGroup} />
<RefGroup labels={labels.filter((label) => label.kind === "tag")} className={styles.detailRefGroup} />
</div>
);
}
/** A commit's message and metadata; `compact` (one of several selected): without the body. */
export function CommitMessage({ commit, compact = false }: { commit: Commit; compact?: boolean }) {
const { details, error } = useCommitDetails(commit, !compact);
@@ -110,7 +91,11 @@ export function CommitMessage({ commit, compact = false }: { commit: Commit; com
))}
</div>
)}
{commit.refs.length > 0 && <CommitReferences refs={commit.refs} />}
{commit.refs.length > 0 && (
<div className={styles.meta}>
<RefLabels refs={commit.refs} />
</div>
)}
{details && (
<>
<div className={styles.meta}>
+14
Переглянути файл
@@ -79,6 +79,20 @@
overflow: hidden;
text-overflow: ellipsis;
}
.splitLabel {
display: flex;
}
.labelStart,
.labelEnd {
min-width: 0;
overflow: hidden;
pointer-events: none;
text-overflow: ellipsis;
}
.labelEnd {
flex: none;
max-width: 50%;
}
.shortcut {
min-width: 0;
max-width: 50%;
+15 -2
Переглянути файл
@@ -43,6 +43,8 @@ export type MenuItem =
label: string;
/** User text (e.g. a past query): shown as is, never looked up in the catalog. */
verbatim?: boolean;
/** Keep the end of a long label visible when the menu has to truncate it. */
preserveLabelEnd?: boolean;
icon?: IconName | (string & {});
shortcut?: string;
disabled?: boolean;
@@ -67,6 +69,7 @@ interface Resolved {
kind: "item" | "separator" | "header" | "title";
key: string;
label: string;
preserveLabelEnd?: boolean;
icon?: string;
shortcut?: string;
disabled?: boolean;
@@ -387,6 +390,8 @@ export function MenuList({
</div>
);
const hasSub = !!r.submenu;
const characters = r.preserveLabelEnd ? Array.from(r.label) : [];
const split = characters.length > 24 ? characters.length - 12 : 0;
return (
<Fragment key={r.key}>
<button
@@ -395,6 +400,7 @@ export function MenuList({
}}
type="button"
role={r.checked !== undefined ? "menuitemcheckbox" : "menuitem"}
aria-label={split ? r.label : undefined}
aria-checked={r.checked}
aria-current={r.current || undefined}
aria-disabled={r.disabled || undefined}
@@ -427,8 +433,15 @@ export function MenuList({
{r.checked ? <Icon name="check" size={13} /> : r.icon ? <Icon name={r.icon} size={14} /> : null}
</span>
)}
<span className={styles.label} title={r.hint ? undefined : r.label}>
{r.label}
<span className={clsx(styles.label, split > 0 && styles.splitLabel)} title={r.hint ? undefined : r.label}>
{split ? (
<>
<span className={styles.labelStart}>{characters.slice(0, split).join("")}</span>
<span className={styles.labelEnd}>{characters.slice(split).join("")}</span>
</>
) : (
r.label
)}
</span>
{r.shortcut && (
<span className={styles.shortcut} title={r.shortcut}>