Skip to content

Commit 78b229e

Browse files
authored
Code Quality: Improved tooltip UX in BreadcrumbBar (#17277)
1 parent 6b3b112 commit 78b229e

File tree

12 files changed

+32
-9
lines changed

12 files changed

+32
-9
lines changed

src/Files.App.Controls/BreadcrumbBar/BreadcrumbBar.Properties.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ public partial class BreadcrumbBar : Control
2121

2222
[GeneratedDependencyProperty]
2323
public partial string? RootItemToolTip { get; set; }
24+
25+
[GeneratedDependencyProperty]
26+
public partial string? RootItemChevronToolTip { get; set; }
2427
}
2528
}

src/Files.App.Controls/BreadcrumbBar/BreadcrumbBar.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
x:Name="PART_RootBreadcrumbBarItem"
5757
Grid.Column="0"
5858
Padding="{StaticResource BreadcrumbBarRootItemPadding}"
59+
ChevronToolTip="{TemplateBinding RootItemChevronToolTip}"
5960
CornerRadius="{StaticResource BreadcrumbBarRootItemCornerRadius}"
6061
ItemToolTip="{TemplateBinding RootItemToolTip}">
6162
<ContentPresenter Content="{Binding RootItem, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />

src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarItem.Properties.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public partial class BreadcrumbBarItem
1414
public partial bool IsLastItem { get; set; }
1515

1616
[GeneratedDependencyProperty]
17-
public partial string ItemToolTip { get; set; }
17+
public partial string? ItemToolTip { get; set; }
1818

1919
[GeneratedDependencyProperty]
20-
public partial string ChevronToolTip { get; set; }
20+
public partial string? ChevronToolTip { get; set; }
2121

2222
partial void OnIsEllipsisChanged(bool newValue)
2323
{

src/Files.App.Controls/Omnibar/Omnibar.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
Width="{StaticResource OmnibarModeDefaultClickAreaWidth}"
132132
Height="{StaticResource OmnibarModeDefaultHeight}"
133133
Margin="1"
134+
AutomationProperties.AccessibilityView="Content"
135+
AutomationProperties.Name="{Binding ModeName, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
134136
Background="{TemplateBinding Background}"
135137
BorderBrush="{TemplateBinding BorderBrush}"
136138
BorderThickness="0"

src/Files.App/Data/Items/PathBoxItem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ public sealed class PathBoxItem
88
public string? Title { get; set; }
99

1010
public string? Path { get; set; }
11+
12+
public string? ChevronToolTip { get; set; }
1113
}
1214
}

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4256,7 +4256,10 @@
42564256
<value>Show collapsed path breadcrumbs</value>
42574257
</data>
42584258
<data name="BreadcrumbBarChevronButtonToolTip" xml:space="preserve">
4259-
<value>Show child folders</value>
4259+
<value>Show folders in {0}</value>
4260+
</data>
4261+
<data name="BreadcrumbBarRootChevronButtonToolTip" xml:space="preserve">
4262+
<value>Show folders in Home</value>
42604263
</data>
42614264
<data name="NoCommandsFound" xml:space="preserve">
42624265
<value>There are no commands containing {0}</value>

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
ItemDropDownFlyoutClosed="BreadcrumbBar_ItemDropDownFlyoutClosed"
252252
ItemDropDownFlyoutOpening="BreadcrumbBar_ItemDropDownFlyoutOpening"
253253
ItemsSource="{x:Bind ViewModel.PathComponents, Mode=OneWay}"
254+
RootItemChevronToolTip="{helpers:ResourceString Name=BreadcrumbBarRootChevronButtonToolTip}"
254255
RootItemToolTip="{helpers:ResourceString Name=Home}">
255256
<controls:BreadcrumbBar.RootItem>
256257
<Image
@@ -264,7 +265,7 @@
264265
AllowDrop="True"
265266
AutomationProperties.AccessibilityView="Content"
266267
AutomationProperties.Name="{x:Bind Title, Mode=OneWay}"
267-
ChevronToolTip="{helpers:ResourceString Name=BreadcrumbBarChevronButtonToolTip}"
268+
ChevronToolTip="{x:Bind ChevronToolTip, Mode=OneWay}"
268269
Content="{x:Bind Title, Mode=OneWay}"
269270
DataContext="{x:Bind}"
270271
DragLeave="BreadcrumbBarItem_DragLeave"

src/Files.App/Utils/Storage/Helpers/StorageFileExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ public static async Task<List<PathBoxItem>> GetDirectoryPathComponentsWithDispla
152152
if (!string.IsNullOrEmpty(folder?.DisplayName))
153153
item.Title = folder.DisplayName;
154154
}
155+
156+
item.ChevronToolTip = string.Format(Strings.BreadcrumbBarChevronButtonToolTip.GetLocalizedResource(), item.Title);
155157
}
156158

157159
return pathBoxItems;
@@ -321,7 +323,8 @@ private static PathBoxItem GetPathItem(string component, string path)
321323
return new PathBoxItem()
322324
{
323325
Title = title,
324-
Path = path
326+
Path = path,
327+
ChevronToolTip = string.Format(Strings.BreadcrumbBarChevronButtonToolTip.GetLocalizedResource(), title),
325328
};
326329
}
327330

src/Files.App/Views/HomePage.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
6969
{
7070
Title = componentLabel,
7171
Path = tag,
72+
ChevronToolTip = string.Format(Strings.BreadcrumbBarChevronButtonToolTip.GetLocalizedResource(), componentLabel),
7273
};
7374

7475
AppInstance.ToolbarViewModel.PathComponents.Add(item);

src/Files.App/Views/ReleaseNotesPage.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
6868
{
6969
Title = componentLabel,
7070
Path = tag,
71+
ChevronToolTip = string.Format(Strings.BreadcrumbBarChevronButtonToolTip.GetLocalizedResource(), componentLabel),
7172
};
7273

7374
AppInstance.ToolbarViewModel.PathComponents.Add(item);

0 commit comments

Comments
 (0)