дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-25 10:54:44 +02:00
Порівняти коміти
1
Коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
9c7704663b |
No files matched your search
@@ -1,36 +0,0 @@
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
test("dirty settings keep scope labels and navigation inside the page header", async ({ workbench: page }) => {
|
||||
await page.keyboard.press("Meta+,");
|
||||
await expect(page.getByRole("dialog", { name: "Settings", exact: true })).toBeVisible();
|
||||
await page.evaluate(async () => {
|
||||
const path = "/src/features/settings/model/staging.ts";
|
||||
const { selectPage, stage } = await import(/* @vite-ignore */ path);
|
||||
stage("languages.node", "project", "languages.node.interpreter", "/custom/node");
|
||||
selectPage("languages.node");
|
||||
});
|
||||
const scope = page.getByRole("radiogroup", { name: "Settings scope" });
|
||||
const reset = page.getByRole("button", { name: "Reset", exact: true });
|
||||
await expect(reset).toBeVisible();
|
||||
for (const width of [1000, 640, 520]) {
|
||||
await page.setViewportSize({ width, height: 760 });
|
||||
const fits = await scope.evaluate((scope) => {
|
||||
const header = scope.parentElement!;
|
||||
const bounds = header.getBoundingClientRect();
|
||||
return [...header.querySelectorAll("button")].every((button) => {
|
||||
const box = button.getBoundingClientRect();
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(button);
|
||||
return (
|
||||
box.left >= bounds.left &&
|
||||
box.right <= bounds.right &&
|
||||
[...range.getClientRects()].every((r) => r.top >= box.top - 1 && r.bottom <= box.bottom + 1)
|
||||
);
|
||||
});
|
||||
});
|
||||
expect(fits).toBe(true);
|
||||
}
|
||||
await reset.click();
|
||||
await expect(reset).toHaveCount(0);
|
||||
await expect(scope.getByRole("radio", { name: "This project" })).toBeVisible();
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
for (const kind of ["external", "ssh", "target"] as const) {
|
||||
test(`${kind} settings keep long names and details inside their selection row`, async ({ workbench: page }) => {
|
||||
await page.keyboard.press("Meta+,");
|
||||
await expect(page.getByRole("dialog", { name: "Settings", exact: true })).toBeVisible();
|
||||
await page.evaluate(async (kind) => {
|
||||
const path = "/src/features/settings/model/staging.ts";
|
||||
const { selectPage, stage } = await import(/* @vite-ignore */ path);
|
||||
const remotePath = "/src/platform/remoteSettings.ts";
|
||||
const workflowPath = "/src/platform/workflowSettings.ts";
|
||||
const { DEFAULT_SSH_CONFIG, DEFAULT_RUN_TARGET } = await import(/* @vite-ignore */ remotePath);
|
||||
const { DEFAULT_EXTERNAL_TOOL } = await import(/* @vite-ignore */ workflowPath);
|
||||
const name = "Run integration tests for the current project with the configured environment";
|
||||
const detail = "Shared infrastructure for the staging environment";
|
||||
if (kind === "external") {
|
||||
stage("tools.externalTools", "global", "externalTools", [
|
||||
{ ...DEFAULT_EXTERNAL_TOOL, id: "qa", name, group: detail },
|
||||
]);
|
||||
selectPage("tools.externalTools");
|
||||
} else if (kind === "ssh") {
|
||||
stage("tools.sshConfigurations", "global", "ssh.configs", [
|
||||
{ ...DEFAULT_SSH_CONFIG, id: "qa", name, host: detail, user: "qa" },
|
||||
]);
|
||||
selectPage("tools.sshConfigurations");
|
||||
} else {
|
||||
stage("build.runTargets", "global", "runTargets", [
|
||||
{ ...DEFAULT_RUN_TARGET, id: "qa", name, kind: "docker", image: detail },
|
||||
]);
|
||||
selectPage("build.runTargets");
|
||||
}
|
||||
}, kind);
|
||||
const row = page.getByRole("dialog", { name: "Settings", exact: true }).getByRole("option").first();
|
||||
await expect(row).toBeVisible();
|
||||
for (const width of [1000, 640, 520]) {
|
||||
await page.setViewportSize({ width, height: 760 });
|
||||
const fits = await row.evaluate((row) => {
|
||||
const box = row.getBoundingClientRect();
|
||||
return [...row.querySelectorAll(":scope > span")].every((span) => {
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(span);
|
||||
return [...range.getClientRects()].every((r) => r.top >= box.top - 1 && r.bottom <= box.bottom + 1);
|
||||
});
|
||||
});
|
||||
expect(fits).toBe(true);
|
||||
}
|
||||
await expect(row.locator(":scope > span").first()).toHaveAttribute(
|
||||
"title",
|
||||
"Run integration tests for the current project with the configured environment",
|
||||
);
|
||||
await page.evaluate(async (kind) => {
|
||||
const path = "/src/features/settings/model/staging.ts";
|
||||
const { stage } = await import(/* @vite-ignore */ path);
|
||||
const [id, key] =
|
||||
kind === "external"
|
||||
? ["tools.externalTools", "externalTools"]
|
||||
: kind === "ssh"
|
||||
? ["tools.sshConfigurations", "ssh.configs"]
|
||||
: ["build.runTargets", "runTargets"];
|
||||
stage(id, "global", key, []);
|
||||
}, kind);
|
||||
const empty = page.getByRole("dialog", { name: "Settings", exact: true }).getByRole("listbox");
|
||||
await expect(row).toHaveCount(0);
|
||||
const hintFits = await empty.evaluate((list) => {
|
||||
const hint = list.firstElementChild!;
|
||||
const box = hint.getBoundingClientRect();
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(hint);
|
||||
return [...range.getClientRects()].every((r) => r.top >= box.top - 1 && r.bottom <= box.bottom + 1);
|
||||
});
|
||||
expect(hintFits).toBe(true);
|
||||
});
|
||||
}
|
||||
@@ -75,10 +75,9 @@
|
||||
.pageHeader {
|
||||
flex: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-height: 40px;
|
||||
height: 40px;
|
||||
padding: 0 12px 0 20px;
|
||||
}
|
||||
.history {
|
||||
@@ -121,7 +120,6 @@
|
||||
}
|
||||
.scope {
|
||||
display: inline-flex;
|
||||
flex: none;
|
||||
padding: 2px;
|
||||
border-radius: var(--radius-small);
|
||||
box-shadow: inset 0 0 0 1px var(--border-strong);
|
||||
@@ -132,7 +130,6 @@
|
||||
border-radius: 3px;
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-small);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.scopeButton:hover {
|
||||
color: var(--fg-emphasis);
|
||||
|
||||
@@ -166,6 +166,21 @@
|
||||
padding: 0 8px;
|
||||
cursor: default;
|
||||
}
|
||||
.toolRow > span {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.toolName {
|
||||
flex: 1;
|
||||
}
|
||||
.toolRow.empty {
|
||||
height: auto;
|
||||
min-height: var(--h-list-row);
|
||||
padding-block: 4px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.toolRow:hover {
|
||||
background: var(--bg-tree-hover);
|
||||
}
|
||||
@@ -174,6 +189,7 @@
|
||||
background: var(--bg-tree-selected);
|
||||
}
|
||||
.toolGroup {
|
||||
max-width: 45%;
|
||||
color: var(--fg-subtle);
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@@ -491,8 +491,13 @@ function RunTargetsEditor() {
|
||||
className={clsx(styles.toolRow, t.id === selected && styles.toolRowSelected)}
|
||||
onMouseDown={() => setSelected(t.id)}
|
||||
>
|
||||
<span>{t.name || t.id}</span>
|
||||
<span className={styles.toolGroup}>
|
||||
<span className={styles.toolName} title={t.name || t.id}>
|
||||
{t.name || t.id}
|
||||
</span>
|
||||
<span
|
||||
className={styles.toolGroup}
|
||||
title={t.kind === "ssh" ? (t.sshConfig ? sshName(t.sshConfig) : "") : containerSummary(t)}
|
||||
>
|
||||
{t.kind === "ssh" ? (t.sshConfig ? sshName(t.sshConfig) : "") : containerSummary(t)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -339,8 +339,12 @@ function SshConfigsEditor() {
|
||||
className={clsx(styles.toolRow, c.id === selected && styles.toolRowSelected)}
|
||||
onMouseDown={() => setSelected(c.id)}
|
||||
>
|
||||
<span>{c.name.trim() || sshLabel(c) || c.id}</span>
|
||||
<span className={styles.toolGroup}>{sshLabel(c)}</span>
|
||||
<span className={styles.toolName} title={c.name.trim() || sshLabel(c) || c.id}>
|
||||
{c.name.trim() || sshLabel(c) || c.id}
|
||||
</span>
|
||||
<span className={styles.toolGroup} title={sshLabel(c)}>
|
||||
{sshLabel(c)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -480,8 +480,12 @@ function ExternalToolsEditor() {
|
||||
checked={t.enabled}
|
||||
onChange={(on) => setTools(tools.map((x) => (x.id === t.id ? { ...x, enabled: on } : x)))}
|
||||
/>
|
||||
<span>{t.name}</span>
|
||||
<span className={styles.toolGroup}>{t.group}</span>
|
||||
<span className={styles.toolName} title={t.name}>
|
||||
{t.name}
|
||||
</span>
|
||||
<span className={styles.toolGroup} title={t.group}>
|
||||
{t.group}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Заблокувати користувача