Skip to content

fix: update summary box when task data loads.#460

Open
Ridanshi wants to merge 1 commit into
Charushi06:mainfrom
Ridanshi:fix/summary-box-stale-render
Open

fix: update summary box when task data loads.#460
Ridanshi wants to merge 1 commit into
Charushi06:mainfrom
Ridanshi:fix/summary-box-stale-render

Conversation

@Ridanshi
Copy link
Copy Markdown

Summary

Fixes the dashboard summary counters showing stale 0 tasks values even when tasks exist in the application.

The summary section was not re-rendering correctly after task state updates, causing daily and weekly statistics to become inconsistent with the actual task list.

Fixes #459


Root Cause

The summary component relied on stale task state during rendering and did not recompute totals after task mutations such as:

  • task creation,
  • task completion updates,
  • or task deletion.

As a result, the displayed counters remained outdated despite the underlying task data changing correctly.


Changes Made

  • updated summary calculation flow to always derive values from the latest task state
  • ensured summary counters recompute after task add/update/delete operations
  • fixed stale render synchronization between task state and dashboard summary
  • preserved existing task rendering and storage behavior

Impact

Accuracy

Daily and weekly summaries now correctly reflect the real number of tasks.

UI Consistency

Dashboard statistics stay synchronized with the task list after all task operations.

Reliability

Removes stale summary rendering behavior that caused incorrect progress tracking.


Testing

  • verified task counts update after task creation
  • verified counts update after task deletion
  • verified completed/incomplete task changes refresh summary correctly
  • verified summary remains correct after refresh/navigation
  • confirmed no regressions in existing task functionality

Notes

This PR intentionally keeps the fix:

  • minimal,
  • isolated,
  • and focused only on summary synchronization behavior.

No unrelated UI, storage, or routing logic was modified.

The daily/weekly summary was computed once at module-load time, before
store.fetchInitialData() had been called, so store.tasks and
store.subjects were both empty arrays. The summary therefore always
displayed "Today you have 0 task(s). Focus on no specific subject."
regardless of how many tasks the user had added.

Wraps the summary update in a renderSummary() function and registers it
as a store subscriber alongside the other render functions, so it
re-renders with real data as soon as the initial fetch completes and on
every subsequent store change.
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.

bug: Daily/weekly summary always shows "0 tasks" regardless of actual task count

1 participant