Skip to content

Add "Mark All as Done" button to Daily Task Reminders#60

Open
jyoti430 wants to merge 1 commit into
jpdevhub:mainfrom
jyoti430:feature/mark-all-done-button
Open

Add "Mark All as Done" button to Daily Task Reminders#60
jyoti430 wants to merge 1 commit into
jpdevhub:mainfrom
jyoti430:feature/mark-all-done-button

Conversation

@jyoti430

@jyoti430 jyoti430 commented Jun 14, 2026

Copy link
Copy Markdown

Summary

Adds a "Mark All as Done" button to the Daily Task Reminders component, allowing farmers to complete all daily tasks with a single click.

Related Issue

Closes #42

Changes

  • Added a "Mark All as Done" button to the Daily Tasks card.
  • Added functionality to mark all daily tasks as completed in one click.
  • Reused the existing task completion and localStorage persistence flow.
  • Preserved compatibility with the existing "Reset for Tomorrow" functionality.

Testing

  • Added/updated tests
  • Tested locally (describe steps)

Local testing:

  • Opened the dashboard page.
  • Clicked "Mark All as Done" and verified all tasks were marked complete.
  • Verified the completion counter updated correctly.
  • Refreshed the page and confirmed task state persisted.
  • Clicked "Reset for Tomorrow" and verified all tasks became unchecked.
  • Refreshed again and confirmed the reset state persisted.

Checklist

  • Code follows the project's TypeScript / Python style conventions
  • No secrets or .env values are committed
  • CI passes

Summary by CodeRabbit

  • New Features

    • Added a "Mark All as Done" button to quickly complete all daily tasks in a single action.
  • UI/UX Improvements

    • Reorganized the task header layout for better visual clarity, combining task completion status and quick-action controls.

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

@jyoti430 is attempting to deploy a commit to the karan3431's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your contribution, @jyoti430!

Please make sure CI passes and the checklist in the PR template is complete. A maintainer will review this soon.

— The AgroNavis team

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

DailyTaskReminders gains a markAllAsDone helper that sets water, fertilize, and harvest states to true. The component header is updated to conditionally render a "Mark All as Done" button alongside the existing completion badge inside a new flex-aligned container.

Changes

Mark All as Done in DailyTaskReminders

Layer / File(s) Summary
markAllAsDone logic and header UI
frontend/src/components/DailyTaskReminders.tsx
Adds markAllAsDone function that sets all three task states to true, and updates the header to conditionally show a "Mark All as Done" button (hidden when all tasks are already complete) alongside the status badge in a flex container.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hippity hop, no task left behind,
One button to check them all, what a find!
Water, fertilize, harvest — all done!
The farmer can rest now under the sun.
✅ Mark all as done, says the bunny with glee~

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: adding a 'Mark All as Done' button to the Daily Task Reminders component, which is the primary objective of this PR.
Linked Issues check ✅ Passed The code changes fully address issue #42 requirements: the PR implements a 'Mark All as Done' button in the Daily Task Reminders component, allowing farmers to mark all tasks as complete simultaneously with integrated persistence.
Out of Scope Changes check ✅ Passed All changes in DailyTaskReminders.tsx are directly related to implementing the 'Mark All as Done' feature and related UI layout improvements as specified in issue #42; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
frontend/src/components/DailyTaskReminders.tsx (1)

90-95: ⚡ Quick win

Derive “all done” state from TASKS to avoid future drift.

Line 91 hardcodes task keys, which can silently desync from TASKS when a new daily task is added. Build the next state from TASKS so bulk-complete always matches the rendered checklist.

Suggested refactor
   const markAllAsDone = () => {
-  setTaskState({
-    water: true,
-    fertilize: true,
-    harvest: true,
-  });
-};
+    setTaskState(
+      TASKS.reduce((acc, task) => {
+        acc[task.id] = true;
+        return acc;
+      }, {} as TaskState)
+    );
+  };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/DailyTaskReminders.tsx` around lines 90 - 95, The
markAllAsDone function hardcodes task keys (water, fertilize, harvest) directly
in the setTaskState call, which can become out of sync when new tasks are added
to the TASKS constant. Refactor the function to dynamically build the state
object by iterating over the TASKS constant and mapping each task to true,
ensuring the bulk-complete action always matches the rendered checklist
regardless of future task additions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/components/DailyTaskReminders.tsx`:
- Around line 114-120: The hardcoded English strings "Mark All as Done", "Done",
and "Today" in the DailyTaskReminders.tsx component are not localized. Wrap each
of these string literals with the t() localization function to match the
existing localization pattern used elsewhere in the component. Apply t() to the
button text content, the conditional string in the span element showing 'Done'
or 'Today', and any other user-facing text in the affected code block.

---

Nitpick comments:
In `@frontend/src/components/DailyTaskReminders.tsx`:
- Around line 90-95: The markAllAsDone function hardcodes task keys (water,
fertilize, harvest) directly in the setTaskState call, which can become out of
sync when new tasks are added to the TASKS constant. Refactor the function to
dynamically build the state object by iterating over the TASKS constant and
mapping each task to true, ensuring the bulk-complete action always matches the
rendered checklist regardless of future task additions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8beca20a-ef85-4657-80cb-669af99bf55a

📥 Commits

Reviewing files that changed from the base of the PR and between 58186ea and 8887d0c.

📒 Files selected for processing (1)
  • frontend/src/components/DailyTaskReminders.tsx

Comment on lines +114 to +120
Mark All as Done
</button>
)}

<span className={`${s.taskStatusBadge} ${allComplete ? s.taskStatusBadgeDone : ''}`}>
{allComplete ? 'Done' : 'Today'}
</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize newly surfaced header labels.

Lines 114–120 use hardcoded English UI text ("Mark All as Done", "Done", "Today") even though this component already uses t(...). This creates a localization gap in non-English locales.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/DailyTaskReminders.tsx` around lines 114 - 120, The
hardcoded English strings "Mark All as Done", "Done", and "Today" in the
DailyTaskReminders.tsx component are not localized. Wrap each of these string
literals with the t() localization function to match the existing localization
pattern used elsewhere in the component. Apply t() to the button text content,
the conditional string in the span element showing 'Done' or 'Today', and any
other user-facing text in the affected code block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'Clear All' button to Daily Tasks

2 participants