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

[Canvas] Fix sharable runtime styles and remove color="ghost" where unnecessary #169313

Merged
merged 9 commits into from
Oct 24, 2023

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Oct 18, 2023

Summary

👋 Hey y'all - EUI will shortly be deprecating the ghost color in all button components (see https://eui.elastic.co/v89.0.0/#/navigation/button#ghost-vs-dark-mode).

I'm opening this PR ahead of time for your team so you can test this migration and ensure no UI regressions have occurred as a result. To be honest, I'm very unsure how to test the shereable runtime feature - I tried downloading a ZIP file but it emitted a html file that rendered nothing, so I'd appreciate help QAing this if possible.

Checklist

  • Tested exported file

@cee-chen cee-chen marked this pull request as ready for review October 19, 2023 19:23
@cee-chen cee-chen requested a review from a team as a code owner October 19, 2023 19:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/eui-team (EUI)

@cee-chen cee-chen added release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas and removed ci:skip-when-possible (Deprecated) no-op, managed automatically labels Oct 19, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nickpeihl nickpeihl self-requested a review October 23, 2023 19:32
Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

Testing the Canvas shareable runtime requires a few steps.

  1. yarn kbn bootstrap
  2. node x-pack/plugins/canvas/scripts/shareable_runtime.js
  3. yarn start
  4. Install sample data ecommerce
  5. Open the "[eCommerce] Revenue Tracking" workpad
  6. Click "Share - Share on a website"
  7. In the flyout, click the "download an example ZIP file" link.
  8. Extract the zip file to a directory
  9. Inside the directory, run python -m http.server and open http://localhost:8000

Any changes to the code require a rebuild of the runtime in step 2. You could copy the output kbn_canvas.js file to the unzipped directory to test.

The shareable runtime has loads of CSS issues in main already. Some of the .scss files use the composes: selector from CSS-Modules, but I believe we no longer support CSS-Modules in favor of Emotion 🤔 .

Here is how it looks in main.
Screenshot 2023-10-23 at 4 41 05 PM

And with this PR
Screenshot 2023-10-23 at 4 42 33 PM

Compare to this screenshot from the original PR.
demo

With our current priorities, I do not foresee us spending time fixing the aesthetic CSS issues in the shareable runtime. The shareable runtime is not widely used and we have higher impact features in our roadmap. cc @ThomThomson @cqliu1 in case they feel differently.

Since this PR as it doesn't break anything and it allows EUI to remove the deprecated prop, I'm going to say "lgtm".

@ThomThomson
Copy link
Contributor

@nickpeihl agreed that we should not spend time fixing these aesthetic problems with the shareable runtime. If an engineer from another team wanted to fix this I wouldn't be against it, but it does have very little usage.

@cee-chen
Copy link
Member Author

Ahh interesting. Yeah it looks like the bottom bar totally broke during EuiBottomBar's conversion to Emotion (elastic/eui#5823), which removed any Sass styles associated with .euiBottomBar and thus broken the composes: behavior here:

If there's a quick and easy way to fix node x-pack/plugins/canvas/scripts/shareable_runtime.js to use Emotion, I could look into that... but yeah not sure if that'd be worth doing if usage is so low. I can timebox myself to 30 mins or so of poking at it

@cee-chen cee-chen requested a review from a team as a code owner October 23, 2023 23:35
@cee-chen
Copy link
Member Author

That wasn't too bad at all! Here's the fixed styles:

canvas_runtime

Quick note - I'm aware the EuiContextMenu colors are broken - this is an issue to fix on EUI's side of things (see #169571 as well). Once we fix it in EUI, this package should automatically inherit the fix.

@ThomThomson
Copy link
Contributor

Amazing, thank you for fixing this @cee-chen!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

Thank you @cee-chen for fixing this! Updated changes lgtm!

@cee-chen cee-chen enabled auto-merge (squash) October 24, 2023 15:19
@cee-chen cee-chen changed the title [Canvas] Convert color="ghost" button to dark mode wrapper [Canvas] Fix sharable runtime styles and remove color="ghost" where unnecessary Oct 24, 2023
@cee-chen cee-chen enabled auto-merge (squash) October 24, 2023 15:20
@cee-chen cee-chen merged commit 8ef12b2 into elastic:main Oct 24, 2023
28 checks passed
@cee-chen cee-chen deleted the eui-ghost/canvas branch October 24, 2023 17:45
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 24, 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 EUI release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants