Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summary is not redrawn on focus #169

Open
shpaass opened this issue Jun 23, 2024 · 9 comments
Open

Summary is not redrawn on focus #169

shpaass opened this issue Jun 23, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@shpaass
Copy link
Owner

shpaass commented Jun 23, 2024

Steps to reproduce:

  • Don't touch the Summary page for several releases.
  • Navigate to the Summary page.
  • Notice that the horizontal scroll bar is at the wrong place and is unresponsive. (screenshot attached)

image

  • Notice that the Summary page does not have all opened pages.
  • If you click on the area where the horizontal scroll bar should've been, the Summary gets refreshed to a correct view.

image

I think the solution to the problem would be to redraw any tab on focus.

@shpaass shpaass added the bug Something isn't working label Jun 23, 2024
@shpaass
Copy link
Owner Author

shpaass commented Jun 23, 2024

Here's the project file: project.zip

@veger
Copy link
Collaborator

veger commented Jun 24, 2024

It is a known visual glitch that sometimes happens: #161 (comment):

Sometimes the scrollbars are drawn in the wrong place, triggering a UI (re)build (by clicking something for example) puts the bars to the correct places. I think it is because the UI contents is repositioned by the Scrollable cause the scrollarea dimensions to change. A followup rebuild uses the new dimensions, causing the bars to move to the correct places. (Fixing this would mean a complete overhaul of the UI system, as there is no way to find the bottom (height)/right (width) of the 'left over' area where the scrollable component needs to be placed. (The UI is 'fluid' and is build from the top/left)

I think we would need to rebuild the UI in some specific cases, which currently do not trigger a rebuild, to fix this. No idea which exact cases yet/though 😄 When I (want to) take a look at it, it doesn't happen. And when I am unaware I realize(d) it happened again...

@shpaass
Copy link
Owner Author

shpaass commented Jun 24, 2024

Here's the save file with mods on which the Yafc project was loaded: summary_not_redrawn.zip

@veger
Copy link
Collaborator

veger commented Jun 24, 2024

Thanks, if this is an opportunity to have a reproducible case it would help figuring out what is going on!

@veger
Copy link
Collaborator

veger commented Jun 24, 2024

Unfortunately, I cannot reproduce.

  • I opened YAFC (from master)
  • Select your project file and leave full pY suite mods enabled (my default gameplay)
  • Load the project
  • Open the Summary page from the menu (as it was not opened)

And this is the result:
image

All tabs are showing, the scrollbar is placed in the bottom, no other (visual) glitches are visible (to me).

@shpaass
Copy link
Owner Author

shpaass commented Jun 24, 2024

Tested just now.

image

@veger
Copy link
Collaborator

veger commented Jun 24, 2024

So it looks like, it is setup/OS dependent? 😞

I am using Linux/KDE/Nvidia, I can try later on my desktop which runs Linux/KDE/AMD

shpaass added a commit that referenced this issue Aug 13, 2024
This closes #175. I was unable to eliminate the issues where I had to
click "Auto balance" multiple times, but I suspect it's related to #169.
Hopefully this change will make it easier to reproduce, and thus fix,
that bug.

There are attempts to detect negative feedback conditions, and they
sometimes work, but the usual exit condition is the `if
(updateOrder.Count == 0)` "no more updates available" test, even when
more updates will become available once the pages finish recalculating.
@shpaass
Copy link
Owner Author

shpaass commented Aug 13, 2024

Please reopen this issue if the bug is reproducible on the recent versions.

@shpaass shpaass closed this as completed Aug 13, 2024
@DaleStan
Copy link
Collaborator

DaleStan commented Aug 13, 2024

I'm still seeing this. When working on #234, I used this project for testing.
Bobs-save.zip
Bobs.yafc.zip

After syncing mods and settings from the save, load the project, check "Only show issues" (primarily to make the behavior easier to see) and click "Auto balance".
You will probably see only three columns, one each for water, hydrogen, and CO₂. (If you see more than five columns, click "Auto balance" again. Each click seems to have a 10%-25% chance of properly updating the table.)
Optionally, uncheck "Only show issues". The hidden columns will appear to be properly balanced (e.g. Rocket fuel could show 106/s production and consumption on two pages of 50/s and 55.5/s.) If you uncheck "Only show issues", recheck it.
To see the issue, hold Ctrl+Tab to sweep through all the tabs (the science packs are the last 8 tabs). When you get back to the Summary page, it will be redrawn with many columns, indicating that the previous display was using stale values.

This can usually be repeated around five times, before the project is fully balanced, and you have to undo or reload.

@DaleStan DaleStan reopened this Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants