Skip to content

fix(home): own orders follow the tab split, with readable pills - #293

Open
Catrya wants to merge 4 commits into
mainfrom
fix/own-orders-tab-filter
Open

fix(home): own orders follow the tab split, with readable pills#293
Catrya wants to merge 4 commits into
mainfrom
fix/own-orders-tab-filter

Conversation

@Catrya

@Catrya Catrya commented Aug 7, 2026

Copy link
Copy Markdown
Member

Closes #290

The order book showed the user's own orders in both tabs
(filteredOrdersProvider only applied the buy/sell kind filter to other
people's orders). With few third-party orders both tabs looked identical,
which read as a bug. On top of that, the own-order pill in Spanish
("USTED ESTÁ VENDIENDO") was the longest of the five languages and the
pill row shrank its labels on small phones, ellipsizing them
("ESTÁS COMP…") — especially when the card also carried a reason badge.

Fix

  • Tab split — dropped the isMine exception: own orders follow the
    same split as everyone else's (a sell order shows only in BUY BTC, a buy
    order only in SELL BTC), distinguished by the "you are selling/buying"
    pill. Tapping still opens MyOrderScreen; managing own orders keeps its
    home in My Trades. Provider test updated to pin the new behavior.
  • Spanish pill — now "ESTÁS VENDIENDO/COMPRANDO": shorter and matching
    the informal register the rest of the Spanish app uses (no real "usted"
    remains). French/German/Italian reviewed and left as-is — short and in
    each language's conventional UI register.
  • Pill layout — pills keep their intrinsic width inside a Wrap and
    reflow to a second line when they don't fit beside the timestamp,
    instead of shrinking and ellipsizing. The own-order pill renders first,
    so on an own order it is always fully readable and the reason badge is
    the one that drops to the next line. Reason badges keep being computed
    for all orders, own ones included.

Changes

  • lib/features/home/providers/home_order_providers.dart: kind filter
    applies to all orders.
  • lib/features/home/widgets/order_list_item.dart: pill wrap + ordering.
  • lib/l10n/app_es.arb: shortened pill strings (l10n regenerated).
  • test/features/home/filtered_orders_provider_test.dart: new-split test
    replaces the old both-tabs one.

Summary by CodeRabbit

  • Bug Fixes
    • Orders now appear only under the matching home tab, including your own orders.
    • Order labels and timestamps remain readable on narrow screens, with pills wrapping as needed.
    • Updated Spanish order-status wording for a more natural tone.

Catrya added 4 commits August 7, 2026 17:28
- Dropped the isMine exception in filteredOrdersProvider: own orders
  showed in both tabs, which read as duplication and made the tabs
  meaningless with few third-party orders (issue #290).
- A sell order now shows only in BUY BTC and a buy order in SELL BTC,
  same as everyone else's
- Provider test updated to pin the new split.
- USTED ESTÁ VENDIENDO/COMPRANDO was the longest of the five
  languages and clipped on small phones.
- Now ESTÁS VENDIENDO/COMPRANDO, matching the informal register the
  rest of the Spanish app already uses (no real usted remains).
- fr/de/it reviewed and left as-is: short and in each language's
  conventional UI register.
- Reason and own-order pills were Flexible in a Row: with both present
  on a small phone they shrank and ellipsized
- Pills now keep their intrinsic width inside a Wrap and reflow to a
  second run when they don't fit beside the timestamp.
- On an own order you are selling/buying must always be readable, so
  it now comes first in the pill wrap.
- The reason badge is the one that drops to the next line when both
  don't fit beside the timestamp.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The home order book now filters owned orders by order kind like other orders. Order cards wrap reason and ownership pills without truncation. Spanish order-status labels use informal wording.

Changes

Home order book updates

Layer / File(s) Summary
Order filtering and validation
lib/features/home/providers/home_order_providers.dart, test/features/home/filtered_orders_provider_test.dart
The provider applies the active tab’s order-kind filter to owned orders. Tests cover owned and third-party orders across BUY and SELL tabs.
Order card pill layout
lib/features/home/widgets/order_list_item.dart, lib/l10n/app_es.arb
The order card wraps intrinsic-width reason and ownership pills while retaining the timestamp column. Spanish labels use “estás” wording.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: andreadiazcorreia, grunch

Poem

A rabbit checks the order tabs,
Each kind now finds its proper place.
Pills wrap softly, labels shine,
Spanish words grow warm and fine.
The timestamp keeps its space.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The order-card layout and Spanish label changes are not covered by linked issue #290. Move the layout and localization changes to a separate issue or link issues that explicitly require them.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main tab-filtering fix and the readable pill layout.
Linked Issues check ✅ Passed The provider and test changes implement issue #290 by applying the buy/sell filter to own orders.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/own-orders-tab-filter

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/features/home/filtered_orders_provider_test.dart (1)

33-40: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Make this assertion order-independent.

filteredOrdersProvider only sorts by createdAt, so the matching sell orders are indistinguishable to the provider when they use the fixture default timestamp. The exact sequence in this test is not dictated by the feature under test.

Proposed test change
-      expect(helper.ids(), ['mine-sell', 'other-sell']);
+      expect(helper.ids(), unorderedEquals(['mine-sell', 'other-sell']));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/features/home/filtered_orders_provider_test.dart` around lines 33 - 40,
Update the assertion using helper.ids() in the filtered-orders test to compare
the matching order IDs without relying on sequence, such as by applying an
order-independent collection matcher. Preserve the expected IDs mine-sell and
other-sell while avoiding assumptions about their relative ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/features/home/filtered_orders_provider_test.dart`:
- Around line 33-40: Update the assertion using helper.ids() in the
filtered-orders test to compare the matching order IDs without relying on
sequence, such as by applying an order-independent collection matcher. Preserve
the expected IDs mine-sell and other-sell while avoiding assumptions about their
relative ordering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e00274b-dfc9-4d00-bc9d-26d441dbd6d8

📥 Commits

Reviewing files that changed from the base of the PR and between 7d37bc2 and b9189a3.

⛔ Files ignored due to path filters (2)
  • test/features/home/goldens/order_list_item_dark.png is excluded by !**/*.png
  • test/features/home/goldens/order_list_item_light.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • lib/features/home/providers/home_order_providers.dart
  • lib/features/home/widgets/order_list_item.dart
  • lib/l10n/app_es.arb
  • test/features/home/filtered_orders_provider_test.dart

@ermeme ermeme Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review summary

Approved. The PR matches issue #290: own orders now follow the same BUY/SELL tab split as third-party orders, while taps still route owned orders to MyOrderScreen. The Spanish pill text is shorter and consistent with the informal register, and the pill row now wraps intrinsic-width pills instead of shrinking the labels.

I also checked the updated provider test and the regenerated light/dark goldens. CodeRabbit's order-independent assertion note is reasonable as a test-hardening nit because the two sell fixtures share the same timestamp, but it is not a merge blocker: the product behavior is correct and CI is green.

Validation:

  • git diff --check origin/main...HEAD
  • Visual inspection of updated light/dark goldens
  • GitHub checks on b9189a3b1d0d2ba2d4254dbf70ba50ce47584873 are green: Flutter analyze/test, Rust build/test/clippy/wasm, and Web wasm smoke test.

Local Flutter/Dart commands are not available in this environment (flutter/dart not installed), so I relied on the repository's passing CI for those gates.

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.

Own orders appear in both BUY and SELL tabs of the order book

1 participant