Skip to content

Commit

Permalink
Fix some code editor formatting and add thought
Browse files Browse the repository at this point in the history
  • Loading branch information
akhatua2 committed Nov 22, 2024
1 parent f275702 commit b3ee78f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions examples/experimental/nodes/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ const App: React.FC = () => {
setMessages(prev => [...prev, newMessage]);
break;

case "thought":
setMessages(prev => [...prev, {
text: `💭 ${agentName} is thinking: ${messageData.data.argument}`,
type: 'status' as const
}]);
break;

case "write":
const filePath = messageData.data.path;
const fileContent = messageData.data.argument;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { html } from '@codemirror/lang-html';
import { css } from '@codemirror/lang-css';
import { python } from '@codemirror/lang-python';
import { githubDark } from '@uiw/codemirror-theme-github';
import { EditorView } from '@codemirror/view';
import './CodeEditor.css'; // Import the CSS file

interface CodeEditorProps {
Expand Down Expand Up @@ -51,7 +52,10 @@ const CodeEditor: React.FC<CodeEditorProps> = ({ code, onChange, filename }) =>
value={fillEmptyLines(code)}
height="100%"
theme={githubDark}
extensions={getLanguageExtension(filename)}
extensions={[
...getLanguageExtension(filename),
EditorView.lineWrapping,
]}
onChange={onChange}
basicSetup={{
lineNumbers: true,
Expand Down

0 comments on commit b3ee78f

Please sign in to comment.