-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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 display name and icon to SUI extensions page #18633
base: dev/cazamor/sui/extensions-page
Are you sure you want to change the base?
Add display name and icon to SUI extensions page #18633
Conversation
|
||
std::wstring_view PowershellCoreProfileGenerator::GetIcon() const noexcept | ||
{ | ||
return POWERSHELL_ICON; |
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.
|
||
std::wstring_view WslDistroGenerator::GetIcon() const noexcept | ||
{ | ||
return IconPath; |
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.
|
||
std::wstring_view SshHostGenerator::GetIcon() const noexcept | ||
{ | ||
return _getProfileIconPath(); |
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.
Haven't tested this one since the generator is disabled by a feature flag, but I assume it doesn't look to great since I'm resizing. Same question as the others: is there a better resource I can use here?
@@ -28,6 +28,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model | |||
public: | |||
static std::wstring_view Namespace; | |||
std::wstring_view GetNamespace() const noexcept override; | |||
std::wstring_view GetDisplayName() const noexcept override; | |||
std::wstring_view GetIcon() const noexcept override { return {}; }; |
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.
The only icons I found here were one for PowerShell and one for CMD. Can we get a Visual Studio asset for here?
@@ -25,6 +25,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model | |||
{ | |||
public: | |||
std::wstring_view GetNamespace() const noexcept override; | |||
std::wstring_view GetDisplayName() const noexcept override; | |||
std::wstring_view GetIcon() const noexcept override { return {}; }; |
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.
Surprised there's no icon here! Can we get one for Azure Cloud Shell?
<!-- | ||
BODGY | ||
Theoretically, you could use a ContentTemplateSelector directly. However, that doesn't work. | ||
For some reason, we just get the object type's ToString called and the selector gets nullptr as a parameter. | ||
Adding the template as a view model property is a workaround. | ||
--> |
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.
📝 FYI, I spent like most of today figuring out how to work around this. Frustrating 😡
@@ -119,17 +119,19 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | |||
_extensionsVM = *extensionsVMImpl; | |||
_extensionsViewModelChangedRevoker = _extensionsVM.PropertyChanged(winrt::auto_revoke, [=](auto&&, const PropertyChangedEventArgs& args) { | |||
const auto settingName{ args.PropertyName() }; | |||
if (settingName == L"CurrentExtensionSource") |
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.
📝 All the changes in this file are really just because I switched from CurrentExtensionSource
to CurrentExtensionPackage
. Honestly, it's better this way imo. It aligns better with how the New Tab Menu works as well as the other subpages for profiles
@@ -42,7 +42,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | |||
WINRT_OBSERVABLE_PROPERTY(Editor::NewTabMenuViewModel, ViewModel, _PropertyChangedHandlers, nullptr); | |||
|
|||
private: | |||
Editor::NewTabMenuEntryTemplateSelector _entryTemplateSelector{ nullptr }; |
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.
📝Drive by. We weren't using it at all.
CC @nguyen-dows and @DHowett for some of the questions above. Y'all may know where I can find some of these assets |
ec88b32
to
7cdbb7c
Compare
f780523
to
cb04e7f
Compare
Summary of the Pull Request
Adds some polish to the Extensions page in the Settings UI. This includes:
References and Relevant Issues
Targets #18559
Detailed Description of the Pull Request / Additional comments
DisplayName
andIcon
toIDynamicProfileGenerator
DisplayName
andIcon
from app extensions and use themExtensionPackage
is a new WinRT class to package a bunch ofFragmentSettings
togetherExtensionPackage
s rather than dynamically adding/removingFragmentSetting
s contentsCurrentExtensionSource
withCurrentExtensionPackage
ExtensionPackageTemplateSelector
is used to displayExtensionPackage
s with metadata vs simple ones that just have a sourceValidation
✅ Keyboard navigation feels right
✅ Screen reader reads all info on screen properly
✅ Accessibility Insights FastPass found no issues
✅ "Discard changes" retains subpage, but removes any changes