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

Fix TreeView flickering #1167

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Fix TreeView flickering #1167

merged 1 commit into from
Jan 9, 2025

Conversation

rowo360
Copy link
Contributor

@rowo360 rowo360 commented Dec 19, 2024

This PR closes #1165 which reports a flicking in the Treeview when executing tests.

As mentioned in the issue description this bug is caused by the 'Show duration' implementation. This implementation updates a tree node name by adding the test duration as a suffix right away whenever a test finished.

I propose to solve this issue by doing one step back: instead of updating the tree node names on TestFinished event, we'll update them on the TestRunFinished event. That means that the TreeView update is triggered only once - which will solve the flickering.

Obviously this is one step back for the user as he cannot observe the test duration anymore during a test run, but needs to wait until the test run finish. Especially for long running test runs (for which test duration is most helpful), that's not the best solution.
However I didn't find any simple solution, which takes care about all use cases. And unfortunately WindowsForms TreeView triggers a TreeView refresh whenever a TreeNode name is changed.
So overall I want to fix this flickering effect first, which is annoying and hits all users regardless if 'Show duration' is activated or not.

Additional note:
If test run was executed previously and afterwards show test duration is activated, the test duration will be shown immediately - this is kept unchanged.

Some further ideas:

  • Introduce a Timer based approach to update the Tree node names. So, the Tree node names are updated during a test run only every 10s (for example)
  • Attention this idea is a major design switch - nonetheless I'm mentioning it.
    We can introduce additional columns next to the tree view. One of these columns will show the 'Test duration'. So instead of updating the tree node names, we need to update the column cells. I hope that updating cells won't cause a flickering effect as well. But overall, it must be evaluated first, if such columns are beneficial at all and for which other information they can be used (for example categories)?
    And it's worth to mention that WindowsForms doesn't support a 'TreeView with additional columns' out-of-the-box. But there are several examples in the web which might be helpful.

Copy link
Contributor

@CharliePoole CharliePoole left a comment

Choose a reason for hiding this comment

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

I think what you have is a good solution that lets us move forward. I'm approving and merging. I'd like to consider alternatives at some point but not in a way to slow down progress on other things.

@CharliePoole CharliePoole merged commit 76d6528 into main Jan 9, 2025
2 checks passed
@CharliePoole CharliePoole deleted the issue-1165 branch January 9, 2025 05:06
@CharliePoole
Copy link
Contributor

CharliePoole commented Jan 9, 2025

Alternatives I think we should consider in a future iteration...

  1. Finding out why this happens at all so as to prevent it at the source. After all, it doesn't happen when we update the image for a test after it is run.
  2. Using a timer as you suggested
  3. Displaying the duration in some other way, e.g. in a tooltip or with an icon overlay.

I'm not really in love with the multi-column design.

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.

Execute tests - TreeView is flickering
2 participants