Increment earnings when using dynamic total#174
Merged
rickykresslein merged 1 commit intounobserved-io:mainfrom Dec 14, 2025
Merged
Conversation
Member
|
I've actually decided to bump the target edition to 2024. Would you like to make changes to this code or should I review and merge it as is? |
If the "dynamic total" setting is enabled, also increment the total daily earnings in the history header row of the current day. Given how close the daily total time and earnings are in the task history header, this behaviour likely matches user expectations more closely. --- The implementation intentionally uses the current timer string and timer input as SSOTs for the current active task to align with the rest of the application. Refactoring the timer state to use a structure that doesn't require string parsing is outside the scope of this patch.
38d786a to
2132367
Compare
Contributor
Author
Thanks for the heads-up! Considering the branch had to be rebased anyway, I went ahead and added the two if-let chains. The PR should be ready for review now 😄 |
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.
When using the "dynamic total" setting, also update the total daily earnings in the history header row using the current timer's time and the rate parsed from the timer input.
I slightly refactored the nested if and if-let blocks in the header method to reduce the code duplication introduced by the lack of let chain support in the current target Rust edition. I believe the code duplication could be further reduced if the target edition were bumped to 2024, but I ultimately decided against bumping the edition (and thus, the MSRV), as Furtherance might be packaged on some older distributions that don't have access to a modern version of rustc.
Please let me know if you'd like to see any changes 🙂