Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions visualizer/src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function CodeBlock({ block, index }: CodeBlockProps) {
<div className="flex items-center gap-2">
{executionTime && (
<Badge variant="outline" className="font-mono text-xs">
{executionTime}s
{executionTime}
</Badge>
)}
{hasError && (
Expand All @@ -66,15 +66,16 @@ export function CodeBlock({ block, index }: CodeBlockProps) {
</CollapsibleTrigger>

<CollapsibleContent>
<CardContent className="p-0">
<div style={{ width: 0, minWidth: '100%' }}>
<CardContent className="p-0">
{/* Code */}
<div className="bg-muted border-t border-border">
<div className="px-3 py-1.5 border-b border-border/50 flex items-center gap-2">
<span className="text-[10px] uppercase tracking-wider text-muted-foreground font-medium">
Python
</span>
</div>
<div className="code-block p-4 overflow-x-auto">
<div className="code-block p-2 overflow-x-auto">
<CodeWithLineNumbers code={block.code} language="python" />
</div>
</div>
Expand All @@ -97,7 +98,7 @@ export function CodeBlock({ block, index }: CodeBlockProps) {

{/* Errors */}
{hasError && (
<div className="border-t border-border bg-red-500/5 dark:bg-red-400/5">
<div className="border-t border-border bg-red-500/5 dark:bg-red-400/5 overflow-hidden">
<div className="px-3 py-1.5 border-b border-border/50 flex items-center gap-2">
<span className="text-[10px] uppercase tracking-wider text-red-600 dark:text-red-400 font-medium">
stderr
Expand Down Expand Up @@ -178,8 +179,11 @@ export function CodeBlock({ block, index }: CodeBlockProps) {
</div>
)}
</CardContent>
</div>
</CollapsibleContent>
</Card>


</Collapsible>
);
}
4 changes: 2 additions & 2 deletions visualizer/src/components/CodeWithLineNumbers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function CodeWithLineNumbers({
return (
<div className="flex">
{/* Line numbers */}
<div className="flex-shrink-0 pr-4 border-r border-border/30 select-none">
<div className="flex-shrink-0 border-r border-border/30 select-none">
{lines.map((_, idx) => (
<div
key={idx}
Expand All @@ -32,7 +32,7 @@ export function CodeWithLineNumbers({
</div>

{/* Code */}
<div className="flex-1 pl-4 overflow-x-auto">
<div className="flex-shrink-0 pl-4">
<SyntaxHighlight code={code} language={language} />
</div>
</div>
Expand Down
Loading