Add an optional parameter to the /series view command to allow the ability to disable the colour filter #355

Open
opened 2024-09-08 18:43:09 +01:00 by Vylpes · 1 comment
Owner

For performance reasons

For performance reasons
Vylpes added this to the 0.11.0 milestone 2026-03-06 20:32:21 +00:00
Vylpes self-assigned this 2026-03-06 20:32:32 +00:00
Vylpes added this to the 0.10 Sprint 3 project 2026-03-06 20:32:35 +00:00
Vylpes stopped working 2026-03-06 20:43:46 +00:00
10 minutes 31 seconds
Member

QA test results — PASS

Tested release/0.11.0 (head 0efae8b, the merge of PR #493 which implemented this change).

The issue body has no explicit acceptance criteria, so I used the GIVEN/WHEN/THEN unit tests written during implementation in PR #493 as the QA tests, plus a static trace of the flag through the call chain.

Pipeline (mirrors .forgejo/workflows)

Step Result
yarn install --frozen-lockfile pass
yarn build (tsc) pass
yarn lint (eslint) pass, 0 problems
yarn test (jest) pass — 22/22 suites, 78 passed, 30 todo, 9 snapshots

Feature-specific tests

tests/commands/series.test.ts — 3/3 passed

  • GIVEN view command has disable_colour_filter=true, EXPECT helper called with true
  • GIVEN view command omits disable_colour_filter, EXPECT helper called with false
  • GIVEN list subcommand, EXPECT list page to be generated

tests/buttonEvents/Series.test.ts — 3/3 passed

  • GIVEN view customId contains filter flag, EXPECT helper called with true
  • GIVEN view customId omits filter flag, EXPECT helper called with false
  • GIVEN list customId, EXPECT list helper and interaction update

Behaviour verified

  • /series view registers the optional boolean option disable_colour_filter ("Show all cards in full colour"), defaulting to false when omitted, so existing behaviour is unchanged.
  • The flag flows from commands/series.ts into SeriesHelper.GenerateSeriesViewPage and on into ImageHelper.GenerateCardImageGrid, where the guard becomes userId != null && !disableColourFilter. With the flag set, the per-card Inventory.FetchOneByCardNumberAndUserId lookup and greyscale pass are skipped entirely — which is the performance win this issue asked for.
  • Pagination preserves the choice: the Previous/Next button customIds are suffixed with 1/0 and buttonEvents/Series.ts reads position 4 back, so paging through a series does not silently re-enable the filter.

Note for UAT

There is no test suite for ImageHelper in this repo (a pre-existing gap, not introduced here), so the greyscale skip itself is covered only by the static trace above and not by an automated assertion. Worth eyeballing a real /series view id:<n> disable_colour_filter:True in Discord during UAT to confirm unclaimed cards render in full colour and that the page loads noticeably faster.

Moving to step/uat.

## QA test results — PASS Tested `release/0.11.0` (head `0efae8b`, the merge of PR #493 which implemented this change). The issue body has no explicit acceptance criteria, so I used the GIVEN/WHEN/THEN unit tests written during implementation in PR #493 as the QA tests, plus a static trace of the flag through the call chain. ### Pipeline (mirrors `.forgejo/workflows`) | Step | Result | | --- | --- | | `yarn install --frozen-lockfile` | pass | | `yarn build` (tsc) | pass | | `yarn lint` (eslint) | pass, 0 problems | | `yarn test` (jest) | pass — 22/22 suites, 78 passed, 30 todo, 9 snapshots | ### Feature-specific tests `tests/commands/series.test.ts` — 3/3 passed - GIVEN view command has `disable_colour_filter=true`, EXPECT helper called with `true` - GIVEN view command omits `disable_colour_filter`, EXPECT helper called with `false` - GIVEN list subcommand, EXPECT list page to be generated `tests/buttonEvents/Series.test.ts` — 3/3 passed - GIVEN view customId contains filter flag, EXPECT helper called with `true` - GIVEN view customId omits filter flag, EXPECT helper called with `false` - GIVEN list customId, EXPECT list helper and interaction update ### Behaviour verified - `/series view` registers the optional boolean option `disable_colour_filter` ("Show all cards in full colour"), defaulting to `false` when omitted, so existing behaviour is unchanged. - The flag flows from `commands/series.ts` into `SeriesHelper.GenerateSeriesViewPage` and on into `ImageHelper.GenerateCardImageGrid`, where the guard becomes `userId != null && !disableColourFilter`. With the flag set, the per-card `Inventory.FetchOneByCardNumberAndUserId` lookup and greyscale pass are skipped entirely — which is the performance win this issue asked for. - Pagination preserves the choice: the Previous/Next button customIds are suffixed with `1`/`0` and `buttonEvents/Series.ts` reads position 4 back, so paging through a series does not silently re-enable the filter. ### Note for UAT There is no test suite for `ImageHelper` in this repo (a pre-existing gap, not introduced here), so the greyscale skip itself is covered only by the static trace above and not by an automated assertion. Worth eyeballing a real `/series view id:<n> disable_colour_filter:True` in Discord during UAT to confirm unclaimed cards render in full colour and that the page loads noticeably faster. Moving to `step/uat`.
Sign in to join this conversation.
No milestone
No project
2 participants
Notifications
Total time spent: 10 minutes 31 seconds
Vylpes
10 minutes 31 seconds
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
External/card-drop#355
No description provided.