Skip to content

feat: redesign chat UI and add SSE token streaming#4

Open
grandmastr wants to merge 1 commit into
Uncensored-Developer:mainfrom
grandmastr:feat/chat-ui-redesign-streaming
Open

feat: redesign chat UI and add SSE token streaming#4
grandmastr wants to merge 1 commit into
Uncensored-Developer:mainfrom
grandmastr:feat/chat-ui-redesign-streaming

Conversation

@grandmastr

@grandmastr grandmastr commented Jun 3, 2026

Copy link
Copy Markdown

Summary

  • Chat UI redesign — conversational welcome screen, neutral pill bubbles, borderless assistant messages, permanent timestamps, shake-on-error input validation
  • Model selector moved out of the compose bar into a chip below-right; input is now just text field + send icon
  • SSE token streaming — new `POST /conversations/:id/messages/stream` endpoint streams LLM explanation tokens character-by-character via `ExplanationStreamer`; both Ollama (`stream:true` NDJSON) and OpenAI (Responses API SSE deltas) supported; non-streaming clients fall back automatically
  • Optimistic UI — user bubble and cleared input appear instantly on send; typing indicator (three dots → live text + blinking cursor) while AI responds
  • Bug fixes — Ollama model ID colon parsing (`llama3.2:1b`), OpenAI Responses API `output_text` content type for history messages, empty-SQL LLM response now returns 400 with model explanation instead of 500

Test plan

  • Send a message with Ollama — verify token-by-token streaming in the bubble
  • Send a message with OpenAI (gpt-4o-mini) — verify streaming works
  • Try sending an empty message — input border turns red and shakes, no error text
  • Hover a message bubble — timestamp is permanently visible below
  • Collapse the sidebar on a wide screen — chat column stays centered
  • Switch between light and dark mode — bubble colors and contrast hold up
  • Scroll up mid-stream — page follows the streaming cursor back to bottom

@grandmastr
grandmastr force-pushed the feat/chat-ui-redesign-streaming branch 4 times, most recently from 5c092f0 to de6fbc1 Compare June 4, 2026 10:55
Chat UI:
- Remove page title header from chat view; replace empty state with
  conversational welcome centered in the message area
- Redesign message bubbles: user messages use a neutral elevated pill,
  assistant messages render as plain text with no border box
- Move model selector out of the compose bar into a chip below-right;
  compose area is now just a text field + send icon
- Add animated typing indicator (three-dot pulse) while waiting for the
  first token; replace with streaming text + blinking cursor as tokens arrive
- Optimistic UI: user bubble and cleared input appear instantly on send
  before the API round-trip completes
- Permanent timestamps below every bubble (smart-formatted: time / Yesterday / date)
- Shake animation + red border on the input when validation fails; no
  inline error text
- Hidden scrollbar; reliable scroll-to-bottom using direct scrollTop
  assignment with setTimeout deferral after state updates
- Center chat column (max 800px, mx auto) within the right content area;
  fix AppShell main box mx:auto so it centers on wide screens

Backend:
- Fix Ollama model ID parsing: colons in model tags (e.g. llama3.2:1b)
  were mistaken for provider separators in normalizeProviderModels
- Fix OpenAI Responses API: assistant history messages must use
  content type output_text, not input_text
- Map empty-SQL LLM responses to ErrInvalidSQL (400) with the model's
  explanation instead of a generic 500 internal server error
- Add SSE streaming endpoint POST /conversations/:id/messages/stream
  that streams explanation tokens via ExplanationStreamer as they arrive
  from Ollama (stream:true NDJSON) and OpenAI (stream:true SSE deltas),
  then runs SQL validation and execution before sending the final events
- Add StreamingClient interface; both Ollama and OpenAI clients implement
  GenerateSQLStream; non-streaming clients fall back automatically
- Add StreamErrorMessage helper to map service errors to SSE error events
@grandmastr
grandmastr force-pushed the feat/chat-ui-redesign-streaming branch from de6fbc1 to cb4977e Compare June 4, 2026 11:22
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