-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Lightbulb header accessibility when selected/focused #24552
Lightbulb header accessibility when selected/focused #24552
Conversation
24165cf
to
3355db7
Compare
build/config/PublishData.json
Outdated
@@ -23,7 +23,7 @@ | |||
}, | |||
"dev15.7.x-vs-deps": { | |||
"nugetKind": "PerBuildPreRelease", | |||
"version": "2.7.*", | |||
"version": "2.8.*", |
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.
Ignore this. I'll figure out how to get rid of it.
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsui:EnvironmentColors.ControlLinkTextBrushKey}}" /> | ||
<Setter Property="TextDecorations" Value="{x:Null}" /> | ||
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> | ||
<Style.Triggers> |
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.
Some of these may be redundant or useless, but they're a direct port from C# and I didn't want to make even more changes here.
{ | ||
// this completely override existing hyperlink style. | ||
// I couldn't find one that does this for me or change existing style little bit for my purpose. | ||
var style = new Style(typeof(Hyperlink)); |
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 class was only used for the PreviewPane, and it had two problems:
- It cached the colors from the first run of the lightbulb, meaning the colors wouldn't update after a theme change.
- Implementing the DataTriggers you see added in XAML above would have been way harder to write in C#.
For these reasons, they've been ported to XAML.
<Setter Property="TextDecorations" Value="Underline" /> | ||
</Trigger> | ||
<DataTrigger Binding="{Binding Path=ParentElement.IsKeyboardFocusWithin, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type pp:PreviewPane}}}" Value="True"> | ||
<Setter Property="Foreground" Value="{DynamicResource {x:Static vsui:EnvironmentColors.CommandBarTextSelectedBrushKey}}" /> |
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.
Full disclaimer, in the light theme for example, this makes it so these hyperlinks turn black when focused (you have to tab past Preview Changes | Document | Project | Solution to get the focus back up to the top). This is exactly what we want for the High Contrast themes, but sub-optimal for the regular themes. Given the timeline (doing this the right way would require a new ShellColor in the VS repo to be coordinated with this change) and accessibility correctness of this approach, I vote we accept this very minor drawback.
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.
Why does it need a new color, there are no suitable existing colors?
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.
sounds minor indeed, can you please show a screenshot?
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.
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.
Looks ok to me, although I don't understand why you cannot use the same color as "Preview Changes", "Document" etc links in the bottom panel.
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.
it's a little ugly :(
Tagging for review: @dotnet/roslyn-ide @matthejo |
3355db7
to
ca0a8fe
Compare
@@ -77,9 +108,12 @@ | |||
Checked="ExpanderToggleButton_CheckedChanged" Unchecked="ExpanderToggleButton_CheckedChanged"/> | |||
<Border Name="SeverityIconBorder" Height="16" Width="16" Margin="-3,0,0,-2"/> | |||
<TextBlock Name="IdTextBlock" Margin="2,0"> | |||
<Hyperlink Name="IdHyperlink" IsEnabled="False" RequestNavigate="LearnMoreHyperlink_RequestNavigate"/> | |||
<Hyperlink Name="IdHyperlink" |
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.
Trailing whitespace.
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.
LGTM other than the trailing whitespace in the XAML file.
private void PreviewPane_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
ParentElement = Parent as FrameworkElement; | ||
} |
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.
nit: unsubscribe from Loaded?
Feedback addressed and screenshot/gif attached. @dotnet/roslyn-ide |
Approved via Link |
Please retarget this PR to dev15.6.x to get this in that release. |
This also lets the colors change appropriately when the theme is changed.
f1a72f3
to
cff110b
Compare
@dpoeschl It seems you pinged the compiler team for review, but I don't see any compiler changes in this PR. Did you mean some other alias? |
@jcouv -- Hahahaha. I changed the base branch to 15.6.x before I had the correct commits in place, so it pulled in ~120 commits that must have spanned the compiler & interactive parts of the code base. I've removed the requests. :) |
retest ubuntu_16_debug_prtest please |
Two major parts of this change
Customer scenario
A sight-impaired user may have a difficult time navigating to the lightbulb's "CS0248" (or similar) hyperlink in High Contrast themes.
Bugs this fixes
https://devdiv.visualstudio.com/DevDiv/_workitems?id=488229&_a=edit&triage=true
Workarounds, if any
The link is visible before it is selected, so the user can see the link text, then repeatedly hit tab/enter until it navigates (because there are too many tab stops and no indication the link is actually selected).
Risk
The risk is very low. Nothing else builds on this, and it's a simple change. In the very unlikely event a new xaml binding introduced here fails, it won't crash VS or corrupt state (but a color could be wrong).
Performance impact
Basically none. This is a simple xaml change that is only relevant when the lightbulb is opened (on the user action) and when the user tabs through the control (per user action).
Is this a regression from a previous update?
No.
Root cause analysis
Accessibility was not taken into account when the Roslyn part of the lightbulb was built.
How was the bug found?
Work on a related bug uncovered this one. Even though it wasn't filed by accessibility testers or a customer, it is a violation that needs to be fixed.