Skip to content
Draft
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
3 changes: 3 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"e2b": "^2.12.1",
"foxact": "^0.2.52",
"inngest": "^3.52.3",
"katex": "^0.16.33",
"lucide-react": "^0.575.0",
"motion": "^12.34.3",
"next": "16.1.6",
Expand All @@ -64,10 +65,12 @@
"react": "19.2.4",
"react-dom": "19.2.4",
"react-markdown": "^10.1.0",
"rehype-katex": "^7.0.1",
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
"rehype-stringify": "^10.0.1",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.2",
"shiki": "^3.22.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import {
} from "@/lib/github";
import { parseRefAndPath, formatBytes, getLanguageFromFilename } from "@/lib/github-utils";
import { CodeViewer } from "@/components/repo/code-viewer";
import { NotebookViewer } from "@/components/repo/notebook-viewer";
import { MarkdownRenderer } from "@/components/shared/markdown-renderer";
import { MarkdownBlobView } from "@/components/repo/markdown-blob-view";
import { File, Download } from "lucide-react";

const MARKDOWN_EXTENSIONS = new Set(["md", "mdx", "markdown", "mdown", "mkd"]);
const NOTEBOOK_EXTENSIONS = new Set(["ipynb"]);

const IMAGE_EXTENSIONS = new Set(["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp"]);

Expand Down Expand Up @@ -127,6 +129,7 @@ export default async function BlobPage({
}

const isMarkdown = MARKDOWN_EXTENSIONS.has(ext);
const isNotebook = NOTEBOOK_EXTENSIONS.has(ext);
const fileDir = path.includes("/") ? path.slice(0, path.lastIndexOf("/")) : "";

if (isMarkdown) {
Expand Down Expand Up @@ -173,6 +176,14 @@ export default async function BlobPage({
);
}

if (isNotebook) {
return (
<div className="border border-border rounded-md overflow-hidden">
<NotebookViewer content={file.content} />
</div>
);
}

return (
<CodeViewer
content={file.content}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/(app)/repos/[owner]/[repo]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default async function RepoLayout({
const forkSyncStatus = await forkSyncPromise;

return (
<div className="-mx-4 flex-1 min-h-0 flex flex-col">
<div className="-mx-4 flex-1 min-h-0 flex flex-col overflow-hidden">
<RepoLayoutWrapper
owner={owner}
repo={repoName}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/repo/code-content-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export function CodeContentWrapper({
}, []);

return (
<div className="flex flex-1 min-h-0">
<div className="flex flex-1 min-h-0 overflow-hidden">
{showTree && (
<>
{/* Collapsed toggle */}
Expand Down Expand Up @@ -312,7 +312,7 @@ export function CodeContentWrapper({
)}
</>
)}
<div className="flex-1 min-w-0 flex flex-col min-h-0">
<div className="flex-1 min-w-0 flex flex-col min-h-0 overflow-hidden">
{isBlobOrTree && (
<div
className="shrink-0 pl-4 pt-3 pb-3 flex items-center gap-3"
Expand Down
Loading
Loading