Skip to content

Conversation

@JatsuAkaYashvant
Copy link
Member

@JatsuAkaYashvant JatsuAkaYashvant commented Aug 31, 2025

Describe the changes you have made in this PR

  • Added micro-interactions to the buttons for better UX feedback.
  • Implemented smooth transition animations between pages during navigation.
  • Added an exit confirmation dialog box to prevent accidental app closure.

Note: Please check Allow edits from maintainers if you would like us to assist in the PR.

Summary by CodeRabbit

  • New Features
    • Added exit confirmation when leaving the app from the home screen, with localized text (EN/AR/HI).
  • Style
    • Introduced smooth fade+scale transitions across app navigation.
    • Upgraded primary, outline, and flat buttons with press animations and dynamic color feedback.
  • Bug Fixes
    • Improved group email input dialog: added scrolling to prevent overflow and clearer validation with localized errors.
  • Refactor
    • Centralized route construction for consistent transitions and navigation behavior.

@coderabbitai
Copy link

coderabbitai bot commented Aug 31, 2025

Walkthrough

Adds exit-confirmation localizations (EN/AR/HI) and wires an exit dialog into CVLandingView back navigation. Refactors router to use a centralized fade+scale transition. Converts primary/outline/flat buttons to animated, stateful interactions. Adjusts GroupDetailsView’s email dialog for scrollability and validation. All changes are additive; no public route APIs altered.

Changes

Cohort / File(s) Change summary
Localization getters (Dart)
lib/gen_l10n/app_localizations.dart, lib/gen_l10n/app_localizations_en.dart, lib/gen_l10n/app_localizations_ar.dart, lib/gen_l10n/app_localizations_hi.dart
Added four getters: cv_exit_app_title, cv_exit_app_message, cv_exit_app, cv_cancel with EN/AR/HI overrides. No removals.
Localization resources (ARB)
lib/l10n/app_en.arb, lib/l10n/app_ar.arb, lib/l10n/app_hi.arb
Added keys/strings for exit confirmation: title, message, confirm, cancel.
Animated buttons
lib/ui/components/cv_primary_button.dart, lib/ui/components/cv_outline_button.dart, lib/ui/components/cv_flat_button.dart
Converted to stateful with AnimationController; added press scale and color/elevation animations; updated tap handling and build paths; maintained existing props usage.
Landing view back navigation
lib/ui/views/cv_landing_view.dart
Implemented PopScope logic: navigate to home on back from non-home; on home, show localized exit dialog and optionally exit via SystemNavigator.pop().
Group details email dialog
lib/ui/views/groups/group_details_view.dart
Wrapped chips input in SingleChildScrollView; set title Column to min main axis; centralized validation and input handling inside SimpleChipsInput.
Router transition wrapper
lib/utils/router.dart
Introduced _buildRoute using PageRouteBuilder with fade+scale transition; routed pages through wrapper; preserved RouteSettings where needed; default route updated.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • hardik17771
  • tachyons

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/ui/components/cv_flat_button.dart (1)

6-10: Remove required modifier from key parameter.

Keys should be optional parameters in Flutter widgets. The required modifier on key is unconventional and may cause issues.

  const CVFlatButton({
-   required Key key,
+   Key? key,
    required this.triggerFunction,
    required this.buttonText,
    this.context,
  }) : super(key: key);
🧹 Nitpick comments (12)
lib/ui/views/cv_landing_view.dart (1)

105-116: Consider enhancing the exit dialog UX with an icon.

The exit confirmation dialog implementation is solid, but adding a warning icon could improve visual communication of the action's significance.

Consider updating the DialogService to support an optional icon parameter for better visual feedback in confirmation dialogs.

lib/utils/router.dart (2)

102-105: Consider making transition durations configurable.

While the current durations work well, consider extracting them as constants for easier adjustment based on user feedback or accessibility needs.

Add constants at the class level:

 class CVRouter {
+  static const Duration _forwardTransitionDuration = Duration(milliseconds: 350);
+  static const Duration _reverseTransitionDuration = Duration(milliseconds: 300);
+  
   static Route<dynamic> generateRoute(RouteSettings settings) {

Then use them in _buildRoute:

   static PageRouteBuilder _buildRoute(Widget page, {RouteSettings? settings}) {
     return PageRouteBuilder(
       settings: settings,
-      transitionDuration: const Duration(milliseconds: 350),
-      reverseTransitionDuration: const Duration(milliseconds: 300),
+      transitionDuration: _forwardTransitionDuration,
+      reverseTransitionDuration: _reverseTransitionDuration,

113-115: Consider accessibility for reduced motion preferences.

Users with motion sensitivity might prefer reduced or no animations. Consider checking for reduced motion preferences.

Would you like me to help implement a check for the system's reduced motion accessibility setting to conditionally apply simpler transitions for users who prefer less motion?

lib/ui/components/cv_outline_button.dart (4)

31-32: Consider making the state class private.

The state class CVOutlineButtonState is exposed as public, but there's no apparent need for external access to the state. Consider making it private by prefixing with an underscore.

  @override
- CVOutlineButtonState createState() => CVOutlineButtonState();
+ _CVOutlineButtonState createState() => _CVOutlineButtonState();
-class CVOutlineButtonState extends State<CVOutlineButton>
+class _CVOutlineButtonState extends State<CVOutlineButton>

63-63: Use withValues instead of deprecated withAlpha method.

The withAlpha method is a legacy API. Use withValues for better forward compatibility with Material 3.

-      end: primaryColor.withAlpha(153), // ~60% opacity
+      end: primaryColor.withValues(alpha: 153), // ~60% opacity

70-70: Use withValues instead of deprecated withAlpha method.

The withAlpha method is a legacy API. Use withValues for better forward compatibility.

-      end: primaryColor.withAlpha(179), // ~70% opacity
+      end: primaryColor.withValues(alpha: 179), // ~70% opacity

140-140: Remove null overlay color to maintain default ripple effect.

Setting overlayColor to null explicitly disables the Material ripple effect. This might not be intended since you're adding custom animations on top of the default Material behavior.

Consider removing the overlayColor: null line to preserve the default Material ripple effect which provides additional visual feedback:

                  foregroundColor:
                      _textColorAnimation.value ??
                      (widget.isPrimaryDark
                          ? CVTheme.primaryColorDark
                          : CVTheme.primaryColor),
-                 overlayColor: null,
                ),
lib/ui/components/cv_primary_button.dart (3)

44-45: Consider making the state class private.

The state class CVPrimaryButtonState is exposed as public, but there's no apparent need for external access to the state. Consider making it private.

  @override
- CVPrimaryButtonState createState() => CVPrimaryButtonState();
+ _CVPrimaryButtonState createState() => _CVPrimaryButtonState();
-class CVPrimaryButtonState extends State<CVPrimaryButton>
+class _CVPrimaryButtonState extends State<CVPrimaryButton>

80-80: Use withValues instead of deprecated withAlpha method.

The withAlpha method is a legacy API. Use withValues for better forward compatibility.

-      end: primaryColor.withAlpha(204), // ~80% opacity for pressed state
+      end: primaryColor.withValues(alpha: 204), // ~80% opacity for pressed state

138-138: Remove null overlay color to maintain default ripple effect.

Setting overlayColor to null explicitly disables the Material ripple effect, which might not be intended.

Consider removing the overlayColor: null line:

                elevation: _elevationAnimation.value,
-               overlayColor: null,
              ),
lib/ui/components/cv_flat_button.dart (2)

40-40: Use withValues instead of deprecated withAlpha method.

The withAlpha method is a legacy API. Use withValues for better forward compatibility.

-      end: Colors.grey.withAlpha(179),
+      end: Colors.grey.withValues(alpha: 179),
            isActive
-               ? CVTheme.primaryColor.withAlpha(179)
-               : Colors.grey.withAlpha(179),
+               ? CVTheme.primaryColor.withValues(alpha: 179)
+               : Colors.grey.withValues(alpha: 179),

Also applies to: 62-63


107-107: Remove null overlay color to maintain default ripple effect.

Setting overlayColor to null explicitly disables the Material ripple effect.

Consider removing the overlayColor property:

                  foregroundColor: WidgetStateProperty.all(
                    _colorAnimation.value,
                  ),
-                 overlayColor: WidgetStateProperty.all(null),
                ),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c538725 and 4009070.

📒 Files selected for processing (13)
  • lib/gen_l10n/app_localizations.dart (1 hunks)
  • lib/gen_l10n/app_localizations_ar.dart (1 hunks)
  • lib/gen_l10n/app_localizations_en.dart (1 hunks)
  • lib/gen_l10n/app_localizations_hi.dart (1 hunks)
  • lib/l10n/app_ar.arb (1 hunks)
  • lib/l10n/app_en.arb (1 hunks)
  • lib/l10n/app_hi.arb (1 hunks)
  • lib/ui/components/cv_flat_button.dart (1 hunks)
  • lib/ui/components/cv_outline_button.dart (2 hunks)
  • lib/ui/components/cv_primary_button.dart (2 hunks)
  • lib/ui/views/cv_landing_view.dart (2 hunks)
  • lib/ui/views/groups/group_details_view.dart (2 hunks)
  • lib/utils/router.dart (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-12T14:34:41.433Z
Learnt from: JatsuAkaYashvant
PR: CircuitVerse/mobile-app#421
File: lib/viewmodels/simulator/simulator_viewmodel.dart:244-244
Timestamp: 2025-08-12T14:34:41.433Z
Learning: In Flutter projects, `Uint8List` is re-exported by `flutter/services.dart`, so importing `dart:typed_data` directly is redundant when `flutter/services.dart` is already imported. The Dart analyzer will confirm such imports as unnecessary.

Applied to files:

  • lib/ui/views/cv_landing_view.dart
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test & Analyze (ubuntu-latest)
  • GitHub Check: Test & Analyze (macos-latest)
  • GitHub Check: Test & Analyze (windows-latest)
🔇 Additional comments (13)
lib/l10n/app_en.arb (1)

434-437: LGTM! New exit confirmation localization keys added correctly.

The new localization keys for exit confirmation dialog are well-structured and follow consistent naming patterns. The placement after cv_language maintains the logical grouping within the cv_landing_view section.

lib/l10n/app_hi.arb (1)

432-435: LGTM! Hindi translations are accurate and culturally appropriate.

The Hindi translations properly convey the intended meaning:

  • "ऐप बंद करें" (Exit App)
  • "क्या आप वाकई ऐप बंद करना चाहते हैं?" (Are you sure you want to exit the application?)
  • "बंद करें" (Exit)
  • "रद्द करें" (Cancel)

These translations are natural and consistent with common Hindi UI terminology.

lib/l10n/app_ar.arb (1)

435-438: LGTM! Arabic translations are accurate and properly localized.

The Arabic translations are contextually appropriate and follow proper Arabic UI conventions:

  • "الخروج من التطبيق" (Exit App)
  • "هل أنت متأكد أنك تريد الخروج من التطبيق؟" (Are you sure you want to exit the application?)
  • "خروج" (Exit)
  • "إلغاء" (Cancel)

The translations maintain consistency with the existing Arabic localization style in the file.

lib/ui/views/groups/group_details_view.dart (2)

166-166: Good improvement for dialog layout.

Adding mainAxisSize: MainAxisSize.min to the Column helps reduce the dialog's vertical footprint, making it more compact and visually appealing.


183-212: Excellent enhancement for email input dialog usability.

The refactoring improves the dialog in several ways:

  1. Scrollability: Wrapping SimpleChipsInput with SingleChildScrollView prevents overflow issues when many email chips are added
  2. Better organization: Moving all SimpleChipsInput configuration parameters inside the widget makes the code more maintainable
  3. Consistent validation: The email validation logic with localized error messages enhances user experience

The dynamic button state management via onChanged callback ensures the "Add" button is only enabled when valid input is present.

lib/gen_l10n/app_localizations.dart (1)

2353-2376: LGTM! Generated localization getters follow Flutter conventions.

The four new getters (cv_exit_app_title, cv_exit_app_message, cv_exit_app, cv_cancel) are properly generated with:

  • Consistent documentation format
  • Proper English translations in comments
  • Standard getter signature pattern
  • Correct placement in the class structure

This aligns with Flutter's localization code generation best practices from the intl package.

lib/gen_l10n/app_localizations_ar.dart (1)

1192-1203: LGTM! Arabic translations for exit dialog are correct.

The Arabic translations are properly implemented and linguistically accurate. The translations follow the standard Arabic UI conventions.

lib/gen_l10n/app_localizations_en.dart (1)

1201-1213: LGTM! English translations are clear and consistent.

The English translations for the exit confirmation dialog follow standard UX patterns with clear messaging.

lib/ui/views/cv_landing_view.dart (2)

124-137: Good implementation of back navigation with exit confirmation.

The back navigation logic correctly handles both navigation to home and app exit scenarios. The async handling and PopScope configuration are properly implemented.


3-3: Keep flutter/services.dart import
SystemNavigator is only available via package:flutter/services.dart and isn’t re-exported by other imports, so this import is required.

Likely an incorrect or invalid review comment.

lib/gen_l10n/app_localizations_hi.dart (1)

1210-1221: LGTM! Hindi translations are appropriate.

The Hindi translations are correctly implemented and use appropriate formal language for the exit confirmation dialog.

lib/utils/router.dart (2)

100-123: Excellent implementation of smooth page transitions!

The fade + scale transition implementation provides a premium feel with well-chosen animation parameters:

  • The 350ms forward and 300ms reverse durations create natural-feeling transitions
  • The subtle scale from 0.96 to 1.0 adds depth without being distracting
  • Using Curves.easeInOutQuart provides smooth acceleration and deceleration

This significantly enhances the user experience compared to default MaterialPageRoute transitions.


41-45: Good preservation of route settings for SimulatorView.

The implementation correctly maintains route metadata by passing RouteSettings to _buildRoute, ensuring proper navigation state management.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 17354405759

Details

  • 153 of 244 (62.7%) changed or added relevant lines in 9 files are covered.
  • 5 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.1%) to 54.599%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/gen_l10n/app_localizations_ar.dart 0 4 0.0%
lib/gen_l10n/app_localizations_en.dart 0 4 0.0%
lib/gen_l10n/app_localizations_hi.dart 0 4 0.0%
lib/ui/views/groups/group_details_view.dart 9 17 52.94%
lib/ui/views/cv_landing_view.dart 0 12 0.0%
lib/ui/components/cv_primary_button.dart 43 56 76.79%
lib/ui/components/cv_flat_button.dart 29 44 65.91%
lib/ui/components/cv_outline_button.dart 52 67 77.61%
lib/utils/router.dart 20 36 55.56%
Files with Coverage Reduction New Missed Lines %
lib/gen_l10n/app_localizations_ar.dart 1 0.0%
lib/gen_l10n/app_localizations_hi.dart 1 0.0%
lib/ui/views/cv_landing_view.dart 1 61.02%
lib/utils/router.dart 2 63.89%
Totals Coverage Status
Change from base Build 17301927562: 0.1%
Covered Lines: 4885
Relevant Lines: 8947

💛 - Coveralls

@hardik17771 hardik17771 merged commit f0aff7a into CircuitVerse:master Aug 31, 2025
11 checks passed
This was referenced Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants