Show planted-flag silence timer in WarBow viewer summary #362

Closed
opened 2026-07-07 02:28:02 +00:00 by PlasticDigits · 13 comments
PlasticDigits commented 2026-07-07 02:28:02 +00:00 (Migrated from gitlab.com)

Parent

GitLab #360 — User bug report (ui/ux)

Approved item: show the planted-flag silence timer in the WarBow viewer summary (same area as BP / guard), not only inside the Flag subcard.

Current codebase

ArenaWarbowHeroPanel renders a viewer summary card at the top of the WarBow hero section:

// ArenaWarbowHeroPanel.tsx — warbow-hero-card--viewer-summary
YOUR BP: …
GUARD: … (countdown or INACTIVE)

When the viewer holds a planted flag, silence / claim state is shown only inside the Flag subcard (warbow-hero-card--claim-flag):

  • warbow-hero-flag-silence-countdown — “Silence ends in MM:SS” or “Silence complete — claim now…”
  • WarbowClaimFlagButton — claim CTA

Props already wired from ArenaSimplePage via useArenaSaleSession:

  • showClaimFlagControl (showWarbowClaimFlagButton)
  • canClaimWarBowFlag
  • flagSilenceEndSec
  • ledgerNowSec (falls back to w.chainNowSec)

Silence math: warbowClaimFlagSilenceRemainingSec in lib/warbowClaimFlagState.ts; constant WARBOW_FLAG_SILENCE_SEC = 300 (5 minutes) in arenaWarbowConstants.ts.

Onchain: Flag plant on buy → silence window → warbowClaimFlag for +BP; interrupt penalty if another buy clears the slot after silence (warbowHeroSubcardHelpCopy.ts).

Why needed

Players watching their BP and guard status cannot see flag silence progress without scanning to the Flag card. #360 asks for the planted-flag timer beside the BP field so high-signal WarBow state lives in one glanceable strip.

Constraints / guardrails

  • Frontend-only — no contract or indexer changes.
  • Reuse existing props and formatCountdown; do not duplicate silence logic.
  • When no planted flag (showClaimFlagControl === false), do not show a flag line in the summary.
  • INV-FRONTEND-301: Use ledgerNowSec / indexer head time when available (already passed from session).
  • Keep Flag subcard behavior (checkbox, claim button, help modal) — summary is additive visibility, not a replacement unless redundancy is clearly excessive.
  • Match warbow-hero-viewer-summary__line typography; avoid layout break on narrow mobile (~360px manual QA widths).

Relevant files

Area Path
Hero panel frontend/src/pages/arena/ArenaWarbowHeroPanel.tsx
Silence helper frontend/src/lib/warbowClaimFlagState.ts
Constants frontend/src/lib/arenaWarbowConstants.ts
Play page props frontend/src/pages/arena/ArenaSimplePage.tsx
Session / flag fields frontend/src/pages/arena/useArenaSaleSession.ts
Claim button frontend/src/components/WarbowClaimFlagButton.tsx
Styles frontend/src/index.css (.warbow-hero-card--viewer-summary)
Tests frontend/src/pages/arena/ArenaWarbowHeroPanel.test.tsx
  1. Add a conditional fourth line to warbow-hero-card--viewer-summary when showClaimFlagControl is true:
    • During silence: FLAG: **MM:SS** until claim (or similar), using existing flagSilenceRemainingSec + formatCountdown.
    • After silence, before claim: FLAG: **claim now** (short urgency copy; full sentence can remain in Flag card).
  2. Add data-testid="warbow-hero-viewer-summary-flag" for tests.
  3. Optionally tune copy so summary line is shorter than the Flag card paragraph (avoid duplicate walls of text).
  4. Do not move the claim button into the summary unless design explicitly wants it — timer visibility is the #360 ask.

Acceptance criteria

  • When the viewer has a planted flag (showClaimFlagControl), the viewer summary card shows a flag silence timer (or “claim now” when eligible) alongside BP and GUARD.
  • When no planted flag, the summary has no flag line (no empty placeholder).
  • Countdown ticks down using the same ledgerNowSec / chain clock as the Flag subcard (values stay in sync).
  • Flag subcard countdown and claim CTA continue to work unchanged.

Test plan

Layer Command Expect
Unit cd frontend && npm test -- ArenaWarbowHeroPanel.test.tsx PASS — summary contains flag timer / claim-now when showClaimFlagControl
Typecheck cd frontend && npm run typecheck PASS
Lint cd frontend && npm run lint PASS
Manual (Anvil) Full stack + plant flag on buy Summary shows decreasing countdown; after 5m silence, shows claim-now hint
Regression cd frontend && npm test PASS

Attack / abuse test plan

  • Clock skew: Summary and Flag card must use the same flagSilenceEndSec and ledger second — no independent timers that diverge.
  • False planted state: Only render when showClaimFlagControl is true (session derives from onchain/indexer flag ownership).
  • Claim spam: Moving claim button is out of scope; existing WarbowClaimFlagButton guards remain authoritative.

Verification criteria

  • npm run typecheck && npm run lint && npm test in frontend/ — PASS
  • ArenaWarbowHeroPanel.test.tsx covers viewer-summary flag line for active silence and post-silence states
  • Manual Anvil check: planted flag → timer visible in summary next to BP
## Parent [GitLab #360 — User bug report (ui/ux)](https://gitlab.com/PlasticDigits/yieldomega/-/issues/360) Approved item: show the planted-flag silence timer in the WarBow viewer summary (same area as BP / guard), not only inside the Flag subcard. ## Current codebase `ArenaWarbowHeroPanel` renders a **viewer summary** card at the top of the WarBow hero section: ```tsx // ArenaWarbowHeroPanel.tsx — warbow-hero-card--viewer-summary YOUR BP: … GUARD: … (countdown or INACTIVE) ``` When the viewer holds a planted flag, silence / claim state is shown **only** inside the Flag subcard (`warbow-hero-card--claim-flag`): - `warbow-hero-flag-silence-countdown` — “Silence ends in **MM:SS**” or “Silence complete — claim now…” - `WarbowClaimFlagButton` — claim CTA **Props already wired from `ArenaSimplePage` via `useArenaSaleSession`:** - `showClaimFlagControl` (`showWarbowClaimFlagButton`) - `canClaimWarBowFlag` - `flagSilenceEndSec` - `ledgerNowSec` (falls back to `w.chainNowSec`) **Silence math:** `warbowClaimFlagSilenceRemainingSec` in `lib/warbowClaimFlagState.ts`; constant `WARBOW_FLAG_SILENCE_SEC = 300` (5 minutes) in `arenaWarbowConstants.ts`. **Onchain:** Flag plant on buy → silence window → `warbowClaimFlag` for +BP; interrupt penalty if another buy clears the slot after silence (`warbowHeroSubcardHelpCopy.ts`). ## Why needed Players watching their BP and guard status cannot see flag silence progress without scanning to the Flag card. #360 asks for the planted-flag timer beside the BP field so high-signal WarBow state lives in one glanceable strip. ## Constraints / guardrails - **Frontend-only** — no contract or indexer changes. - Reuse existing props and `formatCountdown`; do not duplicate silence logic. - When no planted flag (`showClaimFlagControl === false`), do not show a flag line in the summary. - **INV-FRONTEND-301:** Use `ledgerNowSec` / indexer head time when available (already passed from session). - Keep Flag subcard behavior (checkbox, claim button, help modal) — summary is additive visibility, not a replacement unless redundancy is clearly excessive. - Match `warbow-hero-viewer-summary__line` typography; avoid layout break on narrow mobile (~360px manual QA widths). ## Relevant files | Area | Path | |------|------| | Hero panel | `frontend/src/pages/arena/ArenaWarbowHeroPanel.tsx` | | Silence helper | `frontend/src/lib/warbowClaimFlagState.ts` | | Constants | `frontend/src/lib/arenaWarbowConstants.ts` | | Play page props | `frontend/src/pages/arena/ArenaSimplePage.tsx` | | Session / flag fields | `frontend/src/pages/arena/useArenaSaleSession.ts` | | Claim button | `frontend/src/components/WarbowClaimFlagButton.tsx` | | Styles | `frontend/src/index.css` (`.warbow-hero-card--viewer-summary`) | | Tests | `frontend/src/pages/arena/ArenaWarbowHeroPanel.test.tsx` | ## Recommended direction 1. Add a conditional fourth line to `warbow-hero-card--viewer-summary` when `showClaimFlagControl` is true: - **During silence:** `FLAG: **MM:SS** until claim` (or similar), using existing `flagSilenceRemainingSec` + `formatCountdown`. - **After silence, before claim:** `FLAG: **claim now**` (short urgency copy; full sentence can remain in Flag card). 2. Add `data-testid="warbow-hero-viewer-summary-flag"` for tests. 3. Optionally tune copy so summary line is shorter than the Flag card paragraph (avoid duplicate walls of text). 4. Do **not** move the claim button into the summary unless design explicitly wants it — timer visibility is the #360 ask. ## Acceptance criteria - [ ] When the viewer has a planted flag (`showClaimFlagControl`), the viewer summary card shows a flag silence timer (or “claim now” when eligible) alongside BP and GUARD. - [ ] When no planted flag, the summary has no flag line (no empty placeholder). - [ ] Countdown ticks down using the same `ledgerNowSec` / chain clock as the Flag subcard (values stay in sync). - [ ] Flag subcard countdown and claim CTA continue to work unchanged. ## Test plan | Layer | Command | Expect | |-------|---------|--------| | Unit | `cd frontend && npm test -- ArenaWarbowHeroPanel.test.tsx` | PASS — summary contains flag timer / claim-now when `showClaimFlagControl` | | Typecheck | `cd frontend && npm run typecheck` | PASS | | Lint | `cd frontend && npm run lint` | PASS | | Manual (Anvil) | Full stack + plant flag on buy | Summary shows decreasing countdown; after 5m silence, shows claim-now hint | | Regression | `cd frontend && npm test` | PASS | ## Attack / abuse test plan - **Clock skew:** Summary and Flag card must use the same `flagSilenceEndSec` and ledger second — no independent timers that diverge. - **False planted state:** Only render when `showClaimFlagControl` is true (session derives from onchain/indexer flag ownership). - **Claim spam:** Moving claim button is out of scope; existing `WarbowClaimFlagButton` guards remain authoritative. ## Verification criteria - [ ] `npm run typecheck && npm run lint && npm test` in `frontend/` — PASS - [ ] `ArenaWarbowHeroPanel.test.tsx` covers viewer-summary flag line for active silence and post-silence states - [ ] Manual Anvil check: planted flag → timer visible in summary next to BP
PlasticDigits commented 2026-07-07 02:28:10 +00:00 (Migrated from gitlab.com)

mentioned in issue #360

mentioned in issue #360
PlasticDigits commented 2026-07-07 02:35:49 +00:00 (Migrated from gitlab.com)

mentioned in commit b58a0c023f

mentioned in commit b58a0c023f5e26e102910449fd53d341fcde48b3
PlasticDigits commented 2026-07-07 02:36:04 +00:00 (Migrated from gitlab.com)

mentioned in merge request !532

mentioned in merge request !532
PlasticDigits commented 2026-07-07 02:51:02 +00:00 (Migrated from gitlab.com)

mentioned in commit b29ccf0140

mentioned in commit b29ccf014063701fa055d87fc64d01e705089718
PlasticDigits commented 2026-07-07 02:54:37 +00:00 (Migrated from gitlab.com)

mentioned in commit 824be4bf42

mentioned in commit 824be4bf42221c9ce87e8e745c8a48cbca9989d0
PlasticDigits commented 2026-07-07 02:54:41 +00:00 (Migrated from gitlab.com)

mentioned in merge request !533

mentioned in merge request !533
PlasticDigits commented 2026-07-07 04:07:49 +00:00 (Migrated from gitlab.com)

mentioned in commit e7c87b44c7

mentioned in commit e7c87b44c7482b1f97d85e52dc10b5a8b534c4a5
PlasticDigits commented 2026-07-07 04:08:02 +00:00 (Migrated from gitlab.com)

mentioned in merge request !535

mentioned in merge request !535
PlasticDigits commented 2026-07-07 06:27:27 +00:00 (Migrated from gitlab.com)

mentioned in commit 667f2f370a

mentioned in commit 667f2f370a025bed84aed3bdb67e683b13fd654d
PlasticDigits commented 2026-07-07 06:32:34 +00:00 (Migrated from gitlab.com)

mentioned in commit 2a7ad1d3a9

mentioned in commit 2a7ad1d3a926e05852661edaa0a52bca9c0a7fcc
PlasticDigits commented 2026-07-07 06:32:39 +00:00 (Migrated from gitlab.com)

mentioned in merge request !536

mentioned in merge request !536
PlasticDigits commented 2026-07-07 09:44:54 +00:00 (Migrated from gitlab.com)

Verification — GitLab #362 (PASS)

Verified Show planted-flag silence timer in WarBow viewer summary on main @ 667f2f37 (merged issue-362-verify-warbow-flag-supplement).

Acceptance criteria

