Repository: microsoft/terminal (language: cpp)

Issue:
SUI Breadcrumbs should have better keyboard navigation
### Windows Terminal version

1.13.10321.0

### Windows build number

22548.1002

### Other Software

None

### Steps to reproduce

(Part 1)
1. Open Settings UI
2. Go to a profile page
3. Press <kbd>Tab</kbd> repeatedly

(Part 2)
4. From a profile page, now open "Advanced" or "Appearance"
5. Press <kbd>Tab</kbd> repeatedly

### Expected Behavior

The right-most breadcrumb should not be a tab stop or invokable (or if it is invoked, it shouldn't do anything)

### Actual Behavior

Invoking "Advanced" or "Appearance" takes you back to the main profile page. 

### Additional Information
There's a chance that this (or some of this) should be filed on XAML. The goal here is to match what the settings app does.


Discussion / hints:

Fix patch:
diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.cpp b/src/cascadia/TerminalSettingsEditor/MainPage.cpp
index 3d5f00f1807..e456afdc277 100644
--- a/src/cascadia/TerminalSettingsEditor/MainPage.cpp
+++ b/src/cascadia/TerminalSettingsEditor/MainPage.cpp
@@ -476,15 +476,18 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
 
     void MainPage::BreadcrumbBar_ItemClicked(Microsoft::UI::Xaml::Controls::BreadcrumbBar const& /*sender*/, Microsoft::UI::Xaml::Controls::BreadcrumbBarItemClickedEventArgs const& args)
     {
-        const auto tag = args.Item().as<Breadcrumb>()->Tag();
-        const auto subPage = args.Item().as<Breadcrumb>()->SubPage();
-        if (const auto profileViewModel = tag.try_as<ProfileViewModel>())
+        if (gsl::narrow_cast<uint32_t>(args.Index()) < (_breadcrumbs.Size() - 1))
         {
-            _Navigate(*profileViewModel, subPage);
-        }
-        else
-        {
-            _Navigate(tag.as<hstring>(), subPage);
+            const auto tag = args.Item().as<Breadcrumb>()->Tag();
+            const auto subPage = args.Item().as<Breadcrumb>()->SubPage();
+            if (const auto profileViewModel = tag.try_as<ProfileViewModel>())
+            {
+                _Navigate(*profileViewModel, subPage);
+            }
+            else
+            {
+                _Navigate(tag.as<hstring>(), subPage);
+            }
         }
     }
 


Test patch: