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

[Graph] Replace Fontawesome with EUI + Maki icons #162048

Merged
merged 17 commits into from
Jul 20, 2023
Merged

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jul 17, 2023

Summary

Fixes #160232

This PR removes completely FontAwesome from the Graph plugin and replace its usage with mostly EUI + few Maki icons.
As for the Google icon, @MichaelMarcialis do you think we should just have a custom SVG icon within the Graph app?

Here's a list of the replaced icons, but if I forgot anything let me know:

  • Created generic IconRenderer component to abstract away the package type from the rendering
    • Add logic for color switch based on background color
  • Replace icons in graph visualization
    • Replace with EUI icons
    • Replace with Maki icons
    • Add prevName to recover old saved graph SO
    • Fix selection preview icon
    • For the at and key icons it needs to wait for a new EUI release with at & key Icon Glyphs eui#6934
  • Replace drill down icons
    • Replace with EUI icons
    • Replace with Maki icons
    • Find a substitute for Google icon
    • Add prevName to recover old saved graph SO
  • App toolbars
    • Replace app toolbar icons with EUI icons
      • Changed blocked list icon from ban to filterIgnore
    • Replace styling icon + color swatches
      • The EUI dot icon was too small, so switches to rect icons
    • Replace merge icons on link selection
    • Replace group/ungroup icons with fold/unfold
    • Custom drilldowns
  • Removed LegacyIcon
    • Replaced usage in various places

New icons within field configuration + graph visualization

Screenshot 2023-07-17 at 11 00 35 Screenshot 2023-07-17 at 15 13 04

New toolbar with blocked icon changed

Screenshot 2023-07-17 at 15 13 40 Screenshot 2023-07-17 at 15 13 35 Screenshot 2023-07-17 at 12 41 12

New group/ungroup icons

Screenshot 2023-07-17 at 12 41 25 Screenshot 2023-07-17 at 15 15 27

Selection with icons preview

Screenshot 2023-07-17 at 15 07 17 Screenshot 2023-07-17 at 15 07 35

Panel with color styling open

Screenshot 2023-07-17 at 15 07 44

Custom drilldowns (note Google icon has been replaced with a magnifier icon)

Screenshot 2023-07-18 at 17 49 07 Screenshot 2023-07-18 at 17 51 44 Screenshot 2023-07-17 at 15 08 31 Screenshot 2023-07-17 at 15 08 38

Link selection

Screenshot 2023-07-17 at 15 09 06

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@dej611 dej611 added Feature:Graph Graph application feature Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes v8.10.0 labels Jul 17, 2023
@MichaelMarcialis
Copy link
Contributor

As for the Google icon, @MichaelMarcialis do you think we should just have a custom SVG icon within the Graph app?

Yes. Since EUI longer allows for the addition of external logos as part of its icon offering, that approach would be best.

@dej611
Copy link
Contributor Author

dej611 commented Jul 17, 2023

As for the Google icon, @MichaelMarcialis do you think we should just have a custom SVG icon within the Graph app?

Yes. Since EUI longer allows for the addition of external logos as part of its icon offering, that approach would be best.

Rather than implement a custom icon, what if we remove the problem by replacing the Google icon completely for a more generic Search EUI icon?

Screenshot 2023-07-17 at 18 16 40

@dej611
Copy link
Contributor Author

dej611 commented Jul 18, 2023

Ok, talked with the team and replaced for now the Google icon with the more generic Search icon:

Screenshot 2023-07-18 at 17 49 07 Screenshot 2023-07-18 at 17 51 44

Let me know what do you think of it @MichaelMarcialis

Also, fixes a sass issue triggered when I removed the legacy icon component. Now drilldown icons should work back ok again.

@MichaelMarcialis
Copy link
Contributor

Let me know what do you think of it @MichaelMarcialis

Making the icon more general purpose and switching to the EUI search icon glyph makes sense to me. 👍

@dej611 dej611 marked this pull request as ready for review July 19, 2023 06:50
@dej611 dej611 requested review from a team as code owners July 19, 2023 06:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-graph (Feature:Graph)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Thanks, @dej611! This looks great. I left a few small questions and suggestions for you below.

I also noticed that the new key and at icons are missing. Am I correct in saying that this will fix itself as soon as EUI is updated to the latest in Kibana's main branch?

CleanShot 2023-07-19 at 10 24 56

Assuming that's correct, I'll approve now to avoid holding you up further.

className="kuiButton kuiButton--basic kuiButton--small"
disabled={workspace.selectedNodes.length === 0}
<EuiButtonIcon
iconType={'filterIgnore'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would eyeClosed be a better icon choice for this action (to avoid making users think that it is adding a filter to the unified search interface)? In doing so, perhaps it would also make sense to change all references of "blocking" selections to "hiding" instead. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Graph there's no unified search interface, even tho it looks pretty similar. And there's currently no concept of "filter" as for the rest of Kibana, the closest thing to a "filter" is actually this Blocklist thing, but it's like a negative filter only.
Nonetheless I have nothing against the icon change, and probably in the long run (if we ever going to add the unified search interface to Graph) will be a more consistent choice. So 👍 for me.

@@ -41,7 +42,9 @@ export function BlocklistForm({
<FormattedMessage
id="xpack.graph.blocklist.noEntriesDescription"
defaultMessage="You don't have any blocked terms. Select vertices and click {stopSign} in the control panel on the right to block them. Documents that match blocked terms are no longer explored and relationships to them are hidden."
values={{ stopSign: <span className="kuiIcon fa-ban" /> }}
values={{
stopSign: <EuiIcon type="filterIgnore" />,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as previous question. Would it be better to use eyeClosed here instead and change all references of "block" to "hide"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean change also the Blocklist to something like Hidden list as part of this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, exactly. Something like "Hidden list" or "Hidden vertices".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created a follow up issue to track this: #162297

Co-authored-by: Michael Marcialis <[email protected]>
@dej611
Copy link
Contributor Author

dej611 commented Jul 19, 2023

also noticed that the new key and at icons are missing. Am I correct in saying that this will fix itself as soon as EUI is updated to the latest in Kibana's main branch?

Correct.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
graph 282 270 -12

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
graph 458.4KB 407.4KB -50.9KB
Unknown metric groups

async chunk count

id before after diff
graph 3 2 -1

miscellaneous assets size

id before after diff
graph 1.1MB 161.8KB -928.6KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

This looks fantastic and removes 50KB from the bundle! LGTM!

@dej611
Copy link
Contributor Author

dej611 commented Jul 20, 2023

This looks fantastic and removes 50KB from the bundle! LGTM!

Have you checked the static assets table? :D

Screenshot 2023-07-20 at 09 16 40

@dej611 dej611 merged commit d064bfe into elastic:main Jul 20, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 20, 2023
@stratoula
Copy link
Contributor

Wooooooooooow! I didn't!!

ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
## Summary

Fixes elastic#160232

This PR removes completely FontAwesome from the Graph plugin and replace
its usage with mostly EUI + few Maki icons.
As for the Google icon, @MichaelMarcialis do you think we should just
have a custom SVG icon within the Graph app?

Here's a list of the replaced icons, but if I forgot anything let me
know:

* [x] Created generic `IconRenderer` component to abstract away the
package type from the rendering
  * [x] Add logic for color switch based on background color
* Replace icons in graph visualization
  * [x] Replace with EUI icons
  * [x] Replace with Maki icons
  * [x] Add `prevName` to recover old saved graph SO
  * [x] Fix selection preview icon
* For the `at` and `key` icons it needs to wait for a new EUI release
with elastic/eui#6934
* Replace drill down icons 
  * [x] Replace with EUI icons
  * [x] Replace with Maki icons
  * [x] Find a substitute for Google icon
  * [x] Add `prevName` to recover old saved graph SO
* App toolbars
  * [x] Replace app toolbar icons with EUI icons
    * [x] Changed blocked list icon from `ban` to `filterIgnore`
  * [x] Replace styling icon + color swatches
    * The EUI `dot` icon was too small, so switches to rect icons 
  * [x] Replace merge icons on link selection
  * [x] Replace group/ungroup icons with `fold/unfold`
  * [x] Custom drilldowns
* [x] Removed `LegacyIcon`
  * Replaced usage in various places

New icons within field configuration + graph visualization

<img width="1061" alt="Screenshot 2023-07-17 at 11 00 35"
src="https://github.com/elastic/kibana/assets/924948/59f981e7-64b7-4ce5-b3ae-2582d46fc373">

<img width="302" alt="Screenshot 2023-07-17 at 15 13 04"
src="https://github.com/elastic/kibana/assets/924948/fb8d0e63-e982-406f-bd8d-036d71d37442">

New toolbar with blocked icon changed

<img width="202" alt="Screenshot 2023-07-17 at 15 13 40"
src="https://github.com/elastic/kibana/assets/924948/241206c4-7d3b-4296-bd6b-c2df3f3eabe5">

<img width="220" alt="Screenshot 2023-07-17 at 15 13 35"
src="https://github.com/elastic/kibana/assets/924948/5a648932-2f79-4c0e-a8d0-3ab165f68036">

<img width="272" alt="Screenshot 2023-07-17 at 12 41 12"
src="https://github.com/elastic/kibana/assets/924948/e3778d20-3000-496e-881b-61e5f086ae52">

New group/ungroup icons

<img width="168" alt="Screenshot 2023-07-17 at 12 41 25"
src="https://github.com/elastic/kibana/assets/924948/ffc963e6-4fea-4cb5-b0ef-cf8a71a71d6a">
<img width="252" alt="Screenshot 2023-07-17 at 15 15 27"
src="https://github.com/elastic/kibana/assets/924948/98b8b025-32fd-465e-9a66-40f4f866eb6e">

Selection with icons preview

<img width="260" alt="Screenshot 2023-07-17 at 15 07 17"
src="https://github.com/elastic/kibana/assets/924948/08dbda17-0c12-4fa4-8c92-77bbe90d7e14">
<img width="268" alt="Screenshot 2023-07-17 at 15 07 35"
src="https://github.com/elastic/kibana/assets/924948/78987838-42d5-46bf-9e46-b12cc603fa4e">

Panel with color styling open

<img width="266" alt="Screenshot 2023-07-17 at 15 07 44"
src="https://github.com/elastic/kibana/assets/924948/f5866e29-cf22-4e62-a2ff-3ef901c0d564">

Custom drilldowns (note Google icon has been replaced with a magnifier
icon)

<img width="331" alt="Screenshot 2023-07-18 at 17 49 07"
src="https://github.com/elastic/kibana/assets/924948/42e307d1-69b6-4e79-9e19-64c5efb7ee46">
<img width="381" alt="Screenshot 2023-07-18 at 17 51 44"
src="https://github.com/elastic/kibana/assets/924948/bc70c506-4390-45c1-aff5-8e22a68d7130">
<img width="271" alt="Screenshot 2023-07-17 at 15 08 31"
src="https://github.com/elastic/kibana/assets/924948/59fea7e4-a775-4006-805d-0610d7861890">
<img width="269" alt="Screenshot 2023-07-17 at 15 08 38"
src="https://github.com/elastic/kibana/assets/924948/f6c247a0-921d-4d9c-881a-796e02488df5">

Link selection

<img width="295" alt="Screenshot 2023-07-17 at 15 09 06"
src="https://github.com/elastic/kibana/assets/924948/d6a73013-130e-45a8-bdfc-48ac20e66a85">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Michael Marcialis <[email protected]>
@jbudz jbudz mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Graph Graph application feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Graph] Remove usages of font awesome
6 participants