fix: code review cleanup - schema sync, type safety, null handling

- Sync KnowledgeLink schema with migration (add displayText, positionStart, positionEnd, resolved)
- Make targetId optional to support unresolved links
- Fix null handling in graph.service.ts (skip unresolved links)
- Add explicit types to frontend components (remove implicit any)
- Remove unused WikiLink import
- Add null-safe statusInfo check in EntryCard
This commit is contained in:
Jason Woltje
2026-01-29 23:36:41 -06:00
parent 26a334c677
commit 652ba50a19
8 changed files with 1369 additions and 24 deletions

View File

@@ -750,18 +750,22 @@ model KnowledgeLink {
sourceId String @map("source_id") @db.Uuid
source KnowledgeEntry @relation("SourceEntry", fields: [sourceId], references: [id], onDelete: Cascade)
targetId String @map("target_id") @db.Uuid
target KnowledgeEntry @relation("TargetEntry", fields: [targetId], references: [id], onDelete: Cascade)
targetId String? @map("target_id") @db.Uuid
target KnowledgeEntry? @relation("TargetEntry", fields: [targetId], references: [id], onDelete: Cascade)
// Link metadata
linkText String @map("link_text")
context String?
linkText String @map("link_text")
displayText String @map("display_text")
positionStart Int @map("position_start")
positionEnd Int @map("position_end")
resolved Boolean @default(false)
context String?
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz
@@unique([sourceId, targetId])
@@index([sourceId])
@@index([targetId])
@@index([sourceId, resolved])
@@map("knowledge_links")
}