Skip to content

fix: expose order.status on a pending order you created - #680

Merged
grunch merged 2 commits into
mainfrom
fix/order-status-on-a-pending-order-you-made
Aug 28, 2026
Merged

fix: expose order.status on a pending order you created#680
grunch merged 2 commits into
mainfrom
fix/order-status-on-a-pending-order-you-made

Conversation

@grunch

@grunch grunch commented Aug 25, 2026

Copy link
Copy Markdown
Member

docs/automation-contract.md names the trade detail as the home of order.status:

| order.status | trade | Read-only order status; label is the wire status (pending, waiting-payment, active, …). |

That identifier lives in exactly one widget, MostroMessageDetail. And TradeDetailScreen swaps that widget for the creator's reputation on a pending order the user made:

if (isPending && isCreator && originalOrder != null) ...[
  _buildCreatorReputation(context, originalOrder),
] else ...[
  MostroMessageDetail(orderId: orderId),
],

So for the whole pending phase of every order this app creates, the maker's own trade detail has no status at all. A black-box driver reads the screen as having no state — the accessibility dump has order.id and trade.cancel and nothing else:

resource-id="order.id"
resource-id="trade.cancel"

Found by Mortsom, which cannot get past the first step of a sell: element order.status not found within 30s.

The change

A one-pixel readout carries the identifier and the wire status through that branch. That idiom already existed on the pay-invoice screen (pay.invoice.text), so it now has one definition — AutomationReadout — and both screens use it. Nothing changes visually. Note the label is the wire status, not a localized string, because that is what the contract specifies: accessibility gains a machine-readable state on that branch, not a polished announcement.

Two widget tests lock the identifier to the screen, one per branch; the first fails without the readout. Until now nothing in the suite covered it, which is why only an external harness caught the gap.

Test plan

  • flutter analyze clean; flutter test green (1103 tests).
  • Widget tests: order.status is present with the wire status on the maker's pending order and on the message-card branch, and never on both at once.
  • Verified on a real run: the maker's pending order now dumps content-desc="pending" resource-id="order.status", and Mortsom reads it.
  • Full happy_sell end to end — still pending, it needs the companion harness fix (MostroP2P/mortsom#15).

Summary by CodeRabbit

  • Accessibility
    • Preserved order status information for screen readers and automated accessibility tools on pending orders created by the current user.
    • Improved accessibility readouts for invoice payment flows by exposing the invoice being processed.

The trade detail swaps the Mostro message card for the creator's
reputation on a pending order the user made, and that card is the only
place `order.status` lives. The status therefore vanished from the one
screen the automation contract names as its home
(docs/automation-contract.md), for the whole pending phase of every
order this app creates -- a black-box driver reads the maker's own order
as having no state at all.

A one-pixel readout carries the identifier and the wire status through
that branch, the same way `pay.invoice.text` carries the invoice being
paid. Nothing changes visually; screen readers get the status.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 847c6140-d15b-472b-bd16-79550767a333

📥 Commits

Reviewing files that changed from the base of the PR and between 2f4d7d3 and 5cb4ffd.

📒 Files selected for processing (6)
  • docs/automation-contract.md
  • lib/core/automation/automation_id.dart
  • lib/features/order/screens/pay_lightning_invoice_screen.dart
  • lib/features/trades/screens/trade_detail_screen.dart
  • test/core/automation/automation_contract_test.dart
  • test/features/trades/screens/trade_detail_screen_test.dart

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The PR adds a reusable AutomationReadout widget for invisible semantic values. Trade details use it for pending creator order status, and invoice payment uses it for the invoice. Tests verify the semantics contract and trade detail branches.

Changes

Automation readouts

Layer / File(s) Summary
AutomationReadout widget
lib/core/automation/automation_id.dart, test/core/automation/automation_contract_test.dart
Adds AutomationReadout and verifies that its identifier exposes the configured value as the semantics label.
Readout integrations
lib/features/trades/screens/trade_detail_screen.dart, lib/features/order/screens/pay_lightning_invoice_screen.dart, docs/automation-contract.md
Uses AutomationReadout for pending creator order status and invoice automation. Updates the order.status contract.
Trade detail validation
test/features/trades/screens/trade_detail_screen_test.dart
Adds maker-order fixtures and verifies one status semantics node for creator reputation and MostroMessageDetail branches.

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

Merge Risk: ⚪ Minimal · up to 5cb4f

The PR exposes the existing wire-level order status on the maker’s pending-order screen without changing visible UI or order behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: catrya

Poem

A rabbit reads the status bright,
Through hidden nodes beyond the sight.
An invoice joins the semantic flow,
While tests confirm the labels show.
One clear signal, neat and true,
Carrots hop for readouts new.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exposing order.status for pending orders created by the user.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (6 skipped: 6 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/order-status-on-a-pending-order-you-made

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.

The screen only had the identifier through MostroMessageDetail, and the
maker's own pending order renders the creator reputation instead, so the
status was absent for the whole pending phase. Nothing in the suite said
so: the gap was found by an external harness.

Add a widget test for each branch — it fails without the readout — and
give the invisible-readout idiom one definition (AutomationReadout)
instead of a second copy, now used by the pay-invoice screen too. The
contract doc records that the maker's pending order gets its status from
a readout, still exactly one node.
@grunch
grunch merged commit e84a30a into main Aug 28, 2026
2 checks passed
@grunch
grunch deleted the fix/order-status-on-a-pending-order-you-made branch August 28, 2026 21:54
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.

1 participant