8000 UI Consistency Improvements - Issue #92 by AndreaDiazCorreia · Pull Request #121 · MostroP2P/mobile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

UI Consistency Improvements - Issue #92 #121

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

AndreaDiazCorreia
Copy link
Collaborator
@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 improved navigation and visual consistency across the app.
  • Refactor
    • Updated main screens to use the new drawer overlay instead of the previous drawer implementation.
  • Style
    • Enhanced app bar and drawer styling for a more cohesive dark theme and added a subtle bottom border to the app bar.

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 l 8000 ayout 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.

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 112bcc9 and ea53dda.

📒 Files selected for processing (2)
  • lib/shared/widgets/custom_drawer_overlay.dart (1 hunks)
  • lib/shared/widgets/mostro_app_drawer.dart (0 hunks)
💤 Files with no reviewable changes (1)
  • lib/shared/widgets/mostro_app_drawer.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/shared/widgets/custom_drawer_overlay.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
Collaborator 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
8000

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
Collaborator
@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

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.

2 participants
0