feat: ship v0.9.0 with pomodoro, achievements, and injection history

Add pomodoro timer with goal notifications, writing streak milestones, and knowledge injection logging with UI previews across AI writing flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 19:15:52 +08:00
parent 255f1a99a0
commit d4122c8f95
53 changed files with 1679 additions and 80 deletions
@@ -13,6 +13,7 @@ import {
export function KnowledgePanel(): React.JSX.Element {
const { t } = useTranslation()
const bookId = useBookStore((s) => s.currentBookId)
const chapters = useBookStore((s) => s.chapters)
const selectedChapterId = useBookStore((s) => s.selectedChapterId)
const extractThreshold = useSettingsStore((s) => s.knowledgeExtractConfidenceThreshold)
const {
@@ -32,6 +33,8 @@ export function KnowledgePanel(): React.JSX.Element {
extractChapter,
batchApproveHighConfidence
} = useKnowledgeStore()
const injectionPreviews = useKnowledgeStore((s) => s.injectionPreviews)
const loadInjectionPreviews = useKnowledgeStore((s) => s.loadInjectionPreviews)
const [extracting, setExtracting] = useState(false)
const [namingOpen, setNamingOpen] = useState(false)
const [selected, setSelected] = useState<Set<string>>(new Set())
@@ -51,6 +54,14 @@ export function KnowledgePanel(): React.JSX.Element {
)
}, [bookId, entries])
useEffect(() => {
if (!bookId || entries.length === 0) return
void loadInjectionPreviews(
bookId,
entries.map((e) => e.id)
)
}, [bookId, entries, loadInjectionPreviews])
const handleBatchApprove = async (): Promise<void> => {
if (!bookId || selected.size === 0) return
await batchApprove(bookId, [...selected])
@@ -188,6 +199,25 @@ export function KnowledgePanel(): React.JSX.Element {
</div>
)}
{entry.content && <div className="kb-item-content">{entry.content}</div>}
{(injectionPreviews[entry.id]?.length ?? 0) > 0 && (
<div
className="kb-injection-preview"
data-testid={`knowledge-injection-preview-${entry.id}`}
>
<div className="kb-injection-label">{t('knowledge.injectionPreview')}</div>
{injectionPreviews[entry.id]!.map((log) => (
<div key={log.id} className="kb-injection-preview-row">
{t('knowledge.injectionEntry', {
date: new Date(log.injectedAt).toLocaleDateString(),
mode: t(`knowledge.injectionMode.${log.flowMode}`),
chapter:
chapters.find((c) => c.id === log.chapterId)?.title ??
t('knowledge.noChapter')
})}
</div>
))}
</div>
)}
</div>
<div className="kb-item-actions">
{entry.status === 'pending' && bookId && (