feat: editor improvements and architectural grid prototype

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>
This commit is contained in:
Antigravity
2026-05-27 19:45:15 +00:00
parent 2de66a863d
commit f46654f574
99 changed files with 29948 additions and 919 deletions

View File

@@ -3,6 +3,25 @@ import type { Note } from '@/lib/types'
const MD_IMG = /!\[[^\]]*\]\(([^)\s]+)\)/g
const HTML_IMG = /<img[^>]+src=["']([^"']+)["'][^>]*>/gi
/** SSR-safe HTML entity decode so excerpt text matches server and client. */
function decodeHtmlEntities(text: string): string {
return text
.replace(/&nbsp;/gi, ' ')
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/(?:&#0*39;|&apos;)/g, "'")
.replace(/&#(\d+);/g, (_, code: string) => {
const n = Number(code)
return n > 0 && n < 0x110000 ? String.fromCodePoint(n) : `&#${code};`
})
.replace(/&#x([0-9a-f]+);/gi, (_, hex: string) => {
const n = parseInt(hex, 16)
return n > 0 && n < 0x110000 ? String.fromCodePoint(n) : `&#x${hex};`
})
}
/**
* Plain-text preview for list view (light markdown stripping).
*/
@@ -58,6 +77,7 @@ export function getNotePlainExcerpt(note: Note, maxLen = 240): string {
let raw = note.content || ''
raw = raw.replace(/!\[[^\]]*\]\([^)]+\)/g, ' ')
raw = raw.replace(/<[^>]+>/g, ' ')
raw = decodeHtmlEntities(raw)
return stripMarkdownPreview(raw, maxLen)
}