Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

ui: update icons to use the FlightIcon package #2681

Merged
merged 9 commits into from
Dec 14, 2021
Merged

Conversation

sabrinako
Copy link
Contributor

@sabrinako sabrinako commented Nov 4, 2021

Related Issue

#2392

Description

This PR intends to transfer the Waypoint Ui over from using the Pds::Icon components to the new FlightIcon ones.

How to Test

  1. Pull this branch down git checkout ui/flight-icon-update
  2. yarn to download the new packages
  3. yarn start to boot up UI with mock data
  4. Click around to ensure all icons are looking as expected!

Additional Notes

flight-icons currently doesn't have any animated icons, so our loading spinner is not present. There's discussion about adding it that's picked up in recent days, so I imagine this will be added soon but I'm not planning on holding this PR back any longer since it's just 1 icon left.

Screenshots

Deployments Page

Screen Shot 2021-12-08 at 3 40 06 PM

Auth Page

Screen Shot 2021-12-08 at 3 51 04 PM

As of making this PR, the method for altering the colors of the icons in Flight requires altering the use element instead of path. This also seems to prevent us from changing the stroke width. Feedback on how we could change the stroke width would be helpful (since I'm pretty sure it was thinner before)

@sabrinako
Copy link
Contributor Author

Just wanted to update on GH as well but this is on hold until we get the HC logos in Flight

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Ember Asset Size action

As of f82b213

Files that got Bigger 🚨:

File raw gzip
vendor.js +2.37 kB +572 B
vendor.css +166 B +37 B
waypoint.css +643 B -112 B

Files that got Smaller 🎉:

File raw gzip
waypoint.js -59 B -79 B

@sabrinako sabrinako added this to the 0.7.0 milestone Dec 8, 2021
@sabrinako sabrinako marked this pull request as ready for review December 8, 2021 21:00
@sabrinako sabrinako requested review from almonk and a team December 8, 2021 21:00
@jgwhite
Copy link
Contributor

jgwhite commented Dec 9, 2021

Are we dropping icons from the breadcrumbs?

CleanShot 2021-12-09 at 10 02 12@2x

  • Looks like there’s unneeded space for an icon to the left of the app name
  • Icon next to “deployments” seems a bit close to the text (maybe it’s not meant to be there?)

Copy link
Contributor

@jgwhite jgwhite left a comment

Choose a reason for hiding this comment

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

The new icons are looking really nice.

I spotted a few nitpicks, but in general the transition is butter smooth.

ui/app/components/copyable-code/index.hbs Outdated Show resolved Hide resolved
ui/app/components/workspace-switcher.hbs Outdated Show resolved Hide resolved
ui/app/components/git-commit.hbs Show resolved Hide resolved
ui/app/templates/workspace/projects/new.hbs Outdated Show resolved Hide resolved
ui/app/components/app-item/deployment.hbs Show resolved Hide resolved
Copy link
Contributor

@gregone gregone left a comment

Choose a reason for hiding this comment

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

LGTM. just a few questions about using the button element for styling

ui/app/styles/_layout.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@jgwhite jgwhite left a comment

Choose a reason for hiding this comment

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

Looking good. The points @gregone raised are worth investigating but apart from that I didn’t spot anything out of place.

@sabrinako sabrinako merged commit 5222fcd into main Dec 14, 2021
@sabrinako sabrinako deleted the ui/flight-icon-update branch December 14, 2021 22:27
@sabrinako sabrinako linked an issue Dec 15, 2021 that may be closed by this pull request
Copy link

@didoo didoo left a comment

Choose a reason for hiding this comment

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

@sabrinako added a few comments, take them for what they are (just suggestions)

@@ -92,11 +86,23 @@ a[href].button {
}

&--external-link {
> .pds-icon {
> svg {
Copy link

Choose a reason for hiding this comment

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

here you're relying on the component internal structure (expects the SVG to be a direct child) and in case we decide in the future to change it, this would break (unknowingly) the styling.

my suggestion is to use a wrapping container/div, and style that container. in this way you decouple hosting codebase from the components implementation

align-items: stretch;
margin-left: calc(-1 * 0.25rem);

svg {
Copy link

Choose a reason for hiding this comment

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

potentially, also here you have a coupling (less strong than the other one, but still)

one option could be to apply a class to the FlightIcon component and use that one as a CSS selector here (and also in other cases I see where you have used the DOM element as target)


path {
use {
Copy link

Choose a reason for hiding this comment

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

this is not how we would expect color to be applied. you're manipulating directly the internal SVG but we expose a @color prop for this (see https://flight-hashicorp.vercel.app/engineering#example-fill)

plus, our icons use currentColor by default so they can just inherit the color from the parent container

plus, our icons are flat, they don't contain strokes, so the stroke: $brand-color; declaration can be removed

@@ -31,8 +31,10 @@

.icon.brand {
display: flex;
width: scale.$lg-14;
Copy link

Choose a reason for hiding this comment

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

@heatherlarsen for knowledge, one case in which the 24px icon is scaled up to 96px

Choose a reason for hiding this comment

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

I ran into an issue getting this to run locally, but I'm assuming this is either for the Waypoint logo or the HashiCorp logo. I'd advocate for using a logo in these instances instead of an icon.

Copy link
Contributor

Choose a reason for hiding this comment

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

I ran into an issue getting this to run locally

@heatherlarsen I’d like to hear more about this. I’ll reach out to you on Slack :)

@@ -31,14 +30,14 @@
line-height: var(--pds-lineHeight--dense);
padding-left: scale.$lg--2;

.pds-icon {
svg {
position: absolute;
font-size: scale.$lg--1;
Copy link

Choose a reason for hiding this comment

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

do you need a font-size for an icon?

@heatherlarsen
Copy link

@sabrinako I saw your note about changing the stroke weight. Stroke weight is not something that should be changed on Flight icons as each icon was intentionally designed with consistent stroke weight based on the size of the icon. More information about how the icons are drawn can be found in the docs. Is there a specific reason you need to adjust the stroke weight?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: migrate the UI Icons from structure-icons to flight
5 participants