feat: redesign chat UI and add SSE token streaming#4
Open
grandmastr wants to merge 1 commit into
Open
Conversation
9e095dc to
b08cf1d
Compare
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
b08cf1d to
5c092f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan