Repository: microsoft/terminal (language: cpp)

Issue:
Tab context menu entries should have tooltips
This is sometimes needed as a last resort to find some info printed to the screen but unsaved anywhere else. Currently for doing this I had to do manual selection with mouse and then wait for ~1min for it to select all of scrollable viewport (hoping that selection doesn't break since it's quite jumpy), then copy to Notepad, then search.

So either allowing to copy the scrollable viewport into buffer and/or searching it directly can be useful.


Discussion / hints:
You mean something like:
* [`selectAll`](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#select-all-preview), [`copy`](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#copy)
* Alternatively, [`exportBuffer`](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#buffer-exporting)
* Or possibly, [`find`](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#find)

/?
Yes, but making them more discoverable would be good. I've tried right-clicking on the tab (it seems to be doing PasteText in my case), there is no menu.

Only after you posted this, I found a context menu on the tab. Export Text proposed `vadimkantorov@dell_de_vadim: /mnt/c/Users/vadim` which is illegal file name in Windows.

Export Text should have a tooltip that explains what it does. does it export all scrollable viewport? or just current viewport? will it copy to clipboard or to text file?

Ctrl+Shift+P search bar does not find anything by "export" or "select".

Ctrl+Shift+P -> find does the right thing but it's hard to know it exists. Command Palette fast typing also makes for slow rendering, it reacts slower than I type and it's strange. It should not try to re-render the drop-down too fast, better to skip some intermediate searches than re-render and flicker (also it seems a bit slow at rendering, XAML bites again I suppose)
> right-clicking on the tab (it seems to be doing PasteText in my case), there is no menu

That's tracked in #3337 

> Export Text should have a tooltip that explains what it does

Fair - none of those context menu entries have tooltips. Repurposing this issue for that.

> Ctrl+Shift+P search bar does not find anything by "export" or "select".

What version are you on? `selectAll` was added in 1.14, but `exportBuffer` was added to the default actions in https://github.com/microsoft/terminal/pull/12097, which should appear as "Export Buffer" in english.


This issue deals with tooltips explaining a menu item's functionality, whereas issue #13588 dealt with actual text next to the context menu entries to show their associated hotkey, so I'm not sure if it's really a duplicate of this, but I wanted to clarify here the need for hotkey info, preferably as instantly viewable text vs a tooltip that requires hovering to see.
That's what I get for trying to triage on vacation 😅 

Fix patch:
diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw
index 195535985d9..ad685a549c2 100644
--- a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw
+++ b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw
@@ -746,4 +746,40 @@
     <value>Suggestions found: {0}</value>
     <comment>{0} will be replaced with a number.</comment>
   </data>
+  <data name="AboutToolTip" xml:space="preserve">
+    <value>Open a dialog containing product information</value>
+  </data>
+  <data name="ChooseColorToolTip" xml:space="preserve">
+    <value>Open the color picker to choose the color of this tab</value>
+  </data>
+  <data name="CommandPaletteToolTip" xml:space="preserve">
+    <value>Open the command palette</value>
+  </data>
+  <data name="DuplicateTabToolTip" xml:space="preserve">
+    <value>Open a new tab using the active profile in the current directory</value>
+  </data>
+  <data name="ExportTabToolTip" xml:space="preserve">
+    <value>Export the contents of the text buffer into a text file</value>
+  </data>
+  <data name="FindToolTip" xml:space="preserve">
+    <value>Open the search dialog</value>
+  </data>
+  <data name="RenameTabToolTip" xml:space="preserve">
+    <value>Rename this tab</value>
+  </data>
+  <data name="SettingsToolTip" xml:space="preserve">
+    <value>Open the settings page</value>
+  </data>
+  <data name="SplitTabToolTip" xml:space="preserve">
+    <value>Open a new pane using the active profile in the current directory</value>
+  </data>
+  <data name="TabCloseAfterToolTip" xml:space="preserve">
+    <value>Close all tabs to the right of this tab</value>
+  </data>
+  <data name="TabCloseOtherToolTip" xml:space="preserve">
+    <value>Close all tabs except this tab</value>
+  </data>
+  <data name="TabCloseToolTip" xml:space="preserve">
+    <value>Close this tab</value>
+  </data>
 </root>
diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp
index dda15f10bc8..6fd1e365910 100644
--- a/src/cascadia/TerminalApp/TabBase.cpp
+++ b/src/cascadia/TerminalApp/TabBase.cpp
@@ -79,6 +79,10 @@ namespace winrt::TerminalApp::implementation
             }
         });
         _closeTabsAfterMenuItem.Text(RS_(L"TabCloseAfter"));
