Add a global completion percentage to series list #539
Labels
No labels
blocked
duplicate
high priority
needs
approval
needs
criteria
needs
estimate
needs
tests
question
step
doing
step
review
step
testing
step
todo
step
uat
type
admin
type
alert
type
bug
type
change
type
defect
type
dependencies
type
development
type/documentation
type
epic
type
idea
type
incident
type
investigation
type
spike
type
story
type
tests
wontfix
No project
No assignees
2 participants
Notifications
Total time spent: 2 minutes 31 seconds
Due date
Smithy-bot
2 minutes 31 seconds
No due date set.
Dependencies
No dependencies set
Reference
External/card-drop#539
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?
Like how we have for each series, let us have a global percentage also
Why
/series listalready shows per-series claim progress as(owned/total)on each line (SeriesHelper.GenerateSeriesListPage). Players cannot see overall catalog completion without mentally aggregating every series.Scope
In scope: Discord
/series listembed (all pages) and pagination buttons — add global completion based on the same inventory rules as the per-series counts.Out of scope:
/series viewtitle progress (#540); changing per-series line format; web/management UI.Acceptance criteria
GIVEN a user opens
/series list(or navigates list pages via buttons)WHEN
GenerateSeriesListPagebuilds the embedTHEN the embed shows a global completion percentage for the entire card catalog (all series in
CoreClient.Cards), not just the series on the current page.GIVEN the global totals are computed
WHEN compared to the existing per-series
(owned/total)logic on each lineTHEN owned = count of the user’s inventory rows whose
CardNumberappears in any series card list; total = sum ofseries.cards.lengthacross all series (same semantics as today’s per-line filter/count, aggregated once).GIVEN global owned and total
WHEN the percentage is displayed
THEN it is a whole number 0–100 using rounded percent (
Math.round(100 * owned / total)), and total = 0 is handled without division errors (show 0%).GIVEN the list embed is rendered
WHEN a user views the title and footer
THEN the title includes the global percent (e.g.
Series — 42% complete) and the footer includes aggregate counts (e.g.{owned}/{total} cards) in addition to the existing series count and page text.GIVEN the user paginates the series list
WHEN they move between pages
THEN the global percentage and aggregate counts stay identical on every page (only the description lines change).
GIVEN automated tests for
GenerateSeriesListPageWHEN CI runs
THEN tests cover at least: empty inventory (0%); partial catalog completion with correct owned/total; full catalog (100%); pagination does not alter global stats.
Subtasks
SeriesHelper(reuse same inventory + catalog rules as per-series lines){owned}/{total} cardstests/helpers/SeriesHelper.test.tsfor global completion + pagination invariantsNotes
/series viewtitle)Story point estimate
3 story points
Rationale
SeriesHelper+ tests, no new commands or API surface.total = 0) are specified; no open product questions.Smithy-bot → needs/tests (next: QA scripts against the criteria).
Planning — needs/tests → needs/approval
QA scripts mapped to the acceptance criteria in the issue description. Run on a branch with the implementation merged or deployed to stage; unit-test rows via
yarn testlocally/CI.Preconditions
/series listspans ≥ 2 pages (pagination buttons visible).yarn test(tests/helpers/SeriesHelper.test.ts).CoreClient.Cards/ fixture data to compute expected owned/total manually for one scenario.AC1 — Global completion % for entire catalog on
/series list/series listas a user with a partial inventoryMath.round(100 * owned / total)(owned/total)per lineAC2 — Owned/total semantics match per-series logic (aggregated once)
CardNumberappears in any series card list (same filter as per-line logic)series.cards.lengthacross all series inCoreClient.Cards(owned/total)still matches pre-change behaviourAC3 — Percent display and
total = 0edge caseMath.round)AC4 — Title and footer copy
/series listSeries — 42% completeor agreed wording from implementation){owned}/{total} cardsand retains existing series count + page textAC5 — Pagination invariants
AC6 — Automated tests (
SeriesHelper/ CI)yarn test—tests/helpers/SeriesHelper.test.ts(and full suite)Subtasks / scope regression
/series list/series viewtitle progress (#540)Sign-off checklist
Moving to needs/approval for your review before implementation. @Vylpes