Commit Graph

251 Commits

Author SHA1 Message Date
cogwheel0
7a880b507c refactor: rendered 2025-10-02 13:52:28 +05:30
cogwheel0
0f6d1ba464 refactor: improve chat page scrolling behavior and reset logic
- Introduced a new boolean flag `_pendingConversationScrollReset` to manage scrolling behavior when switching conversations.
- Added a method `_resetScrollToTop` to handle scrolling to the top of the chat when necessary, enhancing user experience.
- Updated the logic in the chat page to ensure proper scrolling behavior based on conversation state, improving usability during conversation transitions.
- Refactored the chat input widget to simplify the layout and enhance responsiveness, ensuring better integration with the overall chat interface.
2025-10-02 12:34:12 +05:30
cogwheel0
ba239c47f0 refactor: improve chat input styling and responsiveness
- Enhanced the chat input UI with dynamic background and border colors based on theme brightness and active state.
- Introduced animated containers for smoother transitions in button and input styles, improving user experience.
- Updated the button's shadow and border properties to align with the current theme, ensuring better visual consistency.
- Refactored the layout to utilize a more responsive design, enhancing usability across different devices.
2025-10-02 12:22:07 +05:30
cogwheel0
2538181f8a refactor: enhance chat input UI with compact composer and improved styling
- Introduced a compact composer mode for the chat input, optimizing space when no quick pills are available.
- Refactored the input shell decoration and layout to improve visual consistency and responsiveness.
- Enhanced the text field and button styling, ensuring better integration with the current theme and improved user experience.
- Streamlined the build method by encapsulating the composer text field logic into a separate method for better readability and maintainability.
2025-10-02 12:12:29 +05:30
cogwheel0
a85655d639 refactor: enhance error handling and theming in EnhancedErrorService
- Updated the EnhancedErrorService to utilize the dynamic theme context for improved color handling in SnackBars and AlertDialogs.
- Replaced hardcoded color values with theme-based colors to ensure better accessibility and visual consistency across the application.
- Added context parameter to various components to facilitate theme integration, enhancing the overall user experience.
- Improved the readability of error messages by applying appropriate text colors based on the current theme.
2025-10-02 11:39:17 +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
5eb23b01de refactor: update brand colors for improved accessibility
- Adjusted brand primary colors in the AppTheme to enhance contrast in light and dark modes, ensuring compliance with WCAG standards.
- Updated various theme elements, including chat bubbles and input borders, to utilize the new brand colors for better visual consistency and accessibility.
- This refactor improves the overall user experience by providing a more vibrant and accessible color palette.
2025-10-02 01:08:50 +05:30
cogwheel0
63713622d1 fix: chat input icons 2025-10-02 00:54:35 +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
2d35bf4e07 feat: enhance authentication state management with model preloading
- Introduced a new private method `_preloadDefaultModel` to preload the default model upon successful authentication.
- Updated the token handling logic to kick off dependent background work, ensuring a smoother user experience.
- Enhanced error handling during model preloading to log failures appropriately.
- This change improves the efficiency of user data loading and prepares the application for subsequent operations.
2025-10-01 23:44:22 +05:30
cogwheel0
ebe6cec17c feat: enhance routing and connectivity handling
- Added a new route for connection issues, allowing users to navigate to a dedicated page when the server is unreachable.
- Updated the RouterNotifier to manage navigation based on server connectivity status and authentication state.
- Improved the handling of offline scenarios by integrating connectivity checks into the routing logic.
- Enhanced localization support for connection issue messages in multiple languages.
- Refactored the OfflineIndicator widget to streamline the display of connectivity status without unnecessary complexity.
2025-10-01 23:26:12 +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
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
7552031751 refactor: add file sanitization for WebUI in ApiService
- Introduced a new private method `_sanitizeFilesForWebUI` to clean up file data before sending it to the WebUI.
- Updated message handling to utilize the sanitized file data, ensuring that only non-null entries are included in the messages sent.
- Enhanced the logic for handling attachment IDs and files in the message structure, improving data integrity and consistency.
2025-10-01 17:24:23 +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
3faac9f16b refactor: improve typing indicator in assistant message widget
- Replaced the previous gradient-based typing indicator with a more dynamic three-dot animation.
- Simplified the animation logic for the typing indicator, enhancing visual feedback and responsiveness.
- Adjusted the layout to ensure proper spacing and prevent clipping during animations.
- Cleaned up the code for better readability and maintainability.
2025-10-01 01:50:36 +05:30
cogwheel0
5a4021aaa9 refactor: enhance chat page auto-scrolling behavior
- Introduced new state variables to manage auto-scrolling functionality.
- Implemented a method to calculate the distance from the bottom of the chat.
- Improved the logic for auto-scrolling to the bottom when new messages arrive or when the user is near the bottom.
- Refactored the scroll-to-bottom logic to enhance performance and user experience.
- Ensured that the auto-scroll behavior is only triggered when appropriate, preventing unnecessary scrolls.
2025-10-01 01:38:47 +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
fc4430e8df refactor: improve typing indicator logic in assistant message widget
- Simplified the logic for showing the typing indicator by introducing a new method `_shouldShowTypingIndicator`.
- Enhanced the `_isAssistantResponseEmpty` method to check for various conditions that determine if the assistant's response is empty.
- Refactored the `_buildTypingIndicator` method to streamline the UI rendering and improve visual feedback with a gradient background.
- Removed unnecessary comments and cleaned up the code for better readability and maintainability.
2025-09-30 23:56:35 +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
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
d3b64716b9 chore: update markdown dependency and configuration
- Replaced `gpt_markdown` with `flutter_markdown_plus` in `pubspec.yaml`.
- Updated `pubspec.lock` to reflect the new dependency version.
- Modified `markdown_config.dart` to generalize styling configuration.
- Updated `streaming_markdown_widget.dart` to utilize `MarkdownBody` for rendering markdown content.
2025-09-30 19:53:19 +05:30
cogwheel0
12a6a07043 chore: update dependencies and remove unused files
- Replaced `flutter_highlight` with `gpt_markdown` in `pubspec.yaml`.
- Updated `pubspec.lock` to reflect new dependencies and removed obsolete ones.
- Deleted outdated Riverpod migration documentation files to streamline the project.
- Added new configurations for GptMarkdown styling in `markdown_config.dart` and updated the streaming markdown widget implementation.
2025-09-30 16:02:34 +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
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
e25a763d9d refactor: migrate appSettingsProvider
Phase 5.4 Complete (4/5)
- appSettingsProvider → appSettingsNotifierProvider
- High complexity NotifierProvider with many methods
- 26 usages across 6 files updated automatically
- Data class AppSettings unchanged
2025-09-30 15:01:47 +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
8543f9255e refactor: migrate voiceInputAvailableProvider
Phase 5.1 Complete (1/5)
- voiceInputAvailableProvider → voiceInputAvailable
- Simple FutureProvider migration
- 2 usages updated automatically
2025-09-30 14:58:53 +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
f18d378c3c docs: add comprehensive Riverpod 3.0 migration documentation and Priority 1 implementation
Priority 1 (COMPLETE):
- Add riverpod_lint and custom_lint packages
- Update analysis_options.yaml with custom_lint plugin
- Update AGENTS.md with Riverpod 3.0 best practices
- Fix unsafe ref usage in modern_chat_input.dart
- All tests passing, zero breaking changes

Priority 2 (PLANNED):
- Complete migration plan for 39 providers (RIVERPOD_PRIORITY2_PLAN.md)
- Quick reference guide (RIVERPOD_PRIORITY2_QUICKREF.md)
- Progress tracker (RIVERPOD_PRIORITY2_TRACKER.md)
- Master documentation index (RIVERPOD_MIGRATION_INDEX.md)
- Analysis and summary documents

Documentation includes:
- Step-by-step migration examples
- 6-phase implementation plan (23-33 hours)
- Testing strategies and rollback procedures
- Risk assessment and mitigation
- Timeline and resource estimates
2025-09-30 14:27:50 +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