Skip to content

Web GUI: dark-mode fixes, composer KB picker, and robust agentic trail#25

Merged
lfnothias merged 4 commits into
mainfrom
gui-darkmode-kb-picker
Jun 22, 2026
Merged

Web GUI: dark-mode fixes, composer KB picker, and robust agentic trail#25
lfnothias merged 4 commits into
mainfrom
gui-darkmode-kb-picker

Conversation

@lfnothias

Copy link
Copy Markdown
Collaborator

Summary

A batch of web-GUI fixes plus one feature, all surfaced while testing the local instance in dark mode.

Dark mode

  • Route on-surface CNRS-blue text through --text-body so page titles, KB names, and stat values are legible instead of dark-on-dark (~67 sites / 18 files). Blue-on-light-chip text (yellow/green badges) is preserved.
  • Add a dark-adaptive --surface-hover token so buttons no longer flash near-white (with now-invisible light text) on hover. Migrate 31 hover backgrounds + 17 hover-text colours; fix 8 buttons that were invisible at rest.
  • Set color-scheme on the theme so native <select> dropdowns and scrollbars follow dark/light.

Composer KB picker (feature)

  • A corpus selector beside the mode pills: No KB / Auto / each KB (with paper counts). Overrides the Settings default per conversation and sends kb_name in /api/chat; Auto lets the backend similarity-route. Same Auto option added to Settings → Default knowledge base.

Agentic trail robustness

  • Complete on finish: mark every phase done on a successful run. Previously the later phases (which emit no step events in Basic mode) were stranded as "planned". Errored/cancelled runs keep progressive status so the trail never falsely claims success.
  • Live streaming: handle type:"status" SSE frames in parseFrame — they carry the live phase text ("Retrieving documents…", "Generating response…") and were being dropped, so the trail couldn't advance while the answer streamed.
  • Markdown safety net: wrap ReactMarkdown in an error boundary that falls back to raw text, so a transient Turbopack dev chunk-parse error can't crash the whole chat view.

Backend

  • Auto-route embedding compatibility: when kb_name="auto" routing surfaces KBs across embedding models (legacy all-MiniLM + current text-embedding-3-large), narrow to the running server's embedding family instead of erroring. Clear error only when none are compatible.

Verification

  • Frontend compiles clean (Turbopack); dark-mode legibility checked across KB list / Settings / Conversations / KB detail / Chat.
  • Auto-route fix verified end-to-end against the live server (narrows correctly, returns grounded answers).
  • SSE transport confirmed to stream progressively; status frames now drive live trail updates.

Note: the local OpenAI provider switch lives in the git-ignored config.yml and is intentionally not part of this PR.

🤖 Generated with Claude Code

lfnothias and others added 4 commits June 22, 2026 09:12
Frontend (web GUI):
- Dark mode: route on-surface CNRS-blue text through --text-body so page
  titles, KB names, and stat values are legible instead of dark-on-dark
  (~67 sites / 18 files). Blue-on-light-chip text (yellow/green badges)
  is preserved.
- Hover states: add a dark-adaptive --surface-hover token so buttons no
  longer flash near-white (with now-invisible light text) in dark mode.
  Migrate 31 hover backgrounds + 17 hover-text colours; fix 8 buttons
  that were invisible at rest. Set color-scheme on the theme so native
  <select> dropdowns and scrollbars follow dark/light.
- Composer KB picker: a corpus selector beside the mode pills
  (No KB / Auto / each KB with paper counts) that overrides the Settings
  default per conversation and sends kb_name in /api/chat. Add the same
  "Auto" option to Settings -> Default knowledge base.

Backend:
- Auto-route (kb_name="auto"): when the BM25 router surfaces KBs across
  embedding models, narrow to the running server's embedding family
  instead of failing with an embedding-compat error. Emit a clear error
  only when none of the matched KBs are compatible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Markdown: wrap ReactMarkdown in an error boundary that falls back to
  raw answer text. A SyntaxError thrown from inside react-markdown (pure
  JS, no eval) means a dependency chunk failed to parse — a Turbopack
  dev-mode hiccup when the page is open across a server restart — and
  shouldn't crash the whole chat view. A reload restores formatting.
- Agentic trail: mark every phase done on a successfully completed run
  (!running && !errored). The status previously keyed off the last phase
  with a matching step event, but Basic mode emits steps only for
  retrieval, leaving "Screen for relevance" / "Generate answer" stranded
  as "planned" after the answer finished. Errored/cancelled runs keep
  progressive status so the trail never falsely claims success.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
parseFrame ignored type:"status" SSE frames, so the backend's live phase
signals ("Retrieving documents…", "Generating response…") were dropped
and the agentic trail couldn't advance its active phase while the answer
streamed — it only resolved at completion. Convert status frames to trail
steps so the phases light up in real time as tokens arrive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the default Next.js favicon with the app's CNRS-yellow "sun"
(solid #ffeb6e disc + soft corona on deep navy), matching the hero and
sidebar logo. app/icon.svg drives modern browsers; app/favicon.ico is
regenerated to match (16–256px) as the legacy fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lfnothias lfnothias merged commit e013380 into main Jun 22, 2026
1 of 2 checks passed
@lfnothias lfnothias deleted the gui-darkmode-kb-picker branch June 22, 2026 17:09
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.

1 participant