project-nomad/admin/inertia/components/chat
Chris Sherwood 42bd91df21
fix(KB): blank-screen on panel open + tooltips on bulk-action buttons
The Stored Knowledge Base Files render crashed on first open in v1.32.0-rc.5
with `ReferenceError: sourceToDisplayName is not defined`. The table column's
render() called `sourceToDisplayName(record.source)` but the function was
extracted to `lib/kb_file_grouping.ts` in PR #892 and never imported in
KnowledgeBaseModal.tsx. The unhandled error unmounts the entire React tree,
so users see a blank screen ~20s after opening the panel.

Root cause: PR #895 (conditional warnings) rewrote the render() and used
`sourceToDisplayName(record.source)` instead of `record.displayName`, which
KbFileGroup already carries from groupAndSortKbFiles(). PR #895's review
follow-up (cbae48a) compounded this by narrowing the StyledTable generic
from `KbFileGroup` to `{source: string}`, hiding the type drift from tsc.

This restores the post-#892 pattern:
- StyledTable generic back to `KbFileGroup`
- Render uses `record.displayName` (works for both per-file rows and the
  collapsed admin-docs row; calling sourceToDisplayName on the synthetic
  `__admin_docs_group__` would have rendered that literal as the row name).

Also folds in tooltip copy on the three bulk-action buttons (Reset & Rebuild,
Re-embed All, Sync Storage) so the difference in destructiveness is visible
on hover. Uses native `title` attribute via StyledButton's prop pass-through;
no new component dependency.

Inertia tsconfig catches this regression cleanly (TS2304 + TS2339); the
pre-push hook only runs the backend tsconfig which excludes inertia/**, so
the bug shipped. Tracking the typecheck-coverage gap as a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 17:15:04 +00:00
..
ChatAssistantAvatar.tsx feat: [wip] native AI chat interface 2026-01-31 20:39:49 -08:00
ChatButton.tsx fix(UI): switch to tabler icons only for consistency 2026-01-31 20:39:49 -08:00
ChatInterface.tsx feat(AI): enable remote AI chat host 2026-04-03 14:26:50 -07:00
ChatMessageBubble.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
ChatModal.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
ChatSidebar.tsx feat: switch all PNG images to WEBP (#575) 2026-04-03 14:26:50 -07:00
KbPolicyPromptBanner.tsx fix(KB): silent maybe-later error + redundant prompt-state refetches (PR #899 review) 2026-05-20 17:14:45 +00:00
KnowledgeBaseModal.tsx fix(KB): blank-screen on panel open + tooltips on bulk-action buttons 2026-05-20 17:15:04 +00:00
index.tsx feat(KB): first-chat JIT prompt for ingest policy (RFC #883 Phase 3 task 12) 2026-05-20 17:14:45 +00:00