Conversation
24cd2eb to
25f1432
Compare
Coverage Report for CI Build 36524452026Coverage decreased (-0.6%) to 26.324%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
25f1432 to
1cefd84
Compare
| </LibraryCardList> | ||
| {isReordering ? ( | ||
| <DndContext | ||
| sensors={dragSensors} |
There was a problem hiding this comment.
While manually testing dragging with a mouse, I noticed that I could pull a card far off to the right or the bottom of the screen. A separate package (@dnd-kit/modifiers) provides modifiersrestrictToVerticalAxis and restrictToParentElement that limit the range of a drag.
The current behavior is not a bug, because the cards snap back to the list without issue. I'm only mentioning in case you didn't know these options were available and you might like this behavior better.
| sensors={dragSensors} | |
| sensors={dragSensors} | |
| // less restrictive | |
| modifiers={[restrictToVerticalAxis]} |
| sensors={dragSensors} | |
| sensors={dragSensors} | |
| // more restrictive | |
| modifiers={[restrictToParentElement]} |
| {canReorder && ( | ||
| <Button | ||
| variant="ghost" | ||
| color="ui.link.primary" | ||
| onClick={() => onReorderingChange?.(!isReordering)} | ||
| aria-label={ | ||
| isReordering | ||
| ? t( | ||
| "pinnedLibraryList.doneLabel", | ||
| "Done reordering My Libraries" | ||
| ) | ||
| : t("pinnedLibraryList.reorderLabel", "Reorder My Libraries") | ||
| } | ||
| > | ||
| {isReordering | ||
| ? t("pinnedLibraryList.done", "Done") | ||
| : t("pinnedLibraryList.reorder", "Reorder")} | ||
| </Button> | ||
| )} |
There was a problem hiding this comment.
This button fails the WebAIM Contrast Checker for this font size when it is focused: https://webaim.org/resources/contrastchecker/?fcolor=0576D3&bcolor=CDE8FE
The default variant and color for Button passes (but is a little more boring 🙃)
PoorBillyPilgrim
left a comment
There was a problem hiding this comment.
@tdilauro looks great! Approving with a few small comments to consider.
Description
Adds reordering of pinned libraries ("My Libraries") on the multi-library home page. It is behind the existing
PALACE_CPW_FEATURE_PINNINGfeature flag.@dnd-kit/core,@dnd-kit/sortable,@dnd-kit/utilities.Important
This branch is stacked on #203, which is, in turn, stacked on #202. Those must land before this PR is merged.
Motivation and Context
Patrons who pin several libraries may want their most used or preferred library(ies) first.
[Jira PP-3116]
How Has This Been Tested?
Checklist: