Skip to content

Commit 5b9f7f4

Browse files
More legible history entries
1 parent ffab850 commit 5b9f7f4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/ai-history/src/browser/ai-history-communication-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export interface CommunicationCardProps {
2323

2424
export const CommunicationCard: React.FC<CommunicationCardProps> = ({ entry }) => {
2525
// Format JSON with error handling
26-
const formatJson = (data: unknown): string => {
26+
const formatJson = (data: unknown): React.ReactNode => {
2727
try {
28-
return JSON.stringify(data, undefined, 2);
28+
return JSON.stringify(data, undefined, 2).split(/(?:\\r)?\\n/).flatMap(stringChunk => [stringChunk, <br/>]);
2929
} catch (error) {
3030
console.error('Error formatting JSON:', error);
3131
return 'Error formatting data';

packages/ai-history/src/browser/style/ai-history.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
.theia-card-request pre,
111111
.theia-card-response pre {
112112
background-color: var(--theia-editor-background);
113+
text-wrap: wrap;
113114
}
114115

115116
.theia-card-request,

0 commit comments

Comments
 (0)