Arena: improve WarBow revenge hero card (BP preview, live Valid To countdown) #236
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#236
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The Revenge hero card on
/timecurve/arena(WarbowHeroActions) lists open per-stealer counter-hit windows (GitLab #135) but the copy and timestamps are hard to scan at a glance. Improve the card so each row shows stealer BP, expected BP gained on revenge (humanized), and a liveValid To: HH:MM:SScountdown — and remove redundant summary text.Primary file:
frontend/src/pages/timeCurveArena/WarbowHeroActions.tsxRelated (lower section, optional parity):
frontend/src/pages/timecurve/TimeCurveSections.tsx—WarbowSectionrevenge list (orphaned on Arena but still used elsewhere).Current behavior
When
hasRevengeOpen:<li>shows stealer address + “· until {UTC}” viaUnixTimestampDisplay+ Take revenge CTA.Problems:
UX requirements
1. Remove redundant summary
You have {x} open counter-hit(s). Earliest expiry …(including the word “Earliest expiry”).No revenge available/ indexer env hint).2. Per-row BP context (humanized)
For each open revenge row (each
pendingRevengeTargetsentry / stealer):battlePoints(stealer)read (indexer leaderboard BP when configured — same display policy as Arena WarBow elsewhere; no authoritative BP off-indexer overlay per #216)warbowRevenge(stealer)_warbowStealDrainBp(stealerBp, WARBOW_STEAL_DRAIN_BPS)— revenge always uses the 10% drain branch (TimeCurve.warbowRevenge,WARBOW_STEAL_DRAIN_BPS = 1000)Formatting: Reuse existing Arena BP humanization —
formatWarbowViewerBattlePointsDisplay/formatLocaleIntegerwith comma grouping (same sigfig policy as hero YOUR BP is acceptable). Suggested row copy pattern (tweak for layout):Target: {humanBp} BP · Gain: +{humanBp} BPShow
—or a muted loading state while stealer BP reads are in flight. If preview gain computes to 0, surface the same preflight narrative users would see on submit (TimeCurve: revenge zero) rather than a misleading +0.Implementation note: Stealer BP reads for N open windows may require batched
useReadContracts/ multicall (watch stable deps — see steal discovery batching inuseTimeCurveArenaModel.tsx). Consider a small shared helper (e.g.warbowRevengeRowPreview.ts) for drain math mirroring onchain_warbowStealDrainBp.3. Live
Valid To: HH:MM:SS(not UTC)Replace per-row “· until {UTC}” with a label that counts down to
expiry_exclusive:Valid To: {HH:MM:SS}where the clock is remaining time until the window closes (not wall-clock time of day).ledgerSecInt/effectiveLedgerSecfrom hero timer when available — #48).Valid To: 00:00:00(or drop the row client-side — already filtered byexpiry_exclusive > nowinpendingRevengeTargets).Reuse:
formatCountdown(same helper as claim-flag / guard silence — #218).Do not use
UnixTimestampDisplayfor this hero revenge list after the change.4. Layout / responsive
Preserve #201 wrapping for
.warbow-hero-revenge-list liwhen adding BP + countdown fields (stack on narrow widths; no horizontal overflow).Onchain reference
From
TimeCurve.sol:WARBOW_REVENGE_WINDOW_SEC(24h); expiry stored inwarbowPendingRevengeExpiryExclusive[victim][stealer].WARBOW_STEAL_DRAIN_BPS), floor via_warbowStealDrainBp.GET /v1/timecurve/warbow/pending-revenge→WarbowPendingRevengeItem(stealer,expiry_exclusive, …).Acceptance criteria
Valid To: HH:MM:SScounting down every second until expiry.Date.now()alone).UnixTimestampDisplayremoved from hero revenge rows.WarbowHeroActions.test.tsxfor: no summary paragraph; row copy includes BP fields +Valid To:; countdown string changes whenledgerNowSecadvances (fake timers)./timecurve/arenawithVITE_INDEXER_URLand a wallet holding multiple open stealers (#135 scenario).Docs / invariants (follow-up in implementation PR)
docs/frontend/timecurve-views.md§ Arena WarBow hero (#101).INV-FRONTEND-*-REVENGE-HEROindocs/testing/invariants-and-business-logic.md.marked as related to #135
marked as related to #101
Walked the current-state baseline for #236 on production /timecurve/arena.
All four problems listed in "Current behavior" are reproducible in the visible REVENGE hero card:
Pre-refactor baseline locked. Ready to re-walk against the new BP preview + Valid To: countdown when the refactor lands.
Automated baseline from yesterday's session (current code, pre-refactor): full Vitest suite 534/534 PASS including existing
WarbowHeroActions.test.tsx. The new test cases listed in acceptance criteria (no summary paragraph, row copy includes BP fields + Valid To, countdown ticks under fake timers) need to be added by dev as part of the refactor PR.mentioned in commit
261e7b474dmentioned in merge request !394
Opened MR !394 — implements all 5 acceptance criteria (manual QA on live sale with multiple stealers left for reviewer). Full frontend suite 586/586 passing. Ready for review when you're free @PlasticDigits
mentioned in commit
d348a7e38b