Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(ok): restore vertical centering of the editor empty state (#3247)

sarah77977066a668
diff --git a/.changeset/empty-state-vertical-centering.md b/.changeset/empty-state-vertical-centering.md
new file mode 100644
index 000000000..36498c848
--- /dev/null
+++ b/.changeset/empty-state-vertical-centering.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+The new-tab empty state is vertically centered again. Since the split editor workspace landed, the "Create something great." block was pinned to the top of the pane instead of sitting in the middle, because the pane wrapper it sizes itself against was no longer a flex column. This also restores the header pose when a session panel is open: centered beside the agents panel, bottom-anchored above the terminal dock. A folder overview shown in an unfocused split pane is repaired by the same change: its scroll region now fills the pane and scrolls internally instead of growing past it.
diff --git a/packages/app/src/components/EditorWorkspace.tsx b/packages/app/src/components/EditorWorkspace.tsx
index fe859004a..1c36744e1 100644
--- a/packages/app/src/components/EditorWorkspace.tsx
+++ b/packages/app/src/components/EditorWorkspace.tsx
@@ -311,7 +311,12 @@ function WorkspacePane({
onPointerDownCapture={() => focusPane(pane.id)}
onFocusCapture={() => focusPane(pane.id)}
>
- <div className="relative min-h-0 flex-1">
+ {/* Flex column, not a plain block: surfaces mounted here fill the pane via
+ `flex-1` and position their content against that height — the empty
+ state (`my-auto` / `justify-center` / `justify-end`) and the folder
+ overview's scroll region. A block parent leaves their `flex-1` inert,
+ collapsing them to content height pinned at the top. */}
+ <div className="relative flex min-h-0 flex-1 flex-col">
{renderPane({
pane,
isFocused,
diff --git a/packages/app/tests/stress/editor-area-viewport-resize.e2e.ts b/packages/app/tests/stress/editor-area-viewport-resize.e2e.ts
index ce28860b7..5009d047a 100644
--- a/packages/app/tests/stress/editor-area-viewport-resize.e2e.ts
+++ b/packages/app/tests/stress/editor-area-viewport-resize.e2e.ts
@@ -290,3 +290,48 @@ test.describe('editor-area viewport resize — editor mount stability', () => {
).toBe(true);
});
});
+
+/**
+ * Pane-wrapper fill contract.
+ *
+ * `WorkspacePane` mounts every pane surface inside one wrapper div. Surfaces that
+ * size with `flex-1` (the empty state, the unfocused folder overview) only fill the
+ * pane if that wrapper establishes a flex column — a plain block parent leaves their
+ * `flex-1` inert and collapses them to content height. The contract lived only in a
+ * comment, and the wrapper's `display` has already regressed once.
+ *
+ * Asserts the observable (the surface fills its wrapper), not the markup, so it
+ * fails for any change that breaks the height chain, not only a `display` edit.
+ */
+test.describe('pane wrapper fill contract', () => {
+ test('empty-state root fills the pane wrapper', async ({ page }) => {
+ await page.setViewportSize(WIDE_VIEWPORT);
+ await page.goto('/');
+ // No doc open -> EmptyEditorState, whose root sizes with `flex-1`.
+ await expect(page.getByText('Create something great.')).toBeVisible();
+
+ const panes = await page.evaluate(() =>
+ [...document.querySelectorAll('section[data-editor-pane-id]')].flatMap((pane) => {
+ const wrapper = pane.firstElementChild;
+ const root = wrapper?.firstElementChild;
+ if (!wrapper || !root) return [];
+ return [
+ {
+ paneId: pane.getAttribute('data-editor-pane-id') ?? '',
+ wrapperHeight: Math.round(wrapper.getBoundingClientRect().height),
+ rootHeight: Math.round(root.getBoundingClientRect().height),
+ },
+ ];
+ }),
+ );
+
+ expect(panes.length).toBeGreaterThan(0);
+ for (const pane of panes) {
+ expect(pane.wrapperHeight).toBeGreaterThan(0);
+ expect(
+ pane.rootHeight,
+ `pane ${pane.paneId}: empty-state root must fill its wrapper (the wrapper must establish a flex column)`,
+ ).toBe(pane.wrapperHeight);
+ }
+ });
+});