-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: alternate list marker type for nested lists #857
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Datadog ReportBranch report: ✅ 0 Failed, 167 Passed, 34 Skipped, 42.23s Total Time 🔻 Code Coverage Decreases vs Default Branch (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.
lgtm with 1 minor qn
@@ -21,6 +21,7 @@ const ListItem = ({ content, LinkComponent, site }: ListItemProps) => { | |||
<OrderedList | |||
key={index} | |||
{...item} | |||
level={!!level ? level + 1 : 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.
question: why is this level + 1
and 1
and not level
and 0
? does this have something to do with what tiptap sends us?
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.
Hmm nothing to do with Tiptap here. Cos level
is optional so the burden of setting the level is not placed on users of a list component, so for the OrderedList and UnorderedList components, they will assume that they are at level 0 if it is not provided. This increment in level is because we are starting on the next nested list, so the first nested list will have a level of 1.
This has no schema change either, purely just a components thing to track which level the list is being called at.
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.
ah ok wait let me double check - this is an ordered list inside another ordered list so the level has to be minimally 1?
missed this on initial read
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.
Oops missed this, the first list is always at level 0 (zero-based indexing), then we increment the level every time we start a new nested list.
Problem
Nested lists are currently using the same list marker type, which can be a little confusing and annoying to users.
Fixes ISOM-1662.
Solution
Breaking Changes
Features:
Bug Fixes:
Notes:
Before & After Screenshots
BEFORE:
AFTER: