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

Introduce IconConverter #7830

Merged
merged 6 commits into from
Oct 8, 2020
Merged

Introduce IconConverter #7830

merged 6 commits into from
Oct 8, 2020

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Oct 5, 2020

Summary of the Pull Request

Introduce the IconPathConverter to TerminalApp. Command and Profile now both return the unexpanded icon path. IconPathConverter is responsible for expanding the icon path and retrieving the appropriate icon source.

This also removes Profile's expanded icon path and uses the IconPathConverter when necessary. This allows users to set profile icons to emoji as well. However, emoji do not appear in the jumplist.

References

Based on #7667

PR Checklist

Validation Steps Performed

Deploy succeeded.

@ghost ghost added Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Oct 5, 2020
@carlos-zamora
Copy link
Member Author

Topics for Discussion

  • Should I move the IconPathConverter to TSM?
    • We'll probably need this for Settings UI.
  • Emoji don't appear in jumplist
    • I didn't look into this one too much. I don't know if it's possible.
    • This'll be a problem if/when we allow actions in the jumplist
    • Could I get some guidance here? Should I open a follow-up issue instead of figuring this out now?
    • I need to update docs/schema saying that you can use emoji as profile icons. But I want this part to be resolved first before doing that.

@DHowett
Copy link
Member

DHowett commented Oct 5, 2020

This is likely the difference between an Icon and an IconSource. I have no idea why there's two.

@DHowett
Copy link
Member

DHowett commented Oct 5, 2020

technically IconPathConverter should live in TSE, but we can't have TerminalApp depending on it from there :|

@@ -168,7 +169,7 @@ HRESULT Jumplist::UpdateJumplist(const CascadiaSettings& settings) noexcept

// Create the shell link object for the profile
winrt::com_ptr<IShellLinkW> shLink;
const auto normalizedIconPath{ _normalizeIconPath(profile.ExpandedIconPath()) };
const auto normalizedIconPath{ _normalizeIconPath(profile.IconPath()) };
Copy link
Member

Choose a reason for hiding this comment

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

this will be hard to get emoji working w./

src/cascadia/TerminalSettingsModel/Profile.idl Outdated Show resolved Hide resolved
@DHowett
Copy link
Member

DHowett commented Oct 5, 2020

Oh, I see. No. Emoji will never work in the jumplist. Sorry.

Base automatically changed from dev/cazamor/set/terminal-settings-model to master October 6, 2020 16:57
@DHowett

This comment has been minimized.

src/cascadia/TerminalApp/IconPathConverter.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/IconPathConverter.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalSettingsModel/Command.cpp Outdated Show resolved Hide resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Oct 6, 2020
@zadjii-msft zadjii-msft self-assigned this Oct 7, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Overall, this is so very much better than it used to be. I suppose this counts as a nit, so :shipit:

src/cascadia/inc/cppwinrt_utils.h Show resolved Hide resolved
@zadjii-msft zadjii-msft removed their assignment Oct 7, 2020
@carlos-zamora
Copy link
Member Author

Verified schema now shows icon as an allowable property in command (bonus points!)

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

well ;P

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 8, 2020
@carlos-zamora carlos-zamora merged commit 4fc607a into master Oct 8, 2020
@carlos-zamora carlos-zamora deleted the dev/cazamor/set/tsm/cmd-icon branch October 8, 2020 18:29
skyline75489 pushed a commit to skyline75489/terminal that referenced this pull request Oct 10, 2020
## Summary of the Pull Request
Introduce the `IconPathConverter` to `TerminalApp`. `Command` and `Profile` now both return the unexpanded icon path. `IconPathConverter` is responsible for expanding the icon path and retrieving the appropriate icon source.

This also removes `Profile`'s expanded icon path and uses the `IconPathConverter` when necessary. This allows users to set profile icons to emoji as well. However, emoji do not appear in the jumplist.

## References
Based on microsoft#7667 

## PR Checklist
* [X] Closes microsoft#7784 
* [x] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [x] Schema updated.

## Validation Steps Performed
Deploy succeeded.
@ghost
Copy link

ghost commented Nov 11, 2020

🎉Windows Terminal Preview v1.5.3142.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command should expose IconPath, not IconSource
3 participants