Skip to content

PM-5878: Add Show Dashboard flag to Marathon Match advanced settings - #2155

Open
jmgasper wants to merge 1 commit into
devfrom
PM-5878
Open

PM-5878: Add Show Dashboard flag to Marathon Match advanced settings#2155
jmgasper wants to merge 1 commit into
devfrom
PM-5878

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

What was broken

The Work app in platform-ui had no control for the show_data_dashboard challenge metadata flag, so copilots could not enable the data dashboard graph on a Marathon Match challenge from the challenge editor. As noted in Slack, MM 166 launched without the dashboard because the flag had to be set manually against challenge-api-v6.

Root cause

The flag was only ever consumed, never authored. community-app reads the show_data_dashboard metadata entry (challenge-detail/Header/TabSelector) to decide whether to render the challenge dashboard tab, and challenge-api-v6 stores it as a generic key/value ChallengeMetadata row, but no field in the platform-ui challenge editor ever wrote it.

What was changed

  • Added ShowDashboardField, a Show Dashboard checkbox that reads and writes the exact string-valued show_data_dashboard challenge metadata entry, following the existing StockArtsField / RegisteredMemberDownloadField metadata patterns.
  • Rendered the checkbox in the challenge editor's Advanced Options section only for Marathon Match challenge types.
  • Defaulted the checkbox to checked for fun challenges that have no saved show_data_dashboard value yet, and persisted that implied value so a save keeps the dashboard enabled. A saved value always wins, so the dashboard can be turned back off.
  • Seeded show_data_dashboard during Marathon Match creation as true for fun challenges and false otherwise, so the default takes effect as soon as the challenge is set up.
  • Documented the new field in the ChallengeEditorPage README.

No changes were needed in challenge-api-v6 or community-app: challenge metadata is a generic name/value collection, and community-app already renders the dashboard tab from this flag.

Added/updated tests

  • New ShowDashboardField.spec.tsx covering the standard Marathon Match default (unchecked, no metadata written), the fun-challenge default (checked and persisted as "true"), saved metadata winning over the fun-challenge default, and toggling persisting exact string booleans.
  • New parameterized ChallengeEditorForm.spec.tsx case asserting that creating a Marathon Match sends show_data_dashboard "true" for fun challenges and "false" otherwise. The FunChallengeField mock now binds to the form so the fun flag can be toggled in tests.

Validation

  • npx eslint --quiet -c ./src/.eslintrc.js 'src/apps/work/src/pages/challenges/ChallengeEditorPage/**/*.{ts,tsx}' - clean
  • npx tsc --noEmit -p tsconfig.json - clean
  • yarn build:dev - succeeds
  • CI=true npx craco test --watchAll=false --testPathPattern="src/apps/work" - 674 passed. The 13 remaining failures (AiReviewTab, ChallengePrizesField, PaymentFormModal, ReviewersField) are identical on a clean origin/dev checkout and unrelated to this change.

🤖 Generated with Claude Code

What was broken
The Work app in platform-ui had no control for the show_data_dashboard challenge
metadata flag, so copilots could not enable the data dashboard graph on a
Marathon Match challenge from the challenge editor. MM 166 launched without the
dashboard because the flag had to be set manually against challenge-api-v6.

Root cause
The flag was only ever consumed, never authored. community-app reads the
show_data_dashboard metadata entry to decide whether to render the challenge
dashboard tab, and challenge-api-v6 stores it as a generic key/value metadata
entry, but no editor field ever wrote it.

What was changed
- Added ShowDashboardField, a "Show Dashboard" checkbox that reads and writes the
  exact string-valued show_data_dashboard challenge metadata entry, following the
  existing StockArtsField/RegisteredMemberDownloadField metadata patterns.
- Rendered the checkbox in the challenge editor's Advanced Options section only
  for Marathon Match challenge types.
- Defaulted the checkbox to checked for fun challenges that have no saved
  show_data_dashboard value yet, and persisted that implied value so a save keeps
  the dashboard enabled. A saved value always wins, so the dashboard can be
  turned back off.
- Seeded show_data_dashboard during Marathon Match creation as true for fun
  challenges and false otherwise, so the default takes effect as soon as the
  challenge is set up.
- Documented the new field in the ChallengeEditorPage README.

No changes were needed in challenge-api-v6 or community-app: challenge metadata
is a generic name/value collection and community-app already renders the
dashboard tab from this flag.

Added/updated tests
- New ShowDashboardField.spec.tsx covering the standard Marathon Match default
  (unchecked, no metadata written), the fun-challenge default (checked and
  persisted as "true"), saved metadata winning over the fun-challenge default,
  and toggling persisting exact string booleans.
- New parameterized ChallengeEditorForm.spec.tsx case asserting that creating a
  Marathon Match sends show_data_dashboard "true" for fun challenges and "false"
  otherwise; the FunChallengeField mock now binds to the form so the fun flag can
  be toggled in tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jmgasper
jmgasper requested a review from kkartunov as a code owner August 14, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant