fix(ui): wrap "Add to chat" selections in md fenced blocks (#641) (#684)

packages/ui/src/components/chat/message/TextSelectionMenu.tsx
  - What: Wrap selectedText in ```md fenced block before appending to composer.
  - Why: Selections were appended as raw inline text with no visual distinction.

packages/ui/src/components/chat/ChatInput.tsx
  - What: Replace trimEnd()/trim() + single-space join with raw prev + \n\n separator in append branch.
  - Why: Existing composer newlines were being destroyed and multiple appends ran together.

packages/ui/src/components/session/ProjectNotesTodoPanel.tsx
  - What: Wrap todoText in ```md fenced block before appending to composer.
  - Why: Todo text sent to current session should have the same fenced formatting.
This commit is contained in:
Henry Moran
2026-03-17 02:45:10 +02:00
committed by GitHub
parent edf0a197a8
commit 8f6f1c8284
3 changed files with 7 additions and 7 deletions
@@ -192,7 +192,8 @@ export const ProjectNotesTodoPanel: React.FC<ProjectNotesTodoPanelProps> = ({
return;
}
routeToChat();
setPendingInputText(todoText, 'append');
const fenced = `\`\`\`md\n${todoText}\n\`\`\``;
setPendingInputText(fenced, 'append');
toast.success('Todo sent to current session');
onActionComplete?.();
},