Add some tooltips, and tighten up some phrasing (#555)

* Tags have their tooltip default to their text, if no `ToolTip` is explicitly set
* add a `ctrl+k` tooltip to the more commands button
* change the naming of "indexer" to be "file search" (which is what folks really care about)
* change the naming of "shell commands" to be "Run commands" (again, this is more intuitive)
This commit is contained in:
Mike Griese
2025-03-16 06:08:31 -05:00
committed by GitHub
parent 18ff9d4b99
commit 6d07dba9e2
8 changed files with 12 additions and 9 deletions

View File

@@ -106,7 +106,7 @@ namespace Microsoft.CmdPal.Ext.Shell.Properties {
}
/// <summary>
/// Looks up a localized string similar to Shell.
/// Looks up a localized string similar to Run commands.
/// </summary>
public static string cmd_plugin_name {
get {

View File

@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="cmd_plugin_name" xml:space="preserve">
<value>Shell</value>
<value>Run commands</value>
</data>
<data name="cmd_plugin_description" xml:space="preserve">
<value>Executes commands (e.g. 'ping', 'cmd')</value>

View File

@@ -11,11 +11,13 @@ public partial class TagViewModel(ITag _tag, IPageContext context) : ExtensionOb
{
private readonly ExtensionObject<ITag> _tagModel = new(_tag);
public string ToolTip => string.IsNullOrEmpty(ModelToolTip) ? Text : ModelToolTip;
// Remember - "observable" properties from the model (via PropChanged)
// cannot be marked [ObservableProperty]
public string Text { get; private set; } = string.Empty;
public string ToolTip { get; private set; } = string.Empty;
public string ModelToolTip { get; private set; } = string.Empty;
public OptionalColor Foreground { get; private set; }
@@ -36,7 +38,7 @@ public partial class TagViewModel(ITag _tag, IPageContext context) : ExtensionOb
Text = model.Text;
Foreground = model.Foreground;
Background = model.Background;
ToolTip = model.ToolTip;
ModelToolTip = model.ToolTip;
Icon = new(model.Icon);
Icon.InitializeProperties();

View File

@@ -145,7 +145,7 @@
FontSize="12"
Text="{x:Bind CurrentPageViewModel.Title, Mode=OneWay}"
Visibility="{x:Bind CurrentPageViewModel.IsNested, Mode=OneWay}" />
<!-- TO DO: Replace with ItemsRepeater and bind "Primary commands"? -->
<StackPanel
Grid.Column="2"
HorizontalAlignment="Right"
@@ -230,6 +230,7 @@
Content="{ui:FontIcon Glyph=&#xE712;,
FontSize=16}"
Style="{StaticResource SubtleButtonStyle}"
ToolTipService.ToolTip="Ctrl+k"
Visibility="{x:Bind ViewModel.ShouldShowContextMenu, Mode=OneWay}">
<Button.Flyout>
<Flyout Placement="TopEdgeAlignedRight">

View File

@@ -47,7 +47,6 @@
<!-- https://learn.microsoft.com/windows/apps/design/controls/itemsview#specify-the-look-of-the-items -->
<DataTemplate x:Key="ListItemViewModelTemplate" x:DataType="viewmodels:ListItemViewModel">
<!-- TODO: collapse item if it's empty -->
<Grid Padding="0,12,0,12" ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="28" />
@@ -161,6 +160,5 @@
</controls:Case>
</controls:SwitchPresenter>
</Grid>
</Page>

View File

@@ -14,7 +14,9 @@ public partial class IndexerCommandsProvider : CommandProvider
public IndexerCommandsProvider()
{
Id = "Files";
DisplayName = Resources.IndexerCommandsProvider_DisplayName;
Icon = Icons.FileExplorerSegoe;
}
public override ICommandItem[] TopLevelCommands()

View File

@@ -187,7 +187,7 @@ namespace Microsoft.CmdPal.Ext.Indexer.Properties {
}
/// <summary>
/// Looks up a localized string similar to Indexer file search commands.
/// Looks up a localized string similar to File search.
/// </summary>
internal static string IndexerCommandsProvider_DisplayName {
get {

View File

@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="IndexerCommandsProvider_DisplayName" xml:space="preserve">
<value>Indexer file search commands</value>
<value>File search</value>
</data>
<data name="Indexer_Command_Browse" xml:space="preserve">
<value>Browse</value>