Skip to content
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

Merged

Conversation

ninaandal
Copy link
Contributor

@ninaandal ninaandal commented Aug 30, 2023

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:
Screenshot 2023-08-22 at 13 59 48

After:
Screenshot 2023-08-30 at 14 46 19

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

@ninaandal ninaandal requested a review from a team August 30, 2023 09:45
@vercel
Copy link

vercel bot commented Aug 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Sep 5, 2023 7:56pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 5, 2023 7:56pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 5, 2023 7:56pm

@github-actions
Copy link
Contributor

github-actions bot commented Aug 30, 2023

Component Testing Report Updated Sep 5, 2023 7:57 PM (UTC)

File Status Duration Passed Skipped Failed
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 9s 6 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 12s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 43s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 10s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 5s 3 0 0

Copy link
Contributor

@robinpyon robinpyon left a 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.

image

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}>
/
{'>'}
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we even have that maxWidth set in any condition? Looks better without it?

Screenshot 2023-09-04 at 12 45 40

Screenshot 2023-09-04 at 12 45 33

Copy link
Contributor

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.

Copy link
Contributor

@robinpyon robinpyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ninaandal!

Copy link
Contributor

@binoy14 binoy14 left a 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!

@ninaandal ninaandal added this pull request to the merge queue Sep 6, 2023
Merged via the queue into next with commit 5c75b2c Sep 6, 2023
16 checks passed
@ninaandal ninaandal deleted the feature/edx-441-update-breadcrumb-layout-in-document-history branch September 6, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants