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

...
Автор SHA1 Повідомлення Дата
l0ng-ai 5c981e28eb Merge remote-tracking branch 'origin/main' into fix/editor-wrapped-tab-layout 2026-11-19 20:49:27 +08:00
l0ng-ai ae6324295b fix(editor): fit wrapped tabs inside narrow splits 2026-11-19 19:19:12 +08:00
2 змінених файлів з 48 додано та 2 видалено

No files matched your search

+39
Переглянути файл
@@ -0,0 +1,39 @@
import { expect, openFromTree, test } from "./fixtures";
test("fits a long wrapped tab and its close button inside a narrow editor group", async ({ workbench: page }) => {
const filename = "QuarterlyReconciliationAndCheckoutAllocation.test.ts";
await page.setViewportSize({ width: 720, height: 760 });
await openFromTree(page, "README.md");
await page.evaluate(async (filename) => {
const projectModule = "/src/platform/project.ts";
const projectFilesModule = "/src/features/project-tree/fs.ts";
const editorModule = "/src/editor/core/controller.ts";
const { useProject } = await import(/* @vite-ignore */ projectModule);
const { projectFs } = await import(/* @vite-ignore */ projectFilesModule);
const { editorController, useTabs } = await import(/* @vite-ignore */ editorModule);
const { project, settings } = useProject.getState();
useProject.setState({
settings: {
...settings,
editor: { ...settings?.editor, tabs: { ...settings?.editor?.tabs, multipleRows: true } },
},
});
const path = `${project.root}/${filename}`;
await projectFs(project.root).createFile(path);
await editorController().openFilesIn([path], useTabs.getState().activePane, "right");
}, filename);
const tab = page.getByRole("tab", { name: filename, exact: true });
await expect(tab).toHaveAttribute("aria-selected", "true");
await expect
.poll(() =>
tab.evaluate((element) => {
const close = element.parentElement?.querySelector("[data-tab-close]");
const strip = element.closest('[role="tablist"]');
return !!close && !!strip && close.getBoundingClientRect().right <= strip.getBoundingClientRect().right;
}),
)
.toBe(true);
await tab.locator("..").getByRole("button", { name: "Close Tab", exact: true }).click();
await expect(tab).toBeHidden();
});
+9 -2
Переглянути файл
@@ -13,6 +13,7 @@
}
/* Islands tabs: the selected tab is a rounded pill (tab-selected-bg / -border); no underline, no separators. */
.editor {
--tab-inline-padding: var(--space-2);
height: var(--h-header);
padding: 0 4px;
}
@@ -76,7 +77,7 @@
display: flex;
align-items: center;
gap: var(--space-1-5);
padding: 0 10px;
padding: 0 var(--tab-inline-padding, 10px);
border-radius: inherit;
white-space: nowrap;
color: inherit;
@@ -207,6 +208,12 @@
.wrap .tab {
height: calc(var(--h-header) - 6px);
}
.editor.wrap .tab {
max-inline-size: 100%;
}
.editor.wrap .tabButton {
min-inline-size: 0;
}
/* Vertical strip (editor tabs placed left / right): a scrolling column of full-width tabs. */
.vertical {
@@ -266,7 +273,7 @@
margin: 0 0 0 4px;
}
.closeLeft .closable .tabButton {
padding: 0 10px 0 2px;
padding: 0 var(--tab-inline-padding, 10px) 0 2px;
}
/* drag & drop: the dragged tab is an empty slot the other tabs make room for (IDEA) */