-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(ui): code-split markdown title + desc, fix row linking, etc #12580
Merged
+59
−47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- `react-markdown` and `remark-gfm` are large deps, so we should code-split / lazy load them - and we should only load them if a user is using this feature - can't quite detect if a string is markdown without a dep, but can at least check if the annotations are used - shaved off ~575KB / ~140KB minified / ~41KB gzipped from the main entrypoint - CSS had several issues - was imported from the wrong component - `overlay` was not sufficiently unique (as we currently use global CSS and not something like CSS Modules) - some unnecessary CSS attributes - most importantly, the positioning of rows broke and did not flex to the last column - it caused columns to not match the heading very confusingly and a lot of empty space on the right as well - that also broke some overflow properties - and it broke the details drawer as well - remove `Link` for the entire row as it was unintuitive, especially with the drawer - one could also not copy+paste things from the row because it caused a click - only link the workflow name now - fix nested link issues - capture the event, prevent bubble up, and process it with JS Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
- these were from when I was trying to lazy load `remark-gfm` in the same file and for some reason forgot I could just split both imports into one file that I could lazy load / code-split Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
ab6bf33
to
041db5d
Compare
20 tasks
jmeridth
approved these changes
Jan 28, 2024
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.
Nice use of suspense. Just one minor nit.
7 tasks
4 tasks
juliev0
approved these changes
Feb 26, 2024
19 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/build
Build or GithubAction/CI issues
area/ui
prioritized-review
For members of the Sustainability Effort
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #10553 issues
Related / partial fix for to #12059, although the PR was merged after that issue was created
Motivation
react-markdown
andremark-gfm
are large deps, so we should code-split / lazy load themCSS had several issues
overlay
was not sufficiently unique (as we currently use global CSS and not something like CSS Modules)WorkflowsRow
message is not too long #11908)fix nested link issues
remove
Link
for the entire row as it was unintuitive, especially with the drawerModifications
react-markdown
andremark-gfm
workflows-row-name.tsx
file and merge it back to where it wasworkflows-row.tsx
, notworkflows-row-name.tsx
overlay
anchor element was a workaround for nested linking (which could optionally be used with the markdown feature), remove it and use JS to handle nested links insteadname
column and not the entire row (which included the drawer before, both open and closed)Verification
Rendered UI itself
Manually tested the UI:
Before had several issues (as listed in #10553 (review)):
Misplaced columns; row does not flex all the way to the right:
![Screenshot 2024-01-22 at 1 05 49 AM](https://private-user-images.githubusercontent.com/4970083/300283513-a34fa030-5f5d-4a72-be6a-acb3e4f58320.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NzY0MDcsIm5iZiI6MTcyNTU3NjEwNywicGF0aCI6Ii80OTcwMDgzLzMwMDI4MzUxMy1hMzRmYTAzMC01ZjVkLTRhNzItYmU2YS1hY2IzZTRmNTgzMjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMjI0MTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Mjc1NDhiZGQ0Njg3NzNmZWUyNTY0NTJkNGM4YjA4NTA1ZjQ5ZGEyYmExYmVmM2IzNDJjN2Q4Y2M3NjE0NjNhMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Uhz1ytfG-VxPS460x_aCwAdmZfexLM6gGTVHc2YBmY4)
Details drawer has empty space on both left and right:
![Screenshot 2024-01-28 at 12 21 52 PM](https://private-user-images.githubusercontent.com/4970083/300283313-a47818c4-a367-4bae-bb78-7f2cb2942290.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NzY0MDcsIm5iZiI6MTcyNTU3NjEwNywicGF0aCI6Ii80OTcwMDgzLzMwMDI4MzMxMy1hNDc4MThjNC1hMzY3LTRiYWUtYmI3OC03ZjJjYjI5NDIyOTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMjI0MTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWJkNDQ1ZmEyOWVmNTE1NzhlODkzMzU0MTEzMGFkYzAzNDIxODY2Y2UyZWQ5YjcwNDY5MDYzNTEyMWE0MGQ2ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.n51PbjjFyZLn5GSlJEPkGsCLuS9iuysdJ0wwetSQ800)
![Screenshot 2024-01-28 at 12 22 46 PM](https://private-user-images.githubusercontent.com/4970083/300283319-edd7fae4-cd4d-469d-b0cd-473382db2471.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NzY0MDcsIm5iZiI6MTcyNTU3NjEwNywicGF0aCI6Ii80OTcwMDgzLzMwMDI4MzMxOS1lZGQ3ZmFlNC1jZDRkLTQ2OWQtYjBjZC00NzMzODJkYjI0NzEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMjI0MTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWE3MDgwY2I4ZGI0YTcxOGQ2NmE4ZTNhMmYyNzIyNGZkMzQ3OGQwMmZhMzUxN2M1YjgxZjM2MWRkNWYyODA5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.OfqN7tHMcvntY_yKVmanJX4N2QcG18DhXGgy27WKY4g)
Overflow that was fixed in #11908 was re-broken:
![Screenshot 2024-01-28 at 12 23 53 PM](https://private-user-images.githubusercontent.com/4970083/300283325-aeb3f502-fa1d-4385-8ca1-19118bed1c2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NzY0MDcsIm5iZiI6MTcyNTU3NjEwNywicGF0aCI6Ii80OTcwMDgzLzMwMDI4MzMyNS1hZWIzZjUwMi1mYTFkLTQzODUtOGNhMS0xOTExOGJlZDFjMmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMjI0MTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2UzNDE0ZTI3OGFmOWEwMWY1YjI5NzI2ZTRlNWVjYzdmOThkOTg1MWQ3ZDUwNzIyMjRlNzlkNmY1ZDdiNWYxNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.I8F09urHd0Khq5bI0_uymlm0jxUznaz8gZc52en2YF0)
After:
![Screenshot 2024-01-27 at 9 26 51 PM](https://private-user-images.githubusercontent.com/4970083/300283271-024ef70c-adf0-451c-971d-1c0a607c4166.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NzY0MDcsIm5iZiI6MTcyNTU3NjEwNywicGF0aCI6Ii80OTcwMDgzLzMwMDI4MzI3MS0wMjRlZjcwYy1hZGYwLTQ1MWMtOTcxZC0xYzBhNjA3YzQxNjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMjI0MTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWE5MzUxMjViMjE4NmVmOGUyNjZmZTMyMWVhZGRmYzQxMDc4NGM4OTM2MjM2ZmU4NGJlODBiZDEzMTIwYjZhZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.lQJ6gPizOIZs3oZyUAqKordRI2QGzF8_AkpTRriMQhM)
UI deps code-split
Shaved off ~575KB / ~140KB minified / ~41KB gzipped from the main entrypoint:
![Screenshot 2024-01-28 at 1 39 49 PM](https://private-user-images.githubusercontent.com/4970083/300286116-a61ba14e-7df4-4fbe-82c6-a067a53c2b08.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1NzY0MDcsIm5iZiI6MTcyNTU3NjEwNywicGF0aCI6Ii80OTcwMDgzLzMwMDI4NjExNi1hNjFiYTE0ZS03ZGY0LTRmYmUtODJjNi1hMDY3YTUzYzJiMDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMjI0MTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDVmZDM3NDk1YmEzMjNlMWMzNTVmNTYwYjQ2YjQ3YjMzOW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