дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-21 09:00:49 +02:00
Порівняти коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
572a9b0718 | ||
|
|
7864340a5c |
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
async function openConfigurations(page: Page) {
|
||||
await page.evaluate(async () => {
|
||||
async function openConfigurations(page: Page, target?: string) {
|
||||
await page.evaluate(async (target) => {
|
||||
const path = "/src/features/run/store.ts";
|
||||
const { useRun } = await import(/* @vite-ignore */ path);
|
||||
const base = {
|
||||
@@ -21,6 +21,7 @@ async function openConfigurations(page: Page) {
|
||||
...base,
|
||||
id: "layout:app",
|
||||
name: "Payments development server",
|
||||
target,
|
||||
beforeLaunch: [{ kind: "run", target: "layout:prepare" }],
|
||||
},
|
||||
{ ...base, id: "layout:prepare", name: "Prepare generated sources for the payments development server" },
|
||||
@@ -29,10 +30,31 @@ async function openConfigurations(page: Page) {
|
||||
loaded: true,
|
||||
editorOpen: true,
|
||||
});
|
||||
});
|
||||
}, target);
|
||||
await expect(page.getByRole("dialog", { name: "Run/Debug Configurations", exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
test("long run target names leave room for configuration names in the sidebar", async ({ workbench: page }) => {
|
||||
const target = "payments-development-shared-staging-runner-west";
|
||||
await openConfigurations(page, target);
|
||||
const dialog = page.getByRole("dialog", { name: "Run/Debug Configurations", exact: true });
|
||||
const tree = dialog.getByRole("tree", { name: "Run configurations", exact: true });
|
||||
const row = tree.getByRole("treeitem", { name: /^Payments development server/ });
|
||||
const name = row.getByText("Payments development server", { exact: true });
|
||||
const badge = row.getByText(`@ ${target}`, { exact: true });
|
||||
await expect(badge).toBeVisible();
|
||||
|
||||
for (const width of [1100, 520]) {
|
||||
await page.setViewportSize({ width, height: 820 });
|
||||
await expect.poll(async () => (await name.boundingBox())!.width).toBeGreaterThan(width === 1100 ? 80 : 50);
|
||||
await expect.poll(() => tree.evaluate((el) => el.scrollWidth - el.clientWidth)).toBeLessThanOrEqual(1);
|
||||
}
|
||||
|
||||
await expect(badge).toBeHidden();
|
||||
await expect(row).toHaveAttribute("title", new RegExp(`Payments development server @ ${target}`));
|
||||
await expect(dialog.getByRole("textbox", { name: "Name", exact: true })).toHaveValue("Payments development server");
|
||||
});
|
||||
|
||||
test("run configuration sidebar resizes with mouse and keyboard and remembers the layout", async ({
|
||||
workbench: page,
|
||||
}) => {
|
||||
|
||||
@@ -511,6 +511,7 @@ function EditConfigsDialog() {
|
||||
aria-expanded={!collapsed.has(r.key)}
|
||||
className={styles.editItem}
|
||||
style={{ paddingLeft: 6 }}
|
||||
title={tx(r.label)}
|
||||
onClick={() => toggle(r.key)}
|
||||
onDragOver={(e) => e.preventDefault()}
|
||||
onDrop={(e) => onDrop(e, r.kind, null)}
|
||||
@@ -534,6 +535,7 @@ function EditConfigsDialog() {
|
||||
aria-expanded={!collapsed.has(r.key)}
|
||||
className={clsx(styles.editItem, sel && styles.editItemSelected)}
|
||||
style={{ paddingLeft: 22 }}
|
||||
title={r.name}
|
||||
onClick={() => setSelection({ type: "folder", kind: r.kind, name: r.name })}
|
||||
onDoubleClick={() => toggle(r.key)}
|
||||
onDragOver={(e) => e.preventDefault()}
|
||||
@@ -547,6 +549,9 @@ function EditConfigsDialog() {
|
||||
}
|
||||
const c = r.config;
|
||||
const isTomcat = c.kind === "tomcat";
|
||||
const name = c.name || tx("Unnamed");
|
||||
const target = c.target ? targetName(c, runTargets) : null;
|
||||
const scope = !c.detected && !isTomcat ? (c.local ? "local" : "user") : null;
|
||||
const tomcatNoArtifact =
|
||||
isTomcat &&
|
||||
((c.params?.deployment ?? "artifact") === "artifact"
|
||||
@@ -561,7 +566,9 @@ function EditConfigsDialog() {
|
||||
className={clsx(styles.editItem, current?.id === c.id && styles.editItemSelected)}
|
||||
style={{ paddingLeft: r.depth === 2 ? 50 : 34 }}
|
||||
onClick={() => setSelection({ type: "config", id: c.id })}
|
||||
title={commandLine(c)}
|
||||
title={[name + (target ? ` @ ${target}` : "") + (scope ? ` (${scope})` : ""), commandLine(c)]
|
||||
.filter(Boolean)
|
||||
.join("\n")}
|
||||
draggable
|
||||
onDragStart={(e) => {
|
||||
dragged.current = c.id;
|
||||
@@ -579,11 +586,9 @@ function EditConfigsDialog() {
|
||||
)}
|
||||
</span>
|
||||
<span className={styles.chooserName}>{c.name || <T>Unnamed</T>}</span>
|
||||
{c.target && <span className={styles.chooserMuted}>@ {targetName(c, runTargets)}</span>}
|
||||
{target && <span className={clsx(styles.chooserMuted, styles.editTarget)}>@ {target}</span>}
|
||||
{errorsById[c.id] && <Icon name="error" size={12} className={styles.failed} label="Invalid" />}
|
||||
{!c.detected && !isTomcat && (
|
||||
<span className={styles.chooserMuted}>{c.local ? "local" : "user"}</span>
|
||||
)}
|
||||
{scope && <span className={styles.chooserMuted}>{scope}</span>}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -553,6 +553,7 @@
|
||||
flex: 1;
|
||||
}
|
||||
.editSidebar {
|
||||
container: run-config-navigation / inline-size;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -596,6 +597,22 @@
|
||||
background: var(--bg-selected-strong);
|
||||
color: var(--fg-strong);
|
||||
}
|
||||
.editTarget {
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
max-width: 25%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.editItem .failed {
|
||||
flex: none;
|
||||
}
|
||||
@container run-config-navigation (max-width: 220px) {
|
||||
.editItem .chooserMuted {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.editForm {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -701,6 +718,7 @@
|
||||
}
|
||||
.editGroupName {
|
||||
color: var(--fg-strong);
|
||||
font-weight: 600;
|
||||
}
|
||||
.editEmpty {
|
||||
flex: 1;
|
||||
|
||||
Reference in new issue
Заблокувати користувача