Render annotation cards as list items #6195
Closed
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.
Relates to #6185
This PR is an attempt to improve the annotation cards semantics, by rendering them as list items (
<li />
) inside an unordered list (<ul />
).This is the simplest solution from the ones suggested in#6185. However, I have to admit I haven't been able to fully verify this makes a difference for assistive technologies.
It should have no visual changes.
The other solutions would be a bit trickier, as the component which renders the
article[aria-label]
is deeply nested down the component tree, compared to the component that iterates annotations and therefore knows the index (ThreadList
->ThreadCard
->Thread
->Annotation
).This gets even more inconvenient if we want to index annotations per users (not globally), which would require moving some logic up the component tree in order to do that.
Another option would be to make the
Annotation
component pull all annotations from the store, filter those belonging to the same user, and then trying to compute the index, but this would be slightly inefficient.Note
It's easier to review this PR ignoring whitespaces