diff --git a/apps/desktop/src/components/workspace/editor/latex-editor.tsx b/apps/desktop/src/components/workspace/editor/latex-editor.tsx index 27235ff..e3f8f29 100644 --- a/apps/desktop/src/components/workspace/editor/latex-editor.tsx +++ b/apps/desktop/src/components/workspace/editor/latex-editor.tsx @@ -28,7 +28,7 @@ import { import { unifiedMergeView, getChunks, acceptChunk, rejectChunk } from "@codemirror/merge"; import { latex, latexLinter } from "codemirror-lang-latex"; import { linter, lintGutter, forEachDiagnostic, type Diagnostic } from "@codemirror/lint"; -import { useDocumentStore } from "@/stores/document-store"; +import { useDocumentStore, type ProjectFile } from "@/stores/document-store"; import { useProposedChangesStore, type ProposedChange } from "@/stores/proposed-changes-store"; import { useClaudeChatStore } from "@/stores/claude-chat-store"; import { useHistoryStore } from "@/stores/history-store"; @@ -41,6 +41,8 @@ import { ProposedChangesPanel } from "@/components/claude-chat/proposed-changes- import { ImagePreview } from "./image-preview"; import { SearchPanel } from "./search-panel"; import { ProblemsPanel, type DiagnosticItem } from "./problems-panel"; +import { PdfViewer } from "@/components/workspace/preview/pdf-viewer"; +import { readFile } from "@tauri-apps/plugin-fs"; function getActiveFileContent(): string { const state = useDocumentStore.getState(); @@ -70,7 +72,7 @@ export function LatexEditor() { const isTextFile = activeFile?.type === "tex" || activeFile?.type === "bib" || activeFile?.type === "style" || activeFile?.type === "other"; const activeFileContent = activeFile?.content; - const [imageScale, setImageScale] = useState(0.5); + const [imageScale, setImageScale] = useState(1.0); const [isSearchOpen, setIsSearchOpen] = useState(false); const [searchQuery, setSearchQuery] = useState(""); const [matchCount, setMatchCount] = useState(0); @@ -598,25 +600,7 @@ export function LatexEditor() { }, []); if (activeFile?.type === "pdf") { - return ( -
- -
- {activeFile.dataUrl ? ( -