Commit Graph

100 Commits

Author SHA1 Message Date
cogwheel0
4c5f12919f feat(chat): Add SVG image support for attachments 2025-11-29 11:04:59 +05:30
cogwheel0
61a3fcc83a feat(streaming): Simplify streaming logic and remove persistent tracking 2025-11-27 14:36:13 +05:30
cogwheel0
75ba0dc01d feat(chat): Add context attachment and knowledge base support 2025-11-26 22:19:19 +05:30
cogwheel0
0d49309ad1 feat(tts): Refactor text splitting and offset computation for TTS 2025-11-05 00:59:57 +05:30
cogwheel0
a05837b985 refactor(streaming): Optimize image collection and debounce mechanism 2025-11-02 22:14:45 +05:30
cogwheel0
cfadeffd24 feat(tts): add auto mode for text-to-speech engine selection 2025-11-02 21:31:13 +05:30
cogwheel0
a005c14a67 feat(api): Optimize conversation parsing with worker-based decoding 2025-11-01 14:54:08 +05:30
cogwheel0
ada6d40e5e feat(chat): Add worker manager to streaming helper for image processing 2025-11-01 00:57:40 +05:30
cogwheel0
de0f195aea feat(tts): Improve text-to-speech service with enhanced error handling and state management 2025-10-30 21:42:35 +05:30
cogwheel0
7fb199b2e4 feat: implement service failure handling in background streaming
- Added a method to send failure notifications to Flutter when the background service fails to enter the foreground.
- Implemented a broadcast receiver to handle service failure notifications and notify Flutter about the failure.
- Enhanced the persistent streaming service to attempt recovery for failed streams.
- Introduced heartbeat monitoring for SSE streams to detect stale connections and trigger recovery actions.
2025-10-28 13:59:17 +05:30
cogwheel0
5ab3b9c4e0 feat(api): pass userSettings respect function_calling preference in 2025-10-26 23:00:01 +05:30
cogwheel0
551e844c03 fix: change service declaration to non-late initialization in TextToSpeechController 2025-10-26 19:15:40 +05:30
cogwheel0
1cb8926e21 feat(chat): regenerate variants and support
Hide archived assistant variants in the linear chat view and track
previous assistant as versions so regenerated responses do not
duplicate or lose history. When regenerating, mark the previous assistant
message with an archivedVariant flag for the UI and keep it in server
history. Add a ChatMessageVersion model and a versions field to
ChatMessage to store prior generated variants. Implement
archiveLastAssistantAsVersion in chat providers to snapshot the last
assistant message into versions and reset the message for a fresh
streamed generation. Finalize flow updates to attach an adjacent archived
assistant as a version when needed so the UI can present a switcher
between current and past variants. These changes prevent duplicate
messages, preserve previous responses, and enable variant switching.
2025-10-23 22:29:28 +05:30
cogwheel0
56246507de feat(tts): add karaoke-style TTS progress bar to assistant UI
Add rendering and support for a karaoke-style text-to-speechprogress bar in assistant messages so users can see the currently
spoken sentence and highlighted word during playback.

- Append TTS karaoke bar to AssistantMessageWidget when the message is
  the active TTS target and playback is speaking/paused/loading.
- Implement _buildKaraokeBar to render the active sentence with a
  highlighted word span, using ConduitCard and theme styles.
- Import conduit_components for shared UI primitives.
- Extend TextToSpeechState with sentence data:
  sentences, sentenceOffsets, activeSentenceIndex, and per-word
  progress (wordStartInSentence, wordEndInSentence).
- Add provider callbacks wiring: onSentenceIndex and
  onDeviceWordProgress handlers (hooked into TTS backend).
- Prepare sentence splitting and word-progress plumbing in the TTS
  provider (prepares data used to drive the karaoke display).

This change improves UX by visually indicating the spoken sentence
and current word during TTS playback, aiding comprehension and
accessibility.
2025-10-23 17:05:35 +05:30
cogwheel0
561e7dd616 feat(tts): server-backed TTS engine selection
Introduce server TTS support and engine selection while keeping
device TTS as the default.

- Add new persistence keys for storing TTS engine and selected
  server voice (ttsEngine, ttsServerVoiceId, ttsServerVoiceName).
- Extend TextToSpeechService to support two engines:
  TtsEngine.device (FlutterTts) and TtsEngine.server (remote audio).
- Wire in an AudioPlayer and optional ApiService to fetch raw
  audio bytes from the server and play them, with event hooks
  mapped to existing lifecycle callbacks.
- Implement fallback to device TTS on server errors or empty
  responses, and ensure player lifecycle (pause/stop/dispose)
  is handled when using server engine.
- Allow engine and preferred voice to be configured before
  initialization and updated at runtime via updateSettings.

This enables selecting a server-side voice and using a remote
TTS provider while preserving compatibility with the existing
device TTS implementation.
2025-10-23 16:31:15 +05:30
cogwheel0
6c81d68e59 feat: Add Text-to-Speech settings and customization options
- Introduced new preference keys for TTS settings: voice, speech rate, pitch, and volume.
- Updated SettingsService to handle TTS settings and persist them.
- Enhanced AppSettings to include TTS-related properties.
- Implemented TTS settings UI in AppCustomizationPage, allowing users to select voice and adjust speech parameters.
- Added localization support for TTS settings in multiple languages.
2025-10-17 14:40:44 +05:30
cogwheel0
14af2a100a build: Bump Android Gradle Plugin to 8.9.1
fix(chat): Improve Markdown formatter state management

- Explicitly clear the streaming formatter when switching conversations to prevent state leakage.
- Implement defensive checks to ensure the formatter is always associated with the correct message, resetting it if a mismatch is detected.
- Refine the formatter seeding logic to only use existing content in resume scenarios, preventing content duplication.
- Add detailed logging to the chat provider for better debugging of streaming and formatter behavior.
2025-10-16 11:34:13 +05:30
cogwheel0
e73c5ee93a feat: add composer autofocus management for improved chat input experience
- Introduced ComposerAutofocusEnabled provider to manage the auto-focus state of the chat composer, allowing for better control over user interactions.
- Updated ModernChatInput to respect the autofocus setting, ensuring the keyboard behavior aligns with user intent and context.
- Enhanced ChatPage to suppress auto-focus when opening the slide drawer, improving user experience during navigation.
- Refactored SlideDrawer to include an onOpenStart callback for dismissing the keyboard, ensuring a smoother transition when the drawer is opened.
2025-10-10 15:22:54 +05:30
cogwheel0
fabb1df63a feat: enhance text-to-speech functionality with markdown support
- Integrated markdown conversion in TextToSpeechController to clean text before speech synthesis, ensuring only valid content is spoken.
- Updated VoiceCallService to utilize markdown conversion for responses, improving the clarity of spoken content.
- Enhanced VoiceCallPage to display cleaned text from markdown, providing a better user experience during voice interactions.
2025-10-09 00:20:36 +05:30
cogwheel0
f8098670f9 refactor: improve chat message handling and remote task monitoring
- Removed the InactivityWatchdog implementation to streamline typing indicator management.
- Introduced a Timer-based remote task monitoring system to check task status periodically.
- Enhanced the logic for managing streaming assistant states and task synchronization.
- Improved overall code clarity and maintainability by consolidating task monitoring logic.
2025-10-03 01:02:29 +05:30
cogwheel0
ff02af1e89 refactor: centralize conversation cache management
- Introduced a new method `refreshConversationsCache` to streamline the invalidation of the conversations provider and optionally the folders provider.
- Updated various components to utilize the new cache management method, enhancing code clarity and reducing redundancy.
- This refactor improves the efficiency of conversation and folder synchronization across the application.
2025-10-02 00:30:14 +05:30
cogwheel0
d899ca5f70 refactor: update streaming helper to use conversation delta listener
- Replaced direct stream handling for chat and channel events in `attachUnifiedChunkedStreaming` with a new `RegisterConversationDeltaListener` parameter for improved encapsulation and flexibility.
- Removed the previous chat and channel event stream parameters, streamlining the function signature and enhancing code clarity.
- Updated the `regenerateMessage` and `_sendMessageInternal` methods to utilize the new listener registration, improving the management of conversation delta events.
- Enhanced error handling for delta listeners, ensuring robust logging of errors during event processing.
2025-10-01 19:46:21 +05:30
cogwheel0
f15a8eda79 refactor: streamline conversation delta stream handling
- Replaced direct stream access in the `regenerateMessage` and `_sendMessageInternal` methods with a new helper function `_conversationDeltaStream` for better encapsulation and reusability.
- Improved the management of chat and channel event streams by utilizing the new helper function, enhancing code clarity and maintainability.
- Removed the previous `conversationDeltaEventsProvider` as it is no longer necessary with the new implementation, simplifying the provider structure.
2025-10-01 19:20:46 +05:30
cogwheel0
8a8ba76298 refactor: update providers to use keepAlive for enhanced state management
- Changed multiple provider annotations to `@Riverpod(keepAlive: true)` to improve state retention and management across the application.
- This update aligns with recent enhancements in state management practices, ensuring better performance and user experience throughout the app.
2025-10-01 18:32:16 +05:30
cogwheel0
21cff39c1c Revert "refactor: remove unused code"
This reverts commit 03bb03446b.
2025-10-01 00:47:29 +05:30
cogwheel0
03bb03446b refactor: remove unused code 2025-10-01 00:35:56 +05:30
cogwheel0
46bd057089 refactor: enhance chat message handling and scrolling behavior
- Added `sendMessageWithContainer` function to facilitate message sending with a ProviderContainer.
- Updated `_ChatPageState` to improve scroll behavior, ensuring smoother auto-scrolling when near the bottom of the chat.
- Refactored scroll logic to simplify conditions for showing and hiding the scroll-to-bottom button.
- Adjusted the `OptimizedList` widget to correctly handle item indexing based on the reverse property, enhancing list performance and usability.
2025-09-30 21:17:11 +05:30
cogwheel0
7debb7a055 chore: update markdown dependency and refactor streaming handling
- Added `markdown` dependency version `^7.2.1` in `pubspec.yaml`.
- Updated `pubspec.lock` to reflect the direct dependency change.
- Refactored `streaming_helper.dart` to utilize `StreamingResponseController` for better stream management.
- Enhanced `ChatMessagesNotifier` to handle message streams with improved formatting and error handling.
- Updated `StreamingMarkdownWidget` to streamline markdown rendering and support new configurations.
2025-09-30 20:49:02 +05:30
cogwheel0
375c961412 fix: add comment for ChatMessagesNotifier class
Resolves analyzer errors from previous commit.
2025-09-30 15:04:20 +05:30
cogwheel0
c4b1d10801 docs: revert chatMessagesProvider migration attempt
ChatMessagesNotifier is extremely complex (2400+ lines) and requires
a dedicated, careful migration session with comprehensive testing.

