8000 Polish peek view for inline reviews by donokuda · Pull Request #1080 · github/VisualStudio · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Polish peek view for inline reviews #1080

Merged
merged 69 commits into from
Aug 8, 2017
Merged

Polish peek view for inline reviews #1080

merged 69 commits into from
Aug 8, 2017

Conversation

donokuda
Copy link
Contributor

This pull request starts bringing in support for themes to inline reviews.

Doesn't look 100% great so I'll be following up with some custom color choices in a series of future pull requests. Here's what it looks like so far:

Light

Dark

Blue

donokuda and others added 21 commits July 14, 2017 14:07
This file can contain design time values for any resources that are defined at run time.
It no longer sets the background color explicitly in the glyph factory.
This will be refreshed when the theme changes.
The following application resources will be available:
pack://application:,,,/GitHub.UI;component/SharedDictionary.xaml
pack://application:,,,/GitHub.UI.Reactive;component/SharedDictionary.xaml
pack://application:,,,/GitHub.VisualStudio.UI;component/SharedDictionary.xaml
<Style TargetType="UserControl">
<Style.Triggers>
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add">
<Setter Property="Background" Value="{DynamicResource DiffChangeBackground.Add}" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created 3 new dynamic brushes that will change according the the theme. They're called DiffChangeBackground.Add, DiffChangeBackground.Delete and DiffChangeBackground.None to mirror the DiffChangeType enum.

The old DiffChangeBackground is no longer being set for each glyph. Everything is now done via the DiffChangeType property.

@jcansdale
Copy link
Collaborator

I noticed the arrows won't showing up here:
image

Strange, because they show in your screen grabs. I did merge from master. Maybe something got messed up in the process?


<UserControl.ToolTip>
<ToolTip
Background="{DynamicResource GitHubVsToolWindowBackground}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can now access the GitHub dynamic/themed resources from the glyph XAML files (this wouldn't have worked before). You can see I'm using GitHubVsToolWindowBackground here.

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<SolidColorBrush x:Key="DiffChangeBackground.Add" Color="Green" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want any resources to show up in the designer, you can add there here.

You can see below, I'm also adding the 3 SharedDictionary.xaml files. At the moment this is only needed for the Show/AddInlineCommentGlyph.xaml files (because they're added by BrushesManager.cs rather then an explicit MergedDictionaries element in each XAML file).

@donokuda
Copy link
Contributor Author

Strange, because they show in your screen grabs. I did merge from master. Maybe something got messed up in the process?

🤔 Hmm, that is strange.. I'll take a lookie loo at this.

@donokuda
Copy link
Contributor Author
donokuda commented Jul 21, 2017

Hmm, not running into that problem here...

(EDIT: Although the timestamp color needs fixing)

image

@shana
Copy link
Contributor
shana commented Aug 4, 2017

@donokuda master merged in. this is how it looks to me right now:

image

@donokuda
Copy link
Contributor Author
donokuda commented Aug 4, 2017

@shana Thank you! 🙇

Looks like there's some styling stuff I need to fix but it should be pretty straightforward

Or at least more straightforward than me attempting to fix merge conflicts 😄

@grokys
Copy link
Contributor
grokys commented Aug 7, 2017

Just taking a look at this now: looks great in general, a few things though:

  • The white background to the peek view doesn't look great on the blue theme. Could we use the gray that the light theme uses?
  • On the light theme, the text box background is the same gray as the background and so the text box looks disabled
  • I think we still need some visual indication of where you can leave comments. There's a gray background on lines that were add/removed but IMO it would be better if that were removed and used for lines that can't be commented on

 Conflicts:
	src/GitHub.InlineReviews/Views/InlineCommentPeekView.xaml
@grokys
Copy link
Contributor
grokys commented Aug 7, 2017

@donokuda merged master which now includes #1112 for allowing for the peek view to auto-size to its content.

@donokuda
Copy link
Contributor Author
donokuda commented Aug 7, 2017
  • The white background to the peek view doesn't look great on the blue theme. Could we use the gray that the light theme uses?
  • On the light theme, the text box background is the same gray as the background and so the text box looks disabled

Good calls on both. For the textbox, I updated to use the searchbox background color that VS provides us. Here's what the peek view looks like right now:

@donokuda
Copy link
Contributor Author
donokuda commented Aug 7, 2017

I think we still need some visual indication of where you can leave comments. There's a gray background on lines that were add/removed but IMO it would be better if that were removed and used for lines that can't be commented on

Updated the margins:

@donokuda
Copy link
Contributor Author
donokuda commented Aug 7, 2017

Updated codeblock styles:

image

image

image

@grokys @jcansdale I think this is ready for another review. This branch now has better support for themes and fixes up the peek view so that the experience is better than it was before (by removing and reduce the sizes of some elements.)

Copy link
Contributor
@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments on possibly unneeded code. Also do you think we could afford a little bit of vertical space between the inline comment header and body? They look just too close together now:

image

<Border Background="{DynamicResource GitHubGlyphMarginCommentableBackground}" BorderThickness="0,0,1,0" />
<Viewbox x:Name="AddViewbox" Margin="1,1,0,0">
<Canvas Width="14" Height="14">
<Rectangle Width="13" Height="13" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Rectangle needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! The background is being set with a style.


<Canvas.Resources>
<Style TargetType="Rectangle">
<Style.Triggers>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these triggers still used? AFAICS the add glyph is now always the same color?

<Canvas.Resources>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding DiffChangeType}" Value="Add">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, are these triggers needed?

-->

</Grid.Background>
<Border Background="{DynamicResource GitHubPeekViewBackground}" BorderBrush="{DynamicResource GitHubPeekViewBackground}" BorderThickness="0,0,1,0"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to specify a border when the background is the same color?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe not. I'll check on this.

@donokuda
Copy link
Contributor Author
donokuda commented Aug 8, 2017

Here's what I got so far as of 2ba07ba. Good call on giving a little more spacing between the author information and the comment.

image

@donokuda
Copy link
Contributor Author
donokuda commented Aug 8, 2017

@grokys Ready for another 👀

Copy link
Contributor
@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now!

@grokys grokys merged commit 091f4ae into master Aug 8, 2017
@grokys grokys deleted the ui/inline-themes branch August 8, 2017 18:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0