Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(open-knowledge): stop Ask AI composer covering last lines of a doc (#2304)

miles-kt-inkeepb4a136bcd449
diff --git a/.changeset/composer-scroll-inset-gradient.md b/.changeset/composer-scroll-inset-gradient.md
new file mode 100644
index 000000000..9f0d0eeb8
--- /dev/null
+++ b/.changeset/composer-scroll-inset-gradient.md
@@ -0,0 +1,9 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Fix the Ask AI composer covering the last lines of a document. Two fixes: the
+bottom scroll inset now reserves room for the composer's gradient-fade band (not
+just the card), and in source/markdown mode the inset is no longer zeroed by
+CodeMirror's content-padding reset — so the final lines clear the field in both
+WYSIWYG and source mode instead of sitting under it.
diff --git a/packages/app/src/components/BottomComposer.tsx b/packages/app/src/components/BottomComposer.tsx
index 02b20be0c..df381a7cf 100644
--- a/packages/app/src/components/BottomComposer.tsx
+++ b/packages/app/src/components/BottomComposer.tsx
@@ -196,7 +196,7 @@ export function BottomComposer({
}
const apply = () => {
followBottom();
- root.style.setProperty('--ask-composer-height', `${card.offsetHeight + 24}px`);
+ root.style.setProperty('--ask-composer-height', `${card.offsetHeight + 56}px`);
};
apply();
revealCaret();
diff --git a/packages/app/src/globals.css b/packages/app/src/globals.css
index 756f3ab22..cafa2c797 100644
--- a/packages/app/src/globals.css
+++ b/packages/app/src/globals.css
@@ -2081,6 +2081,17 @@
padding: 0;
}
+/* Restore the floating Ask AI composer's bottom inset for full-page source mode.
+ The `padding: 0` reset above ties on specificity with the shared
+ `.editor-doc-scroll :is(.ProseMirror, .cm-content)` inset rule and, being later,
+ zeroes it — so source mode's last lines sit under the composer while WYSIWYG
+ clears. Scoped to `.source-editor` (not `.cm-editor`) so nested code-block CM
+ inside the WYSIWYG body is never padded; declared after the reset so it wins the
+ tie. */
+.source-editor .cm-content {
+ padding-bottom: var(--ask-composer-height, 0px);
+}
+
.cm-editor.cm-focused {
outline: none;
}