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

...
Автор SHA1 Повідомлення Дата
l0ng-ai 109a8408bb fix(markdown): keep the Project view clickable in Preview only
In Preview only the editor panel stays mounted but hidden, with no
separator. react-resizable-panels adds an implicit resize region between
two enabled panels without a separator, and with the hidden panel's rect at
zero it spans everything left of the preview: a resize cursor there, and
clicks swallowed. The hidden editor panel is now disabled, which leaves the
group a single resizable panel.

Fixes #4589
2026-11-20 04:35:28 +08:00
2 змінених файлів з 16 додано та 1 видалено

No files matched your search

+12
Переглянути файл
@@ -596,3 +596,15 @@ test("dragging the Markdown split divider resizes and reflows editor and preview
.poll(async () => Math.round((await reopenedEditor.boundingBox())!.width))
.toBe(Math.round(initialEditor));
});
test("Markdown Preview only leaves the Project view clickable", async ({ workbench: page }) => {
await openFromTree(page, "README.md");
await page.getByRole("button", { name: "Preview Only" }).click();
await expect(page.getByRole("document", { name: "Markdown preview" })).toBeVisible();
const row = page.getByRole("treeitem", { name: "build.gradle.kts", exact: true });
// A hidden editor panel used to leave an implicit resize region over everything left of the preview,
// which swallowed the click.
await row.click();
await expect(row).toHaveAttribute("aria-selected", "true");
});
+4 -1
Переглянути файл
@@ -122,7 +122,10 @@ export function MarkdownEditor({
className={styles.group}
storageKey={mode === "split" ? SPLIT_STORAGE_KEY : undefined}
>
<SplitPanel id="editor" style={{ overflow: "hidden" }} {...splitBounds}>
{/* Hidden but mounted in Preview only (its caret drives the preview). Disabled, it leaves the group a
single resizable panel: two enabled panels without a separator get an implicit resize region between
them, which for a hidden panel spans everything left of the preview. */}
<SplitPanel id="editor" style={{ overflow: "hidden" }} disabled={mode === "preview"} {...splitBounds}>
<div ref={editorRef} className={styles.editor}>
{children}
</div>