Skip to content

Conversation

@AndreaDiazCorreia
Copy link
Member

@AndreaDiazCorreia AndreaDiazCorreia commented Jun 17, 2025

This PR enhances the visual consistency and polish of the Mostro mobile app's navigation elements, addressing UI improvements outlined in issue #92.

Changes Made
🔧 AppBar Improvements
Color Consistency: Updated AppBar background to AppTheme.backgroundDark to match the BUY/SELL tabs section
Visual Separation: Added subtle white border (1px, 10% opacity) at the bottom of AppBar to create clear separation from tabs
📱 Custom Drawer Enhancements
Icon Modernization: Replaced Material Icons with Lucide icons for better visual consistency:
Account: Icons.person_outline_rounded → LucideIcons.user
Settings: Icons.settings_rounded → LucideIcons.settings
About: Icons.info_rounded → LucideIcons.info
Walkthrough: Icons.menu_book_rounded → LucideIcons.bookOpen
Border Addition: Added subtle white border (1px, 10% opacity) on the right side of drawer for visual separation
🏗️ Drawer Architecture Benefits
Our current overlay-based drawer implementation follows mobile UX best practices.

Summary by CodeRabbit

  • New Features
    • Introduced a new slide-in drawer overlay with animated open/close and improved navigation.
  • Refactor
    • Updated main screens to wrap content with the new drawer overlay instead of using the old drawer.
    • Replaced drawer open/close logic with a state-managed toggle for smoother user interaction.
  • Style
    • Enhanced app bar and drawer styling with a cohesive dark theme and added a subtle bottom border to the app bar.
  • Bug Fixes
    • Improved drawer interaction by closing on overlay tap, back button press, and horizontal drag gestures for better usability.
  • Chores
    • Removed the old drawer component to streamline navigation code.
    • Simplified bottom navigation item tap handling by replacing InkWell with GestureDetector and added accessibility semantics.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 17, 2025

Walkthrough

The drawer implementation across several screens was refactored. The previous use of the MostroAppDrawer as a standard scaffold drawer was replaced by a new CustomDrawerOverlay widget, which overlays the drawer on top of the current content. Drawer state is now managed globally via a new Riverpod provider. Drawer layout and app bar styling were also updated.

Changes

File(s) Change Summary
lib/features/chat/screens/chat_rooms_list.dart
lib/features/home/screens/home_screen.dart
lib/features/trades/screens/trades_screen.dart
Replaced Scaffold drawer with CustomDrawerOverlay wrapping main content; updated drawer logic.
lib/shared/providers/drawer_provider.dart Added DrawerNotifier and drawerProvider for global drawer state management.
lib/shared/widgets/custom_drawer_overlay.dart Introduced CustomDrawerOverlay widget for overlay-style drawer with menu and navigation logic.
lib/shared/widgets/mostro_app_bar.dart Changed app bar color, added bottom border, and updated drawer open logic to use the new provider.
lib/shared/widgets/mostro_app_drawer.dart Removed MostroAppDrawer widget and its usage from the codebase.
lib/shared/widgets/bottom_nav_bar.dart Replaced Material+InkWell with GestureDetector for tap handling on nav items; improved accessibility.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AppBar
    participant DrawerProvider
    participant CustomDrawerOverlay
    participant Navigator

    User->>AppBar: Tap menu icon
    AppBar->>DrawerProvider: toggleDrawer()
    DrawerProvider-->>CustomDrawerOverlay: drawer state changes to open
    CustomDrawerOverlay->>User: Show overlay drawer
    User->>CustomDrawerOverlay: Tap menu item
    CustomDrawerOverlay->>DrawerProvider: closeDrawer()
    CustomDrawerOverlay->>Navigator: Navigate to selected route
    DrawerProvider-->>CustomDrawerOverlay: drawer state changes to closed
    CustomDrawerOverlay->>User: Hide overlay drawer
Loading

Suggested reviewers

  • grunch
  • Catrya

Poem

🐇 Hop, hop, the drawer slides in place,
A shadowed veil, a sleek new space.
With Riverpod’s help, it opens wide,
Menus and routes now side by side.
A bunny’s cheer for this smooth sway—
Drawer delights in a brand new way! ✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0571683 and 0103e66.

📒 Files selected for processing (3)
  • lib/features/home/screens/home_screen.dart (2 hunks)
  • lib/features/trades/screens/trades_screen.dart (2 hunks)
  • lib/shared/widgets/bottom_nav_bar.dart (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/features/trades/screens/trades_screen.dart
  • lib/features/home/screens/home_screen.dart
  • lib/shared/widgets/bottom_nav_bar.dart

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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.

@AndreaDiazCorreia
Copy link
Member Author

@grunch @Catrya se que no es el drawer de lovable pero al menos yo no logre hacerlo en flutter ademas que el de lovable no sigue estandares para app mobile

Copy link
Contributor

@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: 3

🔭 Outside diff range comments (2)
lib/features/home/screens/home_screen.dart (2)

99-101: Compile-time error: Color.withValues

Same API misuse as the app bar:

-            color: Colors.white.withValues(alpha: 0.1),
+            color: Colors.white.withOpacity(0.1),

188-191: All withValues usages need replacement

These two lines also need withOpacity to compile:

-  border: Border.all(color: Colors.white.withValues(alpha: 0.05)),
-  ...
-       color: Colors.black.withValues(alpha: 0.2),
+  border: Border.all(color: Colors.white.withOpacity(0.05)),
+  ...
+       color: Colors.black.withOpacity(0.2),

Search the repo for any remaining occurrences.

🧹 Nitpick comments (6)
lib/shared/providers/drawer_provider.dart (1)

3-9: Consider auto-disposing the notifier or adding documentation

DrawerNotifier is declared as a global, non-autoDispose provider.
If the drawer is only relevant while the app is in the foreground, you can save memory and prevent accidental state leaks by switching to autoDispose or by adding a short comment clarifying why the state must outlive the UI.

No action required if global persistence is intentional.

lib/shared/widgets/mostro_app_bar.dart (1)

35-36: Minor: inline notifier read

Instead of ref.read(drawerProvider.notifier).toggleDrawer(); you can call ref.read(drawerProvider.notifier).toggleDrawer() once and avoid repeated rebuilds by using listen or watch, but that’s optional here.

lib/features/home/screens/home_screen.dart (1)

24-88: Bottom navigation should be in Scaffold.bottomNavigationBar

Embedding BottomNavBar inside the CustomDrawerOverlay means it scrolls with content and is covered by the drawer animation.
Consider moving it back to Scaffold.bottomNavigationBar for a fixed, platform-consistent behaviour.

lib/shared/widgets/custom_drawer_overlay.dart (2)

39-44: Avoid recomputing drawer width multiple times

MediaQuery.of(context).size.width * 0.7 is evaluated twice (once for left, once for width). Cache it in a local final drawerWidth = …; to avoid redundant work and guarantee both expressions stay in sync if the widget is rebuilt during an orientation change.

-AnimatedPositioned(
+final drawerWidth = MediaQuery.of(context).size.width * 0.7;
+AnimatedPositioned(-  left: isDrawerOpen ? 0 : -MediaQuery.of(context).size.width * 0.7,
+  left: isDrawerOpen ? 0 : -drawerWidth,-  child: Container(
-    width: MediaQuery.of(context).size.width * 0.7,
+  child: Container(
+    width: drawerWidth,

129-132: Prevent duplicate navigation pushes

context.push(route) is executed unconditionally. If the user is already on the target route this will add an identical copy on the stack. Guard against this to keep the navigation stack clean:

final currentLocation = GoRouter.of(context).location;
if (currentLocation != route) {
  context.push(route);
}
lib/shared/widgets/mostro_app_drawer.dart (1)

10-17: Redundant MediaQuery calculations

Same remark as in the new overlay: width is computed twice. Refactor with a local drawerWidth variable for consistency and readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 921772a and be4f905.

📒 Files selected for processing (7)
  • lib/features/chat/screens/chat_rooms_list.dart (2 hunks)
  • lib/features/home/screens/home_screen.dart (2 hunks)
  • lib/features/trades/screens/trades_screen.dart (2 hunks)
  • lib/shared/providers/drawer_provider.dart (1 hunks)
  • lib/shared/widgets/custom_drawer_overlay.dart (1 hunks)
  • lib/shared/widgets/mostro_app_bar.dart (3 hunks)
  • lib/shared/widgets/mostro_app_drawer.dart (1 hunks)
🔇 Additional comments (4)
lib/features/trades/screens/trades_screen.dart (1)

25-98: Bottom nav placement mirrors the Home screen concern

BottomNavBar is placed inside the overlay; same UX issue as above (scrolling & z-index). Align both screens for consistency.

lib/features/chat/screens/chat_rooms_list.dart (1)

25-48: Verify drawer z-index vs. list scrolling

Because CustomDrawerOverlay wraps the whole body, confirm that keyboard interactions (e.g., search bars) and list scrolling don’t conflict with the overlay’s Stack order.

lib/shared/widgets/custom_drawer_overlay.dart (2)

58-67: Verify asset registration

assets/images/logo.png is hard-coded. A missing pubspec.yaml asset entry will crash at runtime (Unable to load asset). Please ensure the asset is declared:

flutter:
  assets:
    - assets/images/logo.png

115-134: Nice separation of concerns

Encapsulating menu-item construction in _buildMenuItem keeps the build method concise and makes future additions straightforward. Well done.

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

@AndreaDiazCorreia está muy bueno, solo le haría un par de ajustes para mejorar la UX:

  • Que el drawer se pueda cerrar con swipe hacia la izquierda, como ya funcionaba antes.
  • Agregar una línea divisoria entre el logo de Mostro y los navigation items, y poner el logo con la misma distancia entre el borde superior y esa línea

@AndreaDiazCorreia
Copy link
Member Author

@Catrya le hice los cambios que pediste y ademas agregue lo que me comentaste el otro dia de que se pueda pasar de la pestaña de buy y sell con gestos

route: '/walkthrough',
),
],
// Espacio después del logo
Copy link
Member

Choose a reason for hiding this comment

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

please don't add comments on spanish

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

tACK

grunch
grunch previously requested changes Jun 25, 2025
Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

@AndreaDiazCorreia please resolve the conflicts and rebase to merge

Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
lib/shared/widgets/bottom_nav_bar.dart (1)

73-125: Consider the impact of removing Material ripple effects.

The change from Material + InkWell to GestureDetector removes the native Material Design ripple effect that provides visual feedback when users tap navigation items. While this achieves the UI consistency goals mentioned in the PR, consider the following trade-offs:

  1. User Experience: Users expect visual feedback when tapping interactive elements. Without ripple effects, the tap interaction might feel less responsive.

  2. Accessibility: InkWell provides better accessibility support out-of-the-box compared to GestureDetector.

  3. Platform Consistency: Material Design guidelines recommend using ripple effects for interactive elements.

If you want to maintain the current visual design while preserving some feedback, consider adding a subtle color change or scale animation:

 return Expanded(
   child: GestureDetector(
     onTap: () => _onItemTapped(context, index),
+    child: AnimatedContainer(
+      duration: const Duration(milliseconds: 100),
+      color: Colors.transparent,
       child: SizedBox(
         height: double.infinity,
         child: Column(
           // ... existing content
         ),
       ),
+    ),
   ),
 );

Alternatively, if you want to keep the Material ripple but with custom styling, you could use:

 return Expanded(
-  child: GestureDetector(
-    onTap: () => _onItemTapped(context, index),
+  child: Material(
+    color: Colors.transparent,
+    child: InkWell(
+      onTap: () => _onItemTapped(context, index),
+      splashColor: AppTheme.activeColor.withOpacity(0.1),
+      highlightColor: Colors.transparent,
       child: SizedBox(
         height: double.infinity,
         child: Column(
           // ... existing content
         ),
       ),
+    ),
   ),
 );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e10a362 and 41426c6.

📒 Files selected for processing (3)
  • lib/features/home/screens/home_screen.dart (2 hunks)
  • lib/shared/widgets/bottom_nav_bar.dart (1 hunks)
  • lib/shared/widgets/custom_drawer_overlay.dart (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/features/home/screens/home_screen.dart
  • lib/shared/widgets/custom_drawer_overlay.dart

@AndreaDiazCorreia
Copy link
Member Author

@grunch @Catrya Can you try these latest changes? There shouldn’t be any more conflicts, and I fixed the issue where the bottom nav bar wasn’t showing.

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

Hola @AndreaDiazCorreia sigue sin la barra de navegacion del home

@AndreaDiazCorreia
Copy link
Member Author

@Catrya lo probe en todos los tamaños posibles y me sale igual hice un cambio chico, prueba a ver

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

utACK

@grunch grunch merged commit 2098d83 into MostroP2P:main Jul 2, 2025
1 check passed
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