-
Notifications
You must be signed in to change notification settings - Fork 538
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(ActionList): do not truncate description by default #5169
fix(ActionList): do not truncate description by default #5169
Conversation
🦋 Changeset detectedLatest commit: 6e3b3ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
🟢 golden-jobs completed with status |
Hi @langermank. Wanted to checkin about a slight difference I'm seeing here between PVC/PRC in relations to this PR and the Screen.Recording.2024-10-23.at.6.15.04.PM.mov |
…2-prcactionlist-inline-actionlist-description-is-automatically-truncated
This reverts commit c6c2ec5.
…onlist-description-is-automatically-truncated
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/350286 |
Will need these changes to be pulled into dotcom upon PRC version update |
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.
Lets go! 🚀
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.
so cool 🔥
<Box | ||
as="span" | ||
sx={merge(styles, sx as SxProp)} | ||
id={blockDescriptionId} | ||
id={variant === 'block' ? blockDescriptionId : inlineDescriptionId} |
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 didn't know we have different IDs for inline and block 💭 good to know
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.
was surprised by this one as well hahaah
expect(description).toHaveStyleRule('flex-basis', '0') | ||
expect(description).toHaveStyleRule('text-overflow', 'ellipsis') | ||
expect(description).toHaveStyleRule('overflow', 'hidden') | ||
expect(description).toHaveStyleRule('white-space', 'nowrap') |
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.
Very detail tests!! Love it 🔥
I’m also curious to learn when you prefer to use Jest for visual style testing versus a tool like Playwright. 👀
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.
That's a great question! I actually didn't take the fact that we already had a playwright test for the truncation story into account when writing these so this might be a bit "overkill" haha. I think I tend to go for Jest because it's what I'm most familiar with but love how "complete" vrt testing is in that it'll fail on the smallest visual change in the entire story so it feels like it covers more ground than a specific jest test. That being said I'm a big fan of redundancy.
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.
love how "complete" vrt testing is in that it'll fail on the smallest visual change in the entire story so it feels like it covers more ground than a specific jest test.
Love this!
…onlist-description-is-automatically-truncated
Tagging release conductor as FYI @siddharthkp, @broccolinisoup since I see you're next :) |
Closes https://github.com/github/primer/issues/3472, Closes #4664
The current react implementation of
ActionList.Description
truncates the text by default which poses accessibility concerns due to the content not being able to be read by keyboard users. Additionally, the inline truncation can cause horizontal overflow which causes a WCAG reflow problem. This PR mimics the functionality of PVC's ActionList, which wraps the text instead of truncating by default. An additionaltruncate
prop has been introduced to allow truncation functionality when applicable (documented here)Before
After
Changelog
New
ActionList.Description
in block, inline truncation and inline no-truncation variantstruncate
prop onActionList.Description
Changed
TextWrapAndTruncation
story to include new truncation/no-truncation use casesActionList.Description
to not render inside aTruncate
component if newtruncate
prop is false (false by default)flex-basis
style change onActionList.Description
to grow automatically iftruncate
is falseword-break
is now set tonormal
instead ofbreak-word
if theActionlist.Item
contains an inlineActionlist.Description
Rollout strategy
Testing & Reviewing
Test new truncation behavior in
TextWrapAndTruncation
storyMerge checklist