diff --git a/src/components/Editor.test.tsx b/src/components/Editor.test.tsx index dcce96a9..313f523d 100644 --- a/src/components/Editor.test.tsx +++ b/src/components/Editor.test.tsx @@ -47,6 +47,8 @@ const mockEntry: VaultEntry = { modifiedAt: 1700000000, createdAt: null, fileSize: 1024, + snippet: '', + relationships: {}, } const mockContent = `--- diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 717e9f44..850caec5 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -12,7 +12,6 @@ import { ResizeHandle } from './ResizeHandle' import { TabBar } from './TabBar' import { BreadcrumbBar } from './BreadcrumbBar' import { useEditorTheme } from '../hooks/useTheme' -import { cn } from '@/lib/utils' import { splitFrontmatter, preProcessWikilinks, injectWikilinks, countWords } from '../utils/wikilinks' import './Editor.css' import './EditorTheme.css' @@ -235,7 +234,7 @@ export const Editor = memo(function Editor({ applyBlocks(withWikilinks) } if (result && typeof (result as any).then === 'function') { - (result as Promise).then(handleBlocks) + (result as unknown as Promise).then(handleBlocks) } else { handleBlocks(result as any[]) } diff --git a/src/components/Inspector.test.tsx b/src/components/Inspector.test.tsx index 9f7423cc..d3a1cc63 100644 --- a/src/components/Inspector.test.tsx +++ b/src/components/Inspector.test.tsx @@ -17,6 +17,8 @@ const mockEntry: VaultEntry = { modifiedAt: 1707900000, createdAt: null, fileSize: 1024, + snippet: '', + relationships: {}, } const mockContent = `--- @@ -50,6 +52,8 @@ const referrerEntry: VaultEntry = { modifiedAt: 1707900000, createdAt: null, fileSize: 200, + snippet: '', + relationships: {}, } const allContent: Record = { diff --git a/src/components/Inspector.tsx b/src/components/Inspector.tsx index 115b01b6..e265d517 100644 --- a/src/components/Inspector.tsx +++ b/src/components/Inspector.tsx @@ -70,7 +70,7 @@ function resolveRefType(ref: string, entries: VaultEntry[]): string | undefined if (fileStem === target.split('/').pop()) return true return false }) - return match?.isA + return match?.isA ?? undefined } function RelationshipGroup({ label, refs, entries, onNavigate }: { label: string; refs: string[]; entries: VaultEntry[]; onNavigate: (target: string) => void }) { diff --git a/src/components/NoteList.test.tsx b/src/components/NoteList.test.tsx index db3ddd36..b07d369f 100644 --- a/src/components/NoteList.test.tsx +++ b/src/components/NoteList.test.tsx @@ -131,7 +131,7 @@ describe('NoteList', () => { }) it('shows entity pinned at top with grouped children', () => { - const { container } = render( + render( ) // Entity title appears in header and pinned card diff --git a/src/components/Sidebar.test.tsx b/src/components/Sidebar.test.tsx index 0f53b9e0..1d79cb5f 100644 --- a/src/components/Sidebar.test.tsx +++ b/src/components/Sidebar.test.tsx @@ -18,6 +18,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 1024, + snippet: '', + relationships: {}, }, { path: '/vault/responsibility/grow-newsletter.md', @@ -33,6 +35,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 512, + snippet: '', + relationships: {}, }, { path: '/vault/experiment/stock-screener.md', @@ -48,6 +52,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 256, + snippet: '', + relationships: {}, }, { path: '/vault/procedure/weekly-essays.md', @@ -63,6 +69,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 128, + snippet: '', + relationships: {}, }, { path: '/vault/topic/software-development.md', @@ -78,6 +86,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 256, + snippet: '', + relationships: {}, }, { path: '/vault/topic/trading.md', @@ -93,6 +103,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 180, + snippet: '', + relationships: {}, }, { path: '/vault/person/alice.md', @@ -108,6 +120,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 100, + snippet: '', + relationships: {}, }, { path: '/vault/event/kickoff.md', @@ -123,6 +137,8 @@ const mockEntries: VaultEntry[] = [ modifiedAt: 1700000000, createdAt: null, fileSize: 200, + snippet: '', + relationships: {}, }, ] diff --git a/src/utils/typeColors.ts b/src/utils/typeColors.ts index 9588d2e5..892a61b5 100644 --- a/src/utils/typeColors.ts +++ b/src/utils/typeColors.ts @@ -27,11 +27,11 @@ const DEFAULT_COLOR = 'var(--accent-blue)' const DEFAULT_LIGHT_COLOR = 'var(--accent-blue-light)' /** Returns the CSS variable for the accent color of a given note type */ -export function getTypeColor(isA: string): string { - return TYPE_COLOR_MAP[isA] ?? DEFAULT_COLOR +export function getTypeColor(isA: string | null): string { + return (isA && TYPE_COLOR_MAP[isA]) ?? DEFAULT_COLOR } /** Returns the CSS variable for the light/background variant of a given note type's color */ -export function getTypeLightColor(isA: string): string { - return TYPE_LIGHT_COLOR_MAP[isA] ?? DEFAULT_LIGHT_COLOR +export function getTypeLightColor(isA: string | null): string { + return (isA && TYPE_LIGHT_COLOR_MAP[isA]) ?? DEFAULT_LIGHT_COLOR }