From 02e5c17cebf0de3e6f6e7a96df23abc802128c00 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Tue, 19 May 2026 15:37:50 -0700 Subject: [PATCH] ensure consistent styling; fix breadcrumbs; add tooltips --- .../TerminalSettingsEditor/MainPage.cpp | 60 +++---------------- .../TerminalSettingsEditor/MainPage.h | 3 +- .../TerminalSettingsEditor/MainPage.xaml | 5 -- .../TerminalSettingsEditor/Profiles.xaml | 15 +++-- .../Resources/en-US/Resources.resw | 8 +++ .../TerminalSettingsEditor/SearchIndex.cpp | 2 +- 6 files changed, 26 insertions(+), 67 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.cpp b/src/cascadia/TerminalSettingsEditor/MainPage.cpp index f137d1799a..28c4a4762d 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.cpp +++ b/src/cascadia/TerminalSettingsEditor/MainPage.cpp @@ -212,18 +212,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // place after we rebuild all the settings. IInspectable destination{ nullptr }; auto subPage = BreadcrumbSubPage::None; - hstring parentNavTag{}; if (const auto size = _breadcrumbs.Size(); size > 0) { const auto& crumb = _breadcrumbs.GetAt(size - 1).as(); destination = crumb->Tag(); subPage = crumb->SubPage(); - // If we were inside the Profiles section, remember that so we can restore - // the "Profiles ›" prefix on the rebuilt navigation. - if (_RootCrumbIsProfilesBreadcrumb()) - { - parentNavTag = hstring{ profilesTag }; - } } _InitializeProfilesList(); @@ -247,7 +240,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // Fall back to the Profiles landing page destination = box_value(profilesTag); subPage = BreadcrumbSubPage::None; - parentNavTag = {}; } } else if (destination.try_as()) @@ -267,11 +259,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation { destination = _menuItemSource.GetAt(0).as().Tag(); subPage = BreadcrumbSubPage::None; - parentNavTag = {}; } } - _Navigate(destination, subPage, {}, parentNavTag); + _Navigate(destination, subPage); _UpdateSearchIndex(); } @@ -423,9 +414,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } else if (_colorSchemesPageVM.CurrentPage() == ColorSchemesSubPage::Base) { - // Preserve the current root context so that "Profiles > Color schemes" still shows the Profiles prefix. - const hstring inheritedParentNavTag = _RootCrumbIsProfilesBreadcrumb() ? hstring{ profilesTag } : hstring{}; - _Navigate(boxedTag, BreadcrumbSubPage::None, {}, inheritedParentNavTag); + _Navigate(boxedTag, BreadcrumbSubPage::None); } } else if (settingName == L"CurrentSchemeName") @@ -510,10 +499,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // a view model object (i.e. ProfileViewModel, ColorSchemeViewModel, etc.) for dynamic pages // - subPage: the sub page to navigate to, used for pages that have multiple sub pages (i.e. Profile > Appearance/Terminal/Advanced) // - elementToFocus: the name of the element to focus on the target page - // - parentNavTag: optional nav tag of the parent page when this navigation is invoked from inside another - // landing page. Used by the Profiles landing page to keep itself selected and to prepend a - // "Profiles" breadcrumb when entering Color schemes / a profile / Defaults / Add Profile from there. - void MainPage::_Navigate(const IInspectable& vm, BreadcrumbSubPage subPage, hstring elementToFocus, const hstring& parentNavTag) + void MainPage::_Navigate(const IInspectable& vm, BreadcrumbSubPage subPage, hstring elementToFocus) { _PreNavigateHelper(); @@ -627,13 +613,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } else if (*clickedItemTag == colorSchemesTag) { - // Color Schemes page is accessible from root level and within Profiles, - // so we need to prepend the root crumb in the second case. - if (parentNavTag == profilesTag) - { - _AppendProfilesRootCrumb(); - selectedNavTag = profilesTag; - } + _AppendProfilesRootCrumb(); + selectedNavTag = profilesTag; _breadcrumbs.Append(winrt::make(vm, RS_(L"Nav_ColorSchemes/Content"), BreadcrumbSubPage::None)); contentFrame().Navigate(xaml_typename(), winrt::make(_colorSchemesPageVM, *this, elementToFocus)); @@ -694,17 +675,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // Suppress the handler to avoid double-navigation _colorSchemesPageViewModelChangedRevoker.revoke(); - // Color Schemes page is accessible from within Profiles and root level, - // so we need to prepend the root crumb in the first case. - if (parentNavTag == profilesTag) - { - _AppendProfilesRootCrumb(); - selectedNavTag = profilesTag; - } - else - { - selectedNavTag = colorSchemesTag; - } + _AppendProfilesRootCrumb(); + selectedNavTag = profilesTag; _breadcrumbs.Append(winrt::make(boxedColorSchemesTag, RS_(L"Nav_ColorSchemes/Content"), BreadcrumbSubPage::None)); @@ -849,11 +821,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation if (gsl::narrow_cast(args.Index()) < (_breadcrumbs.Size() - 1)) { const auto crumb = args.Item().as(); - // If the breadcrumb chain is rooted at the Profiles landing page, preserve - // that context so navigating to sub pages (i.e. Color schemes) via a back-breadcrumb - // keeps the "Profiles ›" prefix. - const hstring parentNavTag = _RootCrumbIsProfilesBreadcrumb() ? hstring{ profilesTag } : hstring{}; - _Navigate(crumb->Tag(), crumb->SubPage(), {}, parentNavTag); + _Navigate(crumb->Tag(), crumb->SubPage()); } } @@ -998,16 +966,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _breadcrumbs.Append(winrt::make(box_value(profilesTag), RS_(L"Nav_Profiles/Content"), BreadcrumbSubPage::None)); } - bool MainPage::_RootCrumbIsProfilesBreadcrumb() const - { - if (_breadcrumbs.Size() == 0) - { - return false; - } - const auto rootTag = _breadcrumbs.GetAt(0).as()->Tag().try_as(); - return rootTag && *rootTag == profilesTag; - } - void MainPage::_SelectNavItemByTag(std::wstring_view tag) { if (!_menuItemSource) @@ -1039,7 +997,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _Navigate(box_value(globalProfileTag)); }); _profilesPageVM.OpenColorSchemesRequested([this](const auto&, const auto&) { - _Navigate(box_value(colorSchemesTag), {}, {}, hstring{ profilesTag }); + _Navigate(box_value(colorSchemesTag)); }); _profilesPageVM.AddProfileRequested([this](const auto&, const auto&) { _Navigate(box_value(addProfileTag)); diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.h b/src/cascadia/TerminalSettingsEditor/MainPage.h index dd4d53cc7f..18aecadab5 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.h +++ b/src/cascadia/TerminalSettingsEditor/MainPage.h @@ -95,13 +95,12 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void _NavigateToProfileSubPage(const Editor::ProfileViewModel& profile, ProfileSubPage page, const IInspectable& breadcrumbTag, const hstring& elementToFocus); void _PreNavigateHelper(); - void _Navigate(const IInspectable& vm, BreadcrumbSubPage subPage = BreadcrumbSubPage::None, hstring elementToFocus = {}, const hstring& parentNavTag = {}); + void _Navigate(const IInspectable& vm, BreadcrumbSubPage subPage = BreadcrumbSubPage::None, hstring elementToFocus = {}); void _NavigateToProfileHandler(const IInspectable& sender, winrt::guid profileGuid); void _NavigateToColorSchemeHandler(const IInspectable& sender, const IInspectable& args); Editor::ProfileViewModel _FindProfileViewModelByGuid(winrt::guid profileGuid) const; void _AppendProfilesRootCrumb(); - bool _RootCrumbIsProfilesBreadcrumb() const; void _SelectNavItemByTag(std::wstring_view tag); void _UpdateBackgroundForMica(); diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.xaml b/src/cascadia/TerminalSettingsEditor/MainPage.xaml index 8e80e530f3..08ff008dec 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.xaml +++ b/src/cascadia/TerminalSettingsEditor/MainPage.xaml @@ -162,11 +162,6 @@ x:Uid="Nav_Appearance" Tag="GlobalAppearance_Nav" /> - - - diff --git a/src/cascadia/TerminalSettingsEditor/Profiles.xaml b/src/cascadia/TerminalSettingsEditor/Profiles.xaml index 54b3fd5f28..73fe3f97bf 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles.xaml +++ b/src/cascadia/TerminalSettingsEditor/Profiles.xaml @@ -39,10 +39,10 @@ IsTabStop="False" /> - @@ -52,7 +52,8 @@ Glyph="" /> - @@ -80,8 +81,7 @@ Click="Defaults_Click" Style="{StaticResource NavigatorButtonStyle}"> - + - + - + diff --git a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw index 44a37a5b29..f82c99715e 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw @@ -1101,6 +1101,10 @@ If enabled, the profile will not appear in the list of profiles. This can be used to hide default profiles and dynamically generated profiles, while leaving them in your settings file. A description for what the "hidden" setting does. Presented near "Profile_Hidden". + + Hidden from the dropdown menu + Tooltip shown when hovering the InfoBadge next to a profile name on the Profiles landing page when that profile is hidden from the dropdown menu. + Run this profile as Administrator Header for a control to toggle whether the profile should always open elevated (in an admin window) @@ -2687,6 +2691,10 @@ This automatically-detected profile appears to have been uninstalled. Changes you have made to it are preserved, but it cannot be used until it has been reinstalled. + + Profile is no longer detected + Tooltip shown when hovering the InfoBadge next to a profile name on the Profiles landing page when that profile's source software is no longer installed. + Original Source diff --git a/src/cascadia/TerminalSettingsEditor/SearchIndex.cpp b/src/cascadia/TerminalSettingsEditor/SearchIndex.cpp index 443e58361c..228a6b3a42 100644 --- a/src/cascadia/TerminalSettingsEditor/SearchIndex.cpp +++ b/src/cascadia/TerminalSettingsEditor/SearchIndex.cpp @@ -71,8 +71,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation } else if (const auto colorSchemeVM = runtimeObj.try_as()) { - // No runtimeObjContext: scheme name and generic icon should be enough runtimeObjLabel = colorSchemeVM.Name(); + runtimeObjContext = RS_(L"Nav_ColorSchemes/Content"); } else if (const auto ntmFolderEntryVM = runtimeObj.try_as()) {