fix: update summary box when task data loads.#460
Open
Ridanshi wants to merge 1 commit into
Open
Conversation
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.
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.
Summary
Fixes the dashboard summary counters showing stale
0 tasksvalues 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:
As a result, the displayed counters remained outdated despite the underlying task data changing correctly.
Changes Made
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
Notes
This PR intentionally keeps the fix:
No unrelated UI, storage, or routing logic was modified.