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: Make sure to generate OriginalSourceLocation property on DataTemplates #19389

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

carldebilly
Copy link
Member

@carldebilly carldebilly commented Jan 30, 2025

GitHub Issue (If applicable): https://github.com/unoplatform/uno.hotdesign/issues/2980#issuecomment-2622762701 (related, not closing it)

Bugfix

What is the current behavior?

Right now, when generating the code for an empty <DataTemplate />, there's is no OriginalSourceLocation property attached to it, because it's empty.

Hot Design rely on this, but the location in the sources is lost when root element of the template is removed, causing problems.

What is the new behavior?

When Hot Reload (so Hot Design) is used, the property is always set, even if there's no children.

PR Checklist

Please check if your PR fulfills the following requirements:

…rty information for empty elements (usually DataTemplates) when Hot Reload (and Hot Design) is used.
@github-actions github-actions bot added the area/code-generation Categorizes an issue or PR as relevant to code generation label Jan 30, 2025
@carldebilly carldebilly force-pushed the dev/cdb/hr-OriginalSourceLocation branch 2 times, most recently from 10c7b6a to 4d9d40e Compare January 30, 2025 19:46
@carldebilly carldebilly force-pushed the dev/cdb/hr-OriginalSourceLocation branch from 4d9d40e to 1c45c37 Compare January 30, 2025 19:56
@carldebilly carldebilly enabled auto-merge January 30, 2025 20:44
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19389/index.html

@nventive-devops
Copy link
Contributor

The build 153714 found UI Test snapshots differences: android-28-net8: 24, android-28-net8-Snap: 56, ios: 3, ios-Snap: 52, skia-gtk-screenshots: 63, skia-linux-screenshots: 79, skia-windows-screenshots: 65, wasm: 175, wasm-automated-net9.0-UWP-Default-automated: 1, wasm-automated-net9.0-UWP-RuntimeTests-0: 0, wasm-automated-net9.0-UWP-RuntimeTests-1: 0, wasm-automated-net9.0-UWP-RuntimeTests-2: 0, wasm-automated-net9.0-WinUI-Benchmarks-automated: 0, wasm-automated-net9.0-WinUI-RuntimeTests-0: 0, wasm-automated-net9.0-WinUI-RuntimeTests-1: 0, wasm-automated-net9.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net8: 24 changed over 829

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Button_IsOpacity_Validation_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Button_Opacity_Automated
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • ListView_ListViewWithHeader_InitializesTest_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListViewGrouped
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Popup_PlacementTest_1Default_HSVS_Uno_UI_Samples_Content_UITests_Popup_Popup_HVAlignments
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • NativeCommandBar_Size_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Dynamic
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • NavigateBackAndForthBetweenMenuItemsAndSettings_Fluent_SamplesApp_Samples_Microsoft_UI_Xaml_Controls_NavigationViewTests_FluentStyle_FluentStyle_NavigationViewSample
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
  • android-28-net8-Snap: 56 changed over 1066

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Border_Border_Simple_No_Background_Uno_UI_Samples_UITests_BorderTestsControl_Border_Simple_No_Background
    • Border_OnepxThicknessandRadius_Uno_UI_Samples_UITests_BorderTestsControl_OnepxThicknessandRadius
    • Border_Uniform_Thickness_and_Large_Radius_Uno_UI_Samples_UITests_BorderTestsControl_Uniform_Thickness_and_Large_Radius
    • Animations_DoubleAnimationUsingKeyFrames_TranslateX_GenericApp_Views_Content_UITests_Animations_DoubleAnimationUsingKeyFrames_TranslateX
    • Animations_UITests_Shared_Windows_UI_Xaml_Media_Animation_SetTargetProperty_UITests_Shared_Windows_UI_Xaml_Media_Animation_SetTargetProperty
    • Border_NonUniformThicknessandRadius_Uno_UI_Samples_UITests_BorderTestsControl_NonUniformThicknessandRadius
    • Buttons_UITests_Microsoft_UI_Xaml_Controls_RadioButtonsTests_RadioButtonsPage_UITests_Microsoft_UI_Xaml_Controls_RadioButtonsTests_RadioButtonsPage
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • TabView_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage
    • ItemsRepeater_UITests_Windows_UI_Xaml_Controls_Repeater_UniformGridLayout_Simple_UITests_Windows_UI_Xaml_Controls_Repeater_UniformGridLayout_Simple
    • Border_Border_CornerRadius_Clipping_UITests_Windows_UI_Xaml_Controls_BorderTests_Border_CornerRadius_Clipping
    • Border_OnepxThicknessandRadiusAndTextBlock_Uno_UI_Samples_UITests_BorderTestsControl_OnepxThicknessandRadiusAndTextBlock
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • Animations_DoubleAnimation_Cumulative_Uno_UI_Samples_Content_UITests_Animations_DoubleAnimation_Cumulative
    • Animations_UITests_Windows_UI_Xaml_Media_Animation_ColorAnimation_Background_UITests_Windows_UI_Xaml_Media_Animation_ColorAnimation_Background
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavOnlyPage_MUXControlsTestApp_NavigationViewTopNavOnlyPage
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
    • Border_Simple_with_Radius_Uno_UI_Samples_UITests_BorderTestsControl_Simple_with_Radius
  • ios: 3 changed over 267

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
  • ios-Snap: 52 changed over 1057

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_ImageBrushLocalAsset_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushLocalAsset
    • ListView_ListView_Image_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Image
    • Image_Image_ImageSource_PixelSize_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_ImageSource_PixelSize
    • MUX_MUXControlsTestApp_DropDownButtonPage_MUXControlsTestApp_DropDownButtonPage
    • Brushes_ImageBrushStretch2_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch2
    • ContentPresenter_ContentPresenter_Background_Uno_UI_Samples_Content_UITests_ContentPresenter_ContentPresenter_Background
    • Icons_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground
    • ListView_ListViewHeaderImage_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewHeaderImage
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • TextBlock_TextBlock_FixedWidth_With_DataBound_Run_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run
    • TextBox_Input_InputScope_PhoneNumber_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_InputScope_PhoneNumber
    • Brushes_EllipsemaskingEllipseGrid_Uno_UI_Samples_UITests_ImageBrushTestControl_EllipsemaskingEllipseGrid
    • Brushes_ImageBrushStretch_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch
    • Brushes_UITests_Windows_UI_Xaml_Media_BrushesTests_RevealBrush_Fallback_UITests_Windows_UI_Xaml_Media_BrushesTests_RevealBrush_Fallback
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Vertical
    • Brushes_ImageBrushWithScaleTransform_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushWithScaleTransform
    • Brushes_UITests_Shared_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_SameWithDelay_UITests_Shared_Windows_UI_Xaml_Media_ImageBrushTests_ImageBrush_SameWithDelay
    • Brushes_PathImageBrushfill_Uno_UI_Samples_UITests_ImageBrushTestControl_PathImageBrushfill
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • ColorPicker_ColorPickerSample_UITests_Microsoft_UI_Xaml_Controls_ColorPickerTests_ColorPickerSample
  • skia-gtk-screenshots: 63 changed over 2236

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • ListView_ObservableCollection_Unused_Space.png-dark
    • ListView_ObservableCollection_Unused_Space.png
    • RepeatButton_Automated.png-dark
    • RepeatButton_Automated.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • SwipeControlPage2.png-dark
    • SwipeControlPage2.png
    • ContentPresenter_NativeEmbedding.png-dark
    • BorderImageBrush.png-dark
    • BorderImageBrush.png
    • ContentPresenter_NativeEmbedding.png
    • Focus_FocusVisual_Properties.png-dark
    • Examples.png
    • Native.png-dark
  • skia-linux-screenshots: 79 changed over 2236

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ClipboardTests.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • DragDrop_TestPage.png-dark
    • DragDrop_TestPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • Image_UseTargetSize.png-dark
    • Image_UseTargetSize.png
    • ButtonClippingTestsControl.png-dark
    • BorderImageBrushRelativeTransform.png
    • CompositionEffectBrush.png-dark
  • skia-windows-screenshots: 65 changed over 2236

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • BorderImageBrush.png-dark
    • CompositionPath.png-dark
    • CompositionPath.png
    • ClipboardTests.png
    • ButtonClippingTestsControl.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Examples.png
    • ImageBrush_SameWithDelay.png-dark
    • ImageBrush_SameWithDelay.png
    • BorderImageBrush.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png
  • wasm: 175 changed over 1042

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUXControlsTestApp.NavigationViewMenuItemStretchPage
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_Static
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ComboBox.ComboBox_DropDownWidth
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewGrouped_ItemContainerStyleSelector
    • SamplesApp.Windows_UI_Xaml_Controls.ToggleSwitchControl.Native_ToggleSwitch_IsOn
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.PathTime
    • UITests.Microsoft_UI_Xaml_Controls.TabViewTests.TabViewBasicPage
    • UITests.Microsoft_UI_Xaml_Controls.TabViewTests.TabViewItemsSourceTests
    • UITests.Shared.Wasm.Wasm_CustomEvent
    • UITests.Shared.Windows_ApplicationModel.Calls.PhoneCallHistoryEntryReaderTests
    • UITests.Shared.Windows_UI_Xaml_Controls.Flyout.Flyout_Unloaded
    • UITests.Shared.Windows_UI_Xaml_Media.Transform.List_With_Transformed_Ancestor
    • UITests.Shared.Windows_UI_Xaml_Shapes.PathTestsControl.Path_LinearGradientBrush
    • UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_TreeView
    • UITests.Windows_UI_Xaml_Controls.CommandBar.BackButtonImage.CommandBar_Frame
    • UITests.Windows_UI_Xaml_Controls.TimePicker.TimePicker_TimePickerFlyoutStyle
    • MUXControlsTestApp.RefreshContainerOnImagePage
    • SamplesApp.Wasm.Windows_UI_Xaml_Media.Transform.Border_With_RotateTransform
    • UITests.Windows_UI_Xaml_Controls.CommandBar.BackButtonTitle.CommandBar_Frame
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_VerticalAlignment
  • wasm-automated-net9.0-UWP-Default-automated: 1 changed over 23

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
  • wasm-automated-net9.0-UWP-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-2: 0 changed over 1

  • wasm-automated-net9.0-WinUI-Benchmarks-automated: 0 changed over 1

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

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

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

@jeromelaban jeromelaban disabled auto-merge January 31, 2025 12:31
@jeromelaban jeromelaban merged commit 6694a4d into master Jan 31, 2025
114 checks passed
@jeromelaban jeromelaban deleted the dev/cdb/hr-OriginalSourceLocation branch January 31, 2025 12:32
@jeromelaban
Copy link
Member

@Mergifyio backport release/stable/5.6

Copy link
Contributor

mergify bot commented Jan 31, 2025

backport release/stable/5.6

✅ Backports have been created

jeromelaban added a commit that referenced this pull request Jan 31, 2025
…5.6/pr-19389

fix: Make sure to generate OriginalSourceLocation property on DataTemplates (backport #19389)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-generation Categorizes an issue or PR as relevant to code generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants