feat(notes): vues structurées tableau/kanban, flashcards et MCP robuste
Ajoute la base organisable par carnet (schéma, champs partagés, valeurs par note) avec activation guidée, tableau éditable, kanban et suppression de colonnes. Corrige le multiselect en vue tableau et enrichit sidebar, grille et i18n FR/EN. Inclut aussi les améliorations flashcards SM-2, l'audit consentement IA et la robustesse du serveur MCP (config, validation, rate-limit, métriques). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Info, X } from 'lucide-react'
|
||||
import { useLanguage } from '@/lib/i18n'
|
||||
import type { StructuredViewMode } from '@/lib/structured-views/types'
|
||||
|
||||
const DISMISS_PREFIX = 'memento-structured-help-dismissed-'
|
||||
|
||||
type StructuredViewsHelpBannerProps = {
|
||||
notebookId: string
|
||||
mode: StructuredViewMode
|
||||
}
|
||||
|
||||
export function StructuredViewsHelpBanner({ notebookId, mode }: StructuredViewsHelpBannerProps) {
|
||||
const { t } = useLanguage()
|
||||
const storageKey = `${DISMISS_PREFIX}${notebookId}-${mode}`
|
||||
const [visible, setVisible] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
setVisible(localStorage.getItem(storageKey) !== '1')
|
||||
} catch {
|
||||
setVisible(true)
|
||||
}
|
||||
}, [storageKey])
|
||||
|
||||
if (!visible || (mode !== 'table' && mode !== 'kanban')) return null
|
||||
|
||||
const message =
|
||||
mode === 'kanban'
|
||||
? t('structuredViews.helpBanner.kanban')
|
||||
: t('structuredViews.helpBanner.table')
|
||||
|
||||
return (
|
||||
<div className="mb-6 flex items-start gap-3 rounded-xl border border-brand-accent/20 bg-brand-accent/[0.04] px-4 py-3">
|
||||
<Info size={16} className="text-brand-accent shrink-0 mt-0.5" />
|
||||
<p className="text-[13px] leading-relaxed text-foreground/90 flex-1">{message}</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
try {
|
||||
localStorage.setItem(storageKey, '1')
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
setVisible(false)
|
||||
}}
|
||||
className="shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-foreground/5 transition-colors"
|
||||
aria-label={t('structuredViews.helpBanner.dismiss')}
|
||||
>
|
||||
<X size={14} />
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user