Skip to content

Increment earnings when using dynamic total#174

Merged
rickykresslein merged 1 commit intounobserved-io:mainfrom
archer-321:feature/update-total-earnings-with-dynamic-total
Dec 14, 2025
Merged

Increment earnings when using dynamic total#174
rickykresslein merged 1 commit intounobserved-io:mainfrom
archer-321:feature/update-total-earnings-with-dynamic-total

Conversation

@archer-321
Copy link
Copy Markdown
Contributor

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 🙂

@rickykresslein
Copy link
Copy Markdown
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.
@archer-321 archer-321 force-pushed the feature/update-total-earnings-with-dynamic-total branch from 38d786a to 2132367 Compare December 11, 2025 14:52
@archer-321
Copy link
Copy Markdown
Contributor Author

Would you like to make changes to this code or should I review and merge it as is?

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 😄

@rickykresslein rickykresslein merged commit 3c99753 into unobserved-io:main Dec 14, 2025
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.

2 participants