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
136 changes: 63 additions & 73 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@langchain/core": "^0.3.68",
"@langchain/langgraph-sdk": "^0.0.105",
"@langchain/core": "^1.0.2",
"@langchain/langgraph-sdk": "^1.0.0",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-scroll-area": "^1.2.9",
"@radix-ui/react-slot": "^1.2.3",
Expand All @@ -21,7 +21,7 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.539.0",
"next": "15.4.6",
"next": "^15.5.6",
"nuqs": "^2.4.3",
"prettier": "^3.6.2",
"react": "19.1.0",
Expand Down
22 changes: 16 additions & 6 deletions src/app/components/FileViewDialog/FileViewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import { MarkdownContent } from "../MarkdownContent/MarkdownContent";
import type { FileItem } from "../../types/types";
import styles from "./FileViewDialog.module.scss";

// Ensure content is always a string
const getFileContent = (content: unknown): string => {
if (!content) return "";
if (typeof content === "string") return content;
// Handle cases where content might be an object or other type
return JSON.stringify(content, null, 2);
};

interface FileViewDialogProps {
file: FileItem;
onClose: () => void;
Expand Down Expand Up @@ -66,14 +74,16 @@ export const FileViewDialog = React.memo<FileViewDialogProps>(
}, [fileExtension]);

const handleCopy = useCallback(() => {
if (file.content) {
navigator.clipboard.writeText(file.content);
const content = getFileContent(file.content);
if (content) {
navigator.clipboard.writeText(content);
}
}, [file.content]);

const handleDownload = useCallback(() => {
if (file.content) {
const blob = new Blob([file.content], { type: "text/plain" });
const content = getFileContent(file.content);
if (content) {
const blob = new Blob([content], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
Expand Down Expand Up @@ -120,7 +130,7 @@ export const FileViewDialog = React.memo<FileViewDialogProps>(
{file.content ? (
isMarkdown ? (
<div className={styles.markdownWrapper}>
<MarkdownContent content={file.content} />
<MarkdownContent content={getFileContent(file.content)} />
</div>
) : (
<SyntaxHighlighter
Expand All @@ -133,7 +143,7 @@ export const FileViewDialog = React.memo<FileViewDialogProps>(
}}
showLineNumbers
>
{file.content}
{getFileContent(file.content)}
</SyntaxHighlighter>
)
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../styles/variables";
@use "../../styles/variables" as *;

.sidebar {
width: $sidebar-width;
Expand Down
Loading