Commit Graph

283 Commits

Author SHA1 Message Date
Pascal 7953c18967 webui: fix UI freeze at high token rates with RAF yield
The markdown coalescing loop was processing chunks back-to-back without
yielding to the browser's paint cycle. At high token rates (250+ tok/s),
this caused complete UI freeze as the main thread was perpetually busy.

Add a requestAnimationFrame yield between processing batches. This allows
the browser to paint at screen FPS regardless of token throughput. Chunks
arriving during the yield are coalesced and processed together, so we
skip intermediate states and jump straight to the latest content.

Before: Chunk->process->Chunk->process->... (browser never paints = freeze)
After:  Chunk->process->[RAF]->coalesced chunks->process->[RAF]->... (screen FPS)

Tested with 250 tok/s streams on 50K+ token contexts: smooth scrolling
and responsive UI throughout.
2026-02-01 20:34:08 +01:00
Pascal 0dbaeaf6c7 webui: incremental MDAST transform caching for streaming performance
Replace full AST re-transformation with per-block caching strategy.
Previously, each streaming chunk triggered processor.run() on the entire
document (12 rehype/remark plugins including KaTeX and highlight.js).

Now transforms individual MDAST nodes and caches results by position hash.
In append-only streaming mode, stable blocks are reused directly from cache,
only the unstable trailing block is re-transformed.

- Add SvelteMap FIFO cache (5000 blocks, evicts oldest 1000 on overflow)
- Add getMdastNodeHash() for MDAST node fingerprinting by position
- Add isAppendMode() to detect streaming append patterns
- Add transformMdastNode() for single-node transformation with cache lookup
- Remove stringifyProcessedNode() (dead code after refactor)

Reduces streaming complexity from O(N × transforms) to O(1) for stable blocks.
Targets 200K token contexts without UI degradation on mobile devices.
2026-02-01 19:44:16 +01:00
Pascal 82f6094aa2 feat: render images inline below attachment markers in tool results
Parse tool results line-by-line to display images immediately after their
[Attachment saved: xxx.png] markers. Fixes previous commit where all images
from all tool calls were shown in every section. Each tool call now displays
only its own images.

Uses Svelte derived for memoization to avoid re-parsing on every streaming
chunk. Parsing only occurs when section.toolResult or message.extra changes
2026-02-01 12:06:25 +01:00
Pascal be96423ae9 feat: render images below attachment markers in tool results 2026-02-01 04:56:21 +01:00
Pascal 42244c0162 fix: also skip image attachments in message history for non-vision backends 2026-02-01 04:13:37 +01:00
Pascal 893dbb058a fix: skip sending image attachments to non-vision backends 2026-02-01 03:20:36 +01:00
Pascal 1384352484 fix: responsive MCP server cards, prioritize server name over version 2026-01-31 08:22:41 +01:00
Pascal 1615b1c58c fix: responsive MCP server cards for mobile viewports 2026-01-31 07:58:47 +01:00
Pascal b872838329 webui: adaptive model selector dropdown width
Make model selector dropdown responsive:
- Mobile: full width (w-full max-w-[100vw])
- Desktop: adapts to longest model name (sm:w-max)
- Replace TruncatedText with responsive span (truncate on mobile, full text on desktop via sm:overflow-visible sm:whitespace-nowrap)
- Center status icons in fixed 24px wrapper to prevent layout shifts
- Add sm:pr-2 padding between text and icon zone on desktop

