Add UI checkbox for url configuration #20231
Open
vididvidid wants to merge 2 commits into
Open
Conversation
|
|
||
| // Get the checkbox and make it visible for unsafe URL warnings only | ||
| const auto stackPanel = unopenedUriDialog.Content().as<StackPanel>(); | ||
| const auto checkbox = stackPanel.Children().GetAt(1).as<CheckBox>(); |
Contributor
There was a problem hiding this comment.
I never used WinUI (I know WPF though), but isn't there a way to retrieve the checkbox by name? GetAt(1) seems too fragile.
(I didn't look for it, sorry, I just took a quick look at the PR since I'm AFK)
Contributor
Author
There was a problem hiding this comment.
Thank you sir for the review. You are completely right, GetAt(1) is too fragile. I've updated the XAML and the cpp file to use the name directly now. Please let me know if there is anything else I should adjust.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This PR adds a checkbox to the unsafe URL warning dialog that allows users to easily trust a link. When a user checks the box and clicks "Open anyway", the URL scheme is automatically saved to the
safeUriSchemeslist in theirsettings.json.References and Relevant Issues
safeUriSchemessetting #20207 (which added the backendsafeUriSchemeslogic).Detailed Description of the Pull Request / Additional Comments
The backend for this feature was successfully added in #20207, but it lacked a user interface. This PR connects the UI to that backend logic.
Files Modified
TerminalPage.xamlUriErrorDialogusing aStackPanel.TerminalPage.cpp_settings.GlobalSettings().SafeUriSchemes()if the checkbox is checked.Resources.resw(en-US)compress_by_compress10mb.mp4
Validation Steps Performed
vscode://hyperlink in the terminal using an OSC 8 escape sequence."vscode"was automatically written to thesafeUriSchemesarray insettings.json.vscode://link a second time and verified that the warning dialog was completely bypassed.PR Checklist