hover highlighted sections for feedback

This commit is contained in:
2026-02-21 13:58:19 +10:00
parent ca49a407da
commit e2d3f44dfa
13 changed files with 428 additions and 26 deletions

View File

@@ -56,7 +56,7 @@ export function AnalysisToolbar(): JSX.Element {
setAnalysisMode('passive_voice')
}
const runAIAnalysis = async (mode: 'consistency' | 'style'): Promise<void> => {
const runAIAnalysis = async (mode: 'consistency' | 'style' | 'critique'): Promise<void> => {
if (!activeFilePath || isAILoading) return
setAnalysisMode(mode)
@@ -65,7 +65,9 @@ export function AnalysisToolbar(): JSX.Element {
const prompt =
mode === 'consistency'
? 'Please check this chapter for consistency issues (character names, timeline, repeated phrases).'
: 'Please analyze the style and pacing of this chapter and suggest improvements.'
: mode === 'style'
? 'Please analyze the style and pacing of this chapter and suggest improvements.'
: 'Please give me an honest critique of this chapter.'
addUserMessage(prompt)
startAssistantMessage()
@@ -144,6 +146,18 @@ export function AnalysisToolbar(): JSX.Element {
)}
</button>
<button
className={`toolbar-btn${analysisMode === 'critique' ? ' active' : ''}`}
onClick={() => runAIAnalysis('critique')}
disabled={!hasFile || isAILoading}
title="Honest overall critique of this chapter via AI"
>
{isAILoading && analysisMode === 'critique' ? 'Reading…' : 'Critique'}
{analysisMode === 'critique' && otherCount > 0 && (
<span className="toolbar-badge">{otherCount}</span>
)}
</button>
{annotations.length > 0 && (
<button
className="toolbar-btn toolbar-btn-clear"