Fixes dropdown cutting off long model names on desktop while maintaining full-width display on mobile with proper text truncation
2026-01-30 20:21:05 +01:00
Aleksander Grygier e41f70bb47 refactor: Use CORS Proxy for favicons calls 2026-01-29 16:30:10 +01:00
Aleksander Grygier 46c5bca942 refactor: Proxy utility 2026-01-29 16:29:04 +01:00
Aleksander Grygier 536c6866e3 feat: Integrate with `llama-server` proxy + improve MCP Server Edit Form 2026-01-29 14:59:28 +01:00
Aleksander Grygier 6793c7daac fix: Checking for capabilities from store 2026-01-29 12:45:10 +01:00
Aleksander Grygier 2aa704b821 refactor: Cleanup 2026-01-29 11:44:08 +01:00
Aleksander Grygier d9e82b7c29 fix: Linter errors 2026-01-28 19:55:44 +01:00
Aleksander Grygier 7c9be63a74 refactor: Refine Chat Message Processing State Display 2026-01-28 18:31:37 +01:00
Aleksander Grygier 5a176d1893 feat: Chat logic improvements 2026-01-28 18:31:37 +01:00
Aleksander Grygier aa7089d598 feat: Integrate Resource Attachments into Chat Form UI 2026-01-28 18:31:37 +01:00
Aleksander Grygier 23e4ef7495 feat: MCP Resources UI
feat: Implement MCP Resource Selection Dialog
2026-01-28 18:31:37 +01:00
Aleksander Grygier 1623547e2b feat: Integrate Resource Store into Main MCP Store 2026-01-28 18:31:36 +01:00
Aleksander Grygier dc2076a77c feat: MCP Resources Svelte Store 2026-01-28 18:31:36 +01:00
Aleksander Grygier 192c920d73 refactor: Use constants 2026-01-28 18:31:35 +01:00
Aleksander Grygier 89166a79d4 feat: Introduce MCP Resource Types and Service Methods 2026-01-28 18:31:35 +01:00
Aleksander Grygier 85a61a7c96 refactor: Componentize HorizontalScrollCarousel 2026-01-28 17:32:59 +01:00
Aleksander Grygier bfbcdc7420 fix: Code Preview sandbox 2026-01-28 17:31:04 +01:00
Aleksander Grygier bdae58ceb8 refactor: Reuse MCP connections for health checks 2026-01-27 17:13:09 +01:00
Aleksander Grygier fcb7d1f899 fix: Sync streaming content to active messages 2026-01-27 16:46:19 +01:00
Aleksander Grygier aff13cc085 refactor: Go back to simpler Stores + Services architecture 2026-01-27 15:57:12 +01:00
Aleksander Grygier f7b7ae467e feat: Introduce BaseClient for common store integration
refactor(agentic-client): Extend BaseClient for store integration
refactor(chat-client): Extend BaseClient for store integration
refactor(conversations-client): Extend BaseClient for store integration
2026-01-27 15:27:30 +01:00
Aleksander Grygier ace0de145a feat: Introduce centralized API fetch utilities
refactor(models): Use new API fetch utilities
refactor(props): Use new API fetch utilities
2026-01-27 15:27:29 +01:00
Aleksander Grygier 948278d663 fix: Missing tool call handling 2026-01-27 15:11:06 +01:00
Aleksander Grygier f40b377e34 refactor: Improves abort signal handling 2026-01-27 14:55:35 +01:00
Aleksander Grygier 7ba1b458d5 refactor: Create shared ActiveConversationStore to avoid circular dependency between ChatStore and ConversationsStore 2026-01-27 14:27:13 +01:00
Aleksander Grygier 6e7b3385a2 feat: Enhance ChatMessageMcpPromptContent display 2026-01-27 13:47:18 +01:00
Aleksander Grygier 8219404122 feat: Disable server card toggle when in error state 2026-01-27 13:47:18 +01:00
Aleksander Grygier 738ccd8a52 feat: Add auto-resizing textarea to KeyValuePairs component 2026-01-27 13:47:18 +01:00
Aleksander Grygier 70f96c96b6 refactor: Remove unused `getChatActionsContext` import 2026-01-27 13:10:24 +01:00
Aleksander Grygier d43895d706 feat: Implement inactive chat conversation state cleanup 2026-01-27 13:10:24 +01:00
Aleksander Grygier 2281ac50c6 refactor: Use TTL cache for model properties in ModelsStore 2026-01-27 13:10:24 +01:00
Aleksander Grygier 2e2cb3d210 feat: Implement generic TTL cache utility 2026-01-27 13:10:24 +01:00
Aleksander Grygier 80ab2a5d1f feat: Add cache configuration constants 2026-01-27 13:10:24 +01:00
Aleksander Grygier 25df25a126 refactor: Adapt message child components to MessageEditContext 2026-01-27 13:00:37 +01:00
Aleksander Grygier 93992b10a7 refactor: Encapsulate message editing state and actions in ChatMessage.svelte 2026-01-27 13:00:37 +01:00
Aleksander Grygier cbcd7956c8 refactor: Centralize chat-wide actions in ChatMessages.svelte 2026-01-27 13:00:36 +01:00
Aleksander Grygier 6b6ebd6bca feat: Introduce Chat Actions and Message Edit Contexts 2026-01-27 13:00:36 +01:00
Aleksander Grygier 6cf823fb92 refactor: Components 2026-01-27 12:20:16 +01:00
Aleksander Grygier 8a8cd78237 refactor: Improve styling and overflow handling for ChatMessageMcpPromptContent 2026-01-27 11:56:55 +01:00
Aleksander Grygier 8ca3ffa076 feat: Add support for pasting MCP prompt attachments in ChatForm 2026-01-27 11:56:55 +01:00
Aleksander Grygier 770f993086 feat: Implement clipboard serialization/deserialization for MCP prompts 2026-01-27 11:56:55 +01:00
Aleksander Grygier 99d177d442 feat: Introduce clipboard types for MCP prompt attachments 2026-01-27 11:56:55 +01:00