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

...
3 змінених файлів з 72 додано та 32 видалено

No files matched your search

+23
Переглянути файл
@@ -96,3 +96,26 @@ test("Project Structure keeps every details pane usable in a compact window", as
expect((await details.boundingBox())!.width).toBeGreaterThan(200);
}
});
test("Project Structure starts with compact navigation and remembers the divider", async ({ workbench: page }) => {
await page.keyboard.press("Meta+;");
const dialog = page.getByRole("dialog", { name: "Project Structure", exact: true });
const sections = dialog.getByRole("navigation", { name: "Project Structure sections" });
const handle = dialog.getByRole("separator", { name: "Project Structure sections" });
await expect(handle).toBeVisible();
const width = async () => (await sections.boundingBox())!.width;
const initial = await width();
const layout = (await dialog.getByTestId("project-structure-layout").boundingBox())!.width;
expect(initial / layout).toBeCloseTo(0.15, 2);
await handle.press("ArrowRight");
await expect.poll(width).toBeGreaterThan(initial + 10);
const resized = await width();
await dialog.getByRole("button", { name: "Cancel", exact: true }).click();
await expect(dialog).toBeHidden();
await page.keyboard.press("Meta+;");
await expect(handle).toBeVisible();
await expect.poll(width).toBeCloseTo(resized, 0);
await sections.getByRole("button", { name: "Modules", exact: true }).click();
await expect(sections.getByRole("button", { name: "Modules", exact: true })).toHaveAttribute("aria-current", "page");
});
+41 -27
Переглянути файл
@@ -14,6 +14,9 @@ import {
IconButton,
Input,
Select,
SplitGroup,
SplitHandle,
SplitPanel,
Tree,
folderIconName,
showContextMenu,
@@ -2085,32 +2088,43 @@ function ProjectStructureDialogInner() {
>
<PageContext.Provider value={ctx}>
<SettingsFormContext.Provider value={form}>
<div className={styles.psDialogLayout}>
<nav className={styles.psNavSidebar} aria-label={tx("Project Structure sections")} onKeyDown={onNavKeyDown}>
{NAV_GROUPS.map((group) => (
<div key={group.title} className={styles.psNavGroup}>
<div className={styles.psNavGroupHeader}>
<T>{group.title}</T>
<SplitGroup
id="project-structure-layout"
orientation="horizontal"
className={styles.psDialogLayout}
storageKey="openidea.projectStructure.layout"
>
<SplitPanel id="project-structure-sections" defaultSize="15%" minSize="152px" maxSize="45%">
<nav
className={styles.psNavSidebar}
aria-label={tx("Project Structure sections")}
onKeyDown={onNavKeyDown}
>
{NAV_GROUPS.map((group) => (
<div key={group.title} className={styles.psNavGroup}>
<div className={styles.psNavGroupHeader}>
<T>{group.title}</T>
</div>
{group.items.map((item) => (
<button
key={item.id}
type="button"
className={clsx(styles.psNavItem, section === item.id && styles.psNavItemActive)}
aria-current={section === item.id ? "page" : undefined}
onClick={() => selectProjectStructureSection(item.id)}
>
<Icon name={item.icon} size={14} />
<span>
<T>{item.label}</T>
</span>
</button>
))}
</div>
{group.items.map((item) => (
<button
key={item.id}
type="button"
className={clsx(styles.psNavItem, section === item.id && styles.psNavItemActive)}
aria-current={section === item.id ? "page" : undefined}
onClick={() => selectProjectStructureSection(item.id)}
>
<Icon name={item.icon} size={14} />
<span>
<T>{item.label}</T>
</span>
</button>
))}
</div>
))}
</nav>
<div className={styles.psDialogMain}>
))}
</nav>
</SplitPanel>
<SplitHandle aria-label={tx("Project Structure sections")} />
<SplitPanel id="project-structure-details" className={styles.psDialogMain}>
<div className={styles.psDialogHeader}>
<div className={styles.psDialogCrumbs}>
<span>
@@ -2136,8 +2150,8 @@ function ProjectStructureDialogInner() {
{section === "artifacts" && <ArtifactsSection />}
{section === "sdks" && <SdksSection />}
</div>
</div>
</div>
</SplitPanel>
</SplitGroup>
</SettingsFormContext.Provider>
</PageContext.Provider>
</Dialog>
+8 -5
Переглянути файл
@@ -565,12 +565,11 @@
min-width: 0;
}
.psNavSidebar {
flex: none;
width: 196px;
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
min-height: 0;
border-right: 1px solid var(--border);
padding: 8px 0;
overflow-y: auto;
}
@@ -595,8 +594,8 @@
align-items: center;
gap: var(--space-2);
width: 100%;
height: 26px;
padding: 0 14px 0 22px;
min-height: 26px;
padding: 0 var(--space-2) 0 var(--space-4);
border: 0;
background: transparent;
color: var(--fg);
@@ -604,6 +603,10 @@
text-align: left;
cursor: pointer;
}
.psNavItem > span {
min-width: 0;
overflow-wrap: anywhere;
}
.psNavItem:hover {
background: var(--bg-hover);
}