дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-23 01:50:45 +02:00
Порівняти коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
bd7613e149 | ||
|
|
76d67145f5 | ||
|
|
cf4273eeea |
No files matched your search
Створено
+4
-4
@@ -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
@@ -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 }) => {
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Заблокувати користувача