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

Added a deactivate() function to Tab so when switching tabs it hides … #5386

Merged

Conversation

akoolenbourke
Copy link
Contributor

…the active contents. Also removed clearing of the pages so it's not destroyed each time.

Description

When switching between tabs there was a noticeable lag, especially with larger ones like the Quality tab. The Slicer GUI was destroying all the contents of a tab when going away and recreating it if you went back again.

I have changed it so the contents aren't destroyed, just hidden and removed the destruction of the page.

Screenshots/Recordings/Graphs

Fastertabs.mp4

Tests

I have navigated amongst all the tabs many times. Loaded projects and changed filaments and printers to see that the Tab contents still update correctly.

I checked that icons appeared, settings changes are shown correctly (With the undo arrow) and other things.

…the active contents. Also removed clearing of the pages so it's not destroyed each time.
@yw4z
Copy link
Contributor

yw4z commented May 17, 2024

First thanks. this one is on my list too. annoys me too much
can you test this improvement with this commit #5221
I added icons too all tabs on that commit so they can appear on gCode editor window and compare window but they hidden on tabs. just wondering is there a difference or conflicts

Also code changes will be minimal if you dont use separate function for deactivation

and there is an another lag while using global / objects toggle fyi

@akoolenbourke
Copy link
Contributor Author

First thanks. this one is on my list too. annoys me too much can you test this improvement with this commit #5221 I added icons too all tabs on that commit so they can appear on gCode editor window and compare window but they hidden on tabs. just wondering is there a difference or conflicts

Also code changes will be minimal if you dont use separate function for deactivation

and there is an another lag while using global / objects toggle fyi

Happy to test my change and your PR together. I added deactivate() to match an activate() which made more sense.

I have a question. When I do a PR should I add specific reviewers so it gets noticed? e.g. SoftFever, or just open?

@yw4z
Copy link
Contributor

yw4z commented May 17, 2024

I said check because you said some icons appeared. if there is no additional icons appeared then there is no problem
also i suggest convert lines to comments instead of deleting lines and add comments for reason. adding comments makes maintain process easy when conflicts appear
just try to pick a right title for PR. people mostly checking PR section

@akoolenbourke
Copy link
Contributor Author

I said check because you said some icons appeared. if there is no additional icons appeared then there is no problem also i suggest convert lines to comments instead of deleting lines and add comments for reason. adding comments makes maintain process easy when conflicts appear just try to pick a right title for PR. people mostly checking PR section

Ahh yes. I meant "checked they appeared as expected" as opposed to not appearing correctly due to not rebuilding. My test with your PR was good; your changes looked like they were visible from the bit of testing I did.

@SoftFever
Copy link
Owner

Thanks for the PR.
I will test a bit more.
But it looks very promising!

@akoolenbourke
Copy link
Contributor Author

Thanks for the PR. I will test a bit more. But it looks very promising!

No problem. Do you have a document with a list of test cases I should run if doing more changes?

@SoftFever
Copy link
Owner

Thanks for the PR. I will test a bit more. But it looks very promising!

No problem. Do you have a document with a list of test cases I should run if doing more changes?

No document yet. It mainly depends on one's experience to test. For example, for this PR, we usually test by switching printers/tabs, then editing values, then slicing.

Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Let's merge it into the main branch so that more people can test it.

@SoftFever SoftFever merged commit 7a33559 into SoftFever:main May 19, 2024
12 checks passed
@yw4z
Copy link
Contributor

yw4z commented May 19, 2024

@SoftFever tested few time, parameters on unactive tabs not updates when preset changes

@SoftFever
Copy link
Owner

@SoftFever tested few time, parameters on unactive tabs not updates when preset changes

You'da man
it's indeed not refreshed

SoftFever added a commit that referenced this pull request May 20, 2024
@SoftFever
Copy link
Owner

Hey @akoolenbourke @yw4z
FYI.
I've reverted both PR #5400 and this PR.
I noticed that it called reload_config for every page for every parameter change.

@yw4z
Copy link
Contributor

yw4z commented May 20, 2024

@SoftFever whats the downside for that? i guess it will not slowdown parameter change until we got 99+ tabs with full of configs. better then rebuilding whole UI elements

@akoolenbourke
Copy link
Contributor Author

akoolenbourke commented May 24, 2024

arameters on unactive tabs not updates when preset change

So do you mean, if you changed presets, the inactive tabs don't change and therefore the settings aren't used if you hit 'Slice'?

If so, good find and I'll remember it for next time, but man, the UI should have nothing to do with that stuff. Maybe if we find a performance issue and the call points where we need to read the new values are few, we can just reload at that point.

I hope I can get more time and familiarity with the code and fix a tonne of performance issues but as I get more used to 3d printing and slicers in general I see that the way most software organises their presets doesn't really work well for how I actually use my printer. I want to be able to do things like have a config where I only setup one set of things for say my Standard quality printing, but if I happen to change to a larger nozzle then just select an option and everything I want to change changes automatically without having to make a whole new independent preset.

@akoolenbourke
Copy link
Contributor Author

I notice myfix and yw4z's addition isn't in the current main - will it be included at all as it does provide a usability enhancement. If not, is there something else I can do in this regard, such as perform a more broader optimisation pass to the UI stuff?

@SoftFever
Copy link
Owner

SoftFever commented May 28, 2024

@akoolenbourke @yw4z
Sorry for the late response. I reverted both PRs as mentioned earlier for 3 reasons:

  1. The proposed change would result in reloading the config for all tabs by simply changing a parameter on any page. This is not desirable.
  2. My biggest concern, however, is that our UI logic relies on destructing and constructing a page each time. Some pages/controls will be added or removed during the build, so hiding and unhiding could cause unexpected results.
  3. The performance issue is somewhat addressed by the shared control pool proposal, which I unfortunately also had to revert due to some issues on Linux. But overall, I think that approach is safer once the Linux issue is resolved. (Reference: d72c9f9: revert wxwidgets control pool)

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.

3 participants