Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

nits: ai sidebar styles and skip unecessary input parsing (#6177)

Myles Scolnickc14a26395fcd
diff --git a/frontend/src/components/chat/markdown-renderer.css b/frontend/src/components/chat/markdown-renderer.css
new file mode 100644
index 0000000000..b4c2455add
--- /dev/null
+++ b/frontend/src/components/chat/markdown-renderer.css
@@ -0,0 +1,15 @@
+.mo-markdown-renderer {
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
+ margin-top: 10px;
+ }
+
+ hr {
+ margin-top: 8px;
+ margin-bottom: 12px;
+ }
+}
diff --git a/frontend/src/components/chat/markdown-renderer.tsx b/frontend/src/components/chat/markdown-renderer.tsx
index 376c08b91d..77af2ab04a 100644
--- a/frontend/src/components/chat/markdown-renderer.tsx
+++ b/frontend/src/components/chat/markdown-renderer.tsx
@@ -17,6 +17,7 @@ import { autoInstantiateAtom } from "@/core/config/config";
import { LazyAnyLanguageCodeMirror } from "@/plugins/impl/code/LazyAnyLanguageCodeMirror";
import { useTheme } from "@/theme/useTheme";
import { copyToClipboard } from "@/utils/copy";
+import "./markdown-renderer.css";
const extensions = [EditorView.lineWrapping];
@@ -202,7 +203,7 @@ const MemoizedMarkdownBlock = memo(
<Markdown
components={COMPONENTS}
remarkPlugins={PLUGINS}
- className="prose dark:prose-invert max-w-none prose-pre:pl-0"
+ className="mo-markdown-renderer prose dark:prose-invert max-w-none prose-pre:pl-0"
>
{content}
</Markdown>
diff --git a/frontend/src/components/editor/ai/completion-utils.ts b/frontend/src/components/editor/ai/completion-utils.ts
index acf3c80980..8bbd4c0a93 100644
--- a/frontend/src/components/editor/ai/completion-utils.ts
+++ b/frontend/src/components/editor/ai/completion-utils.ts
@@ -19,8 +19,12 @@ export function getAICompletionBody({
}: {
input: string;
}): Omit<AiCompletionRequest, "language" | "prompt" | "code"> {
- const contextString = extractDatasetsAndVariables(input);
- Logger.debug("Included context", contextString);
+ let contextString = "";
+ // Skip if no '@' in the input
+ if (input.includes("@")) {
+ contextString = extractDatasetsAndVariables(input);
+ Logger.debug("Included context", contextString);
+ }
return {
includeOtherCode: getCodes(""),