benknoble / frosthaven-manager

GUI Frosthaven Scenario Manager
https://benknoble.github.io/frosthaven-manager
Other
11 stars 3 forks source link

rich-text-display flickers when making unrelated adjustments #73

Closed benknoble closed 9 months ago

benknoble commented 10 months ago

I suspect one of the various scroll-to-position 0 calls, but I'm not sure which (or why it's being triggered).

benknoble commented 9 months ago

Possible solution: special case updates of @content to skip updates without changes. I think other GUI Easy views do this, because observables don't inherently "debounce" changes to equivalent values.

benknoble commented 9 months ago

To explain the above more thoroughly: the @creatures list is observable because it's fairly dynamic. I need to be able to add new creatures mid-session. This however means that a change to any player, monster, or monster group effectively triggers a change in the entire list, which ends up meaning a large GUI tree gets updates messages. In many cases this is fast and unnoticed, but I suspect that my rich-text-view is, well, slow. I point out the structure of @creatures also because I cannot change to a static list of observables (tempting as that might be) to avoid spurious updates to unrelated entities.

In GUI Easy, for example, some views try to avoid certain expensive work when possible (image, input, radios?, observable-view, if, choice, tabs). I suspect a similar change here will help.