-
Notifications
You must be signed in to change notification settings - Fork 13
Implement go_router and update colors everywhere #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis update introduces a comprehensive refactor of navigation and theming in a Flutter messaging app. The routing system is migrated to use Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App (Flutter)
participant RouterProvider (Riverpod)
participant AuthProvider
participant GoRouter
User->>App (Flutter): Launches app
App (Flutter)->>RouterProvider: Requests router instance
RouterProvider->>AuthProvider: Checks authentication state
AuthProvider-->>RouterProvider: Returns isAuthenticated
RouterProvider->>GoRouter: Configures routes and redirects
GoRouter-->>App (Flutter): Provides navigation structure
User->>App (Flutter): Interacts with login/onboarding
App (Flutter)->>AuthProvider: Calls login()
AuthProvider-->>RouterProvider: Notifies state change
RouterProvider->>GoRouter: Triggers redirect
GoRouter-->>App (Flutter): Navigates to contacts/chat screen
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (15)
macos/Runner.xcodeproj/project.pbxproj (2)
325-342: Hard-coded file-list paths are fragileThe embed-phase script assumes
${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist.
If thePodfiletarget name changes or a user employs custom build configurations (Staging,AdHoc, …), the glob will break and the frameworks won’t embed.A defensive pattern is:
-inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", -); +inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-$(CONFIGURATION)-input-files.xcfilelist", +);so the value is substituted by Xcode rather than by the shell.
381-424:[CP] Check Pods Manifest.lockscript: quote paths containing spacesThe script references
"${PODS_PODFILE_DIR_PATH}/Podfile.lock"and"${PODS_ROOT}/Manifest.lock".
If either path contains spaces (common in$HOMEwhen a user name has a space), the un-quoteddifffallback will fail.Tiny hardening:
- diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null + /usr/bin/env diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null(or wrap the whole command in
set -euo pipefail)..cursor/rules/vibe-tools.mdc (4)
6-8: Refine introduction for clarity and conciseness.
The first two sentences are repetitive (“vibe-tools is…”), consider combining them to flow smoothly and remove redundancy.
11-38: Use fenced code blocks for command examples.
Inline backticks within prose make long commands hard to read. For each command section (e.g., “Direct Model Queries,” “Ask Command Options,” etc.), wrap examples in triple-backtick blocks to preserve formatting.
92-101: Consider adding a table of contents at the top.
Given the length and number of command categories, a TOC would improve navigability.
108-121: Consolidate overlapping option descriptions.
The “General Command Options” (108–113) and “Repository Command Options” (114–121) share several flags (--provider,--model,--max-tokens). Consider inheriting from the general section or linking back, rather than duplicating descriptions.lib/ui/contact_list/chat_list_screen.dart (1)
8-9: Remove or utilize unused imports
Thego_routerandRoutesimports are added but not referenced in this file. Either remove these imports to clean up the code or implement the intended navigation logic (e.g., tapping a chat tile).lib/ui/auth_flow/welcome_screen.dart (1)
102-102: Navigation updated to use go_router.The direct GoRouter.go call is used appropriately here. For consistency with line 76, consider using a Routes helper method here as well (e.g.,
Routes.goToLogin(context)).lib/config/providers/auth_provider.dart (1)
4-22: Consider adding persistence for authentication stateCurrently, the authentication state is reset to false when the app restarts. For a production app, consider implementing persistence using shared preferences or another storage mechanism.
class AuthState extends ChangeNotifier { - bool _isAuthenticated = false; + bool _isAuthenticated = false; + + // Initialize from storage in constructor + AuthState() { + _loadAuthState(); + } + + Future<void> _loadAuthState() async { + // Load from SharedPreferences or similar + // final prefs = await SharedPreferences.getInstance(); + // _isAuthenticated = prefs.getBool('isAuthenticated') ?? false; + // notifyListeners(); + } + + Future<void> _saveAuthState() async { + // Save to SharedPreferences or similar + // final prefs = await SharedPreferences.getInstance(); + // await prefs.setBool('isAuthenticated', _isAuthenticated); + } bool get isAuthenticated => _isAuthenticated; void login() { _isAuthenticated = true; notifyListeners(); + _saveAuthState(); } void logout() { _isAuthenticated = false; notifyListeners(); + _saveAuthState(); } }lib/ui/chat/widgets/chat_input.dart (1)
187-191: Function name should follow Dart naming conventions.The method
deletePickedFilesshould be renamed to follow Dart's camelCase naming convention.-deletePickedFiles() { +void deletePickedFiles() {lib/ui/core/themes/colors.dart (1)
8-91: Consider documenting color usage patterns.While the implementation is solid, it would be helpful to provide documentation on how different glitch colors should be used for different UI elements. This would help maintain consistency as the app grows.
Consider adding comments that describe the general usage pattern for these colors, such as:
// Color Usage Guidelines: // - glitch50-100: Background colors for light surfaces // - glitch200-300: Border and divider colors // - glitch400-600: Secondary text and icon colors // - glitch700-800: Primary text for dark mode // - glitch900-950: Primary text for light mode and backgrounds for dark mode.repomix-plan-filtered.txt (1)
1-1444: The.repomix-plan-filtered.txtfile is a generated snapshot intended for AI analysis and should not be committed to the main codebase. It’s read-only and not part of the application logic. Please remove this file from the PR.local-research/go_router_implementation_plan.md (3)
1-11: Remove local research document from production PR
This planning document is meant for internal research and not for production or user-facing documentation. Consider moving it to a separate docs directory or excluding it from this PR to keep the repository clean.🧰 Tools
🪛 LanguageTool
[uncategorized] ~7-~7: Possible missing comma found.
Context: ...to get file listing... Found 210 files, approx 133628 tokens. Asking openrouter to ide...(AI_HYDRA_LEO_MISSING_COMMA)
311-311: Remove trailing colons in Markdown headings
Multiple headings end with a colon, which violates MD026 (no trailing punctuation). Please delete the trailing:in these headings for consistency:
### Example for WelcomeScreen:### Example for LoginScreen:### For ChatScreen:### For Android (add to AndroidManifest.xml):### For iOS (update Info.plist):Also applies to: 343-343, 384-384, 452-452, 469-469
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
311-311: Trailing punctuation in heading
Punctuation: ':'(MD026, no-trailing-punctuation)
531-531: Add language identifier to fenced code block
The file-structure example uses a plain ``````` block; please specify a language (e.g.,text orbash) to enable proper syntax highlighting and satisfy MD040.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
531-531: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (2)
ios/Podfile.lockis excluded by!**/*.lockmacos/Podfile.lockis excluded by!**/*.lock
📒 Files selected for processing (40)
.context/01_rust_api.md(2 hunks).cursor/rules/vibe-tools.mdc(1 hunks).repomix-plan-filtered.txt(1 hunks)lib/config/providers/auth_provider.dart(1 hunks)lib/main.dart(3 hunks)lib/routing/router.dart(0 hunks)lib/routing/router_provider.dart(1 hunks)lib/routing/routes.dart(2 hunks)lib/shared/custom_button.dart(1 hunks)lib/shared/custom_textfield.dart(1 hunks)lib/ui/auth_flow/create_profile_screen.dart(4 hunks)lib/ui/auth_flow/info_screen.dart(3 hunks)lib/ui/auth_flow/key_created_screen.dart(4 hunks)lib/ui/auth_flow/logged_screen.dart(3 hunks)lib/ui/auth_flow/login_screen.dart(4 hunks)lib/ui/auth_flow/welcome_screen.dart(3 hunks)lib/ui/chat/chat_screen.dart(10 hunks)lib/ui/chat/groupchat_screen.dart(9 hunks)lib/ui/chat/widgets/chat_audio_item.dart(1 hunks)lib/ui/chat/widgets/chat_input.dart(17 hunks)lib/ui/chat/widgets/chat_reply_item.dart(2 hunks)lib/ui/chat/widgets/contact_info.dart(1 hunks)lib/ui/chat/widgets/message_widget.dart(3 hunks)lib/ui/chat/widgets/reaction/reactions_dialog_widget.dart(6 hunks)lib/ui/chat/widgets/reaction/stacked_reactions.dart(3 hunks)lib/ui/chat/widgets/status_message_item_widget.dart(1 hunks)lib/ui/contact_list/chat_invitation_sheet.dart(3 hunks)lib/ui/contact_list/chat_list_screen.dart(1 hunks)lib/ui/contact_list/group_chat_details_sheet.dart(7 hunks)lib/ui/contact_list/new_chat_bottom_sheet.dart(1 hunks)lib/ui/contact_list/start_chat_bottom_sheet.dart(1 hunks)lib/ui/contact_list/widgets/chat_list_appbar.dart(1 hunks)lib/ui/contact_list/widgets/chat_list_tile.dart(4 hunks)lib/ui/contact_list/widgets/contact_list_tile.dart(3 hunks)lib/ui/contact_list/widgets/empty_chat_widget.dart(1 hunks)lib/ui/core/themes/colors.dart(1 hunks)lib/ui/core/ui/custom_textfield.dart(1 hunks)local-research/go_router_implementation_plan.md(1 hunks)macos/Runner.xcodeproj/project.pbxproj(12 hunks)macos/Runner.xcworkspace/contents.xcworkspacedata(1 hunks)
💤 Files with no reviewable changes (1)
- lib/routing/router.dart
🧰 Additional context used
🪛 LanguageTool
local-research/go_router_implementation_plan.md
[uncategorized] ~7-~7: Possible missing comma found.
Context: ...to get file listing... Found 210 files, approx 133628 tokens. Asking openrouter to ide...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~561-~561: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...IDs (e.g., /chats/:id) - Use extra parameter for complex objects (state.extra) - ...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
🪛 markdownlint-cli2 (0.17.2)
local-research/go_router_implementation_plan.md
311-311: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
343-343: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
384-384: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
452-452: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
469-469: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
531-531: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
🔇 Additional comments (145)
macos/Runner.xcodeproj/project.pbxproj (2)
188-201: Check-in of Pods xcconfig files may bloat the repoA new Pods group referencing
Target Support Files/…/*.xcconfighas been added to the main project.
Ifuse_frameworks!orflutter_export_environmentalready takes care of the configuration, committing these support files can:
- Pollute diffs whenever a teammate runs
pod installwith a different CocoaPods version.- Cause merge conflicts inside
*.xcconfigthat are auto-generated.Consider adding
Pods/to.gitignoreand relying onpod installin CI instead.
474-506: Ensure RunnerTests inherits Flutter flags after xcconfig switchThe three
baseConfigurationReferencelines now point to the Pods-generated xcconfigs.
Verify that the previous settings coming fromDebug.xcconfig/Release.xcconfig(e.g.ENABLE_TESTABILITY, Swift version overrides) are still inherited via#includeinside those Pod files; otherwise you could lose important compiler flags for the test bundle.macos/Runner.xcworkspace/contents.xcworkspacedata (1)
7-9: Pods project correctly added to workspaceAdding
Pods/Pods.xcodeprojensures Xcode can resolve the schemes and build phases generated by CocoaPods. 👍.cursor/rules/vibe-tools.mdc (1)
181-181: Verify version pinning.
The rule is tagged withvibe-tools-version: 0.60.9. Ensure this matches the installed version and consider auto-updating this field during releases.lib/ui/contact_list/widgets/chat_list_appbar.dart (1)
15-17: Apply new glitch theme color to AppBar background
The background color has been correctly updated toAppColors.glitch950to match the new theme palette.lib/ui/chat/widgets/chat_audio_item.dart (1)
44-47: Update audio play button background to glitch600
The circular container’s background color has been successfully switched toAppColors.glitch600, aligning with the updated color scheme.lib/ui/contact_list/widgets/empty_chat_widget.dart (1)
20-22: Standardize text color to glitch600
Both status messages now useAppColors.glitch600, ensuring consistent text styling across the empty state UI.Also applies to: 26-28
lib/ui/core/ui/custom_textfield.dart (1)
30-39: Refresh TextField styling to new glitch palette
ThehintStyleand border colors have been updated to the glitch palette (glitch600for hints,glitch200for borders) with multilineOutlineInputBorder, enhancing visual consistency.lib/ui/contact_list/new_chat_bottom_sheet.dart (3)
88-91: Color theming update: group chat iconThe color filter for the group chat icon has been updated to use
AppColors.glitch600as part of the app-wide theming update, replacing the legacy color constant.
96-104: UI color consistency improvementThe "New Group Chat" text styling has been updated to use the new glitch color palette, maintaining consistency with the surrounding UI elements.
107-110: Color theming update: chevron iconThe chevron icon's color filter has been updated to match the new color scheme, ensuring visual consistency with the text and group chat icon.
lib/ui/auth_flow/create_profile_screen.dart (3)
4-4: Added go_router importAppropriate import added for the go_router package used in navigation updates.
20-20: Navigation update with go_routerNavigation has been updated to use
context.go()instead ofNavigator.push(), aligning with the app-wide migration to go_router for more structured and centralized navigation.
61-61: TextField styling updated to match new themeThe fillColor for both TextFields has been updated from grey to the new glitch color palette, providing visual consistency across the app.
Also applies to: 84-84
lib/ui/chat/widgets/contact_info.dart (3)
9-9: Code formatting improvementConstructor declaration has been condensed to a single line for better readability and consistent code style.
15-15: Widget instantiation formattingCircleAvatar widget instantiation has been condensed to a single line for better readability.
17-17: Color theming updateThe text color has been updated to use the new glitch color palette (
AppColors.glitch200), aligning with the app-wide theming update.lib/ui/contact_list/widgets/chat_list_tile.dart (3)
56-56: Color theming update: chat nameThe chat name text color has been updated to use
AppColors.glitch900from the new color palette.
65-65: Color consistency for secondary textBoth the chat time and last message text colors have been updated to use
AppColors.glitch600, providing visual consistency for secondary text elements.Also applies to: 77-77
87-87: Color theming update: unread badgeThe background color for the unread count badge has been updated to use
AppColors.glitch950, maintaining the visual hierarchy while aligning with the new color scheme.lib/ui/contact_list/start_chat_bottom_sheet.dart (4)
53-56: Clean code formatting!The CircleAvatar widget is now formatted with proper indentation, which improves readability without changing functionality.
58-65: Good update to use the new color schemeThe Text widget for the name now uses the new glitch color palette (
AppColors.glitch950) instead of the legacy color constants, consistent with the app-wide theming update.
67-70: Consistent color theming appliedThe email text styling now uses
AppColors.glitch600, aligning with the new color scheme and maintaining visual hierarchy with the name text above it.
77-77: Theming consistency maintainedThe publicKey text now also uses
AppColors.glitch600, ensuring consistent styling with the email field and maintaining the visual hierarchy in the bottom sheet.lib/shared/custom_button.dart (2)
26-34: Thorough color scheme update for buttonsThe button styling has been comprehensively updated to use the new glitch color palette, with careful attention to different states (primary/secondary, enabled/disabled) and proper opacity for disabled states.
The color mapping looks correct:
- Primary buttons: dark background (
glitch950) with light text (glitch50)- Secondary buttons: light background (
glitch100) with dark text (glitch900)- Disabled states maintain appropriate contrast and visual hierarchy
42-42: Reformatted text styleThe button text style has been cleanly reformatted while maintaining the same functionality and appearance.
lib/ui/chat/widgets/status_message_item_widget.dart (4)
10-15: Improved constructor formattingThe constructor parameters have been formatted more clearly with one parameter per line, improving readability without changing functionality.
22-22: Updated icon color for visual consistencyThe icon color now uses
AppColors.glitch600instead of the legacy color constant, aligning with the app's new color scheme.
28-28: Updated highlighted text colorThe highlighted text now uses
AppColors.glitch950instead of the legacy color constant, ensuring proper emphasis in the visual hierarchy.
32-33: Updated secondary text colorThe secondary text color now uses
AppColors.glitch600, creating proper visual differentiation from the highlighted text while maintaining the new color scheme.lib/shared/custom_textfield.dart (2)
30-42: Complete text field styling updateThe TextField styling has been comprehensively updated to use the new glitch color palette:
- Hint text now uses
AppColors.glitch600for better readability- All border states (default, enabled, focused) use
AppColors.glitch200with explicit BorderSide construction- Content padding logic is preserved while improving code formatting
These changes maintain consistent styling with the rest of the app's UI components.
47-47: Minor formatting improvementThis minor formatting change improves code consistency.
lib/ui/auth_flow/info_screen.dart (4)
4-4: Added go_router importAdded the necessary import for go_router, which is used for the updated navigation approach.
10-10: Updated to use go_router for navigationThe navigation method has been updated from imperative (
Navigator.push) to declarative (context.go) using go_router, aligning with the app-wide routing refactor.
38-38: Updated text color to match new themeThe subtitle text now uses
AppColors.glitch400instead ofAppColors.grey3, consistent with the app's new color palette.
64-64: Standardized apostrophe in stringThe text "What's unique\nabout White Noise" now uses straight apostrophes instead of typographic ones, ensuring consistent string formatting throughout the app.
lib/ui/auth_flow/welcome_screen.dart (2)
3-6: Import changes correctly support the new routing system.The addition of go_router imports and routes.dart replaces the direct imports of screen files, which aligns with the centralized routing approach being implemented.
76-76: Navigation refactored to use Routes helper.Good change replacing direct navigation with the centralized Routes helper. This makes navigation more maintainable and consistent across the app.
.context/01_rust_api.md (2)
23-28: Simplified account model reflects single-account approach.The change from a list of accounts with an active account to a single account simplifies the state model and aligns with the current app architecture.
286-287: Multi-account support commented out for future implementation.Good practice to comment out the function that's intended for future multi-account support while adding a descriptive comment that explains the future plan.
lib/ui/chat/widgets/chat_reply_item.dart (2)
17-17: Updated color scheme to use the new glitch palette.The changes consistently apply the new glitch color theme throughout the widget, improving the visual consistency with the rest of the app. The color choices provide appropriate contrast for both sender and receiver messages.
Also applies to: 21-21, 34-35, 41-43
30-31: Added null coalescing operators for safer string handling.Good addition of null coalescing operators to prevent potential null reference issues when accessing optional fields.
Also applies to: 38-39
lib/ui/auth_flow/key_created_screen.dart (4)
3-3: Updated import to support go_router navigation.The import change supports the move to declarative routing with go_router.
9-9: Navigation updated to use go_router.The navigation logic now uses go_router for a more consistent routing approach throughout the app.
45-48: Updated to use the new glitch color palette.The styling has been updated to use the standardized glitch color scheme, improving visual consistency across the app.
Also applies to: 58-59, 89-93
25-26: Consider encrypting and storing the actual private key.The dummy key shown in the UI should be replaced with the actual private key in production. Also, consider implementing proper security measures for displaying sensitive information.
Also applies to: 117-118
lib/config/providers/auth_provider.dart (2)
4-18: Clean state management implementationThe
AuthStateclass follows best practices for state management withChangeNotifier. The implementation is simple but effective for tracking authentication state.
20-22: Proper Riverpod provider implementationThe
authProvideris correctly set up as aChangeNotifierProviderto expose the authentication state throughout the application.lib/ui/contact_list/chat_invitation_sheet.dart (5)
38-45: Improved code formattingThe builder function is now properly formatted across multiple lines, improving readability.
59-62: Improved widget formattingThe CircleAvatar widget is now properly formatted for better readability.
64-71: Updated to new color schemeThe text color has been updated from a legacy color to the new
glitch950theme color, aligning with the PR objective of updating colors throughout the app.
73-76: Updated to new color schemeThe email text color has been updated to use the new
glitch600theme color.
83-83: Updated to new color schemeThe public key text color has been updated to use the new
glitch600theme color.lib/ui/auth_flow/logged_screen.dart (4)
2-3: Added go_router for navigationProper imports for go_router and routes have been added to support the new routing approach.
9-11: Implemented navigation with go_routerThe previously empty
_onContinuePressedmethod now correctly uses go_router to navigate to the contacts route.
29-29: Updated apostrophe styleChanged from curly to straight apostrophe for consistency.
39-44: Updated text styling and color schemeThe text styling has been updated to use the new
glitch400color from the updated theme, and the TextStyle is now properly formatted across multiple lines.lib/main.dart (5)
4-4: Updated router importChanged from importing the static router to the new router provider, which aligns with the go_router implementation objective.
14-14: Converted to ConsumerWidget for Riverpod integrationMyApp is now a ConsumerWidget, allowing it to access Riverpod providers.
18-18: Added WidgetRef parameterThe build method now correctly accepts a WidgetRef parameter, which is required for ConsumerWidget.
20-20: Using Riverpod to access the routerThe router is now obtained from the routerProvider using ref.watch, which is the correct pattern for accessing Riverpod providers.
38-40: Updated AppBar theme colorThe default AppBar color has been updated to use the new glitch950 color, aligning with the PR objective of updating colors throughout the app.
lib/ui/contact_list/widgets/contact_list_tile.dart (4)
35-39: Clean code formatting!The Image.asset widget's code formatting has been improved for better readability, moving from inline to a multi-line format.
47-51: Consistent color scheme updateThe text styles have been properly updated to use the new glitch color palette (
AppColors.white,AppColors.glitch900,AppColors.glitch600) instead of legacy color constants, aligning with the app-wide theming overhaul.Also applies to: 64-68, 80-83
93-99: Selection indicator colors aligned with new themeThe selection indicator colors have been properly updated to use the new glitch palette (
AppColors.glitch950andAppColors.glitch200), maintaining visual consistency with other UI elements.
100-103: Clean conditional formattingThe conditional rendering of the check icon has been nicely formatted, improving code readability.
lib/ui/chat/widgets/reaction/stacked_reactions.dart (4)
33-36: Improved code structure for emoji processingThe emoji mapping code has been nicely reformatted for better readability, making the transformation from map entries to a list of maps more explicit.
39-40: Clean reactionsToShow assignmentThe simplified inline conditional makes the code more readable while maintaining the same functionality.
46-87: Updated reaction container colors and improved formattingThe reaction container background color has been properly updated from legacy colors to the new glitch palette (
AppColors.glitch200), and the conditional logic has been reformatted for better readability.
90-138: Enhanced widget tree readabilityThe construction of reaction widgets and the overall widget tree structure have been reformatted with proper indentation and line breaks, making the code much easier to read and maintain without changing functionality.
lib/routing/routes.dart (2)
1-3: Added necessary imports for go_router integrationThe import statements for Flutter material package and go_router package have been correctly added to support the new navigation functionality.
24-36: Implemented centralized navigation helpersGreat addition of navigation helper methods that centralize route construction logic and leverage the go_router API. These methods will make navigation more consistent across the app and reduce the chance of routing errors.
The three new methods provide a clean API for common navigation actions:
goToChat: Navigates to a specific chat by IDgoToContact: Navigates to a specific contact by IDgoToOnboarding: Navigates to the onboarding screenlib/ui/chat/widgets/reaction/reactions_dialog_widget.dart (2)
85-160: Updated menu item colors and improved formattingThe destructive menu item colors have been updated from legacy colors to the new theme system (
Colors.redandAppColors.glitch950). The code formatting has also been significantly improved with proper indentation and line breaks.
192-230: Enhanced reaction handling with proper formattingThe reaction handling code has been reformatted for better readability, and the color for the "⋯" reaction container has been updated from
AppColors.grey1toAppColors.glitch100to align with the new color scheme.lib/ui/contact_list/group_chat_details_sheet.dart (6)
17-17: Good use of trailing commaThis follows Dart best practices for constructor parameters, making future modifications easier and improving code formatting.
28-30: Formatting improvement: builder parameterThe improved indentation for the builder parameter makes the code more readable.
81-81: Color scheme updateUpdated to the new "glitch" color palette, consistent with the PR objective to update colors throughout the app.
84-101: Better conditional rendering structureThe improved indentation and structure for this conditional rendering makes the code more maintainable.
116-116: Color scheme consistencyConsistent implementation of the new glitch color palette for text styling.
Also applies to: 136-136
147-147: Widget simplificationGood simplification of the ContactListTile widget instantiation.
lib/ui/chat/widgets/message_widget.dart (7)
17-18: Good use of trailing commaAdding trailing commas follows Dart best practices and makes code more maintainable.
36-61: Improved conditional structureThe enhanced formatting of this complex conditional logic makes the group message avatar display logic much more readable.
84-92: Better variable calculation formatThe calculation of bottomPadding is now better formatted with improved readability.
140-141: Color scheme updateUpdated from legacy colors (AppColors.color202320, AppColors.colorE2E2E2) to the new glitch theme palette (AppColors.glitch950, AppColors.glitch200), consistent with the PR objective.
Also applies to: 143-143
155-175: Improved conditional renderingBetter formatting for the conditional rendering of sender name in group messages improves code readability.
208-245: Structured message content displayThe improved formatting for the message content conditional rendering makes this complex widget structure much easier to understand.
238-239: Consistent icon color updatesIcons consistently updated to use the new glitch color palette.
Also applies to: 268-269
lib/routing/router_provider.dart (6)
16-18: Well-structured router provider with Riverpod integrationThe router provider correctly uses Riverpod to access and watch the authentication state, enabling dynamic routing based on login status.
23-37: Proper authentication-based routingThe redirect logic correctly handles authentication state to ensure users are directed to appropriate screens based on their login status.
40-67: Well-organized auth flow routesAuth flow routes are logically structured with proper nesting, following go_router best practices.
69-83: Contact routes implementationThe contacts route structure is implemented correctly with dynamic ID parameter handling.
84-101: Chat routes implementationChat routes are properly implemented with dynamic chat ID routing and a dedicated path for creating new group chats.
92-93: TODO items for future completionThese TODOs should be addressed in future PRs to complete the chat routing implementation.
Are there any specific tasks or tickets created to handle these TODOs for passing chat data via state.extra and updating the ChatScreen to accept a chatId parameter?
lib/ui/auth_flow/login_screen.dart (4)
2-4: Required imports for Riverpod integrationThe correct imports for Riverpod, go_router, and the auth provider have been added.
7-11: Converting to ConsumerStatefulWidgetProper conversion from StatefulWidget to ConsumerStatefulWidget for Riverpod integration.
25-26: Improved login implementation with RiverpodThe login logic now correctly uses the Riverpod auth provider instead of direct navigation, allowing go_router to handle redirects based on authentication state.
83-83: Color scheme updateUpdated from legacy colors to the new glitch theme palette, consistent with the PR objective to update colors throughout the app.
Also applies to: 95-95
lib/ui/chat/groupchat_screen.dart (13)
16-17: Good implementation of go_router for navigation.You've correctly imported the necessary packages for implementing go_router-based navigation.
28-44: Method refactoring looks good.Clean refactoring of the emoji bottom sheet functionality while maintaining the existing behavior.
56-60: Clean refactoring of message handling.The message insertion logic is clear and consistent with the pattern used throughout the app.
79-84: Navigation pattern correctly implemented.Good job replacing the imperative navigation with go_router. This approach is more consistent with the app-wide navigation strategy.
85-88: Nice UI component refactoring.The ContactInfo widget usage provides better code organization and reusability.
91-95: Consistent navigation pattern applied.Using the centralized Routes helper for navigation is a good practice that ensures consistency throughout the app.
108-136: Theme colors correctly applied to user profile section.Good job updating the colors to use the new glitch theme palette for better visual consistency.
137-165: Status message items look good.The StatusMessageItemWidget usage creates a consistent UI pattern for different notification types.
182-186: Clean conditional expression.The conditional expression for menu items is well-formatted and easy to read.
192-196: Emoji reaction handling looks good.Clean refactoring of the emoji picker interaction flow.
210-214: Alignment logic is clear and well-formatted.The conditional alignment based on message ownership is well-structured.
222-227: Message widget properties are well organized.The message widget properties are clearly defined and properly structured.
236-240: ChatInput integration looks good.Clean integration of the ChatInput component with proper properties.
lib/ui/chat/widgets/chat_input.dart (18)
72-78: Date formatting is well organized.The date formatting is now more readable with clear indentation.
87-96: ContactModel construction is well formatted.The model construction is now much more readable with proper indentation.
108-115: ContactModel formatting is consistent.Good consistent formatting with the other model construction in the file.
117-120: Image URL assignment is clear.The image URL assignment is now properly formatted with clear indentation.
197-205: Recording timer formatting looks good.The time formatting code is now more readable with proper indentation.
246-248: Waveform colors updated to match theme.Good job updating the waveform colors to use the glitch theme for visual consistency.
271-275: Waveform style updated correctly.The waveform style color is properly updated to use the glitch theme.
280-285: Animation transition builder is well formatted.The transition builder code is now more readable with proper indentation.
286-289: Conditional widget selection is clear.The conditional widget selection based on recording state is well structured.
316-319: Container styling updated to match theme.Good job updating the container color to use the glitch theme.
321-325: Icon color updated for better theming.The microphone icon now uses the theme's color scheme for better visual consistency.
329-333: Text styling updated to match theme.Good job updating the text styling to use the glitch color palette.
339-341: Text styling updated to match theme.The "Swipe to Stop" text color now uses the glitch theme.
381-385: Recording button styling uses theme colors.Good job using the theme's error color for the recording button.
443-444: Icon styling updated to match theme.Good job updating the icon color to use the glitch theme.
452-454: Container styling updated to match theme.The text input container color now uses the glitch theme.
480-481: Icon styling updated correctly.The emoji icon color now uses the glitch theme for visual consistency.
500-502: Platform check is well formatted.The platform check for emoji size is now properly formatted.
lib/ui/chat/chat_screen.dart (12)
27-43: Emoji bottom sheet handling is well structured.The emoji picker implementation is clean and consistent with the groupchat screen.
55-59: Message handling is consistently implemented.The message insertion logic matches the pattern used in groupchat_screen.dart.
77-82: Navigation pattern correctly implemented.Good job replacing the imperative navigation with go_router. This is consistent with the app-wide navigation strategy.
83-84: ContactInfo usage provides good component reuse.Using the ContactInfo widget creates consistency across the app.
86-90: Routes helper usage is consistent.Using the centralized Routes helper for navigation ensures consistency.
117-130: Text styling updated to match theme.Good job updating all text styling to use the glitch color palette.
134-136: Text styling follows theme pattern.Email text styling now uses the glitch theme color.
134-207: TextSpan styling consistently updated.All text span colors now use the glitch theme, maintaining a consistent visual hierarchy with alternating colors.
215-246: Status message styling updated correctly.The status message styling uses the new color scheme appropriately.
263-295: Message interaction handling is well formatted.The reaction dialog logic is cleanly formatted and consistent with the groupchat screen.
303-308: MessageWidget construction is clean and consistent.The properties are well organized and match the pattern used in groupchat_screen.dart.
317-321: ChatInput integration is consistent.The ChatInput usage matches the pattern in groupchat_screen.dart.
lib/ui/core/themes/colors.dart (3)
8-20: Great implementation of a comprehensive color palette.The glitch color palette provides a consistent gradient from light to dark that can be used throughout the app. This structured approach will make theming more maintainable.
21-55: Well-structured light color scheme.The light color scheme makes good use of the glitch palette, providing semantic meaning to each color through the Material color roles. All required color scheme properties are properly defined.
57-91: Well-structured dark color scheme.The dark color scheme correctly inverts the color relationships from the light scheme while maintaining the same semantic structure. This will ensure consistent theming in both light and dark modes.
local-research/go_router_implementation_plan.md (2)
217-224: Verify route constants for onboarding flows
The plan addsstatic const onboarding,createProfile, andkeyCreatedinRoutes, but your currentlib/routing/routes.dartmay not define these. Please ensure that these new path constants (and any corresponding helper methods) are present in the actual routes file.
297-299: Ensure new glitch color exists in theme
The example setsAppBarTheme.backgroundColor = AppColors.glitch950. Confirm thatglitch950is defined inAppColors(inlib/ui/core/themes/colors.dart) to avoid build errors.
| 02E9B9081F95BB7F190F86A2 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5795D915D1078E2C3726E6F0 /* Pods_RunnerTests.framework */; }; | ||
| 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; | ||
| 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; | ||
| 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; | ||
| 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; | ||
| 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; | ||
| 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; | ||
| 59A87F43D93CD958D454F786 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D291749B5EE3DF52BA2B2E1B /* Pods_Runner.framework */; }; | ||
| /* End PBXBuildFile section */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Potential double-linking of CocoaPods aggregate frameworks
Pods_Runner.framework and Pods_RunnerTests.framework are now added manually to the Frameworks build phase.
CocoaPods already injects these frameworks through the generated xcconfigs (OTHER_LDFLAGS, FRAMEWORK_SEARCH_PATHS) and later embeds them via the [CP] Embed Pods Frameworks phase. Manually adding them here can lead to
• duplicate symbol / multiple definition errors,
• “linked twice” warnings, or
• brittle merge conflicts when pod install re-generates paths.
Unless you have a very specific reason, it’s safer to let CocoaPods own the linkage entirely and remove these PBXBuildFile + PBXFileReference entries.
Also applies to: 98-107
🤖 Prompt for AI Agents
In macos/Runner.xcodeproj/project.pbxproj around lines 24 to 32 and also lines
98 to 107, the Pods_Runner.framework and Pods_RunnerTests.framework are manually
added to the Frameworks build phase, which can cause duplicate linking issues
and conflicts with CocoaPods management. Remove the PBXBuildFile and
PBXFileReference entries for these frameworks from the project.pbxproj file to
avoid double-linking and let CocoaPods handle the framework linkage and
embedding automatically.
| <vibe-tools Integration> | ||
| # Instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace HTML-like wrapper tags with Markdown section headings.
Using <vibe-tools Integration> and </vibe-tools Integration> breaks Markdown tooling. Change to a level-1 or level-2 heading (e.g., # Vibe-Tools Integration).
🤖 Prompt for AI Agents
In .cursor/rules/vibe-tools.mdc around lines 9 to 10, replace the HTML-like
wrapper tags <vibe-tools Integration> and </vibe-tools Integration> with a
proper Markdown heading such as "# Vibe-Tools Integration" to ensure
compatibility with Markdown tooling.
| --- | ||
| description: Global Rule. This rule should ALWAYS be loaded | ||
| globs: *,**/* | ||
| alwaysApply: true | ||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Validate YAML front matter for consistency and correctness.
The globs field should use a YAML list (e.g., globs: ["*", "**/*"]) or properly quote comma‐separated patterns to avoid parsing errors.
--- a/.cursor/rules/vibe-tools.mdc
+++ b/.cursor/rules/vibe-tools.mdc
@@ 1,5c1,6
- ---
- description: Global Rule. This rule should ALWAYS be loaded
- globs: *,**/*
- alwaysApply: true
- ---
+ ---
+ description: "Global Rule. This rule should ALWAYS be loaded"
+ globs:
+ - "*"
+ - "**/*"
+ alwaysApply: true
+ ---📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --- | |
| description: Global Rule. This rule should ALWAYS be loaded | |
| globs: *,**/* | |
| alwaysApply: true | |
| --- | |
| --- | |
| description: "Global Rule. This rule should ALWAYS be loaded" | |
| globs: | |
| - "*" | |
| - "**/*" | |
| alwaysApply: true | |
| --- |
🤖 Prompt for AI Agents
In .cursor/rules/vibe-tools.mdc at lines 1 to 5, the YAML front matter's globs
field is currently a comma-separated string which can cause parsing errors.
Change the globs field to a proper YAML list format by using square brackets and
quoting each pattern, for example: globs: ["*", "**/*"] to ensure correct
parsing and consistency.
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
|
||
| class AuthState extends ChangeNotifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChangeNotifierProvider/ChangeNotifier are now discouraged in the latest Riverpod. We can update this later since this is just a skeleton/dummy impl.
Use NotifierProvider/Notifier instead.
lib/ui/chat/widgets/chat_input.dart
Outdated
| child: Icon( | ||
| Icons.mic, | ||
| size: 30, | ||
| color: AppColors.glitch950 ?? AppColors.glitch200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeRabbit's suggestion here is correct. AppColors.glitch950 cannot be null so color: AppColors.glitch950, suffices.
* Implement go_router and update colors everywhere * A few small updates
Implement go_router and update colors everywhere (#16)
Summary by CodeRabbit
New Features
Style
Refactor
Chores