diff --git a/.beans/nuzlocke-tracker-tyvc--add-end-of-run-condition-rule.md b/.beans/nuzlocke-tracker-tyvc--add-end-of-run-condition-rule.md index 00a3eb3..9f19b0f 100644 --- a/.beans/nuzlocke-tracker-tyvc--add-end-of-run-condition-rule.md +++ b/.beans/nuzlocke-tracker-tyvc--add-end-of-run-condition-rule.md @@ -1,10 +1,11 @@ --- # nuzlocke-tracker-tyvc title: Add end-of-run condition rule -status: todo +status: completed type: feature +priority: normal created_at: 2026-02-09T08:35:39Z -updated_at: 2026-02-09T08:35:39Z +updated_at: 2026-02-09T11:23:11Z --- Add a new nuzlocke rule: **End of Run Condition**. This is a toggle/switch that lets the player decide when a run is considered complete: @@ -15,7 +16,7 @@ Add a new nuzlocke rule: **End of Run Condition**. This is a toggle/switch that This affects when the player is expected to mark a run as "completed" and could influence level caps and boss tracking in the future. ## Checklist -- [ ] Add `postGameCompletion` (boolean, default false) to the `NuzlockeRules` TypeScript interface and `DEFAULT_RULES` -- [ ] Add a rule definition to `RULE_DEFINITIONS` in `frontend/src/types/rules.ts` -- [ ] Verify the rule appears in the `RulesConfiguration` component (should work automatically via RULE_DEFINITIONS) -- [ ] Verify the rule is stored correctly via the existing run/genlocke creation flows (JSONB, no backend schema change needed) \ No newline at end of file +- [x] Add `postGameCompletion` (boolean, default false) to the `NuzlockeRules` TypeScript interface and `DEFAULT_RULES` +- [x] Add a rule definition to `RULE_DEFINITIONS` in `frontend/src/types/rules.ts` +- [x] Verify the rule appears in the `RulesConfiguration` component (added new "Completion" section) +- [x] Verify the rule is stored correctly via the existing run/genlocke creation flows (JSONB, no backend schema change needed) \ No newline at end of file diff --git a/frontend/src/components/RuleBadges.tsx b/frontend/src/components/RuleBadges.tsx index 1275616..c5eab2a 100644 --- a/frontend/src/components/RuleBadges.tsx +++ b/frontend/src/components/RuleBadges.tsx @@ -25,7 +25,9 @@ export function RuleBadges({ rules }: RuleBadgesProps) { className={`px-2 py-0.5 rounded-full text-xs font-medium ${ def.category === 'core' ? 'bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300' - : 'bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300' + : def.category === 'completion' + ? 'bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300' + : 'bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300' }`} > {def.name} diff --git a/frontend/src/components/RulesConfiguration.tsx b/frontend/src/components/RulesConfiguration.tsx index 94bd735..a86d2cc 100644 --- a/frontend/src/components/RulesConfiguration.tsx +++ b/frontend/src/components/RulesConfiguration.tsx @@ -22,6 +22,9 @@ export function RulesConfiguration({ const difficultyRules = visibleRules.filter( (r) => r.category === 'difficulty' ) + const completionRules = visibleRules.filter( + (r) => r.category === 'completion' + ) const handleRuleChange = (key: keyof NuzlockeRules, value: boolean) => { onChange({ ...rules, [key]: value }) @@ -98,6 +101,30 @@ export function RulesConfiguration({ ))} + + {completionRules.length > 0 && ( +
+ When is the run considered complete +
+