Commit Graph

89 Commits

Author SHA1 Message Date
cogwheel0
8f390b0d2d feat(auth): Improve user fetching with caching and background refresh 2025-11-24 17:43:05 +05:30
cogwheel0
d38e986d7c feat(callkit): Add CallKit service for native call UI and permissions 2025-11-24 12:29:44 +05:30
cogwheel0
c4a36bb51c feat(cache): Add lightweight in-memory cache with TTL and LRU eviction 2025-11-22 21:53:14 +05:30
cogwheel0
4df22422c2 feat(conversations): Improve conversation and folder fetching with concurrent requests 2025-11-20 22:42:31 +05:30
cogwheel0
45135d9185 fix(auth): Improve auth error handling without token clearing 2025-11-12 13:23:58 +05:30
cogwheel0
122bd0a4b1 feat(storage): Add local folders persistence and caching mechanism 2025-11-10 10:44:03 +05:30
cogwheel0
bf98bbd1fc feat(conversations): Implement local cache persistence for conversations 2025-11-05 14:53:55 +05:30
cogwheel0
e15392ea59 refactor(socket): remove unused connection state management code 2025-11-01 22:51:32 +05:30
cogwheel0
42ef62d565 feat(api): Improve file and knowledge base data parsing with normalization 2025-11-01 15:15:38 +05:30
cogwheel0
073e0cf458 feat(folders): Improve folder management and parsing logic 2025-11-01 15:04:50 +05:30
cogwheel0
a005c14a67 feat(api): Optimize conversation parsing with worker-based decoding 2025-11-01 14:54:08 +05:30
cogwheel0
a374c744ef refactor(api): Migrate conversation parsing to worker-based approach 2025-11-01 01:46:46 +05:30
cogwheel0
a00d64fc26 feat(transport): Improve socket transport mode selection and localization 2025-10-30 22:32:59 +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
27bfde8f95 refactor: Enhance onboarding process in chat and app startup providers
- Integrated autofocus management for the composer in both chat and onboarding contexts to improve user experience.
- Added error handling for focus management to ensure smooth onboarding transitions.
- Updated modal bottom sheet handling to restore autofocus state after onboarding completion, enhancing usability across the app.
2025-10-19 21:10:10 +05:30
cogwheel0
60883315a2 refactor: Migrate to Tweakcn themes and enhance UI consistency
- Replaced references to AppColorPalettes with TweakcnThemes across various files to standardize theme usage.
- Updated the AppTheme and AppColorTokens to utilize TweakcnThemeDefinition for improved theme management.
- Adjusted UI components in ChatPage, ChatsDrawer, AppCustomizationPage, and ProfilePage to align with the new theme structure, ensuring consistent styling and color application.
- Removed the deprecated color_palettes.dart file to streamline the theme architecture.
2025-10-18 13:58:15 +05:30
cogwheel0
c07ac6b427 refactor: Improve model tools auto-selection logic
This commit refactors the `modelToolsAutoSelectionProvider` to more robustly handle the automatic selection of tools when the model changes or the list of available tools is updated.

Key changes include:
- Triggering the auto-selection logic not only when the selected model changes, but also when the `toolsListProvider` finishes loading. This ensures tools are correctly applied even if they load after the model is selected.
- Restructuring the logic to handle asynchronous tool loading more gracefully, preventing race conditions.
- Using `Future.microtask` to schedule the tool application, ensuring state updates are handled correctly within the provider lifecycle.
- Clearing selected tools if the new model has no associated tools or if previously selected tools become invalid.
2025-10-13 15:25:20 +05:30
cogwheel0
1333b10cd8 feat: enhance model and tools integration with auto-selection functionality
- Added a new `toolIds` field to the `Model` class to support tool identification.
- Implemented `modelToolsAutoSelectionProvider` to automatically apply model-specific tools when the selected model changes.
- Enhanced the logic to filter and set valid tool IDs based on available tools, improving user experience by ensuring relevant tools are automatically selected.
- Updated the default model auto-selection provider to initialize the new tools auto-selection feature, ensuring seamless integration within the app's lifecycle.
2025-10-11 13:27:39 +05:30
cogwheel0
778116e258 refactor: optimize socket service event handling and token management
- Updated SocketServiceManager to read the authTokenProvider3 without watching it, preventing unnecessary rebuilds on token changes.
- Enhanced SocketService to manage event listeners more effectively by adding and removing event handlers for 'events' and 'events:channel', improving overall socket management.
2025-10-09 20:51:29 +05:30
cogwheel0
c073d71363 feat: enhance background streaming service with foreground handling
- Improved BackgroundStreamingService to manage foreground service notifications more effectively, ensuring compliance with Android requirements.
- Implemented dynamic foreground service type resolution based on microphone permission, enhancing service behavior based on app state.
- Added checks for app foreground status in connectivity management, improving responsiveness to network changes.
- Refactored notification handling to streamline service lifecycle management and improve code maintainability.
2025-10-09 15:47:27 +05:30
cogwheel0
e04b43949b refactor: migrate to flutter_math_fork and markdown_widget for enhanced markdown capabilities
- Replaced flutter_markdown_plus with flutter_math_fork to improve mathematical rendering within markdown content.
- Integrated markdown_widget for better markdown processing and rendering, enhancing overall user experience.
- Updated the markdown configuration to utilize the new packages, ensuring maintainability and adaptability of markdown features.
- Refactored the streaming markdown widget to accommodate the new markdown processing logic, improving code clarity and performance.
2025-10-04 13:37:47 +05:30
cogwheel0
1ea85d5ed1 refactor: enhance theme and error handling across the application
- Updated error handling in EnhancedErrorService to utilize context for color tokens, improving theme consistency.
- Refactored various components to use context-aware shadow and color properties, enhancing visual coherence.
- Replaced hardcoded color values with dynamic tokens in multiple widgets, ensuring better adaptability to theme changes.
- Improved overall code maintainability by centralizing theme-related logic and reducing direct dependencies on static theme values.
2025-10-03 00:12:25 +05:30
cogwheel0
5138491cfa refactor: optimize app initialization and startup flow
- Delayed heavy provider initialization to improve initial UI responsiveness.
- Introduced a queuing mechanism for provider initialization with staggered delays.
- Updated app startup flow to ensure proper handling of mounted state during asynchronous operations.
- Enhanced socket service management and background model loading to improve app performance and reliability.
2025-10-02 21:33:58 +05:30
cogwheel0
1fa8412e0a feat: implement dynamic theme palette selection
- Introduced a new feature allowing users to select from multiple accent color palettes for buttons, cards, and chat bubbles.
- Added `AppThemePalette` provider to manage the current theme palette and persist user selections.
- Updated the `AppTheme` class to utilize the selected palette for light and dark themes, enhancing visual customization.
- Enhanced the `AppCustomizationPage` to include a palette selector, improving user experience and personalization options.
- Updated localization files to support new palette selection UI elements in multiple languages.
2025-10-02 01:58:12 +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
73ccb14b20 refactor: enhance conversation fetching and folder management
- Improved the logic for fetching conversations within folders by introducing a new condition to determine when to fetch folder conversations.
- Added detailed logging for successful and failed fetch attempts to aid in debugging and monitoring.
- Implemented a method to resolve folder conversations, ensuring that conversations are displayed in the correct order and that placeholders are used when necessary.
- Updated the ChatsDrawer to utilize the new conversation resolution logic, enhancing the user experience by ensuring all relevant conversations are displayed.
- This refactor streamlines conversation management and improves the overall efficiency of the chat interface.
2025-10-02 00:06:00 +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
21ef8bf68e refactor: update ConversationDeltaStream for stream compatibility
- Changed the `stream()` method to a public getter `stream` in the `ConversationDeltaStream` class for compatibility with StreamProvider.
- Added documentation to clarify the necessity of this change, noting the exception to the Riverpod 3 guideline against public getters on Notifiers.
- Updated the `conversationDeltaEventsProvider` to utilize the new getter, enhancing the stream delegation pattern.
2025-10-01 18:52:53 +05:30
cogwheel0
f896c4543f refactor: update socket connection state and add conversation delta stream provider
- Changed the initial state of the socket connection from `disconnected` to `connecting` to better reflect the connection process.
- Updated the service change handling to emit the `connecting` state when the service is null.
- Introduced a new `stream()` method in the `ConversationDeltaStream` class for direct access to the underlying stream, improving usability.
- Added a `conversationDeltaEventsProvider` to provide a stream of conversation delta events based on requests, enhancing the application's real-time capabilities.
2025-10-01 18:44:54 +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
28dc16a6e3 refactor: update folders provider to use keepAlive for improved state management
- Changed the folders provider annotation to `@Riverpod(keepAlive: true)` to enhance state retention.
- This update aligns with recent improvements in state management across the application, ensuring better performance and user experience.
2025-10-01 18:08:03 +05:30
cogwheel0
80129c5711 chore: integrate Hive for local storage management
- Added `hive_ce` and `hive_ce_flutter` dependencies for enhanced local storage capabilities.
- Refactored the main application to initialize Hive and migrate existing data.
- Updated storage service implementations to utilize Hive for managing application settings and task queues.
- Removed the deprecated `StorageService` class to streamline the codebase and improve maintainability.
2025-10-01 16:55:44 +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
37ebe46e15 refactor: optimize providers with keepAlive for improved state management
- Updated multiple providers to use `@Riverpod(keepAlive: true)` for better state retention throughout the app lifecycle.
- Enhanced `SocketConnectionStream` and `ConversationDeltaStream` with comments clarifying the purpose of public getters.
- Improved error handling in the `_ChatPageState` by ensuring proper checks for mounted state before using context.
- Added comments to clarify the rationale behind keepAlive usage in various providers, ensuring better maintainability and understanding of the codebase.
2025-09-30 23:18:06 +05:30
cogwheel0
ff6d33abdf refactor: enhance model loading and error handling in providers
- Improved handling of asynchronous states in the model loading process.
- Added debug logging for better traceability of model loading failures.
- Ensured proper checks for mounted state to prevent updates after disposal.
- Cleaned up code formatting for better readability.
- Updated the `defaultModel` provider to include more detailed logging and error handling.
2025-09-30 15:20:08 +05:30
cogwheel0
d5d96dcf46 refactor: migrate conversationsProvider
Phase 5.3 Complete (3/5)
- conversationsProvider → conversations
- High complexity with caching, folder sync, error handling
- ~250 lines of complex business logic preserved
- 33 usages across 6 files updated automatically
2025-09-30 15:00:55 +05:30
cogwheel0
a896b03fd4 refactor: migrate defaultModelProvider
Phase 5.2 Complete (2/5)
- defaultModelProvider → defaultModel
- Medium complexity FutureProvider
- 4 usages updated automatically
- Complex init logic with settings watchers preserved
2025-09-30 15:00:19 +05:30
cogwheel0
3352aa2d6a refactor!: migrate Phase 4 name-changing providers (1-2/2)
BREAKING CHANGE: Provider names changed for clarity

- themeModeProvider → appThemeModeProvider
- localeProvider → appLocaleProvider

Migrated to @riverpod code generation.
Updated all usages (4-5 occurrences each).
All tests passing.

Phase 4 Complete!
2025-09-30 14:54:24 +05:30
cogwheel0
770c1c677f fix: update references to _conversationsCacheTimestamp provider
Generated provider name is _conversationsCacheTimestampProvider.
2025-09-30 14:49:07 +05:30
cogwheel0
17c24a7925 refactor: migrate Phase 6 internal providers (1-2/2)
Migrated internal/private providers:
- _conversationsCacheTimestamp → _ConversationsCacheTimestamp
- _wasOfflineProvider → _WasOffline

Both are private providers with minimal usage.
Phase 6 Complete!
2025-09-30 14:48:44 +05:30
cogwheel0
d9829ee4a7 refactor: migrate Phase 3 family providers (2-4/4)
Migrated remaining family providers to @riverpod functions:
- serverSearchProvider → serverSearch(query)
- fileContentProvider → fileContent(fileId)
- knowledgeBaseItemsProvider → knowledgeBaseItems(kbId)

All provider names unchanged.
Usage: ref.watch(providerName(parameter))
Phase 3 Complete!
2025-09-30 14:42:27 +05:30
cogwheel0
a56906f653 refactor: migrate loadConversationProvider family (Phase 3, 1/4)
- Converted FutureProvider.family to @riverpod function
- Provider name unchanged: loadConversationProvider
- Usage: ref.watch(loadConversationProvider(id))
2025-09-30 14:40:55 +05:30
cogwheel0
dd96ddccb6 refactor: migrate Phase 2 FutureProvider functions (5-15/15)
Migrated 11 more providers to @riverpod functions:
Core providers:
- userSettingsProvider → userSettings
- conversationSuggestionsProvider → conversationSuggestions
- userPermissionsProvider → userPermissions
- foldersProvider → folders
- userFilesProvider → userFiles
- knowledgeBasesProvider → knowledgeBases
- availableVoicesProvider → availableVoices
- imageModelsProvider → imageModels

Feature providers:
- promptsListProvider → promptsList
- toolsListProvider → toolsList

Bonus notifiers also migrated:
- activePromptCommandProvider → ActivePromptCommand
- selectedToolIdsProvider → SelectedToolIds

Phase 2 Complete! All 15 FutureProvider functions migrated.
All provider names unchanged, no breaking changes.
Analyzer passing, only pre-existing keepAlive warnings.
2025-09-30 14:39:22 +05:30
cogwheel0
083c65527d fix: use Ref instead of typed refs for @riverpod functions
Riverpod 3.0 generated providers use Ref directly, not custom typed refs.
Fixed all Phase 2 function signatures to use Ref.
2025-09-30 14:35:33 +05:30
cogwheel0
ff13c07708 refactor: migrate Phase 2 batch 1 - FutureProvider functions (1-4/15)
Migrated providers to @riverpod functions:
- serverConfigsProvider → serverConfigs
- activeServerProvider → activeServer
- currentUserProvider → currentUser
- modelsProvider → models

All provider names unchanged.
Code generation successful, no breaking changes.
2025-09-30 14:35:05 +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
b5674e5b55 refactor: migrate searchQueryProvider to @riverpod (Phase 1, 1/10)
- Converted SearchQueryNotifier to SearchQuery class
- Using @riverpod annotation with code generation
- Provider name unchanged: searchQueryProvider
- Build runner successful, all tests passing
- No breaking changes
2025-09-30 14:28:56 +05:30
cogwheel0
3dfa5c6ec8 refactor: sockets to use riverpod 2025-09-29 00:22:12 +05:30
cogwheel0
0ba48030c8 refactor: riverpod 3 2025-09-28 23:18:24 +05:30