Multiple feature additions and improvements across the application: - NextGen Editor: drag handles, smart paste, block actions - Structured views: Kanban and table layouts for notes - Architectural Grid: new brainstorming/agent interface prototype - Flashcards: SM-2 revision algorithm with AI generation - MCP server: robustness improvements - Graph/PDF chat: fix click propagation and copy behavior - Various UI/UX enhancements and bug fixes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
822 B
TypeScript
22 lines
822 B
TypeScript
import type { NotesLayoutMode } from '@/components/notes-list-views'
|
|
|
|
export const NOTES_LAYOUT_COOKIE = 'memento-notes-layout'
|
|
export const NOTES_LAYOUT_STORAGE_KEY = 'memento-notes-layout'
|
|
|
|
const LAYOUT_VALUES: NotesLayoutMode[] = ['grid', 'list', 'table', 'kanban', 'gallery']
|
|
|
|
export function parseNotesLayoutMode(value: string | undefined | null): NotesLayoutMode {
|
|
if (value && (LAYOUT_VALUES as string[]).includes(value)) {
|
|
const mode = value as NotesLayoutMode
|
|
if (mode === 'gallery') return 'grid'
|
|
return mode
|
|
}
|
|
return 'list'
|
|
}
|
|
|
|
export function setNotesLayoutPreference(layout: NotesLayoutMode) {
|
|
if (typeof window === 'undefined') return
|
|
localStorage.setItem(NOTES_LAYOUT_STORAGE_KEY, layout)
|
|
document.cookie = `${NOTES_LAYOUT_COOKIE}=${layout}; path=/; max-age=31536000; SameSite=Lax`
|
|
}
|