Introduce optional web search enrichment flow for chat and regenerate requests. New /websearch endpoint calls enrich_prompt via SearXNG and returns enriched_prompt + citation sources.
DB: add sources_json column to chat_messages via ensure_sources_column migration helper.
Backend: persist sources_json for assistant replies (streaming and non-streaming); extend ChatRequest/RegenerateRequest to accept enriched_message and sources; history endpoint returns sources.
Frontend: add toggle for web search, settings for SearXNG URL + engines, and optional enrichment calls in sendMessage/regenerate. Render citation sources as rounded chips labeled with base domain under assistant replies.
Dependencies: add beautifulsoup4, httpx[http2], numpy for enrichment pipeline.
Implemented a per‑message collapse state that hides long user messages (>30 lines) with a “Show entire message / Collapse” button.
• Added collapsedUserMsgs map and helper collapseKeyFor to generate stable keys.
• Initialized or updated the collapse map whenever chat sessions or the active session change, preserving user toggles.
• Provided toggleUserMsgCollapse to switch the collapsed state.
• Updated the JSX to render the truncated content with an ellipsis when collapsed and render the expand/collapse button.
• Adjusted CSS for the new expand button: changed color to var(--muted), added align-self: flex-start, removed stray left margin, and retained bold, pointer cursor, and left‑aligned text.
• Minor style tweaks for the button hover effect.
Implemented an editing state that visually highlights the user message bubble with an accent border and shadow.
• Updated the message render logic to handle an CSS class and overlay a textarea that perfectly aligns with the bubble using a hidden shadow element.
• Re‑worked the and styles to apply the accent border, box‑shadow, and transition effects.
• Adjusted the textarea styling (, ) so it inherits the bubble’s look, respects whitespace, and automatically resizes without extra padding or borders.
• Added a hidden to keep the bubble width/height consistent while editing.
• Included new button styling for expandable user messages.
• Minor cleanup of redundant padding, margin, and color definitions in the styles.
• Updated the JSX to conditionally render the overlay textarea only during editing, ensuring a smooth UX.
• Added appropriate ARIA attributes and cursor styles for clarity.
Implemented robust streaming handling for assistant replies: a placeholder message is inserted, unread sessions are flagged when the user is in a different chat, and scroll‑to‑bottom/ tip logic is applied once the stream completes.
• Added copy‑to‑clipboard support for code blocks with visual feedback.
• Re‑implemented Markdown to clean trailing whitespace in code blocks, preserve formatting, add copy buttons, and refine table & blockquote handling.
• Introduced new CSS classes (.codeblock, .codeblock__header, .codeblock__copy, etc.) to style the code block wrapper, header bar, copy button, and pre/code area.
• Updated the front‑end to wire up the new copy handler, manage pending scroll targets, and keep unread state in sync.
• Minor cleanup of stray tags and comments throughout the renderer.
• Minor fixes to ensure proper scrolling behavior when the user scrolls away from the bottom during streaming.
• Added descriptive comments and ensured cross‑browser copy functionality via navigator.clipboard.
• Updated the markdown renderer to keep raw newlines for copy‑paste fidelity and to escape HTML entities correctly.
• Adjusted CSS to match existing theme variables and provide smooth copy button transitions.
Add PUT /sessions/{session_id}/messages/{index} to edit a user message and prune all subsequent messages.
Add POST /sessions/{session_id}/regenerate to regenerate an assistant response from a given index (supports optional streaming).
Introduce EditMessageRequest and RegenerateRequest schemas.
Update the frontend to: • allow in‑place editing of user messages with an auto‑focusing textarea; • copy messages to clipboard; • regenerate assistant responses via a button.
Add new CSS rules for message options bars and the editing textarea.