-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Migrate Word Cloud visualization to React #3930
Conversation
@arikfr @ranbena @gabrieldutra This PR is ready for review - I'll appreciate any feedback. I'm still testing it, and will remove WIP label once I'm finally happy with everything. |
@mohamagdy Since this PR is going to replace yours (#3668) I'll appreciate your feedback as well (sorry, cannot request your review from GitHub UI) |
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.
👌
720c7b5
to
ead140f
Compare
ead140f
to
4b8ffe3
Compare
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.
👌
I think the only thing missing now is a simple Percy test for it. |
@ranbena Added some tests |
660c589
to
6b32a47
Compare
6b32a47
to
7c78ada
Compare
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.
Perfection
@ranbena Thanks! There are some issues with Percy (visualization is messed up on screenshots), I'm trying to figure this out. After that I'll merge this PR. |
5d3bc30
to
8192527
Compare
8192527
to
17aacc1
Compare
@arikfr @ranbena @gabrieldutra There is an issue with this visualization and Percy, which was quite hard to figure out (even required a help from Percy support). Word Cloud used an "Impact" font to compute layout, and later the same font was assigned to all words. But "Impact" is not available on all machines, so browser uses some fallback. To take a screenshot of a page, Percy takes a complete DOM snapshot with all loaded resources and inline CSS, copies it to own machines and then loads in own browsers. On CI machines word cloud was computed using some default font, and after copying DOM to Percy - restored with another default font available on that machine:
The only solution which 100% worked was to use some fixed font, which will be exactly the same on all machines. I tried Roboto because we already have it (however, don't use since #2081), but before I merge it - I decided to start a discussion to be sure that I'm not missing anything important. Upd.: This behavior is totally not a problem for users, because when user changes OS/browser - they will reload page and visualization will re-build using another font. The issue is only when using CI and Percy together (because of copying DOM instead of reloading page in Percy or taking screenshot on CI machines) |
@kravets-levko good catch! How about we define a Percy only CSS rule that uses Roboto, but keep things for users unchanged? |
@arikfr We need to detect Cypress env as well - because Roboto should be loaded there for proper layout calculation. Not sure if there is any "legal" way to target Cypress and Percy 🤔 |
I think I can add some env to Cypress dockerfile and then use it to conditionally add fonts during webpack build: redash/.circleci/docker-compose.cypress.yml Lines 12 to 16 in d7b03ba
@gabrieldutra Do you have any better ideas? |
In the test code we have full control of the browser, why not change the CSS from code? Feels safer and easier than passing around from the Dockerfile. |
That's interesting idea. If Percy will pick that injected font - then it should work. Need to try |
@arikfr Yay, it works! I needed to update webpack config to copy Roboto files to |
Looks good 👍 |
What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
#3301 (Migrate Visualizations to React -> Word Cloud)
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Query page:
New editor options:
Dashboard: