Compare commits

...
Author SHA1 Message Date
l0ng-ai bd7613e149 fix(vcs): show readable commit message history previews 2026-11-23 02:31:15 +08:00
Charlie.Weiandcharli117 76d67145f5 test(smoke): give the language-smoke closure tests a 20s timeout (#5240)
The two Language smoke workflow tests compute the repo-wide import closure and crate tree. On a CI runner running the whole suite they took longer than vitest's default 5 s and failed the Frontend job on main.

Co-authored-by: charli117 <[email protected]>
2026-11-23 01:13:43 +08:00
Charlie.Weiandcharli117 cf4273eeea chore(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (#5237)
url 2.5.8 overflows the stack in Url::origin() on nested blob: URLs (RUSTSEC-2026-0592), which failed Cargo deny on main. 2.5.9 fixes it; form_urlencoded moves to 1.2.3 with it. The rest of the lockfile stays as on main.

Co-authored-by: charli117 <[email protected]>
2026-11-23 01:13:33 +08:00
6 changed files with 89 additions and 35 deletions

No files matched your search

Generated
+4 -4
View File
@@ -2361,9 +2361,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "form_urlencoded"
version = "1.2.2"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
dependencies = [
"percent-encoding",
]
@@ -10827,9 +10827,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
version = "2.5.8"
version = "2.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
dependencies = [
"form_urlencoded",
"idna",
+34 -10
View File
@@ -1024,27 +1024,51 @@ test("the Commit tool window restores the draft and author options for the inclu
await expect(message).toHaveValue("Default draft");
});
test("commit message history opens above the message without an empty icon column", async ({ workbench: page }) => {
test("commit message history shows compact message previews above the editor", async ({ workbench: page }) => {
await page.emulateMedia({ reducedMotion: "reduce" });
await stubRepository(page);
await page.keyboard.press("Meta+k");
const message = page.getByRole("textbox", { name: "Commit message" });
await expect(message).toBeVisible();
await page.evaluate((root) => {
localStorage.setItem(`openidea.vcs.commitMessages:${root}`, JSON.stringify(["Previous commit message"]));
localStorage.setItem(
`openidea.vcs.commitMessages:${root}`,
JSON.stringify([
"Update inventory\n\nReview settlement totals",
"Update inventory\n\nReconcile export records",
...Array.from({ length: 7 }, (_, index) => `Earlier message ${index + 1}`),
]),
);
}, ROOT);
await message.fill("Draft");
await page.getByRole("button", { name: "Commit Message History" }).click();
const history = page.getByRole("button", { name: "Commit Message History" });
await history.click();
const menu = page.getByRole("menu", { name: "Recent commit messages" });
const row = menu.getByRole("menuitem", { name: "Previous commit message" });
const row = menu.getByRole("menuitem", { name: /Update inventory.*Review settlement totals/ });
await expect(row).toBeVisible();
const messageBox = await message.boundingBox();
const menuBox = await menu.locator("..").boundingBox();
expect(messageBox).not.toBeNull();
expect(menuBox).not.toBeNull();
expect(menuBox!.y + menuBox!.height).toBeLessThan(messageBox!.y);
expect(Math.abs(menuBox!.x - messageBox!.x)).toBeLessThan(2);
const messageBox = (await message.boundingBox())!;
const menuBox = (await menu.locator("..").boundingBox())!;
const rowBox = (await row.boundingBox())!;
expect(messageBox.y - menuBox.y - menuBox.height).toBeCloseTo(3, 0);
expect(Math.abs(menuBox.x - messageBox.x)).toBeLessThan(2);
expect(menuBox.height).toBeLessThan(rowBox.height * 8);
await expect(row).toHaveCSS("font-family", await message.evaluate((el) => getComputedStyle(el).fontFamily));
await expect(row).toHaveCSS("font-size", await message.evaluate((el) => getComputedStyle(el).fontSize));
await expect(row.locator("span")).toHaveCount(1);
await row.press("Escape");
await expect(menu).toBeHidden();
await expect(message).toHaveValue("Draft");
await history.click();
await row.press("Home");
await expect(row).toBeFocused();
await page.keyboard.press("ArrowDown");
const second = menu.getByRole("menuitem", { name: /Update inventory.*Reconcile export records/ });
await expect(second).toBeFocused();
await page.keyboard.press("Enter");
await expect(message).toHaveValue("Update inventory\n\nReconcile export records");
await expect(message).toBeFocused();
});
test("Amend shows the original author and warns when the committer differs", async ({ workbench: page }) => {
+2 -2
View File
@@ -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[] = [];
+16
View File
@@ -134,6 +134,22 @@
gap: var(--space-0-5) var(--space-1);
padding: var(--space-0-5) 6px var(--space-0-5) 12px;
}
.messageHistory {
--history-row-height: max(var(--h-list-row), calc(1em + var(--space-2)));
min-width: min(180px, calc(100vw - var(--space-3)));
max-height: calc(7 * var(--history-row-height) + var(--space-2) + 2px);
padding-block: var(--space-1);
overflow-x: hidden;
}
.messageHistory [role="menu"] {
max-width: calc(var(--history-columns) + var(--space-4) + var(--space-2));
font-size: inherit;
}
.messageHistory [role="menuitem"] {
height: var(--history-row-height);
margin-inline: var(--space-1);
padding-inline: var(--space-2);
}
.amendTarget {
min-width: 0;
max-width: 112px;
+32 -19
View File
@@ -29,7 +29,8 @@ import {
EmptyState,
Icon,
IconButton,
Menu,
MenuList,
Popup,
Spinner,
SplitGroup,
SplitHandle,
@@ -1374,7 +1375,6 @@ export function CommitMessageField({
const amend = useCommit((s) => s.amend);
const focusTick = useCommit((s) => s.focusTick);
const ref = useRef<HTMLTextAreaElement>(null);
const barRef = useRef<HTMLDivElement>(null);
const [historyOpen, setHistoryOpen] = useState(false);
const historyTick = useCommit((s) => s.historyTick);
const { emptyError } = runner;
@@ -1393,6 +1393,11 @@ export function CommitMessageField({
const cfg = useWorkflowSettings((s) => s.vcs.commit);
const editor = useProject((s) => s.settings?.editor);
const { family, size } = resolveMonoFont(undefined, editor);
const messageFont = {
fontFamily: family,
fontSize: size,
fontWeight: fontWeightOf(editor?.fontWeight, 400),
};
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"));
@@ -1402,7 +1407,7 @@ export function CommitMessageField({
return (
<>
<div ref={barRef} className={styles.commitBar}>
<div className={styles.commitBar}>
<Checkbox checked={amend} onChange={(v) => void setAmend(v)} label="Amend" />
{chooseAmendTarget && amendRoot && <AmendTargetMenu root={amendRoot} />}
<IconButton
@@ -1414,22 +1419,32 @@ export function CommitMessageField({
aria-expanded={historyOpen}
onClick={() => setHistoryOpen((o) => !o)}
/>
<Menu
<Popup
open={historyOpen}
onClose={() => setHistoryOpen(false)}
anchor={barRef}
anchor={ref}
placement="top-start"
iconColumn={false}
aria-label="Recent commit messages"
items={history.map((m, i) => ({
id: `h${i}`,
label: m.split("\n")[0]!.slice(0, 80),
run: () => {
useCommit.setState({ message: m });
ref.current?.focus();
},
}))}
/>
offset={3}
role="presentation"
autoFocus={false}
className={styles.messageHistory}
style={{ ...messageFont, ["--history-columns" as string]: `${cfg.subjectLimit}ch` }}
>
<MenuList
onDone={() => setHistoryOpen(false)}
iconColumn={false}
aria-label={tx("Recent commit messages")}
items={history.map((m, i) => ({
id: `h${i}`,
label: m.replace(/\r\n?|\n/g, " ⏎ "),
verbatim: true,
run: () => {
useCommit.setState({ message: m });
ref.current?.focus();
},
}))}
/>
</Popup>
<CommitMessageActions />
<span className={styles.grow} />
{tooLong && (
@@ -1445,9 +1460,7 @@ export function CommitMessageField({
aria-invalid={emptyError || undefined}
style={{
["--guide" as string]: `${margin}ch`,
fontFamily: family,
fontSize: size,
fontWeight: fontWeightOf(editor?.fontWeight, 400),
...messageFont,
lineHeight: editor?.lineHeight ? `${editor.lineHeight}px` : undefined,
}}
value={message}
+1
View File
@@ -28,6 +28,7 @@
"The Git operation changed. Review the current changes and try again.": "The Git operation changed. Review the current changes and try again.",
"Git operation has no current commit": "Git operation has no current commit",
"Invalid commit message": "Invalid commit message",
"Recent commit messages": "Recent commit messages",
"Invalid commit message file path": "Invalid commit message file path",
"Review staged changes": "Review staged changes",
"Commit and Continue": "Commit and Continue",