Skip to content

Commit 8abcf58

Browse files
committed
fix: correct JSON highlighter timestamp handling and restore Stripe link color
1 parent eeb4b31 commit 8abcf58

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/ui/tui/primitives/LogViewer.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ export const LogViewer = ({ filePath, height }: LogViewerProps) => {
6767
return (
6868
<Box flexDirection="column" height={visibleLines}>
6969
{lines.map((line, i) => {
70-
// Strip optional [timestamp] prefix before checking for JSON content
71-
const content = line.replace(/^\s*\[.*?\]\s*/, '');
70+
const prefixMatch = line.match(/^(\s*\[.*?\]\s*)([\s\S]*)$/);
71+
const prefix = prefixMatch ? prefixMatch[1] : '';
72+
const content = prefixMatch ? prefixMatch[2] : line;
7273
const isJson =
7374
content.startsWith('{') ||
7475
content.startsWith('[{') ||
@@ -79,7 +80,14 @@ export const LogViewer = ({ filePath, height }: LogViewerProps) => {
7980
color={isJson ? undefined : Colors.muted}
8081
wrap="truncate"
8182
>
82-
{isJson ? highlightCode(line, 'json') : line}
83+
{isJson ? (
84+
<>
85+
<Text color={Colors.muted}>{prefix}</Text>
86+
{highlightCode(content, 'json')}
87+
</>
88+
) : (
89+
line
90+
)}
8391
</Text>
8492
);
8593
})}

src/ui/tui/screens/RunScreen.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ const ConditionalTips = ({ store }: { store: WizardStore }) => {
9090
<Text key="stripe" color={Colors.secondary}>
9191
<Text color={Colors.accent}>{Icons.diamond}</Text> Stripe detected
9292
{Icons.dash} add as data source:{' '}
93-
<TerminalLink url={OUTBOUND_URLS.stripeDataSource}>
93+
<TerminalLink
94+
url={OUTBOUND_URLS.stripeDataSource}
95+
color={Colors.accentSecondary}
96+
>
9497
{OUTBOUND_URLS.stripeDataSource}
9598
</TerminalLink>
9699
</Text>,

0 commit comments

Comments
 (0)