diff --git a/src/components/Inspector.test.tsx b/src/components/Inspector.test.tsx index 5910b9e5..f86f6bd0 100644 --- a/src/components/Inspector.test.tsx +++ b/src/components/Inspector.test.tsx @@ -485,25 +485,8 @@ Status: Active /> ) - expect(screen.getByText(/via Belongs to/)).toBeInTheDocument() - expect(screen.getByText(/via Related to/)).toBeInTheDocument() - }) - - it('shows count badge for referenced-by entries', () => { - render( - - ) - // 2 entries reference via Belongs to — badge appears in the Referenced by header - const allTwos = screen.getAllByText('2') - expect(allTwos.length).toBeGreaterThanOrEqual(1) - // At least one "2" is inside a badge (span with ml-1 class) - expect(allTwos.some(el => el.classList.contains('ml-1'))).toBe(true) + expect(screen.getByText(/← Belongs to/i)).toBeInTheDocument() + expect(screen.getByText(/← Related to/i)).toBeInTheDocument() }) it('hides referenced-by section when no entries reference the current note', () => { @@ -580,7 +563,7 @@ Status: Active /> ) expect(screen.getByText('On Writing Well')).toBeInTheDocument() - expect(screen.getByText(/via Topics/)).toBeInTheDocument() + expect(screen.getByText(/← Topics/i)).toBeInTheDocument() }) it('excludes entries from backlinks when already shown in referenced-by', () => { @@ -619,7 +602,7 @@ Status: Active /> ) // noteA shows in Referenced By (via Belongs to) - expect(screen.getByText(/via Belongs to/)).toBeInTheDocument() + expect(screen.getByText(/← Belongs to/i)).toBeInTheDocument() expect(screen.getByText('On Writing Well')).toBeInTheDocument() // But NOT in Backlinks (even though outgoingLinks matches) — section hidden expect(screen.queryByText('Backlinks')).not.toBeInTheDocument() diff --git a/src/components/InspectorPanels.test.tsx b/src/components/InspectorPanels.test.tsx index a9725342..55f5b38b 100644 --- a/src/components/InspectorPanels.test.tsx +++ b/src/components/InspectorPanels.test.tsx @@ -467,18 +467,8 @@ describe('ReferencedByPanel', () => { expect(screen.getByText('Write Essays')).toBeInTheDocument() expect(screen.getByText('On Writing Well')).toBeInTheDocument() expect(screen.getByText('SEO Experiment')).toBeInTheDocument() - expect(screen.getByText(/via Belongs to/)).toBeInTheDocument() - expect(screen.getByText(/via Related to/)).toBeInTheDocument() - }) - - it('shows count badge when items exist', () => { - const items: ReferencedByItem[] = [ - { entry: makeEntry({ path: '/vault/a.md', title: 'A' }), viaKey: 'Has' }, - { entry: makeEntry({ path: '/vault/b.md', title: 'B' }), viaKey: 'Has' }, - { entry: makeEntry({ path: '/vault/c.md', title: 'C' }), viaKey: 'Topics' }, - ] - render() - expect(screen.getByText('3')).toBeInTheDocument() + expect(screen.getByText(/← Belongs to/i)).toBeInTheDocument() + expect(screen.getByText(/← Related to/i)).toBeInTheDocument() }) it('navigates when clicking a referenced-by entry', () => { diff --git a/src/components/InspectorPanels.tsx b/src/components/InspectorPanels.tsx index 303d00f4..44c350d2 100644 --- a/src/components/InspectorPanels.tsx +++ b/src/components/InspectorPanels.tsx @@ -413,15 +413,12 @@ export function ReferencedByPanel({ items, typeEntryMap, onNavigate }: { if (items.length === 0) return null return ( -
-

- Referenced by {items.length} -

+
{grouped.map(([viaKey, groupEntries]) => (
- - via {viaKey} + + ← {viaKey}
{groupEntries.map((e) => { diff --git a/src/index.css b/src/index.css index ba455d1a..57d5ad32 100644 --- a/src/index.css +++ b/src/index.css @@ -164,3 +164,8 @@ letter-spacing: 0.02em; text-transform: uppercase; } + +.referenced-by-panel button:hover { + text-decoration: underline; + text-decoration-style: dotted; +}