Current status: 38/39 providers migrated (97%)
Remaining: chatMessagesProvider only

All other Phase 5 providers successfully migrated!
2025-09-30 15:04:04 +05:30
cogwheel0
a63739db6b refactor: migrate Phase 1 providers (2-7/10) to @riverpod
Migrated providers:
- selectedModelProvider → SelectedModel
- isManualModelSelectionProvider → IsManualModelSelection
- reviewerModeProvider → ReviewerMode
- isLoadingConversationProvider → IsLoadingConversation
- prefilledInputTextProvider → PrefilledInputText
- inputFocusTriggerProvider → InputFocusTrigger
- composerHasFocusProvider → ComposerHasFocus
- batchModeProvider → BatchMode
- reducedMotionProvider → ReducedMotion

All provider names unchanged, no breaking changes.
Build runner successful, analyzer passing.
Only 1 WARNING (keepAlive usage) and 2 INFO items remaining.
2025-09-30 14:31:56 +05:30
cogwheel0
3dfa5c6ec8 refactor: sockets to use riverpod 2025-09-29 00:22:12 +05:30
cogwheel0
cb86ad8cd2 refactor: redesign status history 2025-09-28 15:58:46 +05:30
cogwheel0
ea8eda6784 refactor: remove debuglogs 2025-09-27 16:57:42 +05:30
cogwheel0
9411c81424 fix: followups not arriving issue 2025-09-27 16:50:16 +05:30
cogwheel0
0d5fcabea8 fix: streaming issues 2025-09-27 16:34:37 +05:30
cogwheel0
0c2bd5b4f9 refactor: login and streaming issues 2025-09-26 20:57:54 +05:30
cogwheel0
3c959c83bf refactor: use background only flows 2025-09-26 13:59:28 +05:30
cogwheel0
5f03610f35 fix: streaming 2025-09-26 01:38:00 +05:30
cogwheel0
3124bccfeb refactor: more logs 2025-09-25 23:22:48 +05:30
cogwheel0
9210b2155a refactor: all logging 2025-09-25 22:36:42 +05:30
cogwheel0
db0261ffed refactor: titles 2025-09-25 21:15:47 +05:30
cogwheel0
bfa5ff6363 feat: followups 2025-09-25 18:25:39 +05:30
cogwheel0
637274133f refactor: removing legacy socket code 2025-09-25 12:28:02 +05:30
cogwheel0
7ab1ec3acf fix: image and files previews on the web 2025-09-22 23:17:23 +05:30
cogwheel0
462bf4cde2 refactor: migrate to riverpod 3 2025-09-21 22:31:44 +05:30
cogwheel0
37e5633c5c fix: tts 2025-09-21 20:18:21 +05:30
cogwheel0
c05644f731 feat: text to speech 2025-09-20 23:58:18 +05:30
cogwheel0
e8416d28e8 fix: bugs with system prompt 2025-09-20 18:47:38 +05:30
cogwheel0
f73d308e06 fix: adhere to system prompts 2025-09-20 18:28:12 +05:30