manuscript reference as a tool

This commit is contained in:
2026-03-03 10:55:41 +10:00
parent d15b134d43
commit cc00c40214
7 changed files with 70 additions and 63 deletions

View File

@@ -4,13 +4,12 @@ import { FileTreeNode } from './FileTreeNode'
import './FileTree.css'
export function FileTree(): JSX.Element {
const { fileTree, activeFilePath, setActiveFile, markSaved, setStoryBibleMode } = useEditorStore()
const { fileTree, activeFilePath, setActiveFile, markSaved } = useEditorStore()
const handleOpenStoryBible = async (): Promise<void> => {
try {
const { path, content } = await window.api.openStoryBible()
setActiveFile(path, content)
setStoryBibleMode(true)
// If the path didn't change (already on Story Bible), the MarkdownEditor's
// activeFilePath-keyed effect won't fire. Push content directly, same
// pattern as RevisionPanel.restore().