Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Disallow editing fields during preview #67

Open
ImmortalZypther opened this issue May 4, 2021 · 3 comments
Open

Disallow editing fields during preview #67

ImmortalZypther opened this issue May 4, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ImmortalZypther
Copy link

If you click > to preview the resin amount tomorrow, then click any of the buttons to subtract resin, and then click < to return to your current time, you'll have negative resin that shows as 0.
Clicking > again won't fix the issue, the preview will act like usual and add hours to simulate regeneration without touching the actual number.
image

@luaneko
Copy link

luaneko commented May 4, 2021

This is working as intended as far as I'm concerned. If you modify resin value and go back in time, the extrapolated value will be negative, but it's not possible to have negative resins, hence it's clamped in the range [0, 160].

The same behavior can be observed when marking tasks as done while previewing the next few days. I think this is a logical behavior.

The only "fix" for this might be to disallow editing things altogether while in preview.

@luaneko luaneko added the wontfix This will not be worked on label May 4, 2021
@ImmortalZypther
Copy link
Author

As logical as it is, I don't think anybody intends to have negative resin.

If you look at the times, you'll see that even thought it shows as 0, it's still being calculated as if it were a negative number.

Disallowing editing things while in the preview is a good fix, but you could alternatively make it not touch your resin in the present since resin you edit in the "future" shouldn't affect the resin you have in the present.

@luaneko
Copy link

luaneko commented May 4, 2021

you could alternatively make it not touch your resin in the present since resin you edit in the "future" shouldn't affect the resin you have in the present.

It's definitely possible, but I think the complexity required code-wise to address this edge case makes it not worth pursuing. This will require us to clone another instance of the data store for previewing, but the current code isn't written with this in mind.

I think disabling edits during preview is a practical way to go. Other issues should be prioritized, but I'll keep this open in case someone else wants to tackle it.

@luaneko luaneko added bug Something isn't working help wanted Extra attention is needed and removed wontfix This will not be worked on labels May 4, 2021
@luaneko luaneko changed the title Negative Resin Disallow editing fields during preview May 30, 2021
@luaneko luaneko added enhancement New feature or request and removed bug Something isn't working labels May 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants