Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*/)
Expand Down
28 changes: 27 additions & 1 deletion src/cascadia/TerminalSettingsEditor/AddProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,27 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void AddProfile::OnNavigatedTo(const NavigationEventArgs& e)
{
_State = e.Parameter().as<Editor::AddProfilePageNavigationState>();

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();
}

Expand All @@ -42,7 +58,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
if (const auto selected = Profiles().SelectedItem())
{
_State.RequestDuplicate(selected.try_as<Model::Profile>().Guid());
const auto selectedProfile = selected.as<Model::Profile>();
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());
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/cascadia/TerminalSettingsEditor/ColorSchemes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*/)
Expand Down
22 changes: 22 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,25 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

void CompatibilityViewModel::ResetApplicationState()
{
TraceLoggingWrite(
g_hTerminalSettingsEditorProvider,
"ResetApplicationState",
TraceLoggingDescription("Event emitted when the user resets their application state"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));

_settings.ResetApplicationState();
}

void CompatibilityViewModel::ResetToDefaultSettings()
{
TraceLoggingWrite(
g_hTerminalSettingsEditorProvider,
"ResetToDefaultSettings",
TraceLoggingDescription("Event emitted when the user resets their settings to their default value"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));

_settings.ResetToDefaultSettings();
}

Expand All @@ -41,6 +55,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void Compatibility::OnNavigatedTo(const NavigationEventArgs& e)
{
_ViewModel = e.Parameter().as<Editor::CompatibilityViewModel>();

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));
}

void Compatibility::ResetApplicationStateButton_Click(const Windows::Foundation::IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*e*/)
Expand Down
12 changes: 11 additions & 1 deletion src/cascadia/TerminalSettingsEditor/EditColorScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
_ViewModel = e.Parameter().as<Editor::ColorSchemeViewModel>();

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,
Expand Down
36 changes: 32 additions & 4 deletions src/cascadia/TerminalSettingsEditor/Extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ using namespace winrt::Windows::UI::Xaml::Navigation;

namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
static constexpr std::wstring_view ExtensionPageId{ L"page.extensions" };

Extensions::Extensions()
{
InitializeComponent();
Expand All @@ -41,6 +39,36 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
vmImpl->ExtensionPackageIdentifierTemplateSelector(_extensionPackageIdentifierTemplateSelector);
vmImpl->LazyLoadExtensions();
vmImpl->MarkAsVisited();

if (vmImpl->IsExtensionView())
{
const auto currentPkgVM = vmImpl->CurrentExtensionPackage();
const auto currentPkg = currentPkgVM.Package();
TraceLoggingWrite(
g_hTerminalSettingsEditorProvider,
"NavigatedToPage",
TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"),
TraceLoggingValue("extensions.extensionView", "PageId", "The identifier of the page that was navigated to"),
TraceLoggingValue(currentPkg.Source().c_str(), "FragmentSource", "The source of the fragment included in this extension package"),
TraceLoggingValue(currentPkgVM.FragmentExtensions().Size(), "FragmentCount", "The number of fragments included in this extension package"),
TraceLoggingValue(currentPkgVM.Enabled(), "Enabled", "The enabled status of the extension"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}
else
{
TraceLoggingWrite(
g_hTerminalSettingsEditorProvider,
"NavigatedToPage",
TraceLoggingDescription("Event emitted when the user navigates to a page in the settings UI"),
TraceLoggingValue("extensions", "PageId", "The identifier of the page that was navigated to"),
TraceLoggingValue(vmImpl->ExtensionPackages().Size(), "ExtensionPackageCount", "The number of extension packages displayed"),
TraceLoggingValue(vmImpl->ProfilesModified().Size(), "ProfilesModifiedCount", "The number of profiles modified by enabled extensions"),
TraceLoggingValue(vmImpl->ProfilesAdded().Size(), "ProfilesAddedCount", "The number of profiles added by enabled extensions"),
TraceLoggingValue(vmImpl->ColorSchemesAdded().Size(), "ColorSchemesAddedCount", "The number of color schemes added by enabled extensions"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}
}

void Extensions::ExtensionNavigator_Click(const IInspectable& sender, const RoutedEventArgs& /*args*/)
Expand Down Expand Up @@ -338,7 +366,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

bool ExtensionsViewModel::DisplayBadge() const noexcept
{
return !Model::ApplicationState::SharedInstance().BadgeDismissed(ExtensionPageId);
return !Model::ApplicationState::SharedInstance().BadgeDismissed(L"page.extensions");
}

// Returns true if the extension is enabled, false otherwise
Expand Down Expand Up @@ -411,7 +439,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

void ExtensionsViewModel::MarkAsVisited()
{
Model::ApplicationState::SharedInstance().DismissBadge(ExtensionPageId);
Model::ApplicationState::SharedInstance().DismissBadge(L"page.extensions");
_NotifyChanges(L"DisplayBadge");
}

Expand Down
8 changes: 8 additions & 0 deletions src/cascadia/TerminalSettingsEditor/GlobalAppearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void GlobalAppearance::OnNavigatedTo(const NavigationEventArgs& e)
{
_ViewModel = e.Parameter().as<Editor::GlobalAppearanceViewModel>();

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));
}
}
8 changes: 8 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Interaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void Interaction::OnNavigatedTo(const NavigationEventArgs& e)
{
_ViewModel = e.Parameter().as<Editor::InteractionViewModel>();

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));
}
}
8 changes: 8 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Launch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
_ViewModel = e.Parameter().as<Editor::LaunchViewModel>();
auto innerViewModel{ winrt::get_self<Editor::implementation::LaunchViewModel>(_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));
}
}
9 changes: 9 additions & 0 deletions src/cascadia/TerminalSettingsEditor/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
</ItemGroup>
<!-- ========================= Cpp Files ======================== -->
<ItemGroup>
<ClCompile Include="init.cpp" />
<ClCompile Include="Actions.cpp">
<DependentUpon>Actions.xaml</DependentUpon>
</ClCompile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="init.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="Utils.cpp" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/cascadia/TerminalSettingsEditor/NewTabMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void NewTabMenu::OnNavigatedTo(const NavigationEventArgs& e)
{
_ViewModel = e.Parameter().as<Editor::NewTabMenuViewModel>();

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*/)
Expand Down
11 changes: 11 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Profiles_Advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
const auto args = e.Parameter().as<Editor::NavigateToProfileArgs>();
_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<GUID>(_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*/)
Expand Down
23 changes: 23 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Profiles_Appearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GUID>(_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*/)
Expand All @@ -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<GUID>(_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();
}

Expand Down
Loading
Loading