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>
23 lines
882 B
TypeScript
23 lines
882 B
TypeScript
import type { StructuredViewMode } from './types'
|
|
|
|
const MODES: StructuredViewMode[] = ['list', 'table', 'kanban', 'gallery']
|
|
|
|
export function structuredViewStorageKey(notebookId: string) {
|
|
return `memento-structured-view-${notebookId}`
|
|
}
|
|
|
|
export function parseStructuredViewMode(value: string | null | undefined): StructuredViewMode {
|
|
if (value && (MODES as string[]).includes(value)) return value as StructuredViewMode
|
|
return 'list'
|
|
}
|
|
|
|
export function getStructuredViewPreference(notebookId: string): StructuredViewMode {
|
|
if (typeof window === 'undefined') return 'list'
|
|
return parseStructuredViewMode(localStorage.getItem(structuredViewStorageKey(notebookId)))
|
|
}
|
|
|
|
export function setStructuredViewPreference(notebookId: string, mode: StructuredViewMode) {
|
|
if (typeof window === 'undefined') return
|
|
localStorage.setItem(structuredViewStorageKey(notebookId), mode)
|
|
}
|