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(ListViewBase): Adjust indices repairing considering recursive list manipulation #11841

Merged
merged 4 commits into from
Mar 30, 2023

Conversation

jeromelaban
Copy link
Member

GitHub Issue (If applicable): closes #11821

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the new behavior?

When manipulating its internal ListView, the TreeView control handles TreeViewItem datacontext changes so remove items in a recursive way. Removal of items in a ListView was incorrectly repairing indices after cleaning up containers, causing containers to be incorrectly reused.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

…t manipulation

When manipulating its internal ListView, the TreeView control handles TreeViewItem datacontext changes so remove items in a recursive way. Removal of items in a ListView was incorrectly repairing indices after cleaning up containers, causing containers to be incorrectly reused.
@nventive-devops
Copy link
Contributor

The build 73979 found UI Test snapshots differences: android-28-xamarin: 39, android-28-xamarin-Snap: 65, ios: 26, ios-Snap: 95, macOS-screenshots: 30, skia-gtk-screenshots: 15, skia-wpf-screenshots: 12, wasm: 27, wasm-automated-net7.0-UWP-Benchmarks: 0, wasm-automated-net7.0-UWP-Default: 5, wasm-automated-net7.0-UWP-RuntimeTests: 0, wasm-automated-net7.0-WinUI-RuntimeTests: 0

Details
  • android-28-xamarin: 39 changed over 828

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Check_ListView_Swallows_Measure_after_scroll
    • FocusManager_GetFocusedElement_TextBoxSingleLine_LostFocus_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • Check_ListView_Swallows_Measure_before_scroll
    • FocusManager_GetFocusedElement_Grid_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • Late_With_Fixed_Dimensions_UITests_Windows_UI_Xaml_Controls_ImageTests_ImageWithLateSourceFixedDimensions
    • BasicExpressionTest_UITests_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBox_ExpressionTest
    • CommandTest_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage
    • FlyoutTest_DataBoundButton_CommandExecutes_UITests_Shared_Windows_UI_Xaml_Controls_Flyout_Flyout_ButtonInContent
    • FocusManager_GetFocusedElement_Button_LostFocus_Validation_FocusManager_-_LostFocus_-_Button_-_1_-_Initial_State
    • ListView_ChangeHeight_Validation_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewChangeHeight
    • ListView_ExpandableItemLarge_ExpandHeaderWithMultipleItems_Validation_Expanded_State
    • Check_ListView_Swallows_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • CommandBar_LongTitle_Validation_CommandBar_-_LongTitle_-_4_-_Orientation_Landscape
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • FocusManager_GetFocusedElement_Button_LostFocus_Validation_FocusManager_-_LostFocus_-_Button_-_2_-_Click_outside
    • FocusManager_GetFocusedElement_Button_LostFocus_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • FocusManager_GetFocusedElement_ToggleButton_LostFocus_Validation_Uno_UI_Samples_Content_UITests_FocusTests_FocusManager_GetFocus_Automated
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • ListView_Weird_Measure_During_Arrange_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Weird_Measure
    • ListView_ExpandableItem_ExpandMultipleItems_Expanded_State
  • android-28-xamarin-Snap: 65 changed over 1021

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BreadcrumbBar_MUXControlsTestApp_BreadcrumbBarPage_MUXControlsTestApp_BreadcrumbBarPage
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • Buttons_UITests_Microsoft_UI_Xaml_Controls_RadioButtonsTests_RadioButtonsPage_UITests_Microsoft_UI_Xaml_Controls_RadioButtonsTests_RadioButtonsPage
    • Flyouts_MenuFlyout_IosNative_UITests_Shared_Windows_UI_Xaml_Controls_MenuFlyoutTests_MenuFlyout_IosNative
    • Flyouts_MenuFlyout_Simple_Uno_UI_Samples_Content_UITests_MenuFlyout_MenuFlyout_Simple
    • Image_ImageSourceStream_Uno_UI_Samples_UITests_ImageTestsControl_ImageSourceStream
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Icons_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Icons
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize
    • ListView_ListViewChangeViewArbitrary_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewChangeViewArbitrary
    • Expander_WinUIExpanderPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ExpanderTests_WinUIExpanderPage
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller
    • ListView_ListViewHeaderFooter_ImplicitlyBinded_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderFooter_ImplicitlyBinded
    • ListView_ListView_ChangeView_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_ChangeView
    • ListView_ListView_Changing_Text_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Changing_Text
    • ListView_ListView_DataContext_Propagation_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_DataContext_Propagation
    • ListView_ListView_DataTemplateSelector_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_DataTemplateSelector
    • ListView_ListView_Expandable_Item_Large_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • ListView_ListView_Expandable_Item_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item
    • GridView_Uno_UI_Samples_Content_UITests_GridView_GridViewScrollIntoViewTest_Uno_UI_Samples_Content_UITests_GridView_GridViewScrollIntoViewTest
    • MUX_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage
  • ios: 26 changed over 291

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Keyboard_Textbox_NoScrollViewer_Validation_2_-_Remove_Focus_on_placeholderTextTextBox
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Screenshots_Image_Stretch_Alignment_Equal_Mode-2
    • Screenshots_Image_Stretch_Alignment_Equal_Mode-3
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-2
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-3
    • Keyboard_Textbox_NoScrollViewer_Validation_0_-_Remove_Focus_on_normalTextBox
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • ListView_ObservableCollection_Creation_Count_Added
    • ListView_ObservableCollection_Creation_Count_Added_above
    • ListView_ObservableCollection_Creation_Count_Removed_above
    • ListView_ObservableCollection_Creation_Count_Scrolled1
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Screenshots_Image_Stretch_Alignment_Equal_Mode-0
    • Screenshots_Image_Stretch_Alignment_Equal_Mode-1
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-0
    • Screenshots_Image_Stretch_Alignment_Wider_Mode-1
    • TextBox_UpdatedBinding_On_OneWay_Mode_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Bindings
    • Keyboard_Textbox_NoScrollViewer_Validation_1_-_Remove_Focus_on_filledTextBox
    • Screenshots_Image_Stretch_Alignment_Smaller_Mode-1
  • ios-Snap: 95 changed over 1012

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ComboBox_ComboBox_SelectedIndex_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_SelectedIndex
    • CommandBar_CommandBar_Xaml_Automated_UITests_Shared_Windows_UI_Xaml_Controls_CommandBar_CommandBar_Xaml_Automated
    • AutoSuggestBox_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_Icons_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_Icons
    • Border_Uno_UI_Samples_UITests_BorderTestsControl_Border_BorderThickness_Uno_UI_Samples_UITests_BorderTestsControl_Border_BorderThickness
    • Clipping_SamplesApp_Windows_UI_Xaml_Clipping_DoubleAnimationClipping_SamplesApp_Windows_UI_Xaml_Clipping_DoubleAnimationClipping
    • Border_BorderLeftwithmargins_Uno_UI_Samples_UITests_BorderTestsControl_BorderLeftwithmargins
    • Brushes_UITests_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_Formats_UITests_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_Formats
    • ComboBox_ComboBox_ItemsSource_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_ItemsSource
    • ComboBox_ComboBox_MaxDropdownHeight_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_MaxDropdownHeight
    • AutoSuggestBox_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_BitmapIcon_UITests_Windows_UI_Xaml_Controls_AutoSuggestBoxTests_AutoSuggestBox_BitmapIcon
    • Border_BorderRightwithmargins_Uno_UI_Samples_UITests_BorderTestsControl_BorderRightwithmargins
    • Border_BorderTopwithmargins_Uno_UI_Samples_UITests_BorderTestsControl_BorderTopwithmargins
    • Clipping_SamplesApp_Windows_UI_Xaml_Clipping_Transform_Ellipse_In_Border_SamplesApp_Windows_UI_Xaml_Clipping_Transform_Ellipse_In_Border
    • ComboBox_ComboBox_NoDataContext_UITests_Shared_Windows_UI_Xaml_Controls_ComboBox_ComboBox_NoDataContext
    • ComboBox_ComboBox_Picker_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_Picker
    • Default_UITests_Shared_Windows_UI_Xaml_Controls_Canvas_Canvas_With_Outer_Clip_UITests_Shared_Windows_UI_Xaml_Controls_Canvas_Canvas_With_Outer_Clip
    • Flyouts_UITests_Shared_Microsoft_UI_Xaml_Controls_RadioMenuFlyoutItemTests_RadioMenuFlyoutItemPage_UITests_Shared_Microsoft_UI_Xaml_Controls_RadioMenuFlyoutItemTests_RadioMenuFlyoutItemPage
    • Flyouts_UITests_Windows_UI_Xaml_Controls_FlyoutTests_Flyout_ShowAt_Window_Content_UITests_Windows_UI_Xaml_Controls_FlyoutTests_Flyout_ShowAt_Window_Content
    • Gesture_Recognizer_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_GestureEventsCommons_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_GestureEventsCommons
    • Grid_UITests_Shared_Windows_UI_Xaml_Controls_GridTestsControl_Grid_Spacing_Adjustable_UITests_Shared_Windows_UI_Xaml_Controls_GridTestsControl_Grid_Spacing_Adjustable
  • macOS-screenshots: 30 changed over 1090

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Animations-BeginTime_MultipleAnimations.png
    • Image-Image_Fixed_Size_Alignment.png
    • Image-ImageSourceStream.png
    • Lottie-Lottie Progress.png
    • MUX-TabViewPage.png
    • MUX-WinUIColorPickerPage.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • NavigationView-NavigationViewAnimationPage.png
    • ListView-ListView_IsSelected.png
    • MediaPlayerElement-Original.png
    • MediaPlayerElement-Using .3gp.png
    • MediaPlayerElement-Using .avi.png
    • MediaPlayerElement-Using .flv.png
    • NavigationView-NavigationViewCompactPaneLengthTestPage.png
    • NavigationView-NavigationViewCustomThemeResourcesPage.png
    • NavigationView-NavigationViewRS4Page.png
    • NavigationView-NavigationViewTopNavOnlyPage.png
    • MUX-NavigationViewCustomThemeResourcesPage.png
    • MUX-NavigationViewPage.png
  • skia-gtk-screenshots: 15 changed over 1079

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes-Ellipse.png
    • Brushes-ImageBrushChangingCornerRadius.png
    • Image-Image_Stretch.png
    • DragAndDrop-DragDrop_TestPage.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • MUX-NavigationViewPage.png
    • Lottie-Lottie Progress.png
    • MUX-TabViewPage.png
    • Progress-ProgressRingHeightTest.png
    • Progress-WindowsProgressRing_GH1220.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • Pickers-CalendarView_Theming.png
  • skia-wpf-screenshots: 12 changed over 1079

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes-ImageBrushAlignmentXY2.png
    • Image-ImageSourceStream.png
    • Lottie-Lottie Progress.png
    • MUX-TabViewPage.png
    • Pickers-CalendarView_Theming.png
    • Progress-ProgressRingHeightTest.png
    • Progress-WindowsProgressRing_GH1220.png
    • Progress-WinUIProgressRingPage.png
    • Progress-WinUIProgressRing_CustomSources.png
    • Progress-WinUIProgressRing_Features.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
  • wasm: 27 changed over 1019

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • initial_state
    • MUXControlsTestApp.NavigationViewTopNavPage
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Lottie.LottieProgressPage
    • MUXControlsTestApp.NavigationViewPage
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRingPage
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_CustomSources
    • UITests.Microsoft_UI_Xaml_Controls.ProgressRing.WinUIProgressRing_Features
    • MUXControlsTestApp.NavigationViewMenuItemStretchPage
    • MUXControlsTestApp.NavigationViewMinimalPage
    • MUXControlsTestApp.NavigationViewRS4Page
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Expandable_Item_Large
    • UITests.Microsoft_UI_Xaml_Controls.RatingControlTests.RatingControlPage
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewHeaderImage
    • UITests.Shared.Microsoft_UI_Xaml_Controls.TwoPaneViewTests.TwoPaneViewPage
    • UITests.Microsoft_UI_Xaml_Controls.TabViewTests.TabViewPage
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ColorPickerTests.WinUIColorPickerPage
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_With_ListViews_Count_Measure
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_ViewManagement.ApplicationViewSizing
  • wasm-automated-net7.0-UWP-Benchmarks: 0 changed over 1

  • wasm-automated-net7.0-UWP-Default: 5 changed over 887

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DatePicker_Flyout_DatePicker_-_Flyout
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • When_Theme_Changed_No_Crash_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • When_TransformToVisual_ScrollViewer_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_ScrollViewer
  • wasm-automated-net7.0-UWP-RuntimeTests: 0 changed over 1

  • wasm-automated-net7.0-WinUI-RuntimeTests: 0 changed over 1

@jeromelaban jeromelaban merged commit 51fc6bf into master Mar 30, 2023
@jeromelaban jeromelaban deleted the dev/jela/tree-view-reuse branch March 30, 2023 07:00
@jeromelaban
Copy link
Member Author

@Mergifyio backport release/stable/4.8

@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2023

backport release/stable/4.8

✅ Backports have been created

@jeromelaban
Copy link
Member Author

@Mergifyio backport release/stable/4.7

@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2023

backport release/stable/4.7

✅ Backports have been created

jeromelaban added a commit that referenced this pull request Apr 4, 2023
…4.7/pr-11841

fix(ListViewBase): Adjust indices repairing considering recursive list manipulation (backport #11841)
jeromelaban added a commit that referenced this pull request Apr 5, 2023
…4.8/pr-11841

fix(ListViewBase): Adjust indices repairing considering recursive list manipulation (backport #11841 and #11639)
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.

[Playground][Wasm]-TreeView Data Binding- Tree view is improper, displaying item randomly.
4 participants