Skip to content

Conversation

@AndreaDiazCorreia
Copy link
Member

@AndreaDiazCorreia AndreaDiazCorreia commented Jun 2, 2025

Fixes #104
Changes:

SafeArea implementation: Added SafeArea to BottomNavBar to prevent overlap with Android gestural navigation bar
Button positioning: Updated AddOrderButton positioning to maintain consistent 16px distance from BottomNavBar across all devices
Icon color fix: Set explicit black color for BUY/SELL arrow icons to prevent Material You theme override in release builds

Summary by CodeRabbit

  • New Features

    • Order list items now display either a fixed sats amount or a premium percentage, offering clearer information for fixed and market price orders.
  • Improvements

    • Add Order button position now adapts to device safe areas for better accessibility across different devices.
    • Bottom navigation bar now respects device safe areas, preventing overlap with system UI elements.
    • Enhanced styling and layout for the Buy/Sell menu options in the Add Order button for improved clarity and usability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 2, 2025

Walkthrough

The changes adjust UI elements in multiple widgets: the vertical position of the AddOrderButton now accounts for device safe area insets, the order list item visually distinguishes fixed orders by displaying sats instead of a percentage, the AddOrderButton menu arrow icons are conditionally shown and styled, and the bottom navigation bar is wrapped in a SafeArea for proper device compatibility.

Changes

File(s) Change Summary
lib/features/home/screens/home_screen.dart Adjusted AddOrderButton vertical position to account for device bottom padding and safe area insets.
lib/features/home/widgets/order_list_item.dart Updated order row layout: shows sats for fixed orders, otherwise shows premium percentage; improved conditionals.
lib/shared/widgets/add_order_button.dart Modified menu option buttons: added conditional arrow icons, updated button styling, removed redundant comments.
lib/shared/widgets/bottom_nav_bar.dart Wrapped navigation bar in SafeArea (bottom only) to handle device UI insets.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeScreen
    participant AddOrderButton
    participant MediaQuery
    participant OrderListItem

    User->>HomeScreen: Opens Home Screen
    HomeScreen->>MediaQuery: Get bottom padding
    HomeScreen->>AddOrderButton: Render with calculated bottom offset

    User->>AddOrderButton: Taps menu
    AddOrderButton->>AddOrderButton: Toggle menu state
    AddOrderButton->>AddOrderButton: Show conditional arrow icons

    User->>OrderListItem: Views order
    OrderListItem->>OrderListItem: Check if fixed order
    alt Fixed order
        OrderListItem->>OrderListItem: Display sats amount
    else Market order
        OrderListItem->>OrderListItem: Display premium percentage
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Fixed orders should indicate the exact amount of sats, not just the fiat, and remove the % (104)
Put the neworder arrows the same color as BUY and SELL (104)
Move the icons up a bit because on some phones it looks like an icon is selected (104)

Possibly related PRs

  • Feat/tabs and orders #98: Introduces the initial AddOrderButton widget and its UI integration, which is directly related to the current PR's adjustments to its positioning and appearance.

Suggested reviewers

  • grunch

Poem

A button floats, now safe and neat,
Arrows match their colored seat.
Sats are shown when orders fix,
No more percent in that mix!
The nav bar hugs the bottom tight,
UI tweaks bring pure delight.
🐰✨


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.

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/add_order_button.dart (1)

74-129: Addresses Material You theme override with explicit color styling.

The arrow icons are now explicitly colored black (color: Colors.black) to prevent the Material You theme from overriding their appearance in release builds, directly addressing the PR objective. The conditional display ensures icons only appear when the menu is open.

Consider a cleaner approach by using custom button widgets instead of ElevatedButton.icon with empty SizedBox icons:

-ElevatedButton.icon(
+ElevatedButton(
  onPressed: _isMenuOpen
      ? () => _navigateToCreateOrder(context, 'buy')
      : null,
  style: ElevatedButton.styleFrom(
    backgroundColor: AppTheme.buyColor,
    foregroundColor: Colors.black,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(50),
    ),
    padding: const EdgeInsets.symmetric(
        horizontal: 16, vertical: 10),
  ),
-  icon: const SizedBox(width: 16, height: 16),
-  label: const Text('BUY',
-      style: TextStyle(fontWeight: FontWeight.bold)),
+  child: Row(
+    mainAxisSize: MainAxisSize.min,
+    children: [
+      if (_isMenuOpen)
+        const Icon(Icons.arrow_downward, size: 16, color: Colors.black),
+      if (_isMenuOpen) const SizedBox(width: 8),
+      const Text('BUY', style: TextStyle(fontWeight: FontWeight.bold)),
+    ],
+  ),
),

This would eliminate the need for the Stack wrapper while maintaining the same functionality.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c403a5b and 1036a77.

📒 Files selected for processing (4)
  • lib/features/home/screens/home_screen.dart (1 hunks)
  • lib/features/home/widgets/order_list_item.dart (2 hunks)
  • lib/shared/widgets/add_order_button.dart (2 hunks)
  • lib/shared/widgets/bottom_nav_bar.dart (2 hunks)
🔇 Additional comments (4)
lib/features/home/screens/home_screen.dart (1)

82-82: Excellent implementation of responsive button positioning.

The dynamic calculation correctly accounts for device safe areas by using MediaQuery.of(context).viewPadding.bottom, ensuring the AddOrderButton maintains consistent 16px spacing from the BottomNavBar across all devices, including those with Android gestural navigation bars.

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

21-22: Perfect SafeArea implementation for device compatibility.

Wrapping the BottomNavBar in SafeArea with top: false correctly prevents overlap with Android gestural navigation bars while allowing the top edge to extend to the screen boundary. This addresses the core issue mentioned in the PR objectives.

lib/features/home/widgets/order_list_item.dart (2)

20-22: Clear logic for distinguishing order types.

The isFixedOrder determination correctly identifies orders with specific sats amounts, enabling better visual differentiation in the UI.


115-189: Enhanced order display improves user experience.

The restructured layout effectively distinguishes between fixed sats orders and market price orders with percentage indicators. The conditional display provides clearer information to users about order types.

Note: While this is a valuable UI improvement, it appears to be separate from the main PR objectives focused on navigation bar and button positioning fixes.

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

Catrya

This comment was marked as duplicate.

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 5a4ab7d into MostroP2P:main Jun 3, 2025
1 check passed
@AndreaDiazCorreia AndreaDiazCorreia deleted the feat/issue-104 branch June 10, 2025 00:51
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.

Pending visual fixes to the order screen

3 participants