Skip to content

Backlinks UI Panel - Display 'Mentioned By' References - #340

Merged
malibio merged 6 commits into
mainfrom
feature/issue-318-backlinks-panel
Oct 23, 2025
Merged

malibio merged 6 commits into
mainfrom
feature/issue-318-backlinks-panel

Conversation

@malibio

@malibio malibio commented Oct 23, 2025

Copy link
Copy Markdown
Collaborator

Closes #318

malibio and others added 6 commits October 23, 2025 22:02
Extended ADR-022 with container-level backlinks architecture decision.

Key points:
- Backlinks resolved at container level, not individual nodes
- Matches user mental model (pages, not paragraphs)
- Automatic deduplication when multiple nodes in same container mention target
- Task/ai-chat nodes treated as own containers (exceptions)

Related to #318

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Implements container-level backlinks display with bits-ui Collapsible component.

**Backend Changes:**
- Add `get_mentioning_containers()` to NodeService (packages/core/src/services/node_service.rs)
- Resolves incoming mentions to container nodes with automatic deduplication
- Handles task/ai-chat node exceptions (treated as own containers)
- SQL query with CASE statement for container resolution
- Add Tauri command `get_mentioning_containers` (packages/desktop-app/src-tauri/src/commands/nodes.rs)
- Register command in lib.rs

**Frontend Changes:**
- Add `getMentioningContainers()` to BackendAdapter interface and implementations
- Create BacklinksPanel component (packages/desktop-app/src/lib/design/components/backlinks-panel.svelte)
- Uses bits-ui Collapsible for accordion-style collapse/expand
- Chevron on right (rotates 180° when open)
- Shows count badge in trigger
- Card-style list of container backlinks
- Loading, empty, and error states
- Integrate into DateNodeViewer below hierarchical content

**Design Pattern:**
- Follows Schema-Driven Property Forms collapsible pattern from design system
- Uses bits-ui primitives directly (consistent with existing patterns)
- Design system compliant styling (CSS variables, spacing, colors)

**Container-Level Resolution:**
- If nodes A and B (children of Container X) mention target node
- Returns ['container-x-id'] instead of ['node-a-id', 'node-b-id']
- Automatic deduplication at database level
- Task and ai-chat nodes show as themselves (not their containers)

