Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions frontend/src/components/chat/markdown-renderer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.mo-markdown-renderer {
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 10px;
}

hr {
margin-top: 8px;
margin-bottom: 12px;
}
}
3 changes: 2 additions & 1 deletion frontend/src/components/chat/markdown-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -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>
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/components/editor/ai/completion-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(""),
Expand Down
Loading