project-nomad/admin/inertia/components
Chris Sherwood 60e7d45908 feat(KB): first-chat JIT prompt for ingest policy (RFC #883 Phase 3 task 12)
When a user opens AI Chat with content available but no global ingest
policy yet recorded, surface a one-time banner above the chat header
asking how they want new content handled:

  - 'Index existing content' -> sets rag.defaultIngestPolicy=Always and
    triggers a sync so pending_decision files queue immediately
  - 'Maybe later' -> sets policy=Manual; existing and future content
    waits in pending_decision until the user opts in from the KB modal

After either button is clicked the banner never reappears, because both
write the policy KV (the same one #894 manages via the KB modal toggle).
There is intentionally no 'dismiss without deciding' X — that would just
re-show the banner forever.

Backend
- New GET /api/rag/policy-prompt-state returns
  {shouldPrompt, hasContent, totalFiles}
- RagService.getPolicyPromptState() reads KVStore('rag.defaultIngestPolicy')
  and counts kb_ingest_state rows; shouldPrompt is true only when policy
  is null AND scanner has seen >=1 file (avoids prompting on empty NOMADs)

Frontend
- New KbPolicyPromptBanner component (~120 LOC) handles the two-button
  decision flow with optimistic loading state, success/error toasts, and
  invalidates kbPolicyPromptState + ingestPolicy + embed-jobs + storedFiles
  on success
- Mounted in components/chat/index.tsx as the first child of the main
  content column so it sits above the chat title bar without taking space
  when shouldPrompt is false (renders nothing)
- Reads aiAssistantName from Inertia page props so banner copy matches
  the user's chosen assistant name

Stacks on feat/kb-policy-toggle (#894) because the policy KV mechanism
it writes through is introduced there. Both can land in rc.5; this PR
auto-rebases to rc once #894 merges.

Existing users on first upgrade to v1.32.0 will see this banner on first
chat visit post-upgrade — an explicit opt-in moment for content that was
already on disk. New users see it the first time they have curated
content downloaded.
2026-05-16 23:06:08 -07:00
..
chat feat(KB): first-chat JIT prompt for ingest policy (RFC #883 Phase 3 task 12) 2026-05-16 23:06:08 -07:00
file-uploader feat(KnowledgeBase): support up to 5 files upload of 100mb each per req 2026-04-03 14:26:50 -07:00
inputs feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
layout feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
maps fix(Maps): render notes in marker popup when populated 2026-05-05 10:38:56 -07:00
markdoc feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
systeminfo feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
ActiveDownloads.tsx feat(downloads): rich progress, friendly names, cancel, and live status (#554) 2026-04-03 14:26:50 -07:00
ActiveEmbedJobs.tsx fix(KB): remove redundant Refresh button from Processing Queue 2026-05-16 22:17:39 -07:00
ActiveModelDownloads.tsx fix(AI): allow cancelling in-progress model downloads and ensure consistent progress UI (#701) 2026-04-17 14:43:41 -07:00
Alert.tsx fix(UI): manual import map for DynamicIcon to avoid huge bundle of Tabler icons 2026-04-03 14:26:50 -07:00
BouncingDots.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
BouncingLogo.tsx feat: switch all PNG images to WEBP (#575) 2026-04-03 14:26:50 -07:00
BuilderTagSelector.tsx fix(UI): switch to tabler icons only for consistency 2026-01-31 20:39:49 -08:00
CategoryCard.tsx feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
CountryPickerModal.tsx fix(UI): Country Picker UX polish + auto-refresh stored files (#817) 2026-05-03 14:06:56 -07:00
CuratedCollectionCard.tsx feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
DebugInfoModal.tsx fix(UI): minor styling fixes for Night Ops 2026-03-20 11:46:10 -07:00
DownloadURLModal.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
DynamicIcon.tsx fix(UI): manual import map for DynamicIcon to avoid huge bundle of Tabler icons 2026-04-03 14:26:50 -07:00
Footer.tsx feat(UI): add Debug Info modal for bug reporting 2026-03-20 11:46:10 -07:00
HorizontalBarChart.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
InfoTooltip.tsx fix(UI): switch to tabler icons only for consistency 2026-01-31 20:39:49 -08:00
InstallActivityFeed.tsx fix(UI): constrain install activity feed height with auto-scroll (#611) 2026-04-03 14:26:50 -07:00
LoadingSpinner.tsx fix(ui): support proper size override of LoadingSpinner 2026-03-20 11:46:10 -07:00
MarkdocRenderer.tsx feat(docs): polish docs rendering with desert-themed components 2026-02-06 14:41:30 -08:00
ProgressBar.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
StorageProjectionBar.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
StyledButton.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
StyledModal.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
StyledSectionHeader.tsx feat: curated zim collections 2025-12-05 15:47:22 -08:00
StyledSidebar.tsx fix: cache docker list requests, aiAssistantName fetching, and ensure inertia used properly 2026-04-03 14:26:50 -07:00
StyledTable.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
ThemeToggle.tsx fix(UI): improve version display in Settings sidebar (#547) 2026-03-25 16:30:35 -07:00
TierSelectionModal.tsx feat(KB): surface embedding-disk estimate in curated tier-change modal (RFC #883 §1) 2026-05-16 21:33:30 -07:00
UpdateServiceModal.tsx feat(UI): add Night Ops dark mode with theme toggle 2026-03-20 11:46:10 -07:00
WikipediaSelector.tsx fix(ui): support proper size override of LoadingSpinner 2026-03-20 11:46:10 -07:00