All quality checks pass. Ready for review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…ypes (issue #318)

**Final Design Polish:**
- Changed default state to collapsed (`isOpen = false`) for cleaner UX
- Fixed TypeScript error by properly importing and using IconName type
- Updated SchemaPropertyFormDemo with same default collapsed behavior
- Ensured proper spacing with `pb-4` on children section
- Verified chevron rotation animation works correctly

**Type Safety:**
- Added `import { type IconName }` to backlinks-panel.svelte
- Updated `getNodeIcon()` return type and iconMap Record type
- All TypeScript compilation errors resolved

**Design Matches:**
- Simple collapsible accordion style matching Schema-Driven Property Forms
- Clean link list with node icons (no hover effects, no underlines)
- Proper visual hierarchy with border-top separator and padding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
**Backend Implementation:**
- Added get_mentioning_containers() function to NodeService (Rust)
- Created Tauri command for mentioning containers endpoint
- Added HTTP endpoint /api/nodes/:id/mentioning-containers for dev server
- Full backend integration complete

**Frontend Implementation:**
- Created BacklinksPanel.svelte with bits-ui Collapsible component
- Integrated directly into BaseNodeViewer (container-level feature)
- Added getMentioningContainers() to BackendAdapter interface
- Implemented mock support in MockBackendAdapter for testing
- Panel automatically appears in ALL container viewers (date, task, etc.)

**Critical Fix - Tailwind v4 → v3 Downgrade:**
- Removed @tailwindcss/postcss v4.1.12 and tailwindcss v4.1.11
- Installed tailwindcss v3.4.18 (matching design-system package)
- Updated postcss.config.js: '@tailwindcss/postcss' → 'tailwindcss'
- Root cause: Tailwind v4 wasn't generating CSS for any utility classes
- All Tailwind utilities now work: pt-2, border-t, gap-3, text-sm, h-4, w-4, py-3, font-medium, mt-4
- DOM measurements confirm identical rendering to Schema-Driven Property Forms demo

**Architecture:**
- BacklinksPanel rendered inside BaseNodeViewer's node-content-area
- Inherits proper 24px left/right padding from scroll wrapper
- Positioned below hierarchical children with mt-4 spacing
- Matches demo structure and positioning exactly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The count "(0 nodes)" already indicates no backlinks exist.
Removed redundant "No pages mention this one yet." message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
… BacklinksPanel issues (issue #318)

**Backend Tests (Rust):**
- Added 6 comprehensive unit tests for get_mentioning_containers() function
- Tests cover: basic backlinks, deduplication, task exception, empty backlinks, mixed containers, nonexistent nodes
- All tests passing with proper container-level resolution logic verification
- Commented out ai-chat exception test (node type not yet implemented)

**Frontend Fixes (BacklinksPanel):**
- Fixed cache dependency issue: Now explicitly fetches nodes via backendAdapter instead of relying on sharedNodeStore cache
- Added null filtering to handle deleted nodes gracefully
- Restored empty state message for better UX: "No pages mention this one yet."
- Removed unused sharedNodeStore import (lint fix)
- All TypeScript type safety issues resolved

**Code Review Findings Addressed:**
✅ Critical: Rust tests for get_mentioning_containers() (6 tests)
✅ Important: Cache dependency issue fixed (explicit fetch)
✅ Important: Empty state message restored
✅ Nit: Redundant type annotation removed (auto-formatted by prettier)
⏭️  Skipped: Frontend component tests (pragmatic decision - simple component, backend well-tested)
⏭️  Skipped: Tailwind v4 migration issue (speculative work, v3 works fine)

**Quality Checks:**
- ✅ All Rust tests pass (6/6)
- ✅ TypeScript compilation clean (0 errors, 0 warnings)
- ✅ Linting clean (oxlint + eslint)
- ✅ Formatting applied (prettier)
- ✅ Rust clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@malibio
malibio merged commit 40f89bc into main Oct 23, 2025
@malibio
malibio deleted the feature/issue-318-backlinks-panel branch October 23, 2025 22:46
malibio added a commit that referenced this pull request Feb 4, 2026
* docs: Add container-level backlinks decision to ADR-022

Extended ADR-022 with container-level backlinks architecture decision.

Key points:
- Backlinks resolved at container level, not individual nodes
- Matches user mental model (pages, not paragraphs)
- Automatic deduplication when multiple nodes in same container mention target
- Task/ai-chat nodes treated as own containers (exceptions)

Related to #318

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Add BacklinksPanel with collapsible design (#318)

Implements container-level backlinks display with bits-ui Collapsible component.

**Backend Changes:**
- Add `get_mentioning_containers()` to NodeService (packages/core/src/services/node_service.rs)
- Resolves incoming mentions to container nodes with automatic deduplication
- Handles task/ai-chat node exceptions (treated as own containers)
- SQL query with CASE statement for container resolution
- Add Tauri command `get_mentioning_containers` (packages/desktop-app/src-tauri/src/commands/nodes.rs)
- Register command in lib.rs

**Frontend Changes:**
- Add `getMentioningContainers()` to BackendAdapter interface and implementations
- Create BacklinksPanel component (packages/desktop-app/src/lib/design/components/backlinks-panel.svelte)
- Uses bits-ui Collapsible for accordion-style collapse/expand
- Chevron on right (rotates 180° when open)
- Shows count badge in trigger
- Card-style list of container backlinks
- Loading, empty, and error states
- Integrate into DateNodeViewer below hierarchical content

**Design Pattern:**
- Follows Schema-Driven Property Forms collapsible pattern from design system
- Uses bits-ui primitives directly (consistent with existing patterns)
- Design system compliant styling (CSS variables, spacing, colors)

**Container-Level Resolution:**
- If nodes A and B (children of Container X) mention target node
- Returns ['container-x-id'] instead of ['node-a-id', 'node-b-id']
- Automatic deduplication at database level
- Task and ai-chat nodes show as themselves (not their containers)

All quality checks pass. Ready for review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Set BacklinksPanel to collapsed by default and fix TypeScript types (issue #318)

**Final Design Polish:**
- Changed default state to collapsed (`isOpen = false`) for cleaner UX
- Fixed TypeScript error by properly importing and using IconName type
- Updated SchemaPropertyFormDemo with same default collapsed behavior
- Ensured proper spacing with `pb-4` on children section
- Verified chevron rotation animation works correctly

**Type Safety:**
- Added `import { type IconName }` to backlinks-panel.svelte
- Updated `getNodeIcon()` return type and iconMap Record type
- All TypeScript compilation errors resolved

**Design Matches:**
- Simple collapsible accordion style matching Schema-Driven Property Forms
- Clean link list with node icons (no hover effects, no underlines)
- Proper visual hierarchy with border-top separator and padding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Implement BacklinksPanel with Tailwind v3 downgrade (issue #318)

**Backend Implementation:**
- Added get_mentioning_containers() function to NodeService (Rust)
- Created Tauri command for mentioning containers endpoint
- Added HTTP endpoint /api/nodes/:id/mentioning-containers for dev server
- Full backend integration complete

**Frontend Implementation:**
- Created BacklinksPanel.svelte with bits-ui Collapsible component
- Integrated directly into BaseNodeViewer (container-level feature)
- Added getMentioningContainers() to BackendAdapter interface
- Implemented mock support in MockBackendAdapter for testing
- Panel automatically appears in ALL container viewers (date, task, etc.)

**Critical Fix - Tailwind v4 → v3 Downgrade:**
- Removed @tailwindcss/postcss v4.1.12 and tailwindcss v4.1.11
- Installed tailwindcss v3.4.18 (matching design-system package)
- Updated postcss.config.js: '@tailwindcss/postcss' → 'tailwindcss'
- Root cause: Tailwind v4 wasn't generating CSS for any utility classes
- All Tailwind utilities now work: pt-2, border-t, gap-3, text-sm, h-4, w-4, py-3, font-medium, mt-4
- DOM measurements confirm identical rendering to Schema-Driven Property Forms demo

**Architecture:**
- BacklinksPanel rendered inside BaseNodeViewer's node-content-area
- Inherits proper 24px left/right padding from scroll wrapper
- Positioned below hierarchical children with mt-4 spacing
- Matches demo structure and positioning exactly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* refine: Remove empty state message from BacklinksPanel

The count "(0 nodes)" already indicates no backlinks exist.
Removed redundant "No pages mention this one yet." message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* test: Add comprehensive tests for get_mentioning_containers() and fix BacklinksPanel issues (issue #318)

**Backend Tests (Rust):**
- Added 6 comprehensive unit tests for get_mentioning_containers() function
- Tests cover: basic backlinks, deduplication, task exception, empty backlinks, mixed containers, nonexistent nodes
- All tests passing with proper container-level resolution logic verification
- Commented out ai-chat exception test (node type not yet implemented)

**Frontend Fixes (BacklinksPanel):**
- Fixed cache dependency issue: Now explicitly fetches nodes via backendAdapter instead of relying on sharedNodeStore cache
- Added null filtering to handle deleted nodes gracefully
- Restored empty state message for better UX: "No pages mention this one yet."
- Removed unused sharedNodeStore import (lint fix)
- All TypeScript type safety issues resolved

**Code Review Findings Addressed:**
✅ Critical: Rust tests for get_mentioning_containers() (6 tests)
✅ Important: Cache dependency issue fixed (explicit fetch)
✅ Important: Empty state message restored
✅ Nit: Redundant type annotation removed (auto-formatted by prettier)
⏭️  Skipped: Frontend component tests (pragmatic decision - simple component, backend well-tested)
⏭️  Skipped: Tailwind v4 migration issue (speculative work, v3 works fine)

**Quality Checks:**
- ✅ All Rust tests pass (6/6)
- ✅ TypeScript compilation clean (0 errors, 0 warnings)
- ✅ Linting clean (oxlint + eslint)
- ✅ Formatting applied (prettier)
- ✅ Rust clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 5, 2026
* docs: Add container-level backlinks decision to ADR-022

Extended ADR-022 with container-level backlinks architecture decision.

Key points:
- Backlinks resolved at container level, not individual nodes
- Matches user mental model (pages, not paragraphs)
- Automatic deduplication when multiple nodes in same container mention target
- Task/ai-chat nodes treated as own containers (exceptions)

Related to #318

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Add BacklinksPanel with collapsible design (#318)

Implements container-level backlinks display with bits-ui Collapsible component.

**Backend Changes:**
- Add `get_mentioning_containers()` to NodeService (packages/core/src/services/node_service.rs)
- Resolves incoming mentions to container nodes with automatic deduplication
- Handles task/ai-chat node exceptions (treated as own containers)
- SQL query with CASE statement for container resolution
- Add Tauri command `get_mentioning_containers` (packages/desktop-app/src-tauri/src/commands/nodes.rs)
- Register command in lib.rs

**Frontend Changes:**
- Add `getMentioningContainers()` to BackendAdapter interface and implementations
- Create BacklinksPanel component (packages/desktop-app/src/lib/design/components/backlinks-panel.svelte)
- Uses bits-ui Collapsible for accordion-style collapse/expand
- Chevron on right (rotates 180° when open)
- Shows count badge in trigger
- Card-style list of container backlinks
- Loading, empty, and error states
- Integrate into DateNodeViewer below hierarchical content

**Design Pattern:**
- Follows Schema-Driven Property Forms collapsible pattern from design system
- Uses bits-ui primitives directly (consistent with existing patterns)
- Design system compliant styling (CSS variables, spacing, colors)

**Container-Level Resolution:**
- If nodes A and B (children of Container X) mention target node
- Returns ['container-x-id'] instead of ['node-a-id', 'node-b-id']
- Automatic deduplication at database level
- Task and ai-chat nodes show as themselves (not their containers)

All quality checks pass. Ready for review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Set BacklinksPanel to collapsed by default and fix TypeScript types (issue #318)

**Final Design Polish:**
- Changed default state to collapsed (`isOpen = false`) for cleaner UX
- Fixed TypeScript error by properly importing and using IconName type
- Updated SchemaPropertyFormDemo with same default collapsed behavior
- Ensured proper spacing with `pb-4` on children section
- Verified chevron rotation animation works correctly

**Type Safety:**
- Added `import { type IconName }` to backlinks-panel.svelte
- Updated `getNodeIcon()` return type and iconMap Record type
- All TypeScript compilation errors resolved

**Design Matches:**
- Simple collapsible accordion style matching Schema-Driven Property Forms
- Clean link list with node icons (no hover effects, no underlines)
- Proper visual hierarchy with border-top separator and padding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Implement BacklinksPanel with Tailwind v3 downgrade (issue #318)

**Backend Implementation:**
- Added get_mentioning_containers() function to NodeService (Rust)
- Created Tauri command for mentioning containers endpoint
- Added HTTP endpoint /api/nodes/:id/mentioning-containers for dev server
- Full backend integration complete

**Frontend Implementation:**
- Created BacklinksPanel.svelte with bits-ui Collapsible component
- Integrated directly into BaseNodeViewer (container-level feature)
- Added getMentioningContainers() to BackendAdapter interface
- Implemented mock support in MockBackendAdapter for testing
- Panel automatically appears in ALL container viewers (date, task, etc.)

**Critical Fix - Tailwind v4 → v3 Downgrade:**
- Removed @tailwindcss/postcss v4.1.12 and tailwindcss v4.1.11
- Installed tailwindcss v3.4.18 (matching design-system package)
- Updated postcss.config.js: '@tailwindcss/postcss' → 'tailwindcss'
- Root cause: Tailwind v4 wasn't generating CSS for any utility classes
- All Tailwind utilities now work: pt-2, border-t, gap-3, text-sm, h-4, w-4, py-3, font-medium, mt-4
- DOM measurements confirm identical rendering to Schema-Driven Property Forms demo

**Architecture:**
- BacklinksPanel rendered inside BaseNodeViewer's node-content-area
- Inherits proper 24px left/right padding from scroll wrapper
- Positioned below hierarchical children with mt-4 spacing
- Matches demo structure and positioning exactly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* refine: Remove empty state message from BacklinksPanel

The count "(0 nodes)" already indicates no backlinks exist.
Removed redundant "No pages mention this one yet." message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* test: Add comprehensive tests for get_mentioning_containers() and fix BacklinksPanel issues (issue #318)

**Backend Tests (Rust):**
- Added 6 comprehensive unit tests for get_mentioning_containers() function
- Tests cover: basic backlinks, deduplication, task exception, empty backlinks, mixed containers, nonexistent nodes
- All tests passing with proper container-level resolution logic verification
- Commented out ai-chat exception test (node type not yet implemented)

**Frontend Fixes (BacklinksPanel):**
- Fixed cache dependency issue: Now explicitly fetches nodes via backendAdapter instead of relying on sharedNodeStore cache
- Added null filtering to handle deleted nodes gracefully
- Restored empty state message for better UX: "No pages mention this one yet."
- Removed unused sharedNodeStore import (lint fix)
- All TypeScript type safety issues resolved

**Code Review Findings Addressed:**
✅ Critical: Rust tests for get_mentioning_containers() (6 tests)
✅ Important: Cache dependency issue fixed (explicit fetch)
✅ Important: Empty state message restored
✅ Nit: Redundant type annotation removed (auto-formatted by prettier)
⏭️  Skipped: Frontend component tests (pragmatic decision - simple component, backend well-tested)
⏭️  Skipped: Tailwind v4 migration issue (speculative work, v3 works fine)

**Quality Checks:**
- ✅ All Rust tests pass (6/6)
- ✅ TypeScript compilation clean (0 errors, 0 warnings)
- ✅ Linting clean (oxlint + eslint)
- ✅ Formatting applied (prettier)
- ✅ Rust clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 26, 2026
* docs: Add container-level backlinks decision to ADR-022

Extended ADR-022 with container-level backlinks architecture decision.

Key points:
- Backlinks resolved at container level, not individual nodes
- Matches user mental model (pages, not paragraphs)
- Automatic deduplication when multiple nodes in same container mention target
- Task/ai-chat nodes treated as own containers (exceptions)

Related to #318

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Add BacklinksPanel with collapsible design (#318)

Implements container-level backlinks display with bits-ui Collapsible component.

**Backend Changes:**
- Add `get_mentioning_containers()` to NodeService (packages/core/src/services/node_service.rs)
- Resolves incoming mentions to container nodes with automatic deduplication
- Handles task/ai-chat node exceptions (treated as own containers)
- SQL query with CASE statement for container resolution
- Add Tauri command `get_mentioning_containers` (packages/desktop-app/src-tauri/src/commands/nodes.rs)
- Register command in lib.rs

**Frontend Changes:**
- Add `getMentioningContainers()` to BackendAdapter interface and implementations
- Create BacklinksPanel component (packages/desktop-app/src/lib/design/components/backlinks-panel.svelte)
- Uses bits-ui Collapsible for accordion-style collapse/expand
- Chevron on right (rotates 180° when open)
- Shows count badge in trigger
- Card-style list of container backlinks
- Loading, empty, and error states
- Integrate into DateNodeViewer below hierarchical content

**Design Pattern:**
- Follows Schema-Driven Property Forms collapsible pattern from design system
- Uses bits-ui primitives directly (consistent with existing patterns)
- Design system compliant styling (CSS variables, spacing, colors)

**Container-Level Resolution:**
- If nodes A and B (children of Container X) mention target node
- Returns ['container-x-id'] instead of ['node-a-id', 'node-b-id']
- Automatic deduplication at database level
- Task and ai-chat nodes show as themselves (not their containers)

All quality checks pass. Ready for review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Set BacklinksPanel to collapsed by default and fix TypeScript types (issue #318)

**Final Design Polish:**
- Changed default state to collapsed (`isOpen = false`) for cleaner UX
- Fixed TypeScript error by properly importing and using IconName type
- Updated SchemaPropertyFormDemo with same default collapsed behavior
- Ensured proper spacing with `pb-4` on children section
- Verified chevron rotation animation works correctly

**Type Safety:**
- Added `import { type IconName }` to backlinks-panel.svelte
- Updated `getNodeIcon()` return type and iconMap Record type
- All TypeScript compilation errors resolved

**Design Matches:**
- Simple collapsible accordion style matching Schema-Driven Property Forms
- Clean link list with node icons (no hover effects, no underlines)
- Proper visual hierarchy with border-top separator and padding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* feat: Implement BacklinksPanel with Tailwind v3 downgrade (issue #318)

**Backend Implementation:**
- Added get_mentioning_containers() function to NodeService (Rust)
- Created Tauri command for mentioning containers endpoint
- Added HTTP endpoint /api/nodes/:id/mentioning-containers for dev server
- Full backend integration complete

**Frontend Implementation:**
- Created BacklinksPanel.svelte with bits-ui Collapsible component
- Integrated directly into BaseNodeViewer (container-level feature)
- Added getMentioningContainers() to BackendAdapter interface
- Implemented mock support in MockBackendAdapter for testing
- Panel automatically appears in ALL container viewers (date, task, etc.)

**Critical Fix - Tailwind v4 → v3 Downgrade:**
- Removed @tailwindcss/postcss v4.1.12 and tailwindcss v4.1.11
- Installed tailwindcss v3.4.18 (matching design-system package)
- Updated postcss.config.js: '@tailwindcss/postcss' → 'tailwindcss'
- Root cause: Tailwind v4 wasn't generating CSS for any utility classes
- All Tailwind utilities now work: pt-2, border-t, gap-3, text-sm, h-4, w-4, py-3, font-medium, mt-4
- DOM measurements confirm identical rendering to Schema-Driven Property Forms demo

**Architecture:**
- BacklinksPanel rendered inside BaseNodeViewer's node-content-area
- Inherits proper 24px left/right padding from scroll wrapper
- Positioned below hierarchical children with mt-4 spacing
- Matches demo structure and positioning exactly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* refine: Remove empty state message from BacklinksPanel

The count "(0 nodes)" already indicates no backlinks exist.
Removed redundant "No pages mention this one yet." message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* test: Add comprehensive tests for get_mentioning_containers() and fix BacklinksPanel issues (issue #318)

**Backend Tests (Rust):**
- Added 6 comprehensive unit tests for get_mentioning_containers() function
- Tests cover: basic backlinks, deduplication, task exception, empty backlinks, mixed containers, nonexistent nodes
- All tests passing with proper container-level resolution logic verification
- Commented out ai-chat exception test (node type not yet implemented)

**Frontend Fixes (BacklinksPanel):**
- Fixed cache dependency issue: Now explicitly fetches nodes via backendAdapter instead of relying on sharedNodeStore cache
- Added null filtering to handle deleted nodes gracefully
- Restored empty state message for better UX: "No pages mention this one yet."
- Removed unused sharedNodeStore import (lint fix)
- All TypeScript type safety issues resolved

**Code Review Findings Addressed:**
✅ Critical: Rust tests for get_mentioning_containers() (6 tests)
✅ Important: Cache dependency issue fixed (explicit fetch)
✅ Important: Empty state message restored
✅ Nit: Redundant type annotation removed (auto-formatted by prettier)
⏭️  Skipped: Frontend component tests (pragmatic decision - simple component, backend well-tested)
⏭️  Skipped: Tailwind v4 migration issue (speculative work, v3 works fine)

**Quality Checks:**
- ✅ All Rust tests pass (6/6)
- ✅ TypeScript compilation clean (0 errors, 0 warnings)
- ✅ Linting clean (oxlint + eslint)
- ✅ Formatting applied (prettier)
- ✅ Rust clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backlinks UI Panel - Display 'Mentioned By' References

1 participant