-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
treeview started as closed need another refresh (or re-opening) to show content #129019
Comments
@boltex I can repro the issue with the gitlens commits view but not with any other view, and as far as I can see the commit tree is just returning 0 children. Can you point me to another tree view where you also see this issue? |
@alexr00 Thank you for your time and consideration! I've investigated this last night to try and get to the bottom of it. Turns out I had an event tied to the change of visibility of the treeview, and if visible === true, then I launched a 'refresh root' of the tree, which seemed to 'glitch out' that said refresh cycle. (is it intended/normal?) (I re-use the same instance of the tree provider for two instances of the tree view: one in the explorer panel, and another one in a view-container that My extension provides. And so I thought I had to refresh the tree manually if uncovered by the user, either by unfolding it or by switching to the other view-container.) I've noticed that, if the treeview was never populated, vscode launches a 'refresh cycle' itself upon revealing a treeview. (i verified by adding console.logs in the 'getChildren' method of my treeview provider) And me also calling this._onDidChangeTreeData.fire(); was causing glitching in the treeview it seems, preventing it to refresh properly. Workaround : I've solved it by debouncing my calls to this._onDidChangeTreeData.fire() by 80 milliseconds. (perhaps I only should try to refresh if I know my tree structure has changed - instead of also refreshing when I detect a visibility change that tells me a treeview was uncovered / unfolded and made visible.) I'll let you close this issue if you see fit, as I'm not sure anymore if it's actually a bug that calling the refresh-root procedure as it's actually already refreshing bugs the treeview by not refreshing at all. Many thanks again for your attention to the issue I raised! You Rock!! :) |
Thanks for the investigation @boltex! I'll take some time to make sure the behavior you're seeing is intended before closing. |
Started investigation, but can't finish right now. Some notes for when I pick it back up:
|
@alexr00 Another sidenote, in case it can help with this directly-related issue: @eamodio also seems to consider this a bug gitkraken/vscode-gitlens#1582 when I tried to reproduce & pointed out this behavior in his extension. |
/verified @alexr00 I want to thank you personally for this fix. Helped a lot with my extension. :) |
Issue Type: Bug
I'm developping an extension, and i've noticed a problem that i can also reproduce with the gitlens default extension in vscode. (therefore prompting me to think it's an issue with vscode and not my extension)
Make sure the 'commits' section of gitlens is closed when
closing vscode.
Restart vscode, goto the git lens view, open the commit tree view. Notice it's empty.
You'll have to hit the 'refresh icon' on the right of its title bar to populate it correctly. This was not the case a couple weeks ago.
(Thanks for your great product nonetheless you guys!)
VS Code version: Code 1.58.2 (c3f1263, 2021-07-14T22:30:16.440Z)
OS version: Linux x64 5.7.1-050701-generic
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (36)
(13 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: