Skip to content
Merged
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
1 change: 1 addition & 0 deletions apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"react": "19.2.3",
"react-dom": "19.2.3",
"react-markdown": "^10.1.0",
"rehype-raw": "^7.0.0",
"react-resizable-panels": "^3.0.6",
"sonner": "^2.0.7",
"tailwind-merge": "^3.4.0",
Expand Down
7 changes: 6 additions & 1 deletion apps/ui/src/components/ui/markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import rehypeSanitize from 'rehype-sanitize';
import { cn } from '@/lib/utils';

interface MarkdownProps {
Expand All @@ -9,6 +11,7 @@ interface MarkdownProps {
/**
* Reusable Markdown component for rendering markdown content
* Theme-aware styling that adapts to all predefined themes
* Supports raw HTML elements including images
*/
export function Markdown({ children, className }: MarkdownProps) {
return (
Expand Down Expand Up @@ -37,10 +40,12 @@ export function Markdown({ children, className }: MarkdownProps) {
'[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground [&_blockquote]:italic [&_blockquote]:my-2',
// Horizontal rules
'[&_hr]:border-border [&_hr]:my-4',
// Images
'[&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-2 [&_img]:border [&_img]:border-border',
className
)}
>
<ReactMarkdown>{children}</ReactMarkdown>
<ReactMarkdown rehypePlugins={[rehypeRaw, rehypeSanitize]}>{children}</ReactMarkdown>
</div>
);
}
5 changes: 2 additions & 3 deletions apps/ui/src/components/views/github-issues-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CircleDot, Loader2, RefreshCw, ExternalLink, CheckCircle2, Circle, X }
import { getElectronAPI, GitHubIssue } from '@/lib/electron';
import { useAppStore } from '@/store/app-store';
import { Button } from '@/components/ui/button';
import { Markdown } from '@/components/ui/markdown';
import { cn } from '@/lib/utils';

export function GitHubIssuesView() {
Expand Down Expand Up @@ -241,9 +242,7 @@ export function GitHubIssuesView() {

{/* Body */}
{selectedIssue.body ? (
<div className="prose prose-sm dark:prose-invert max-w-none">
<div className="whitespace-pre-wrap text-sm">{selectedIssue.body}</div>
</div>
<Markdown className="text-sm">{selectedIssue.body}</Markdown>
) : (
<p className="text-sm text-muted-foreground italic">No description provided.</p>
)}
Expand Down
16 changes: 3 additions & 13 deletions apps/ui/src/components/views/github-prs-view.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { useState, useEffect, useCallback } from 'react';
import {
GitPullRequest,
Loader2,
RefreshCw,
ExternalLink,
GitMerge,
Circle,
X,
AlertCircle,
} from 'lucide-react';
import { GitPullRequest, Loader2, RefreshCw, ExternalLink, GitMerge, X } from 'lucide-react';
import { getElectronAPI, GitHubPR } from '@/lib/electron';
import { useAppStore } from '@/store/app-store';
import { Button } from '@/components/ui/button';
import { Markdown } from '@/components/ui/markdown';
import { cn } from '@/lib/utils';

export function GitHubPRsView() {
Expand Down Expand Up @@ -296,9 +288,7 @@ export function GitHubPRsView() {

{/* Body */}
{selectedPR.body ? (
<div className="prose prose-sm dark:prose-invert max-w-none">
<div className="whitespace-pre-wrap text-sm">{selectedPR.body}</div>
</div>
<Markdown className="text-sm">{selectedPR.body}</Markdown>
) : (
<p className="text-sm text-muted-foreground italic">No description provided.</p>
)}
Expand Down
198 changes: 198 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
},
"dependencies": {
"cross-spawn": "^7.0.6",
"rehype-sanitize": "^6.0.0",
"tree-kill": "^1.2.2"
},
"devDependencies": {
Expand Down