Criterion Result How verified
Planted flag shows FLAG: timer / claim-now in viewer summary beside BP & GUARD PASS Manual Anvil + Playwright headed Chromium (390×844): data-testid="warbow-hero-viewer-summary-flag" → FLAG: 00:04:57 until claim; post-warp → FLAG: claim now
No flag line when unplanted PASS ArenaWarbowHeroPanel.test.tsx — omits viewer-summary flag line when no planted flag (#362)
Summary & Flag subcard use same clock (stay in sync) PASS Manual: summary 00:04:57 until claim matched subcard Silence ends in 00:04:57; both use flagSilenceEndSec + ledgerNowSec via warbowClaimFlagSilenceRemainingSec
Flag subcard countdown + claim CTA unchanged PASS Manual: warbow-hero-flag-silence-countdown + warbow-hero-claim-flag-submit visible; unit tests for claim CTA after silence

Test plan

Layer Command Result
Typecheck cd frontend && npm run typecheck PASS
Lint cd frontend && npm run lint PASS (4 pre-existing warnings, 0 errors)
Unit (panel) cd frontend && npm test -- ArenaWarbowHeroPanel.test.tsx PASS (15/15)
Regression cd frontend && npm test PASS (896/896)
Manual Anvil start-local-anvil-stack.sh (native PG :5433, Anvil :8545, indexer :3100) → level-5 buy with plantWarBowFlag=true → Vite VITE_E2E_MOCK_WALLET=1 → Playwright on / WarBow tab PASS

Attack / abuse checks

Check Result
Clock skew — no divergent timers PASS (shared flagSilenceRemainingSec math)
False planted state — only when showClaimFlagControl PASS (unit + session deriveWarbowClaimFlagFields)
Claim spam guards unchanged PASS (WarbowClaimFlagButton still authoritative)

Infra notes

  • Indexer GET /v1/arena/timers omits planted-flag fields (expected); frontend supplements via arenaV2WarbowFlagSupplementContracts onchain reads (#301 / #362).
  • Invariant documented: INV-FRONTEND-362-WARBOW-VIEWER-SUMMARY-FLAG.

No repo changes required — closing as verified.

## Verification — GitLab #362 (PASS) Verified **Show planted-flag silence timer in WarBow viewer summary** on `main` @ `667f2f37` (merged `issue-362-verify-warbow-flag-supplement`). ### Acceptance criteria | Criterion | Result | How verified | |-----------|--------|--------------| | Planted flag shows `FLAG:` timer / claim-now in viewer summary beside BP & GUARD | **PASS** | Manual Anvil + Playwright headed Chromium (`390×844`): `data-testid="warbow-hero-viewer-summary-flag"` → `FLAG: 00:04:57 until claim`; post-warp → `FLAG: claim now` | | No flag line when unplanted | **PASS** | `ArenaWarbowHeroPanel.test.tsx` — `omits viewer-summary flag line when no planted flag (#362)` | | Summary & Flag subcard use same clock (stay in sync) | **PASS** | Manual: summary `00:04:57 until claim` matched subcard `Silence ends in 00:04:57`; both use `flagSilenceEndSec` + `ledgerNowSec` via `warbowClaimFlagSilenceRemainingSec` | | Flag subcard countdown + claim CTA unchanged | **PASS** | Manual: `warbow-hero-flag-silence-countdown` + `warbow-hero-claim-flag-submit` visible; unit tests for claim CTA after silence | ### Test plan | Layer | Command | Result | |-------|---------|--------| | Typecheck | `cd frontend && npm run typecheck` | **PASS** | | Lint | `cd frontend && npm run lint` | **PASS** (4 pre-existing warnings, 0 errors) | | Unit (panel) | `cd frontend && npm test -- ArenaWarbowHeroPanel.test.tsx` | **PASS** (15/15) | | Regression | `cd frontend && npm test` | **PASS** (896/896) | | Manual Anvil | `start-local-anvil-stack.sh` (native PG `:5433`, Anvil `:8545`, indexer `:3100`) → level-5 buy with `plantWarBowFlag=true` → Vite `VITE_E2E_MOCK_WALLET=1` → Playwright on `/` WarBow tab | **PASS** | ### Attack / abuse checks | Check | Result | |-------|--------| | Clock skew — no divergent timers | **PASS** (shared `flagSilenceRemainingSec` math) | | False planted state — only when `showClaimFlagControl` | **PASS** (unit + session `deriveWarbowClaimFlagFields`) | | Claim spam guards unchanged | **PASS** (`WarbowClaimFlagButton` still authoritative) | ### Infra notes - Indexer `GET /v1/arena/timers` omits planted-flag fields (expected); frontend supplements via `arenaV2WarbowFlagSupplementContracts` onchain reads ([#301](https://gitlab.com/PlasticDigits/yieldomega/-/issues/301) / [#362](https://gitlab.com/PlasticDigits/yieldomega/-/issues/362)). - Invariant documented: **`INV-FRONTEND-362-WARBOW-VIEWER-SUMMARY-FLAG`**. No repo changes required — closing as verified.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-07-07 09:44:55 +00:00
PlasticDigits commented 2026-07-09 07:57:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #370

mentioned in issue #370
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#362
No description provided.