-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NavigationViewItem: Empty tooltip no longer shown #3430
NavigationViewItem: Empty tooltip no longer shown #3430
Conversation
The test if failing on my machine, and with the changes. |
PR branch is up-to-date with master. |
Edit: It was not, it was me not knowing what should expose tooltips. I think that this is a regression with ToolTip service in the latest insider build, other tooltips are also failing on my machine now too. |
@YuliKl do we know about this? |
@chingucoding can you provide an example of your tooltips not working? if this is broken we need to track it down. Is it unique to uwp app? what about the title bar tooltips? |
@chingucoding @StephenLPeters I've updated to the newest 20236 Insider build in my insider VM and checked the XAML Controls Gallery app there. All tooltips seemingly work fine (NavigationView tooltips, titlebar tooltips, tooltips on the XCG's ToolTip page,...). In Windows itself, the shell tooltips appear to work just fine too (small tiles' tooltips in the start menu and Win32 tooltips in the task bar). So the issue @chingucoding is seeing might not be present on every device running the newest insider build and might be caused by some stuff like A/B testing, different device configurations,... |
@chingucoding I assume you have tested the WinUI NavigationView in Left mode with the pane closed? Only in that case (when we just show the "navigation strip") do we currently show tooltips for the NavigationViewItems. When the pane is open, as in your posted gif, we do not show tooltips:
That said, should we consider changing that? I view tooltips as one way to convey information to the user which otherwise might not fit on the screen. Right now, if I set a NavigationViewItem content long enough to not fit into the NavigationView pane, then I only see the tooltip when I close the pane. <muxc:NavigationView>
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem Icon="Home" Content="Quite a long description which should not fit entirely" />
</muxc:NavigationView.MenuItems>
</muxc:NavigationView> We already expose APIs to configure the width of the open pane (for example Another aspect might be a fixed open pane length but due to localization, in some supported app languages we might have translated strings which don't entirely fit into the available space whereas they would (easily) fit in other app languages. So while the open pane length would stay the same across app language changes, the menu item's content width could be increased and suddenly not fit into the available space any longer. Thus, I think we should show tooltips even when not in closed compact mode while using Left navigation. For Top navigation, no menu item content will be cutoff. If the item doesn't fit into the space currently available, it will be moved into the overflow menu which will take enough space to show the entire menu item (icon + content). @StephenLPeters @YuliKl Your thoughts? |
I did in fact not, that tooltip works. So it was just me not knowing when tooltips of NavView show, sorry about that. Still, the test failure remains. Looking at the code, I think the reason why it failed on my machine is that the API test was run on a screen large enough to expand the pane resulting in not showing the tooltip. The CI machines also run through fine as their resolution is HD. Adding |
@chingucoding I think enforcing CI dimensions for API tests makes sense, Lets open a new issue for that. @YuliKl can you weigh in on felix's tooltip question? |
dev/NavigationView/NavigationView_ApiTests/NavigationViewTests.cs
Outdated
Show resolved
Hide resolved
dev/NavigationView/NavigationView_ApiTests/NavigationViewTests.cs
Outdated
Show resolved
Hide resolved
{ | ||
if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5)) | ||
{ | ||
Log.Warning("On RS4 and earlier the test needs to be modified slightly."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only be a placeholder for now. The tooltip implementation changed with RS5+ and I can only test that behavior on my local machine for now. I do not have a VM up and running RS4 and earlier yet. Since I cannot locally test that scenario, I haven't written a test case for it yet, though the implementation used in RS4 and below still exists and I could write a test based on the source code. Testing that would have to rely on the test pipeline then to spot any errors made when writing that test.
Should I go ahead and create a test based on the available implementation?
{ | ||
if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5)) | ||
{ | ||
Log.Warning("On RS4 and earlier the test needs to be modified slightly."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
dev/NavigationView/NavigationView_ApiTests/NavigationViewTests.cs
Outdated
Show resolved
Hide resolved
@YuliKl The Groove music app shows another scenario where showing tooltips even when the pane is open in Left mode is useful: Groove allows the user to create custom playlists (with custom names without name length limitation) so the chosen playlist name might not fit the pane width entirely. A tooltip can be used to show the entire name to the user. I think, alongside the other points I mentioned earlier, that it makes sense to show tooltips by default in Left mode (pane open/closed) so that developers don't have to take care of that. |
@Felix-Dev can you please merge with master ? Thanks! |
Merged with master. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@Felix-Dev I'm trying to find the discussion we had a while back about the dificulties you had with getting VS to recognize the new API test project you added. Do you happen to know where that discussion was? Sorry not really related to this PR at all. |
@StephenLPeters Do you perhaps mean this conversation? |
Hmm, I think so. Thank you! |
🎉 Handy links: |
Description
This PR fixes an issue where an (empty) tooltip was shown for a NavigationViewItem with its content set to the empty string.
Motivation and Context
Fixes #3427
How Has This Been Tested?
Tested visually and added API test.