[1.7] Tab indicators in the cmdpal aren't working (sometimes?) #12738

Closed
opened 2026-01-31 03:23:34 +00:00 by claunia · 10 comments
Owner

Originally created by @zadjii-msft on GitHub (Feb 25, 2021).

Build is 1.7.552.0.

  • run wt ; nt
  • mark the second pane as read only
  • open the tab switcher

You should see a lock:
image

But sometimes you don't?
image

On the debug build, I wasn't able to get them to appear, until I stepped through it once, and now they always appear. Like, no launches of the terminal ever had them, now all launches of the terminal have them

When I was first debugging through this, it looked like PaletteItemTemplateSelector::_TabItemTemplate was null. However when debugging the release build that doesn't repro this, _TabItemTemplate definitely isn't null, so that can't be it.

Originally created by @zadjii-msft on GitHub (Feb 25, 2021). Build is 1.7.552.0. * run `wt ; nt` * mark the second pane as read only * open the tab switcher You should see a lock: ![image](https://user-images.githubusercontent.com/18356694/109203820-3b4be380-776a-11eb-83e6-30dcf65e89a2.png) But sometimes you don't? ![image](https://user-images.githubusercontent.com/18356694/109204056-8108ac00-776a-11eb-8dcf-8928beb7e9c5.png) > On the debug build, I wasn't able to get them to appear, until I stepped through it once, and now they _always_ appear. Like, no launches of the terminal ever had them, now all launches of the terminal have them When I was first debugging through this, it looked like `PaletteItemTemplateSelector::_TabItemTemplate` was null. However when debugging the release build that doesn't repro this, `_TabItemTemplate` definitely isn't null, so that can't be it.
Author
Owner

@Don-Vito commented on GitHub (Feb 25, 2021):

I hope to get back to work on Terminal - I am missing all the action

@Don-Vito commented on GitHub (Feb 25, 2021): I hope to get back to work on Terminal - I am missing all the action
Author
Owner

@zadjii-msft commented on GitHub (Mar 11, 2021):

woah today I got a new variation of this:

image

That's the tab switcher, and one of the tabs has the nested command arrow in it. That's not right 😮

@zadjii-msft commented on GitHub (Mar 11, 2021): woah today I got a new variation of this: ![image](https://user-images.githubusercontent.com/18356694/110827179-70bcfa80-825b-11eb-90bd-70d6930f05c2.png) That's the tab switcher, and one of the tabs has the nested command arrow in it. That's not right 😮
Author
Owner

@Don-Vito commented on GitHub (Mar 11, 2021):

woah today I got a new variation of this:

image

That's the tab switcher, and one of the tabs has the nested command arrow in it. That's not right 😮

Holly mother of God.. I will take a look..

@Don-Vito commented on GitHub (Mar 11, 2021): > > woah today I got a new variation of this: > > ![image](https://user-images.githubusercontent.com/18356694/110827179-70bcfa80-825b-11eb-90bd-70d6930f05c2.png) > > That's the tab switcher, and one of the tabs has the nested command arrow in it. That's not right 😮 Holly mother of God.. I will take a look..
Author
Owner

@Don-Vito commented on GitHub (Mar 11, 2021):

So it appears that ListView (_filteredActionViews) recycles ListViewItems. 🤦

To reproduce the problem simply:

  1. Start terminal
  2. Open command palette
  3. Open tab with two panes, and zoom one
  4. Open another tab
  5. Switch between the tabs

No zoom icon will be shown.

Still considering how to fix this.

@Don-Vito commented on GitHub (Mar 11, 2021): So it appears that ListView (_filteredActionViews) recycles ListViewItems. 🤦 To reproduce the problem simply: 1. Start terminal 2. Open command palette 3. Open tab with two panes, and zoom one 4. Open another tab 5. Switch between the tabs No zoom icon will be shown. Still considering how to fix this.
Author
Owner

@DHowett commented on GitHub (Mar 12, 2021):

HUH. I would have expected ListViewItems to be recycled only based on data template (!!!) so this is sorta scary.

@DHowett commented on GitHub (Mar 12, 2021): **HUH**. I would have expected ListViewItems to be recycled only based on data template (!!!) so this is sorta scary.
Author
Owner

@DHowett commented on GitHub (Mar 12, 2021):

Ah. "Container-recycling with heterogeneous collections"

ChoosingItemContainer is an event that allows you to provide an item (ListViewItem/GridViewItem) to the ListView/GridView whenever a new item is needed during start-up or recycling. You can create a container based on the type of data item the container will display (shown in the example below). ChoosingItemContainer is the higher-performing way to use different data templates for different items.

@DHowett commented on GitHub (Mar 12, 2021): Ah. ["Container-recycling with heterogeneous collections"](https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/optimize-gridview-and-listview#container-recycling-with-heterogeneous-collections) > ChoosingItemContainer is an event that allows you to provide an item (ListViewItem/GridViewItem) to the ListView/GridView whenever a new item is needed during start-up or recycling. You can create a container based on the type of data item the container will display (shown in the example below). ChoosingItemContainer is the higher-performing way to use different data templates for different items.
Author
Owner

@Don-Vito commented on GitHub (Mar 12, 2021):

HUH. I would have expected ListViewItems to be recycled only based on data template (!!!) so this is sorta scary.

According to the documentation it does:

When recycling an item (ListViewItem/GridViewItem), the framework must decide whether the items that are available for use in the recycle queue (the recycle queue is a cache of items that are not currently being used to display data) have an item template that will match the one desired by the current data item. If there are no items in the recycle queue with the appropriate item template then a new item is created, and the appropriate item template is instantiated for it. If, on other hand, the recycle queue contains an item with the appropriate item template then that item is removed from the recycle queue and is used for the current data item. An item template selector works in situations where only a small number of item templates are used and there is a flat distribution throughout the collection of items that use different item templates.

@Don-Vito commented on GitHub (Mar 12, 2021): > > > **HUH**. I would have expected ListViewItems to be recycled only based on data template (!!!) so this is sorta scary. According to the documentation it does: >When recycling an item (ListViewItem/GridViewItem), the framework must decide whether the items that are available for use in the recycle queue (the recycle queue is a cache of items that are not currently being used to display data) have an item template that will match the one desired by the current data item. If there are no items in the recycle queue with the appropriate item template then a new item is created, and the appropriate item template is instantiated for it. If, on other hand, the recycle queue contains an item with the appropriate item template then that item is removed from the recycle queue and is used for the current data item. An item template selector works in situations where only a small number of item templates are used and there is a flat distribution throughout the collection of items that use different item templates.
Author
Owner

@Don-Vito commented on GitHub (Mar 12, 2021):

The issues seems to be somehow related to virtualization.
See: https://github.com/microsoft/microsoft-ui-xaml/issues/2121.

Though looking at ItemsControl::DataTemplateSelectorRecyclingContext::IsCompatible (in /onecoreuap/windows/dxaml/xcp/dxaml/lib/ItemsControl_Partial.cpp) I cannot find an issue 😕

After debugging ModernCollectionBasePanel for two hours I still cannot understand what's going on there (each function is like 500 lines) 😄.
Currently my theory (very preliminary) is that

  • IsCompatible check is getting invoked all the time.
  • But if we don't find compatible container, we repurpose an existing container (i.e., the template is changed)
  • But UI elements are not modified.

@DHowett - I tried disabling virtualization (by overriding the stack panel with VirtualizingStackPanel in VirtualizationMode="Standard"). It solved the problem (but for some reason screwed a horizontal alignment a bit - I guess it is fixable). WDYT?

@Don-Vito commented on GitHub (Mar 12, 2021): The issues seems to be somehow related to virtualization. See: https://github.com/microsoft/microsoft-ui-xaml/issues/2121. Though looking at `ItemsControl::DataTemplateSelectorRecyclingContext::IsCompatible` (in /onecoreuap/windows/dxaml/xcp/dxaml/lib/ItemsControl_Partial.cpp) I cannot find an issue 😕 After debugging `ModernCollectionBasePanel` for two hours I still cannot understand what's going on there (each function is like 500 lines) :smile:. Currently my theory (very preliminary) is that * IsCompatible check is getting invoked all the time. * But if we don't find compatible container, we repurpose an existing container (i.e., the template is changed) * But UI elements are not modified. @DHowett - I tried disabling virtualization (by overriding the stack panel with VirtualizingStackPanel in VirtualizationMode="Standard"). It solved the problem (but for some reason screwed a horizontal alignment a bit - I guess it is fixable). WDYT?
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

:tada:This issue was addressed in #9487, which has now been successfully released as Windows Terminal v1.7.1033.0.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:This issue was addressed in #9487, which has now been successfully released as `Windows Terminal v1.7.1033.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.7.1033.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

:tada:This issue was addressed in #9487, which has now been successfully released as Windows Terminal Preview v1.8.1032.0.🎉

Handy links:

@ghost commented on GitHub (Apr 14, 2021): :tada:This issue was addressed in #9487, which has now been successfully released as `Windows Terminal Preview v1.8.1032.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1032.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12738