Commit Graph
139 Commits
Author SHA1 Message Date
Alessandro 797a88faec Keep welcome sends visible while initial chat history loads
The first history snapshot could clear the optimistic user bubble after a
Welcome send created and selected a chat, leaving the prompt invisible
until its backend log arrived.

Skip the redundant history reset on the first snapshot and rebuild the
merged message window in log order. Reuse the existing message IDs and
renderer so the greeting precedes the prompt and the backend echo updates
the same user row. Later full snapshots still clear stale history.

Add browser regressions for text and attachment sends with snapshots
arriving during or after rendering, and update the WebUI contracts.

Validation: 72 focused tests passed. Live desktop and mobile checks covered
delayed dispatch, normal in-chat sending, and a real backend message echo.
2026-11-10 19:30:54 +01:00
Alessandro dc34830447 fix: preserve compatibility across tool plugin refactor
Initialize the scheduler store before snapshots. Preserve legacy memory calls and per-action permissions while advertising the unified tool, and retain saved policy IDs for moved tools. Restore legacy log rendering and connector tool events, and reject malformed boolean arguments by default.
2026-10-27 17:33:33 +01:00
linkliti 6f079d8817 feat(plugins): move the tasks interface and scheduler task endpoints into the scheduler plugin
Move the scheduler CRUD endpoints, modals, styles, sidebar tasks list, and task row into the _scheduler plugin and drop the core tasks components. The sidebar hosts plugin sections through a neutral sidebar-extensions point inside the extensions-section container instead of a tasks-specific one, so other plugins can contribute sections there too. The scheduler and datepicker styles load through the plugin page-head extension instead of core index.html preloads, and the shared flatpickr preload stays in core. Repoint the header scheduler entry at the plugin modal path and update the api and plugins DOX indexes. Pin indicators follow the relocated task row and the pin test reads it from the plugin. The chats store and core chat behavior adopt the plugin task store idiom, and the ws client surface test expects the plugin store accessor. The modals and css DOX drop their core scheduler ownership and the scheduler plugin DOX indexes its sidebar and page-head extensions. The plugin manifest becomes always enabled with a broader description so the Tasks UI stays core behavior, and the scheduler editor test follows the moved endpoint and store paths.

Validation: pytest plugins/_pin_to_top/tests/test_pins.py tests/test_sidebar_row_actions.py tests/test_webui_extension_surfaces.py tests/test_ws_client_api_surface.py tests/test_webui_startup_assets.py::test_only_the_icon_guard_stylesheet_blocks_application_paint tests/test_chat_working_animation.py tests/test_scheduler_editor.py
2026-10-21 23:37:31 +03:00
Alessandro 86fcaedf7c Preserve pending setup prompts and message action order
Keep pending model setup prompts and session recovery until dispatch or queue
insertion is accepted. Defer retries during another send, resolve readiness
and preset editing for the pending chat, and preserve new composer drafts.
Prevent retries from entering another selected chat's queue.

Preserve Detail, Copy, Speak order when actions are inserted or replaced,
without remounting unchanged controls. Add behavioral and browser regressions,
including preset-switch draft persistence, and update the WebUI contracts.

Validation: 84 focused tests passed; git diff --check passed.
2026-10-13 21:52:11 +02:00
linkliti 94dd95ca36 refactor(model-config): gate model setup on backend rejection
Every send paid a blocking model_config_get round-trip before dispatching, because the frontend had to know whether a chat model is configured to decide between sending and rendering the setup card. Move the check behind the dispatch: a user_message_ui extension in _model_config flags unconfigured chats, the message handlers reject before logging or dispatching and return a model_not_configured payload, and the client opens the setup gate from that response. Isolated sends no longer make any configuration round-trip, the optimistic user row and draft handling stay intact through the gate flow, and the post-setup retry drops its bypass flag since the backend re-checks on dispatch.

Validation: pytest tests/test_model_gate_backend_reject.py tests/test_welcome_composer_static.py tests/test_webui_chat_deletion.py tests/test_webui_send_pause_responsiveness_static.py tests/test_message_action_buttons_static.py tests/test_markdown_tilde_rendering.py tests/test_webui_message_queue_static.py (23 passed); node --check webui/index.js webui/components/chat/model-gate-store.js
2026-10-13 18:06:47 +03:00
linkliti e9c5f3c27d fix(webui): block duplicate sends while a send is in flight
Rapid clicking the send button or hammering Enter dispatched several /message_async calls for one intent because the extension hook and model-gate check are awaited before the busy-state branch, and backend running state only flips after the POST response. An in-flight guard makes repeat sendMessage invocations no-ops until the first completes, closing the double-send window without touching queue dispatch or the model-gate retry path.

Validation: pytest tests/test_webui_send_pause_responsiveness_static.py (3 passed); node --check webui/index.js
2026-10-13 18:06:47 +03:00
linkliti 334e9e0ade fix(webui): make composer pause optimistic against poll snapshots
Composer pause lagged behind poll snapshots: a snapshot write to the pause flag raced the click in flight, so the button flipped back mid-request. A click in flight now suppresses snapshot writes to the pause flag until its request settles, and a failed request restores the prior state only when no newer click is pending.

Validation: send/pause responsiveness static suite passes; node --check on input-store.js and index.js.
2026-10-13 18:06:47 +03:00
Alessandro d1945523af fix(webui): stop stale snapshots after chat switches 2026-09-22 08:55:56 +02:00
Alessandro 6d791cda47 Stabilize streaming message controls
Keep message action buttons mounted while streamed updates refresh their handlers, preserving hover, focus, and extension controls. Render the first user turn optimistically and serialize WebSocket state pushes so welcome-screen messages remain visible.
2026-08-27 06:31:42 +02:00
Alessandro cb39a16c24 Optimize realtime WebUI synchronization
Negotiate collection deltas and preserve sidebar row identity so high-rate log streams avoid resending and reconciling unchanged state. Bound streamed log fields, defer expensive response formatting until completion, update capped process groups only for new steps, and keep disconnect and terminal task state accurate. Add focused lifecycle, snapshot, sync, and WebUI regressions.
2026-08-26 15:27:36 +02:00
Alessandro 7eb819731c Preserve per-chat composer drafts
Store unsent composer text per chat in session storage and restore it when switching contexts or refreshing the page.

Keep the Welcome composer prompt intact when its first send creates a chat, and cover the behavior with a focused Node regression.
2026-08-19 12:28:42 +02:00
frdel bebe6826cf Improve WebUI bundling, manifest and stop command
Introduce a WebUI extension manifest and rewrite the asset bundler/server to support caller-supplied entry sets, extension-injected entries, and negotiated gzip. Key changes: add get_webui_extension_manifest() to helpers/extension, refactor Stop logic into stop_context() and reuse it from the connector `/stop` command, and add a new `/rename` slash command for chat naming. ui_bundler now accepts entry_urls, includes enabled extension entry files, raises the embedded text file size limit to 512 KiB, computes per-entry-set cache keys, and returns a bundle version based on the bundle signature. ui_server applies Starlette GZip middleware, adds routes (/, /index.html, /ui/index, /safe), serves splash/safe documents, injects the serialized webui_extension_manifest into the rendered index, and streamlines the /ui/asset-bundle endpoint with ETag and gzip handling. Also add multiple WebUI assets and fonts, new/updated plugin command YAML and Python command handlers, and corresponding tests covering bundling, commands, chat naming, and WebUI behaviors. Documentation (.dox.md) updated to reflect the new runtime contracts and guidance.
2026-07-29 19:49:07 +02:00
frdel b6be345a56 Chat rendering/pagination, Add chat-naming and pin-to-top plugins
Refactor of messages.js to support lazy rendering.
Move chat rename functionality out of core and into a new _chat_naming plugin, and add a built-in _pin_to_top plugin for sidebar pinning. The chat-naming plugin includes API handlers, prompts, helper logic for selecting user messages and budgeted Utility Model calls, a python monologue_start extension, web UI (modal, store, config, sidebar action), and comprehensive tests. Removed the old core renaming extension and deprecated prompts/tests. Also added pin-to-top plugin files (API, helpers, webui store, tests/docs) and updated various AGENTS.md docs to reflect the new plugins and lifecycle clarifications. Minor UI/js tweak: reorder speak/copy buttons in browser tool handler and add a new webui message-window.js along with related webui/store/component updates and test adjustments.
2026-07-29 08:17:50 +02:00
Alessandro caf5c2f129 Refine onboarding model setup flow
Remove composer blocking so sends always create or enter a chat and route missing-model messages through the in-thread gate.

Make Utility model selection explicit by removing same-as-main sync and defaulting to each provider's utility model when available.

Compact onboarding success channel cards and update static regressions for the new onboarding/gate behavior.
2026-07-02 17:29:40 +02:00
Alessandro 04ecaac0cd Add deferred first-send model gate
Move missing-model setup out of the welcome screen and into an in-thread gate that preserves the pending prompt, survives refresh, and auto-dispatches after a usable model is configured.

Reuse existing onboarding, OAuth account settings, and advanced model configuration surfaces instead of duplicating provider forms. Connected OAuth accounts can now populate Main and Utility defaults when no chat model is configured.

Update model readiness checks, focused static regressions, and DOX contracts for the new deferred setup flow.
2026-07-02 17:29:40 +02:00
Alessandro a4b2848172 Fix WebUI message replay ordering
Treat full log snapshots as authoritative replays by clearing the message DOM when the snapshot starts at log no 0, then render logs in backend order. This prevents streamed responses from staying above earlier welcome/user messages after sync races while keeping incremental updates patch-based.
2026-06-26 14:15:54 +02:00
Alessandro 0e262f7b87 Refresh welcome screen and composer
Rework the welcome screen around the shared new-chat composer, renewed quick actions, discovery cards, OAuth accounts, and dedicated system resources panel.

Restore static button colors and neutral surfaces, move microphone state feedback onto the icon, and keep Rubik/code-font composer behavior.

Add focused static regressions for the welcome composer, OAuth discovery panel, and speech button contract.
2026-06-22 15:12:20 +02:00
Alessandro d1827e6c66 Refactor: use user locale for time displays
Add user-configurable timezone and 12/24-hour preferences, then wire them through settings, runtime snapshots, scheduler payloads, wait handling, notifications, backups, memory, plugin metadata, and frontend formatters.

Keep UTC as the boundary for absolute instants while serializing user-facing dates in the configured or browser-resolved timezone. Preserve scheduler wall-clock inputs in the selected timezone, propagate TZ into desktop/runtime process environments, and restart active desktop sessions when the runtime timezone changes.

Cover the risky paths with timezone regression tests for settings normalization, auto and fixed timezone resolution, scheduler round-trips, memory timestamp conversion, and desktop timezone sync.
2026-05-21 15:26:00 +02:00
Alessandro 675afa8dee Refactor speech stack into built-in Kokoro TTS and Whisper STT plugins
Split the legacy core speech stack into two built-in, independently toggleable plugins: `_kokoro_tts` for TTS and `_whisper_stt` for STT.

This refactor keeps dependency installation and bootstrap concerns in Docker/bootstrap/preload, while moving speech-specific tooling, APIs, prompts, UI, and runtime behavior into the plugins. Core now exposes engine-agnostic `tts-service` and `stt-service` brokers, with browser-native TTS preserved as the fallback when Kokoro is disabled.

Included in this change:
- add built-in `_kokoro_tts` plugin with plugin-owned synth API, config, status UI, and provider registration
- add built-in `_whisper_stt` plugin with plugin-owned transcribe API, mic runtime, device UI, prompt injection, and provider registration
- remove legacy core speech APIs/helpers/settings/UI and delete unused `webui/js/speech_browser.js`
- replace the old hardcoded speech settings section with a generic voice surface backed by plugin extensions
- update preload/docs/tests to match the new plugin-owned speech architecture

Behavioral intent:
- both plugins are built-in but not `always_enabled`
- users can now hot-switch TTS and STT independently
- browser TTS remains available when `_kokoro_tts` is off
- Whisper mic UI only appears when `_whisper_stt` is enabled
2026-05-21 05:41:59 +02:00
Alessandro 5026a72b0a fix: update chat input via Alpine store for voice transcripts (fixes #1510)
Fixes "BUG: STT transcription succeeds but text never appears in chat input (Alpine.js x-model conflict)".

Update `webui/index.js` `updateChatInput()` to append transcribed text to
`inputStore.message` (the Alpine-backed source of truth) instead of mutating
`#chat-input.value` directly and dispatching an `input` event.

This avoids the x-model race where Alpine overwrites the DOM value, ensuring
voice/transcribed text appears in the chat composer and textarea height is
recalculated after store update.
2026-04-21 06:12:27 +02:00
TerminallyLazy a2547f12a1 Add model config presets and ignore agent artifacts
- Add model switcher component for chat input with progress display
- Enhance model config store with active preset/model retrieval
- Show agent progress as ghost text in chat input placeholder
- Add agent artifact patterns to .gitignore
2026-03-28 11:10:52 -04:00
Alessandro dae502bc1d ux: trigger focus on chat input after new chat and ctx switch 2026-03-27 12:12:26 +01:00
Alessandro 4b3666aa35 ui: enhance chat input vertical expansion and auto-resize
- Switched chat-input to use `clamp()` for vertical expansion (up to 20rem, 12 lines of text vs. previous 5 lines).
- Added `field-sizing: content` for modern browser auto-resize support.
- Removed layout constraints on `#input-section` by allowing overflow.
- Fixed an issue where the textarea wouldn't shrink after sending messages.
2026-02-26 11:59:17 +01:00
Alessandro b43cde0b45 add extension points coverage; add JS hooks 2026-02-18 12:32:04 +01:00
frdel 3bfdf91637 Support webui JS/HTML extensions and plugin paths
Add full support for loading web UI extensions from plugins: - Frontend: new extensions loader (js/extensions.js) that loads and caches JS and HTML extensions, calls JS hooks, imports HTML as <x-component> tags, normalizes paths, and replaces the old plugins.js auto-inject logic. - Messages: make setMessages async, introduce extension hooks (set_messages_before_loop / after_loop) and integrate JS extension calls; adjust Scroller usage accordingly. - Components: fix x-component path handling in several templates and components import logic. - Backend: add filters to /api/load_webui_extensions and pass them to plugin helper; update helpers to look for plugin extensions under extensions/python instead of backend. - Plugins helper: extend get_webui_extensions to accept file glob filters, dedupe matches, return relative paths, and improve error logging. - Project config: include plugins and usr/plugins JS files in jsconfig.json. - Add a small test extension file and move several plugin extension files from backend/ to python/ directories. - Minor: reset error_retries earlier in agent message loop to avoid stale retry counts.

These changes enable a flexible plugin extension system for both JS and HTML assets, improve caching and path normalization, and wire up backend APIs and helpers to support the new structure.
2026-02-17 10:17:19 +01:00
frdel d3608d1925 autoscroll on next process group improvement 2026-02-08 21:16:27 +01:00
frdel 724e06ae9d skills cleanup, minor fixes
removed frameworks
standardized directories
cleanup of prompt injection
fix of chat reset
2026-02-02 19:03:58 +01:00
frdel 4932e12546 WebSocket merge 2026-02-01 16:07:45 +01:00
frdel 1c83af8837 welcome screen polishing. 2026-01-31 17:47:09 +01:00
frdel 020822adfd ui: message queue polishing, scrollbars unified 2026-01-31 12:13:10 +01:00
frdel 1e1d22d94e Merge branch 'pr/974' into development 2026-01-31 11:23:03 +01:00
keyboardstaff 34e0997e73 Adjust message queue behavior 2026-01-31 00:23:42 -08:00
frdel 0094aff20f fixing scrolling, markdown, subordinates 2026-01-30 15:21:54 +01:00
Wabifocus fba5b4cd9d Merge branch 'development' into message-queue 2026-01-29 21:47:55 -08:00
Wabifocus c8bdb2f044 Remove unused import for applyModeSteps
Removed unused import for applyModeSteps from process-group-dom.js.
2026-01-29 21:46:35 -08:00
keyboardstaff a8595e1575 Queued Messages 2026-01-29 21:22:41 -08:00
3clyp50 a15069acc6 smooth scroller
smooth option for scroller
2026-01-29 17:43:28 +01:00
frdel 2edb3e511a fix autoexpand, generation step info 2026-01-28 17:46:40 +01:00
frdel dd717dc8cc UI fixes, cleanups 2026-01-28 15:53:54 +01:00
frdel 6c822f1446 scroller update, action buttons - WIP 2026-01-26 09:53:33 +01:00
frdel f63df9f4eb chat rendering refactor - work in progress 2026-01-25 19:12:34 +01:00
frdel c4846e7e9d continued log+rendering refactor 2026-01-23 22:08:19 +01:00
3clyp50 23beed94de message handling refactor #1 2026-01-23 14:13:02 +01:00
3clyp50 fdfdd45419 mode switch bugfix 2026-01-22 08:54:33 +01:00
frdel 060f631f3e user message attachments progress 2026-01-21 16:47:57 +01:00
3clyp50 91304a58d5 step expansion fix and timeout 2026-01-21 14:58:03 +01:00
3clyp50 54248d4937 detail modes for process groups/steps 2026-01-20 14:36:06 +01:00
3clyp50 c9c5efda40 progress/steps shiny-text helper 2026-01-20 11:49:47 +01:00
3clyp50 1455e1d213 scrollChatToBottom; chat navigation helpers
cleanup and mv to chat-navigation-store
chat navigation btn styling
2026-01-15 14:38:43 +01:00
frdel f11f5da555 UI polishing 2026-01-07 16:59:01 +01:00