koboldcpp/tools/ui/tests/unit
Aleksander Grygier 3dc7285b4f
ui: Services consolidation refactor (#27239)
* ui: Move stream lookup and replay fetches into ChatService

chatStore called fetch() directly for /v1/streams/lookup and the
/v1/stream replay. These now live next to the other stream-session
methods in ChatService, so services stay the only API I/O layer.

* ui: Move /models/sse feed reader into ModelsService

ModelsService.watchModelEvents owns the byte stream, reconnect loop
and SSE record parsing; modelsStore keeps only event routing and
state.

* ui: Extract conversation import/export into ConversationTransferService

The JSONL session format, ZIP archiving and browser downloads are
pure I/O with no store state, so they move out of
conversationsStore. The store keeps the DB orchestration
(bulkExportConversations, downloadConversation,
importConversationsData) and delegates the format work.

* ui: Consolidate active model resolution into modelsStore.activeModelId

The same resolution chain was duplicated in useChatScreenActiveModel,
ChatForm, ChatFormActionModels and contextStatsStore, with slight
drift in the single-model fallback. The canonical getter now lives in
modelsStore, and the shared last-assistant-model lookup moved to
utils as getConversationModel.

* ui: Initialize stores explicitly via initStores()

Store constructors and module-level side effects ran migrations and
localStorage reads in import order. Migrations rename and rewrite
localStorage keys, so a settings load racing ahead of them could
clobber migrated values. initStores() is called once from the root
layout and runs migrations first, then the stores that read
localStorage, then the conversations DB load.

* refactor: Constants for stream query params
2026-08-18 16:39:32 +02:00
..
abort.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
agentic-hotpath.bench.ts ui: add read_media tool (#25877) 2026-08-12 12:03:32 +02:00
agentic-sections.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
agentic-strip.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00
assistant-raw-output.test.ts refactor: Clean up UI types (#26909) 2026-08-13 08:07:34 +02:00
chat-form-input-rich-tokenizer.test.ts refactor: Naming (#27001) 2026-08-13 19:45:32 +02:00
chat-form-input-rich-word-jump.test.ts refactor: Naming (#27001) 2026-08-13 19:45:32 +02:00
classify-tool-result.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
clipboard.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
code.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
command-token.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
compute-line-diff.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
continue-intent.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
conversation-import.test.ts ui: Services consolidation refactor (#27239) 2026-08-18 16:39:32 +02:00
favicon-colorize.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
glob-search-children.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
headers.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
jpeg-orientation.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
latex-protection.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
mcp-default-overrides-merge.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
mcp-override-fallback.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00
mcp-servers-default.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00
mcp-service.test.ts ui: read structuredContent from MCP tool result when content is empty (#26691) 2026-08-15 20:00:18 +02:00
mention-badge.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
mention-segments.test.ts ui: UI/chat form follow ups (#26743) 2026-08-10 13:32:51 +02:00
mention-token.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
model-id-parser.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
model-names.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
parse-exec-shell-status.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
parse-mcp-server-settings.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00
parse-toolcalls-memo.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
partial-tool-call-cleanup.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
pwa.spec.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
reasoning-context.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
redact.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
request-helpers.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
sanitize-headers.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00
search-results-fixture.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
search-results.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
settings-private-fields.test.ts ui: mask API Key field in settings and error splash to stop browser a… (#26562) 2026-08-15 22:52:55 +02:00
source-history.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
sse.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
stream-discovery.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
stream-resume.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
tool-call-meta.test.ts ui: Linting & Formatting scripts (#26819) 2026-08-10 08:38:37 +02:00
tool-calls.test.ts ui: Refactor Built-In Tools naming (Server/Browser) (#27271) 2026-08-17 22:23:22 +02:00
uri-template.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00
working-directory.test.ts ui: Constants refactor (#26908) 2026-08-13 06:53:56 +02:00