diff --git a/src/cascadia/TerminalSettingsEditor/Actions.cpp b/src/cascadia/TerminalSettingsEditor/Actions.cpp index dafc7b51da..f27d89eb27 100644 --- a/src/cascadia/TerminalSettingsEditor/Actions.cpp +++ b/src/cascadia/TerminalSettingsEditor/Actions.cpp @@ -66,6 +66,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } } }); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("actions", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void Actions::AddNew_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*eventArgs*/) diff --git a/src/cascadia/TerminalSettingsEditor/AddProfile.cpp b/src/cascadia/TerminalSettingsEditor/AddProfile.cpp index bb2156c646..03864e855e 100644 --- a/src/cascadia/TerminalSettingsEditor/AddProfile.cpp +++ b/src/cascadia/TerminalSettingsEditor/AddProfile.cpp @@ -29,11 +29,27 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void AddProfile::OnNavigatedTo(const NavigationEventArgs& e) { _State = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("addProfile", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void AddProfile::AddNewClick(const IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*eventArgs*/) { + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "AddNewProfile", + TraceLoggingDescription("Event emitted when the user adds a new profile"), + TraceLoggingValue("EmptyProfile", "Type", "The type of the creation method (i.e. empty profile, duplicate)"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + _State.RequestAddNew(); } @@ -42,7 +58,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { if (const auto selected = Profiles().SelectedItem()) { - _State.RequestDuplicate(selected.try_as().Guid()); + const auto selectedProfile = selected.as(); + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "AddNewProfile", + TraceLoggingDescription("Event emitted when the user adds a new profile"), + TraceLoggingValue("Duplicate", "Type", "The type of the creation method (i.e. empty profile, duplicate)"), + TraceLoggingValue(!selectedProfile.Source().empty(), "SourceProfileHasSource", "True, if the source profile has a source (i.e. dynamic profile generator namespace, fragment). Otherwise, False, indicating it's based on a custom profile."), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + + _State.RequestDuplicate(selectedProfile.Guid()); } } diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp b/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp index be932d2b90..899cc5f826 100644 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp +++ b/src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp @@ -44,6 +44,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation ColorSchemeListView().Focus(FocusState::Programmatic); }); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("colorSchemes", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void ColorSchemes::AddNew_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) diff --git a/src/cascadia/TerminalSettingsEditor/Compatibility.cpp b/src/cascadia/TerminalSettingsEditor/Compatibility.cpp index e95b17fe13..6c7a202d8e 100644 --- a/src/cascadia/TerminalSettingsEditor/Compatibility.cpp +++ b/src/cascadia/TerminalSettingsEditor/Compatibility.cpp @@ -31,5 +31,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Compatibility::OnNavigatedTo(const NavigationEventArgs& e) { _ViewModel = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("compatibility", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } } diff --git a/src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp b/src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp index ce24a89e48..1c1d5f0c84 100644 --- a/src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp +++ b/src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp @@ -42,7 +42,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { _ViewModel = e.Parameter().as(); - NameBox().Text(_ViewModel.Name()); + const auto schemeName = _ViewModel.Name(); + NameBox().Text(schemeName); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("colorSchemes.editColorScheme", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(schemeName.data(), "SchemeName", "The name of the color scheme that's being edited"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void EditColorScheme::ColorPickerChanged(const IInspectable& sender, diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp index acb0abcb34..2b220b2ddd 100644 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp +++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp @@ -25,5 +25,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void GlobalAppearance::OnNavigatedTo(const NavigationEventArgs& e) { _ViewModel = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("globalAppearance", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } } diff --git a/src/cascadia/TerminalSettingsEditor/Interaction.cpp b/src/cascadia/TerminalSettingsEditor/Interaction.cpp index ed3c55fbda..7f5e9eaf38 100644 --- a/src/cascadia/TerminalSettingsEditor/Interaction.cpp +++ b/src/cascadia/TerminalSettingsEditor/Interaction.cpp @@ -18,5 +18,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Interaction::OnNavigatedTo(const NavigationEventArgs& e) { _ViewModel = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("interaction", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } } diff --git a/src/cascadia/TerminalSettingsEditor/Launch.cpp b/src/cascadia/TerminalSettingsEditor/Launch.cpp index 286ed7c814..9c0a933961 100644 --- a/src/cascadia/TerminalSettingsEditor/Launch.cpp +++ b/src/cascadia/TerminalSettingsEditor/Launch.cpp @@ -43,5 +43,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _ViewModel = e.Parameter().as(); auto innerViewModel{ winrt::get_self(_ViewModel) }; /* coroutine dispatch */ innerViewModel->PrepareStartOnUserLoginSettings(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("startup", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } } diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.cpp b/src/cascadia/TerminalSettingsEditor/MainPage.cpp index ec22d6d356..485c640d3a 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.cpp +++ b/src/cascadia/TerminalSettingsEditor/MainPage.cpp @@ -333,6 +333,15 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation const auto altPressed = WI_IsFlagSet(lAltState, CoreVirtualKeyStates::Down) || WI_IsFlagSet(rAltState, CoreVirtualKeyStates::Down); const auto target = altPressed ? SettingsTarget::DefaultsFile : SettingsTarget::SettingsFile; + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "OpenJson", + TraceLoggingDescription("Event emitted when the user clicks the Open JSON button in the settings UI"), + TraceLoggingValue(target == SettingsTarget::DefaultsFile ? "DefaultsFile" : "SettingsFile", "SettingsTarget", "The target settings file"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + OpenJson.raise(nullptr, target); return; } diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj index 955f58af7c..fe2f8ced6d 100644 --- a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj @@ -227,6 +227,7 @@ + Actions.xaml diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters index 97caa229d1..f49f4c9bc7 100644 --- a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj.filters @@ -9,6 +9,7 @@ + diff --git a/src/cascadia/TerminalSettingsEditor/NewTabMenu.cpp b/src/cascadia/TerminalSettingsEditor/NewTabMenu.cpp index 901b809f34..9c7e7679bd 100644 --- a/src/cascadia/TerminalSettingsEditor/NewTabMenu.cpp +++ b/src/cascadia/TerminalSettingsEditor/NewTabMenu.cpp @@ -46,6 +46,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void NewTabMenu::OnNavigatedTo(const NavigationEventArgs& e) { _ViewModel = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue(_ViewModel.IsFolderView() ? "newTabMenu.folderView" : "newTabMenu", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void NewTabMenu::FolderPickerDialog_Opened(const IInspectable& /*sender*/, const Controls::ContentDialogOpenedEventArgs& /*e*/) diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.cpp index 29b9f89108..64bdecd1d4 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.cpp @@ -29,6 +29,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation const auto args = e.Parameter().as(); _Profile = args.Profile(); _windowRoot = args.WindowRoot(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("profile.advanced", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void Profiles_Advanced::OnNavigatedFrom(const NavigationEventArgs& /*e*/) diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp index cdf1e851ae..2a16978a38 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp @@ -44,6 +44,19 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // The Appearances object handles updating the values in the settings UI, but // we still need to listen to the changes here just to update the preview control _AppearanceViewModelChangedRevoker = _Profile.DefaultAppearance().PropertyChanged(winrt::auto_revoke, { this, &Profiles_Appearance::_onProfilePropertyChanged }); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("profile.appearance", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingValue(_Profile.DefaultAppearance().BackgroundImageSettingsVisible(), "HasBackgroundImage", "If the profile has a background image defined"), + TraceLoggingValue(_Profile.HasUnfocusedAppearance(), "HasUnfocusedAppearance", "If the profile has an unfocused appearance defined"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void Profiles_Appearance::OnNavigatedFrom(const NavigationEventArgs& /*e*/) @@ -54,6 +67,16 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Profiles_Appearance::CreateUnfocusedAppearance_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) { + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "CreateUnfocusedAppearance", + TraceLoggingDescription("Event emitted when the user creates an unfocused appearance for a profile"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + _Profile.CreateUnfocusedAppearance(); } diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp index 476c81e311..f37f405830 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp @@ -55,6 +55,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _Profile.FocusDeleteButton(false); } }); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("profile", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to. Set to {3ad42e7b-e073-5f3e-ac57-1c259ffa86a8} if the profiles.defaults object is being modified."), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void Profiles_Base::OnNavigatedFrom(const NavigationEventArgs& /*e*/) @@ -79,6 +90,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Profiles_Base::DeleteConfirmation_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) { + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "DeleteProfile", + TraceLoggingDescription("Event emitted when the user deletes a profile"), + TraceLoggingValue(to_hstring(_Profile.Guid()).c_str(), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingValue(false, "Orphaned", "Tracks if the profile is orphaned"), + TraceLoggingValue(_Profile.Hidden(), "Hidden", "Tracks if the profile is hidden"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + winrt::get_self(_Profile)->DeleteProfile(); } diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base_Orphaned.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Base_Orphaned.cpp index bc27cc4c2d..dc1de90cb0 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base_Orphaned.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base_Orphaned.cpp @@ -41,6 +41,16 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _Profile.FocusDeleteButton(false); } }); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("profileOrphaned", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void Profiles_Base_Orphaned::DeleteConfirmation_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Terminal.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Terminal.cpp index 7d42d64d21..fd8899dff1 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Terminal.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Terminal.cpp @@ -22,6 +22,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Profiles_Terminal::OnNavigatedTo(const NavigationEventArgs& e) { _Profile = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("profile.terminal", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingValue(_Profile.IsBaseLayer(), "IsProfileDefaults", "If the modified profile is the profile.defaults object"), + TraceLoggingValue(static_cast(_Profile.Guid()), "ProfileGuid", "The guid of the profile that was navigated to"), + TraceLoggingValue(_Profile.Source().c_str(), "ProfileSource", "The source of the profile that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } void Profiles_Terminal::OnNavigatedFrom(const NavigationEventArgs& /*e*/) diff --git a/src/cascadia/TerminalSettingsEditor/Rendering.cpp b/src/cascadia/TerminalSettingsEditor/Rendering.cpp index 5ce0d1285e..836d63ca20 100644 --- a/src/cascadia/TerminalSettingsEditor/Rendering.cpp +++ b/src/cascadia/TerminalSettingsEditor/Rendering.cpp @@ -17,5 +17,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Rendering::OnNavigatedTo(const NavigationEventArgs& e) { _ViewModel = e.Parameter().as(); + + TraceLoggingWrite( + g_hTerminalSettingsEditorProvider, + "NavigatedToPage", + TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"), + TraceLoggingValue("rendering", "PageId", "The identifier of the page that was navigated to"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } } diff --git a/src/cascadia/TerminalSettingsEditor/Utils.cpp b/src/cascadia/TerminalSettingsEditor/Utils.cpp index 5fc2fea999..07fde8471f 100644 --- a/src/cascadia/TerminalSettingsEditor/Utils.cpp +++ b/src/cascadia/TerminalSettingsEditor/Utils.cpp @@ -13,8 +13,6 @@ using namespace winrt::Windows::System; using namespace winrt::Windows::Foundation; using namespace winrt::Windows::UI::Xaml; -UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"Microsoft.Terminal.Settings.Editor/Resources"); - namespace winrt::Microsoft::Terminal::Settings { hstring GetSelectedItemTag(const winrt::Windows::Foundation::IInspectable& comboBoxAsInspectable) diff --git a/src/cascadia/TerminalSettingsEditor/init.cpp b/src/cascadia/TerminalSettingsEditor/init.cpp new file mode 100644 index 0000000000..bf25f63dc0 --- /dev/null +++ b/src/cascadia/TerminalSettingsEditor/init.cpp @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation +// Licensed under the MIT license. + +#include "pch.h" +#include +#include + +// Note: Generate GUID using TlgGuid.exe tool +TRACELOGGING_DEFINE_PROVIDER( + g_hTerminalSettingsEditorProvider, + "Microsoft.Windows.Terminal.Settings.Editor", + // {1b16317d-b594-51f8-c552-5d50572b5efc} + (0x1b16317d, 0xb594, 0x51f8, 0xc5, 0x52, 0x5d, 0x50, 0x57, 0x2b, 0x5e, 0xfc), + TraceLoggingOptionMicrosoftTelemetry()); + +BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD reason, LPVOID /*reserved*/) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hInstDll); + TraceLoggingRegister(g_hTerminalSettingsEditorProvider); + Microsoft::Console::ErrorReporting::EnableFallbackFailureReporting(g_hTerminalSettingsEditorProvider); + break; + case DLL_PROCESS_DETACH: + if (g_hTerminalSettingsEditorProvider) + { + TraceLoggingUnregister(g_hTerminalSettingsEditorProvider); + } + break; + } + + return TRUE; +} + +UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"Microsoft.Terminal.Settings.Editor/Resources"); diff --git a/src/cascadia/TerminalSettingsEditor/pch.h b/src/cascadia/TerminalSettingsEditor/pch.h index d21e5321ef..cc4965ef9a 100644 --- a/src/cascadia/TerminalSettingsEditor/pch.h +++ b/src/cascadia/TerminalSettingsEditor/pch.h @@ -56,6 +56,13 @@ #include #include +// Including TraceLogging essentials for the binary +#include +#include +TRACELOGGING_DECLARE_PROVIDER(g_hTerminalSettingsEditorProvider); +#include +#include + #include #include #include