-
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
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>
agilgur5
force-pushed
the
fix-ui-markdown-title-desc
branch
from
January 28, 2024 18:47
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.
1 task
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:
Details drawer has empty space on both left and right:
Overflow that was fixed in #11908 was re-broken:
After:
UI deps code-split
Shaved off ~575KB / ~140KB minified / ~41KB gzipped from the main entrypoint: