Skip to content
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

[File Locksmith] Add infobar when not running as admin #30993

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

HydroH
Copy link
Contributor

@HydroH HydroH commented Jan 17, 2024

Summary of the Pull Request

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copy link
Collaborator

@Jay-o-Way Jay-o-Way left a comment

Choose a reason for hiding this comment

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

Would be extra nice to have a "Restart as admin" button somewhere here :⁠-⁠)

@@ -164,4 +164,7 @@
<value>Administrator: File Locksmith</value>
<comment>Title of the window when running as administrator.</comment>
</data>
<data name="NotRunningAsAdminInfoBar.Message" xml:space="preserve">
<value>Some results might be missing because of insufficient permission. Restart as administrator to see them.</value>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Personal opinion: this is still pretty vague, to me.

Suggested change
<value>Some results might be missing because of insufficient permission. Restart as administrator to see them.</value>
<value>Run [File Locksmith] with admin rights to see more results.</value>

Copy link
Contributor Author

@HydroH HydroH Jan 17, 2024

Choose a reason for hiding this comment

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

This does not contain information about missing results were because of insufficient permissions, maybe make it more clear?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to use the text "Some results might be missing because of insufficient permission." and move the restart as admin button to the infobar as text button "Restart as administrator"?

Copy link
Contributor

@niels9001 niels9001 Jan 29, 2024

Choose a reason for hiding this comment

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

+1 on @htcfreek 's suggestion. This is consistent with the OS and other PT modules.

@htcfreek
Copy link
Collaborator

Would be extra nice to have a "Restart as admin" button somewhere here :⁠-⁠)

It exists in the ui. At the top where the reload button is.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

Thanks for opening the PR.
I've tried running the PR in both Debug and release, but both are crashing for me when trying to start File Locksmith.

@HydroH
Copy link
Contributor Author

HydroH commented Jan 24, 2024

Thanks for opening the PR. I've tried running the PR in both Debug and release, but both are crashing for me when trying to start File Locksmith.

I can replicate this problem when running from a clean build at the first time, but it does not crash in subsequent runs.
Did a couple of tests, crash happens as long as a Infobar is present.
Seems to be related to this issue: microsoft/microsoft-ui-xaml#7143

@jaimecbernardo
Copy link
Collaborator

Thanks for opening the PR. I've tried running the PR in both Debug and release, but both are crashing for me when trying to start File Locksmith.

I can replicate this problem when running from a clean build at the first time, but it does not crash in subsequent runs. Did a couple of tests, crash happens as long as a Infobar is present. Seems to be related to this issue: microsoft/microsoft-ui-xaml#7143

Thank for looking into it.
Seems related, although we're not using the mentioned flags:
IncludeNativeLibrariesForSelfExtract or PublishSingleFile

Definitely can't bring it in if it's causing crashes, though.
Regarding the change itself, can you please share some screenshots? I'm thinking this will look a bit big in the UI.

@HydroH
Copy link
Contributor Author

HydroH commented Jan 26, 2024

Thanks for opening the PR. I've tried running the PR in both Debug and release, but both are crashing for me when trying to start File Locksmith.

I can replicate this problem when running from a clean build at the first time, but it does not crash in subsequent runs. Did a couple of tests, crash happens as long as a Infobar is present. Seems to be related to this issue: microsoft/microsoft-ui-xaml#7143

Thank for looking into it. Seems related, although we're not using the mentioned flags: IncludeNativeLibrariesForSelfExtract or PublishSingleFile

Definitely can't bring it in if it's causing crashes, though. Regarding the change itself, can you please share some screenshots? I'm thinking this will look a bit big in the UI.

This is how it looks currently.
image

Maybe putting the restart as admin button in the infobar would be better?
image

@htcfreek
Copy link
Collaborator

@HydroH
Yes. Please move the button. But then we should use a text instead of a symbol, I think.

@jaimecbernardo jaimecbernardo added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 16, 2024
@HydroH
Copy link
Contributor Author

HydroH commented Feb 17, 2024

@HydroH Yes. Please move the button. But then we should use a text instead of a symbol, I think.

Sorry for responding late, I was on a holiday.
This is what it looks like now.
image

But I think this PR is blocked by the infobar issue at the moment.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 17, 2024
HydroH and others added 2 commits February 17, 2024 17:58
@Jay-o-Way
Copy link
Collaborator

I know it's kinda late, but I think a Popup control might be even better: you can connect it to the existing restart-as-admin button. And it's just as intrusive as an info bar.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

I've given it another test with the latest changes. This is still crashing for me on startup of File Locksmith.
The way I test it is by building an installer and running from the context menu. It also crashes when I run directly from "PowerToys\x64\Release\WinUI3Apps\PowerToys.FileLocksmithUI.exe"
/needinfo

@jaimecbernardo jaimecbernardo added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Team-Response An issue author responded so the team needs to follow up Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants