Commit Graph

376 Commits

Author SHA1 Message Date
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
cogwheel0
d2aeafc773 fix: conversations fetching 2025-09-28 21:33:49 +05:30
cogwheel0
f08259be2b refactor: optimize startup 2025-09-28 20:59:19 +05:30
cogwheel0
ba1176a181 fix: login 2025-09-28 20:41:35 +05:30
cogwheel0
cb86ad8cd2 refactor: redesign status history 2025-09-28 15:58:46 +05:30
cogwheel0
0ff48eeb38 fix: sources count 2025-09-28 15:15:35 +05:30
cogwheel0
b8856679da feat: show sources 2025-09-28 14:59:29 +05:30
cogwheel0
ae20035900 fix: number of sites count 2025-09-28 14:25:35 +05:30
cogwheel0
75b744d061 fix: status history parsing 2025-09-28 14:17:27 +05:30
cogwheel0
b9828bde5d refactor: remove streamchunker 2025-09-28 12:32:43 +05:30
cogwheel0
c458056199 fix: followups on 2nd response 2025-09-27 20:17:58 +05:30
cogwheel0
6a313df905 fix: default model selection 2025-09-27 17:29:15 +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
8ebf17f712 fix: relogin 2025-09-26 23:25:20 +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
748f2a43a8 refactor: followups design 2025-09-26 00:10:43 +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
0943621731 refactor: animations 2025-09-25 19:40:34 +05:30
cogwheel0
69e7238d54 fix: title update and followups 2025-09-25 18:39:59 +05:30
cogwheel0
bfa5ff6363 feat: followups 2025-09-25 18:25:39 +05:30