-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
[FEAT]: Penalty Day Logic & Dashboard Action Suite
Type: Feature Request
Context / Problem Statement:
The current "Grit" engine is pass/fail. For the "75 Balanced" protocol or custom "Allow Penalty" challenges, users need a way to recover from a single mistake without a full restart. Additionally, the "Fail Challenge" action is currently buried in the Settings modal, making it inaccessible for a high-frequency action.
User Story:
As a Grit user, I want to be able to add a penalty day or fail my challenge directly from the dashboard so that I can manage my progress and protocol adherence with high visibility.
Proposed Solution:
- State Update: Add
allowPenaltyDay: booleanandpenaltyUsed: booleanto the challenge schema. - Dynamic End Date: Update the challenge completion logic to calculate the end date as:
startDate + duration + (penaltyUsed ? 1 : 0). - Dashboard UI Refactor:
- Move the "Fail Challenge" button from Settings to the Dashboard.
- If
allowPenaltyDayis true ANDpenaltyUsedis false, display the "Add Penalty Day" button. - If a penalty is already used or not allowed, only show the "Fail Challenge" button.
Acceptance Criteria (AC):
- Add Allow Penalty Day checkbox to the Challenge Setup Wizard (stored in challenge config).
- Implement Add Penalty Day button on the
/app/Dashboard. - Constraint: The "Add Penalty Day" button must only appear once per challenge. After use, it is replaced by the "Fail Challenge" option.
- End Date Logic: Ensure the progress bar and "Days Remaining" counter update immediately when a penalty day is added.
- Fail Button: Move the "Fail Challenge" button to the Dashboard (standardized with a high-contrast/danger style).
- Add a Confirmation Dialog for adding a penalty: "This will add 1 extra day to your total challenge duration. You only get 1 miss!"
Technical Implementation Details:
- Store: Update
useChallengeStore.tsto include atriggerPenalty()action. - Components:
- Refactor
src/components/dashboard/DashboardHeader.tsxorActiveChallenge.tsxto include the new Action Bar. - Update the date utility (likely using
date-fnsordayjs) that calculatesisExpiredorcompletionDate.
- Refactor
- Logic: Ensure
penaltyUsedis persisted inlocalStorageor the database.
Definition of Done (DoD):
- Verify that adding a penalty day shifts the "End Date" by exactly 24 hours.
- Verify that after one penalty is used, the button disappears and "Fail Challenge" remains the only fallback.
- Test the "Fail" button to ensure it still triggers the hard reset/deletion logic correctly.
- UI Check: Ensure the buttons are responsive and don't clutter the mobile view of the Dashboard.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels