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(core): add maxLength to breadcrumb and change symbol #4880
fix(core): add maxLength to breadcrumb and change symbol #4880
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Component Testing Report Updated Sep 5, 2023 7:57 PM (UTC)
|
7348435
to
b08cf9e
Compare
ef611bc
to
83b1584
Compare
83b1584
to
a11c5a4
Compare
packages/sanity/src/core/field/diff/components/ChangeBreadcrumb.tsx
Outdated
Show resolved
Hide resolved
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.
Thanks @ninaandal!
Minor point, but we should make sure to use correct icons rather than the text equivalent.
Whilst not a regression introduced by this PR, breadcrumbs in this space can be unnecessarily truncated. An example can be found here.
I believe this is happening because <ChangeTitleSegment>
will always set maxWidth = 100
when its supplied string is over 30 chars.
We should consider only truncating this text when we know we're dealing with a breadcrumb containing multiple segments.
separator={ | ||
<Text muted size={1}> | ||
/ | ||
{'>'} |
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.
suggestion: Use <ChevronRightIcon />
(from @sanity/icons
) instead of a greater than symbol
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.
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.
maxWidth
probably made more sense before this <Breadcrumbs>
component used maxLength
. I agree in that it's probably no longer necessary.
50db5e3
to
7b282af
Compare
bbc510d
to
43619be
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.
Thanks @ninaandal!
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.
Great job! thank you!
Description
The breadcrumps for the review changes could get very long if there were several objects. Added a
maxLength
and changed the symbol from/
to>
as a separator to make it consistent with the new breadcrumb styling.Before:
After:
What to review
Review changes -> the headings of which document has been editedrr
Notes for release
Fixed a visibility issue with breadcrumbing which document was edited in Review Changes