дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
fix(navigation): keep File Structure filters readable
Цей коміт міститься в:
1 джерело
6e2c19846c
коміт
adb8178336
3 files changed
+61
-8
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import { expect, openFromTree, stubDesktop, test } from "./fixtures";
|
||||
|
||||
test("File Structure keeps symbol filters readable at desktop and minimum window widths", async ({
|
||||
workbench: page,
|
||||
}) => {
|
||||
await openFromTree(page, "build.gradle.kts");
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(async () => {
|
||||
const range = { start: { line: 0, col: 0 }, end: { line: 1, col: 1 } };
|
||||
const field = {
|
||||
name: "orderCount",
|
||||
kind: "field",
|
||||
visibility: "private",
|
||||
range,
|
||||
selection_range: range,
|
||||
children: [],
|
||||
};
|
||||
window.__ipc.handlers.doc_outline = () => [
|
||||
{ name: "OrderController", kind: "class", range, selection_range: range, children: [field] },
|
||||
];
|
||||
window.__ipc.handlers.lsp_type_hierarchy = () => [];
|
||||
const path = "/src/platform/actions.ts";
|
||||
const { executeAction } = await import(/* @vite-ignore */ path);
|
||||
await executeAction("navigate.fileStructure");
|
||||
});
|
||||
|
||||
const dialog = page.getByRole("dialog", { name: "File Structure" });
|
||||
const fields = dialog.getByRole("checkbox", { name: "Show fields" });
|
||||
await expect(dialog.getByRole("checkbox", { name: "Show inherited members" })).toBeVisible();
|
||||
for (const width of [400, 1000]) {
|
||||
await page.setViewportSize({ width, height: 600 });
|
||||
const clipped = await dialog.evaluate((element) => {
|
||||
const labels = [...element.querySelectorAll("label")].filter((label) =>
|
||||
label.querySelector('input[type="checkbox"]'),
|
||||
);
|
||||
const row = labels[0]!.parentElement!.getBoundingClientRect();
|
||||
return labels.flatMap((label) => {
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(label);
|
||||
const box = range.getBoundingClientRect();
|
||||
return box.top < row.top - 1 || box.right > row.right + 1 || box.bottom > row.bottom + 1
|
||||
? [label.textContent]
|
||||
: [];
|
||||
});
|
||||
});
|
||||
expect(clipped).toEqual([]);
|
||||
}
|
||||
expect((await dialog.boundingBox())!.width).toBeCloseTo(540, 0);
|
||||
const field = dialog.getByRole("treeitem", { name: "orderCount" });
|
||||
await expect(field).toBeVisible();
|
||||
await fields.uncheck();
|
||||
await expect(field).toBeHidden();
|
||||
});
|
||||
@@ -101,14 +101,12 @@
|
||||
border: 0;
|
||||
outline: none;
|
||||
color: var(--fg-strong);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-code);
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--fs-ui);
|
||||
caret-color: var(--accent);
|
||||
}
|
||||
.filter::placeholder {
|
||||
color: var(--fg-faint);
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
.filterStatus {
|
||||
color: var(--fg-muted);
|
||||
@@ -125,10 +123,12 @@
|
||||
}
|
||||
.popupOptions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
height: 26px;
|
||||
padding: 0 12px;
|
||||
gap: var(--space-1) var(--space-3);
|
||||
min-height: 32px;
|
||||
padding: var(--space-1) var(--space-3);
|
||||
border-bottom: 1px solid var(--border-popup);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ function FileStructureDialog() {
|
||||
<Dialog
|
||||
open
|
||||
onClose={close}
|
||||
width={460}
|
||||
width={540}
|
||||
position="top"
|
||||
transparentBackdrop
|
||||
aria-label="File Structure"
|
||||
|
||||
Reference in new issue
Заблокувати користувача