-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add shield to tab row when elevated #11224
Conversation
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.
Love it! Idk how valid my concern is below, so I'll just approve.
@@ -32,6 +32,7 @@ | |||
<ColumnDefinition Width="Auto" /> | |||
</Grid.ColumnDefinitions> | |||
|
|||
|
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: you can undo changes to this file
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. 😄
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.
Yes plz
// GH#2455 - Make sure to try/catch calls to Application::Current, | ||
// because that _won't_ be an instance of TerminalApp::App in the | ||
// LocalTests | ||
try |
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.
How does this try-catch work with the magic static? If the try fails, is isElevated
permanently stuck as false
?
(Also, is this even a valid concern? Does Application::Current fail often?)
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.
does Application::Current fail often
literally only in the tests, because Application::Current isn't a TerminalApp::App in the tests. With the magic static, we catch the exception as it's getting initialized, return false, and then put false in the static member to store forever
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.
Right now AppLogic just sets a member on itself already when it is created, but also the implementation of IsUserAdmin
doesn't actually rely on any part of AppLogic's state. Would it make sense to then make a free function/static function IsElevated
somewhere else that could just be used directly without multiple layers of caching and indirection? As an optimization that IsElevated
function could store a static member, should you choose to.
If that free function exists somewhere sufficiently up the stack, it could also be used for ApplicationState :)
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.
FWIW there's one of my many branches hanging around that does this. I think it's going to get looped in to #11222 when I bump that next (hopefully today, likely monday tho)
Don't forget to update the docs/schema! |
I think this breaks max and min width in showTabsInTitlebar=false mode. |
CanReorderTabs="True" | ||
IsAddTabButtonVisible="false" | ||
TabWidthMode="Equal"> | ||
<StackPanel Orientation="Horizontal"> |
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.
protip: ignore whitespace for this file
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. Let me know if you want to leave it as it is and I'll approve it.
@@ -32,6 +32,7 @@ | |||
<ColumnDefinition Width="Auto" /> | |||
</Grid.ColumnDefinitions> | |||
|
|||
|
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. 😄
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.
In addition to the comments, the spacing feels a bit cramped to me. cc @cinnamon-msft for design oversight, but in the meantime... I wonder if it should have equal padding on the four sides compared to the tab itself.
I know -- the TabView has its own padding, which means that we need to pad the UAC shield asymmetrically to make up for it
@@ -715,4 +715,7 @@ | |||
<data name="InfoBarDismissButton.Content" xml:space="preserve"> | |||
<value>Don't show again</value> | |||
</data> | |||
<data name="ElevationShield.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve"> | |||
<value>This Terminal window is running as an Administrator</value> |
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.
Wording here feels off... but I cannot figure out why.,
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 Terminal window is running with elevated permissions"?
- "This Terminal window is running in High-IL"
- "This Terminal window is running as Admin"
- "This Terminal window is running elevated"
- "This Terminal window has elevated permissions"
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.
I'm fond of this one.
<value>This Terminal window is running as an Administrator</value> | |
<value>This Terminal window is running as Admin</value> |
@@ -32,6 +32,7 @@ | |||
<ColumnDefinition Width="Auto" /> | |||
</Grid.ColumnDefinitions> | |||
|
|||
|
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.
Yes plz
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.
LES DO DIS
@@ -715,4 +715,7 @@ | |||
<data name="InfoBarDismissButton.Content" xml:space="preserve"> | |||
<value>Don't show again</value> | |||
</data> | |||
<data name="ElevationShield.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve"> | |||
<value>This Terminal window is running as an Administrator</value> |
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.
I'm fond of this one.
<value>This Terminal window is running as an Administrator</value> | |
<value>This Terminal window is running as Admin</value> |
qq, should we make it less "bright"? right now it's the primary text color which is very bright on dark displays; we could tone it down a bit to maybe the |
ez |
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Do tend to agree about the spacing! fix it in post? |
🎉 Handy links: |
Summary of the Pull Request
Adds a visible indicator that a Terminal window is elevated. This icon can be disabled with
"showAdminShield" false
in the global settings.References
PR Checklist
Validation Steps Performed