fix: Reduce DB calls when saving archived day edits#131
Merged
Conversation
The save button in ArchiveEditDialog now mirrors the behaviour of
TaskEditDialog: it is disabled and reads "No Changes" when the form
is clean, switches to "Save Changes" when any field or task has been
modified, and shows a spinner ("Saving...") while the async persist
is in flight.
https://claude.ai/code/session_016b7TfPXSNPU8Jz7qyYMvRu
Two targeted improvements: 1. ArchiveEditDialog: only include tasks in the update payload when tasks were explicitly edited or the date changed (a date shift re-stamps all task timestamps). Previously tasks were always sent, causing an unnecessary SELECT + UPSERT even for notes-only edits. 2. TimeTrackingContext: on updateArchivedDay error, roll back only the affected day using its pre-update snapshot rather than re-fetching the entire archived-days collection from the database. https://claude.ai/code/session_016b7TfPXSNPU8Jz7qyYMvRu
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
Minimize the amount of calls to the database during archiving and editing of archived tasks. Simplifies three calls down to one.
Type of Change
Related Issue
Closes #
Changes Made
Checklist
Documentation
README.mdCHANGELOG.mdupdated accordinglyGeneral
mainnpm run test,npm run lint, andnpm run buildNotes for Reviewers