+        const auto closeTabsAfterToolTip = RS_(L"TabCloseAfterToolTip");
+
+        WUX::Controls::ToolTipService::SetToolTip(_closeTabsAfterMenuItem, box_value(closeTabsAfterToolTip));
+        Automation::AutomationProperties::SetHelpText(_closeTabsAfterMenuItem, closeTabsAfterToolTip);
 
         // Close other tabs
         _closeOtherTabsMenuItem.Click([weakThis](auto&&, auto&&) {
@@ -88,6 +92,10 @@ namespace winrt::TerminalApp::implementation
             }
         });
         _closeOtherTabsMenuItem.Text(RS_(L"TabCloseOther"));
+        const auto closeOtherTabsToolTip = RS_(L"TabCloseOtherToolTip");
+
+        WUX::Controls::ToolTipService::SetToolTip(_closeOtherTabsMenuItem, box_value(closeOtherTabsToolTip));
+        Automation::AutomationProperties::SetHelpText(_closeOtherTabsMenuItem, closeOtherTabsToolTip);
 
         // Close
         Controls::MenuFlyoutItem closeTabMenuItem;
@@ -103,6 +111,10 @@ namespace winrt::TerminalApp::implementation
         });
         closeTabMenuItem.Text(RS_(L"TabClose"));
         closeTabMenuItem.Icon(closeSymbol);
+        const auto closeTabToolTip = RS_(L"TabCloseToolTip");
+
+        WUX::Controls::ToolTipService::SetToolTip(closeTabMenuItem, box_value(closeTabToolTip));
+        Automation::AutomationProperties::SetHelpText(closeTabMenuItem, closeTabToolTip);
 
         // GH#8238 append the close menu items to the flyout itself until crash in XAML is fixed
         //Controls::MenuFlyoutSubItem closeSubMenu;
diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp
index b29b1489c3d..2e6dbf91e9e 100644
--- a/src/cascadia/TerminalApp/TerminalPage.cpp
+++ b/src/cascadia/TerminalApp/TerminalPage.cpp
@@ -923,6 +923,10 @@ namespace winrt::TerminalApp::implementation
                 // Create the settings button.
                 auto settingsItem = WUX::Controls::MenuFlyoutItem{};
                 settingsItem.Text(RS_(L"SettingsMenuItem"));
+                const auto settingsToolTip = RS_(L"SettingsToolTip");
+
+                WUX::Controls::ToolTipService::SetToolTip(settingsItem, box_value(settingsToolTip));
+                Automation::AutomationProperties::SetHelpText(settingsItem, settingsToolTip);
 
                 WUX::Controls::SymbolIcon ico{};
                 ico.Symbol(WUX::Controls::Symbol::Setting);
@@ -940,6 +944,10 @@ namespace winrt::TerminalApp::implementation
                 // Create the command palette button.
                 auto commandPaletteFlyout = WUX::Controls::MenuFlyoutItem{};
                 commandPaletteFlyout.Text(RS_(L"CommandPaletteMenuItem"));
+                const auto commandPaletteToolTip = RS_(L"CommandPaletteToolTip");
+
+                WUX::Controls::ToolTipService::SetToolTip(commandPaletteFlyout, box_value(commandPaletteToolTip));
+                Automation::AutomationProperties::SetHelpText(commandPaletteFlyout, commandPaletteToolTip);
 
                 WUX::Controls::FontIcon commandPaletteIcon{};
                 commandPaletteIcon.Glyph(L"\xE945");
@@ -959,6 +967,10 @@ namespace winrt::TerminalApp::implementation
             // Create the about button.
             auto aboutFlyout = WUX::Controls::MenuFlyoutItem{};
             aboutFlyout.Text(RS_(L"AboutMenuItem"));
+            const auto aboutToolTip = RS_(L"AboutToolTip");
+
+            WUX::Controls::ToolTipService::SetToolTip(aboutFlyout, box_value(aboutToolTip));
+            Automation::AutomationProperties::SetHelpText(aboutFlyout, aboutToolTip);
 
             WUX::Controls::SymbolIcon aboutIcon{};
             aboutIcon.Symbol(WUX::Controls::Symbol::Help);
diff --git a/src/cascadia/TerminalApp/TerminalTab.cpp b/src/cascadia/TerminalApp/TerminalTab.cpp
index 4bac51928bf..292ae7c410f 100644
--- a/src/cascadia/TerminalApp/TerminalTab.cpp
+++ b/src/cascadia/TerminalApp/TerminalTab.cpp
@@ -1230,6 +1230,11 @@ namespace winrt::TerminalApp::implementation
         chooseColorMenuItem.Text(RS_(L"TabColorChoose"));
         chooseColorMenuItem.Icon(colorPickSymbol);
 
+        const auto chooseColorToolTip = RS_(L"ChooseColorToolTip");
+
+        WUX::Controls::ToolTipService::SetToolTip(chooseColorMenuItem, box_value(chooseColorToolTip));
+        Automation::AutomationProperties::SetHelpText(chooseColorMenuItem, chooseColorToolTip);
+
         Controls::MenuFlyoutItem renameTabMenuItem;
         {
             // "Rename Tab"
@@ -1245,6 +1250,11 @@ namespace winrt::TerminalApp::implementation
             });
             renameTabMenuItem.Text(RS_(L"RenameTabText"));
             renameTabMenuItem.Icon(renameTabSymbol);
+
+            const auto renameTabToolTip = RS_(L"RenameTabToolTip");
+
+            WUX::Controls::ToolTipService::SetToolTip(renameTabMenuItem, box_value(renameTabToolTip));
+            Automation::AutomationProperties::SetHelpText(renameTabMenuItem, renameTabToolTip);
         }
 
         Controls::MenuFlyoutItem duplicateTabMenuItem;
@@ -1262,6 +1272,11 @@ namespace winrt::TerminalApp::implementation
             });
             duplicateTabMenuItem.Text(RS_(L"DuplicateTabText"));
             duplicateTabMenuItem.Icon(duplicateTabSymbol);
+
+            const auto duplicateTabToolTip = RS_(L"DuplicateTabToolTip");
+
+            WUX::Controls::ToolTipService::SetToolTip(duplicateTabMenuItem, box_value(duplicateTabToolTip));
+            Automation::AutomationProperties::SetHelpText(duplicateTabMenuItem, duplicateTabToolTip);
         }
 
         Controls::MenuFlyoutItem splitTabMenuItem;
@@ -1279,11 +1294,16 @@ namespace winrt::TerminalApp::implementation
             });
             splitTabMenuItem.Text(RS_(L"SplitTabText"));
             splitTabMenuItem.Icon(splitTabSymbol);
+
+            const auto splitTabToolTip = RS_(L"SplitTabToolTip");
+
+            WUX::Controls::ToolTipService::SetToolTip(splitTabMenuItem, box_value(splitTabToolTip));
+            Automation::AutomationProperties::SetHelpText(splitTabMenuItem, splitTabToolTip);
         }
 
         Controls::MenuFlyoutItem exportTabMenuItem;
         {
-            // "Split Tab"
+            // "Export Tab"
             Controls::FontIcon exportTabSymbol;
             exportTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
             exportTabSymbol.Glyph(L"\xE74E"); // Save
@@ -1296,11 +1316,16 @@ namespace winrt::TerminalApp::implementation
             });
             exportTabMenuItem.Text(RS_(L"ExportTabText"));
             exportTabMenuItem.Icon(exportTabSymbol);
+
+            const auto exportTabToolTip = RS_(L"ExportTabToolTip");
+
+            WUX::Controls::ToolTipService::SetToolTip(exportTabMenuItem, box_value(exportTabToolTip));
+            Automation::AutomationProperties::SetHelpText(exportTabMenuItem, exportTabToolTip);
         }
 
         Controls::MenuFlyoutItem findMenuItem;
         {
-            // "Split Tab"
+            // "Find"
             Controls::FontIcon findSymbol;
             findSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
             findSymbol.Glyph(L"\xF78B"); // SearchMedium
@@ -1313,6 +1338,11 @@ namespace winrt::TerminalApp::implementation
             });
             findMenuItem.Text(RS_(L"FindText"));
             findMenuItem.Icon(findSymbol);
+
+            const auto findToolTip = RS_(L"FindToolTip");
+
+            WUX::Controls::ToolTipService::SetToolTip(findMenuItem, box_value(findToolTip));
+            Automation::AutomationProperties::SetHelpText(findMenuItem, findToolTip);
         }
 
         // Build the menu


Test patch: