fix: Memory Echo sans vol de scroll, badge IA sidebar, wizard langue

- Ne plus auto-scroller vers Memory Echo : pastille bas de page + reset scroll au titre
- Badges notes/carnets générés par l’IA dans la sidebar
- Wizard : langue du contenu = langue de la requête ; refresh carnet après création
- Voix : erreurs not-allowed/no-speech moins bruyantes
This commit is contained in:
Antigravity
2026-07-16 17:25:57 +00:00
parent 45297da333
commit 704fed1191
11 changed files with 672 additions and 210 deletions

View File

@@ -33,6 +33,7 @@ export async function POST(request: NextRequest) {
throw err
}
// language = UI locale (fallback only). Content language = language of the topic string.
const result = await notebookWizardService.generateCarnet(
profile as WizardProfile,
topic,
@@ -47,13 +48,20 @@ export async function POST(request: NextRequest) {
|| topic.trim().slice(0, 60)
).slice(0, 80)
// Place new notebook at top of manual order (before existing min order)
const minOrder = await prisma.notebook.aggregate({
where: { userId: session.user.id, trashedAt: null },
_min: { order: true },
})
const nextOrder = (minOrder._min.order ?? 0) - 1
// 1. Create notebook
const notebook = await prisma.notebook.create({
data: {
name: resolvedName,
icon: notebookIcon || '📚',
userId: session.user.id,
order: 0,
order: nextOrder,
},
})
@@ -95,6 +103,8 @@ export async function POST(request: NextRequest) {
notebookId: notebook.id,
type: 'richtext',
order: noteIndex++,
autoGenerated: true,
aiProvider: 'notebook-wizard',
},
})