fix(home): own orders follow the tab split, with readable pills - #293
fix(home): own orders follow the tab split, with readable pills#293Catrya wants to merge 4 commits into
Conversation
- 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.
WalkthroughThe 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. ChangesHome order book updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/features/home/filtered_orders_provider_test.dart (1)
33-40: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueMake this assertion order-independent.
filteredOrdersProvideronly sorts bycreatedAt, 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
⛔ Files ignored due to path filters (2)
test/features/home/goldens/order_list_item_dark.pngis excluded by!**/*.pngtest/features/home/goldens/order_list_item_light.pngis excluded by!**/*.png
📒 Files selected for processing (4)
lib/features/home/providers/home_order_providers.dartlib/features/home/widgets/order_list_item.dartlib/l10n/app_es.arbtest/features/home/filtered_orders_provider_test.dart
There was a problem hiding this comment.
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
b9189a3b1d0d2ba2d4254dbf70ba50ce47584873are 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.
Closes #290
The order book showed the user's own orders in both tabs
(
filteredOrdersProvideronly applied the buy/sell kind filter to otherpeople'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
isMineexception: own orders follow thesame 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 itshome in My Trades. Provider test updated to pin the new behavior.
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.
Wrapandreflow 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 filterapplies 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 testreplaces the old both-tabs one.
Summary by CodeRabbit