- Rename directory keep-notes -> memento-note with all code references - Prisma: SQLite -> PostgreSQL (both app and MCP server schemas) - Sync MCP schema with main app (add missing fields, relations, indexes) - Delete 17 SQLite migrations (clean slate for PostgreSQL) - Remove SQLite dependencies (@libsql/client, better-sqlite3, etc.) - Fix MCP server: hardcoded Windows DB paths -> DATABASE_URL env var - Fix MCP server: .dockerignore excluded index-sse.js (SSE mode broken) - MCP Dockerfile: node:20 -> node:22 - Docker Compose: add postgres service, remove SQLite volume - Generate favicon.ico, icon-192.png, icon-512.png, apple-icon.png - Update layout.tsx icons and manifest.json for PNG icons - Update all .env files for PostgreSQL - Rewrite README.md with updated sections - Remove mcp-server/node_modules and prisma/client-generated from git tracking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
'use client'
|
|
|
|
import { useState } from 'react'
|
|
import { useTitleSuggestions } from '@/hooks/use-title-suggestions'
|
|
|
|
export default function TestTitleSuggestionsPage() {
|
|
const [content, setContent] = useState('')
|
|
|
|
const { suggestions, isAnalyzing, error } = useTitleSuggestions({
|
|
content,
|
|
enabled: true // Always enabled for testing
|
|
})
|
|
|
|
const wordCount = content.split(/\s+/).filter(w => w.length > 0).length
|
|
|
|
return (
|
|
<div style={{ padding: '20px', maxWidth: '800px', margin: '0 auto' }}>
|
|
<h1>Test Title Suggestions</h1>
|
|
|
|
<div style={{ marginBottom: '20px' }}>
|
|
<label>Content (need 50+ words):</label>
|
|
<textarea
|
|
value={content}
|
|
onChange={(e) => setContent(e.target.value)}
|
|
style={{ width: '100%', height: '200px', marginTop: '10px' }}
|
|
placeholder="Type at least 50 words here..."
|
|
/>
|
|
</div>
|
|
|
|
<div style={{ marginBottom: '20px', padding: '10px', background: '#f0f0f0' }}>
|
|
<p><strong>Word count:</strong> {wordCount} / 50</p>
|
|
<p><strong>Status:</strong> {isAnalyzing ? 'Analyzing...' : 'Idle'}</p>
|
|
{error && <p style={{ color: 'red' }}><strong>Error:</strong> {error}</p>}
|
|
</div>
|
|
|
|
<div>
|
|
<h2>Suggestions ({suggestions.length}):</h2>
|
|
{suggestions.length > 0 ? (
|
|
<ul>
|
|
{suggestions.map((s, i) => (
|
|
<li key={i}>
|
|
<strong>{s.title}</strong> (confidence: {s.confidence}%)
|
|
{s.reasoning && <p>→ {s.reasoning}</p>}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
) : (
|
|
<p style={{ color: '#666' }}>No suggestions yet. Type 50+ words and wait 2 seconds.</p>
|
|
)}
|
|
</div>
|
|
|
|
<div style={{ marginTop: '20px' }}>
|
|
<button onClick={() => {
|
|
setContent('word '.repeat(50))
|
|
}}>
|
|
Fill with 50 words (test)
|
|
</button>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|