diff --git a/backend/templates/apa.docx b/backend/templates/apa.docx index 5bb59be..3a99ef2 100644 Binary files a/backend/templates/apa.docx and b/backend/templates/apa.docx differ diff --git a/backend/templates/resume.docx b/backend/templates/resume.docx index 5bb59be..b415e7e 100644 Binary files a/backend/templates/resume.docx and b/backend/templates/resume.docx differ diff --git a/frontend/src/components/FileExplorer.tsx b/frontend/src/components/FileExplorer.tsx index d22f8df..12e4547 100644 --- a/frontend/src/components/FileExplorer.tsx +++ b/frontend/src/components/FileExplorer.tsx @@ -487,8 +487,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { const [pinnedFiles, setPinnedFiles] = useState([]); useEffect(() => { - if (pinnedExpanded) { - api.listPinned().then(data => { + api.listPinned().then(data => { const items = data.items || []; items.sort((a: FileItem, b: FileItem) => { const idxA = pinnedOrder.indexOf(a.path); @@ -500,8 +499,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { }); setPinnedFiles(items); }).catch(console.error); - } - }, [pinnedExpanded, pinnedOrder, pinnedRefreshCounter]); + }, [pinnedOrder, pinnedRefreshCounter]); async function handlePinnedDragEnd(sourcePath: string, destPath: string) { const newOrder = [...pinnedOrder]; @@ -1908,7 +1906,8 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { setEditingFile(file)} - onCreateBlank={(file) => setEditingFile(file)} + onCreateBlank={(file) => setEditingFile(file)} + onPinChange={() => setPinnedRefreshCounter(c => c + 1)} /> ) : (
diff --git a/frontend/src/components/OfficeHome.tsx b/frontend/src/components/OfficeHome.tsx index 40bf695..54408e4 100644 --- a/frontend/src/components/OfficeHome.tsx +++ b/frontend/src/components/OfficeHome.tsx @@ -17,6 +17,7 @@ interface OfficeHomeProps { type: 'docs' | 'slides'; onFileSelect: (file: FileItem) => void; onCreateBlank: (file: FileItem) => void; + onPinChange?: () => void; } // Custom Word icon (blue) @@ -43,7 +44,7 @@ interface ContextMenuState { file: FileItem; } -export default function OfficeHome({ type, onFileSelect, onCreateBlank }: OfficeHomeProps) { +export default function OfficeHome({ type, onFileSelect, onCreateBlank, onPinChange }: OfficeHomeProps) { const [recentFiles, setRecentFiles] = useState([]); const [pinnedFiles, setPinnedFiles] = useState([]); const [allFiles, setAllFiles] = useState([]); @@ -161,6 +162,7 @@ export default function OfficeHome({ type, onFileSelect, onCreateBlank }: Office try { await api.togglePin(file.path); fetchFiles(); + if (onPinChange) onPinChange(); } catch (err) { console.error("Failed to pin", err); } @@ -318,17 +320,7 @@ export default function OfficeHome({ type, onFileSelect, onCreateBlank }: Office
- {/* Pinned Documents */} - {pinnedFiles.length > 0 && ( -
-
-

Pinned {title.toLowerCase()}

-
- {pinnedFiles.map(file => renderFileCard(file))} -
-
-
- )} + {/* Recent Documents */}