perf: memo GridCard, fuse save fns, fix slash tab active color
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 1m32s
CI / Deploy production (on server) (push) Has been skipped

This commit is contained in:
Antigravity
2026-06-14 14:06:05 +00:00
parent a8785ed4f1
commit a623454347
120 changed files with 12301 additions and 785 deletions

View File

@@ -60,12 +60,18 @@ export function asArray<T = unknown>(val: unknown, fallback: T[] = []): T[] {
* Guarantees array fields are always real arrays or null.
*/
export function parseNote(dbNote: any): Note {
if (!dbNote) return null as any
let noteType: NoteType = dbNote.type || 'text'
if (noteType === 'text' && dbNote.isMarkdown) {
noteType = 'markdown'
}
let content = dbNote.content
if (content && typeof content === 'string') {
content = content.replace(/(https?:\/\/(?:note\.parsanet\.org|memento-note\.com|www\.memento-note\.com|localhost:3000))?\/uploads\/notes\//gi, '/uploads/notes/')
}
return {
...dbNote,
content,
type: noteType,
isMarkdown: noteType === 'markdown',
checkItems: asArray(dbNote.checkItems, null as any) ?? null,