Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
The Work app in platform-ui had no control for the
show_data_dashboardchallenge 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-appreads theshow_data_dashboardmetadata entry (challenge-detail/Header/TabSelector) to decide whether to render the challenge dashboard tab, and challenge-api-v6 stores it as a generic key/valueChallengeMetadatarow, but no field in the platform-ui challenge editor ever wrote it.What was changed
ShowDashboardField, aShow Dashboardcheckbox that reads and writes the exact string-valuedshow_data_dashboardchallenge metadata entry, following the existingStockArtsField/RegisteredMemberDownloadFieldmetadata patterns.Advanced Optionssection only forMarathon Matchchallenge types.show_data_dashboardvalue 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.show_data_dashboardduring Marathon Match creation astruefor fun challenges andfalseotherwise, so the default takes effect as soon as the challenge is set up.ChallengeEditorPageREADME.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
ShowDashboardField.spec.tsxcovering 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.ChallengeEditorForm.spec.tsxcase asserting that creating a Marathon Match sendsshow_data_dashboard"true"for fun challenges and"false"otherwise. TheFunChallengeFieldmock 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}'- cleannpx tsc --noEmit -p tsconfig.json- cleanyarn build:dev- succeedsCI=true npx craco test --watchAll=false --testPathPattern="src/apps/work"- 674 passed. The 13 remaining failures (AiReviewTab,ChallengePrizesField,PaymentFormModal,ReviewersField) are identical on a cleanorigin/devcheckout and unrelated to this change.🤖 Generated with Claude Code