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

@@ -42,10 +42,6 @@ export function ChatPanel(): JSX.Element {
setActiveSession,
rightPanelTab,
setRightPanelTab,
wholeStoryMode,
setWholeStoryMode,
storyBibleMode,
setStoryBibleMode,
} = useEditorStore()
const tab = rightPanelTab
@@ -89,9 +85,7 @@ export function ChatPanel(): JSX.Element {
.slice(-10)
.map((m) => ({ role: m.role, content: m.content })),
userMessage: text,
attachments: attachments.length > 0 ? attachments : undefined,
projectMode: wholeStoryMode,
storyBibleMode: storyBibleMode
attachments: attachments.length > 0 ? attachments : undefined
},
(chunk: string) => {
appendToLastAssistantMessage(chunk)
@@ -164,25 +158,6 @@ export function ChatPanel(): JSX.Element {
</button>
</div>
{/* ── Context toggles: Story bible + Whole story ── */}
{tab === 'chat' && hasFile && (
<div className="chat-context-bar">
<button
className={`chat-project-toggle${storyBibleMode ? ' chat-project-toggle--active' : ''}`}
onClick={() => setStoryBibleMode(!storyBibleMode)}
title={storyBibleMode ? 'Story bible on — Claude sees your reference notes' : 'Enable story bible context'}
>
{storyBibleMode ? '◉' : '○'} Story bible
</button>
<button
className={`chat-project-toggle${wholeStoryMode ? ' chat-project-toggle--active' : ''}`}
onClick={() => setWholeStoryMode(!wholeStoryMode)}
title={wholeStoryMode ? 'Whole story on — Claude sees all chapters' : 'Enable whole story context'}
>
{wholeStoryMode ? '◉' : '○'} Whole story
</button>
</div>
)}
{/* ── Chat sub-header: History link + New Chat button ── */}
{showSubheader && (

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().