Add to the series view command the completion progress number to the title #540
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: 15 minutes 36 seconds
Due date
Smithy-bot
15 minutes 36 seconds
No due date set.
Dependencies
No dependencies set
Reference
External/card-drop#540
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 on the series list
Why
/series listshows per-series claim progress as(owned/total)on each line (SeriesHelper.GenerateSeriesListPage)./series viewembed title is only the series name today (GenerateSeriesViewPage), so players must infer progress from inventory elsewhere.Scope
In scope: Discord
/series viewembed (all card pages) and pagination buttons — add per-series completion in the embed title, using the same inventory rules as the matching line on/series list.Out of scope: Global catalog completion on
/series list(#539); changing list line format; changing card grid description lines; web/management UI.Acceptance criteria
GIVEN a user opens
/series viewfor a series (or paginates with Previous/Next)WHEN
GenerateSeriesViewPagebuilds the embedTHEN the embed title includes that series’ completion percentage (not just the bare series name).
GIVEN the user’s inventory is loaded for the view
WHEN owned/total are computed for the viewed series
THEN owned = count of inventory rows whose
CardNumberappears in that series’cardslist (duplicate copies of the same card count once); total =series.cards.length— matching the(owned/total)logic on the corresponding/series listline.GIVEN owned and total for the series
WHEN the percentage is shown in the title
THEN it is a whole number 0–100 using
Math.round(100 * owned / total), and total = 0 is handled without division errors (show 0%).GIVEN the title is rendered
WHEN a user reads it
THEN it follows the same pattern as the global list title in #539, e.g.
{series.name} — 67% complete.GIVEN the user paginates within the same series
WHEN they move between card pages
THEN the title percentage (and series name) stay identical on every page; only the card grid image/description and page footer text change.
GIVEN automated tests for
GenerateSeriesViewPageWHEN CI runs
THEN tests cover at least: no claims (0%); partial series completion; full series (100%); pagination does not alter title progress.
Subtasks
GenerateSeriesViewPageand compute per-series owned/total (reuse or extract shared helper with list line logic / #539 work where practical){series.name} — {n}% completetests/helpers/SeriesHelper.test.tsfor view title progress + pagination invariantsNotes
/series listtitle); no hard dependency — can ship independently.(owned/total)on list lines shipped in 0.10.0; this story adds percentage in the view title only.Completed needs/criteria: acceptance criteria, subtasks, and scope are on the issue body (per-series completion % in
/series viewtitle; aligns with list inventory rules and #539 title pattern).→ needs/estimate (Smithy-bot still assigned).
Story point estimate
3 story points
Rationale
GenerateSeriesViewPage, title format{series.name} — {n}% complete, unit tests, CHANGELOG.SeriesHelper+ tests, no new commands or API surface.total = 0are 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 viewspans ≥ 2 pages (Previous/Next visible).yarn test(tests/helpers/SeriesHelper.test.ts).(owned/total)on the matching/series listline to cross-check view title math.AC1 — Per-series completion % in
/series viewembed title/series viewfor a series with partial inventory/series viewfor a series with no owned cards in that series/series viewfor a fully completed seriesAC2 — Owned/total semantics match
/series listline for that series(owned/total)on/series list/series viewfor that seriesCardNumberappears in that series’cardslist; duplicate copies of the same card count onceseries.cards.length; rounded percent matchesMath.round(100 * owned / total)from T2.1/T2.2AC3 — Percent display and
total = 0edge caseMath.round)AC4 — Title copy pattern
/series view{series.name} — 67% complete(aligned with #539 list title style)AC5 — Pagination invariants (same series)
/series view, note title (series name + %) and footer/page textAC6 — Automated tests (
GenerateSeriesViewPage/ CI)yarn test—tests/helpers/SeriesHelper.test.ts(and full suite)Subtasks / scope regression
/series list(#539)(owned/total)on list linesSign-off checklist
Moving to needs/approval for your review before implementation. @Vylpes
Implemented
/series viewtitle completion percentage.PR: #572 (
cursor/540-series-view-completion→release/0.11.0)What changed
GenerateSeriesViewPageloads inventory and sets title to{series.name} — {n}% completeQuantity > 0)ClaimedCardIdsFromInventory/SeriesCompletionPercent(usable by #539 later)Verify locally:
npx tsc --noEmit, eslint on touched files,npx jest tests/helpers/SeriesHelper.test.ts(21 passed)Moved to
step/reviewand assigned to @Vylpes for approval. Not merging; please review PR 572.@Smithy-bot Made a comment on the PR, please fix this.
Addressed the PR review feedback on #572: series view title now uses the middle-dot separator for consistency with footers elsewhere (
{series.name} · {n}% complete).Updated
SeriesHelper.ts, tests, and CHANGELOG. Local verify:npx tsc --noEmit, eslint on touched files,npx jest tests/helpers/SeriesHelper.test.ts(21 passed).Moved back to
step/reviewand assigned to @Vylpes. Please re-review PR 572.QA results —
step/testing→step/uatBranch / commit:
release/0.11.0@5141416(PR #572 merge)Pipeline
yarn build(tsc)yarn lint(eslint .)yarn testtests/helpers/SeriesHelper.test.tsAcceptance criteria (vs QA scripts T1–T5 / U1–U6 / S1)
% completefor 0% / partial (50%) / 100%ClaimedCardIdsFromInventory+SeriesCompletionPercentmatch list-line owned/total (unique cards,Quantity > 0)Math.round(100 * owned / total); empty series → 0% (unit-tested){name} · {n}% complete(middle-dot per review; approved in PR 572)Live Discord smoke (
/series view+ Previous/Next) left for human UAT.Moved to
step/uatand assigned @Vylpes.