---
title: Apply trade-approval simplification findings from the code review
type: task
status: completed
description: >-
  Apply the three simplification findings from the trade-approval review that remain unapplied:
  collapse the reducer's duplicate error field, replace the countdown guard with the shared
  predicate, and confirm the duplicate comment is gone.
base_uri: user:task/league/apply-trade-approval-simplification-findings.md
created_at: '2026-08-13T20:15:00.380Z'
entity_id: 9dbbf637-cbb7-4f30-999d-e027c3968b94
finished_at: '2026-08-13T20:29:47.598Z'
observations:
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: Medium
public_read: true
relations:
  - relates [[██████████████████████-█████-████-██████-████████]]
  - relates [[████████████████████-████-████-████-████████████]]
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-08-13T20:29:47.598Z'
visibility_analyzed_at: '2026-11-05T23:48:23.132Z'
---

## Context

A simplification review of the "Approve Trade" change cluster in the league repo (commits 08cd28937..HEAD) ran in thread [[████████████████████-████-████-████-████████████]] and reported three findings above confidence 80 to its orchestrator. The two correctness defects the review surfaced (the Approve button issuing a GET, and a stale error alert surviving an in-flight approve) are already fixed and recorded on the feature task; the cluster shipped and deployed. What remains unapplied is the simplification residue below, verified still present in the working tree.

## Plan

- [ ] Collapse the trade reducer's `vetoError` and `approveError` fields into one `action_error` field, letting the two PENDING and two FAILED cases fall through to single handlers, and drop the second error Alert in trade-action.js. Saves ~9 lines. (review confidence 82; the sibling-field mirroring is deliberate and the wider rename is tracked on [[user:task/league/rename-trade-domain-identifiers.md]])
- [ ] Replace the 4-clause guard at `app/views/components/trade-veto-countdown/trade-veto-countdown.js:33` with the shared `is_trade_within_veto_window` predicate, which is equivalent by inspection and already gates both call sites. Saves ~1 line and one copy of the window rule. (review confidence 85)
- [ ] Verify the duplicate explanation at `app/views/components/trade-action/trade-action.js` is fully gone: the flagged "block disappears once approved" header comment is already removed from the working tree; keep only the inline comment at the `trade.approved` ternary if any overlap remains. (review confidence 80)

## Key locations

- `repository/active/league/app/core/trade/reducer.js` — lines 22-23, 88-89, 93-102, 122-123
- `repository/active/league/app/views/components/trade-veto-countdown/trade-veto-countdown.js:33`
- `repository/active/league/app/views/components/trade-action/trade-action.js` — lines 17-21, 52-54
- Source thread: `████████████████████████████████████████████████`
- Feature task: `█████████████████████████████████████████████████` — Completed; holds the already-fixed defects and design deferrals
