diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index dc666e3..c9fd877 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -383,6 +383,7 @@ export class ClaudeDev { }) .join("") + vscode.window.showTextDocument(vscode.Uri.file(filePath), { preview: false }) const { response, text } = await this.ask( "tool", JSON.stringify({ @@ -415,6 +416,7 @@ export class ClaudeDev { } await fs.mkdir(path.dirname(filePath), { recursive: true }) await fs.writeFile(filePath, newContent) + vscode.window.showTextDocument(vscode.Uri.file(filePath), { preview: false }) return `New file created and content written to ${filePath}` } } catch (error) { diff --git a/webview-ui/src/components/ChatRow.tsx b/webview-ui/src/components/ChatRow.tsx index 3e180f4..4af8b56 100644 --- a/webview-ui/src/components/ChatRow.tsx +++ b/webview-ui/src/components/ChatRow.tsx @@ -123,77 +123,106 @@ const ChatRow: React.FC = ({ const renderMarkdown = (markdown: string = "") => { // react-markdown lets us customize elements, so here we're using their example of replacing code blocks with SyntaxHighlighter. However when there are no language matches (` or ``` without a language specifier) then we default to a normal code element for inline code. Code blocks without a language specifier shouldn't be a common occurrence as we prompt Claude to always use a language specifier. return ( - - ) - }, - ol(props) { - const { style, ...rest } = props - return
    - }, - ul(props) { - const { style, ...rest } = props - return
      - }, - // https://github.com/remarkjs/react-markdown?tab=readme-ov-file#use-custom-components-syntax-highlight - code(props) { - const { children, className, node, ...rest } = props - const match = /language-(\w+)/.exec(className || "") - return match ? ( - - ) : ( - - {children} - - ) - }, - }} - /> +
      + + ) + }, + ol(props) { + const { style, ...rest } = props + return ( +
        + ) + }, + ul(props) { + const { style, ...rest } = props + return ( +
          + ) + }, + // https://github.com/remarkjs/react-markdown?tab=readme-ov-file#use-custom-components-syntax-highlight + code(props) { + const { children, className, node, ...rest } = props + const match = /language-(\w+)/.exec(className || "") + return match ? ( + + ) : ( + + {children} + + ) + }, + }} + /> +
      ) } @@ -209,8 +238,9 @@ const ChatRow: React.FC = ({ const pStyle: React.CSSProperties = { margin: 0, - whiteSpace: "pre-line", + whiteSpace: "pre-wrap", wordBreak: "break-word", + overflowWrap: "anywhere", } switch (message.type) { diff --git a/webview-ui/src/components/TaskHeader.tsx b/webview-ui/src/components/TaskHeader.tsx index 3c73491..0b523c2 100644 --- a/webview-ui/src/components/TaskHeader.tsx +++ b/webview-ui/src/components/TaskHeader.tsx @@ -109,6 +109,7 @@ const TaskHeader: React.FC = ({ taskText, tokensIn, tokensOut, fontSize: "var(--vscode-font-size)", overflowY: isExpanded ? "auto" : "hidden", wordBreak: "break-word", + overflowWrap: "anywhere", }}>