sul-dlss / dlme

Digital Library of the Middle East web application, based on Spotlight
https://dlmenetwork.org/
Other
20 stars 2 forks source link

Display horizontally-scrolling categories in a browse group #1142

Closed ggeisler closed 3 years ago

ggeisler commented 3 years ago

Related to #1066 (preliminary discussion) and #1145 (widget for this feature).

The general idea is to present the published browse categories associated with a published browse group in a row on the page. On desktop viewports, three browse categories are shown at one time, with previous/next controls available for scrolling, where scrolling is done by groups of three (except at either end of the list, if there are less than three left), rather than one at a time as is done in some similar components.

I leave it to the developers to decide on the best component/library to base this on, but I’ll note that:

LG

A & B: Heading and associated link

C: Previous/Next buttons

Note that by including both previous and next buttons I’m suggesting that we not have the navigation of the categories wrap. When you get to the last set of categories in a group, the next button is disabled and you have to use the previous button to go back and see the other sets of categories in the group.

Vertical spacing between rows

D: Responsive adjustments

The design assumes the browse category blocks will use the exact same sizing and other styling, including the text labels on the blocks, as the browse categories/pages widgets currently do. Because of that I won’t include any sizing details here other than to note that the XS viewport uses one size (the largest), MD and LG use another, XL a third size.

The SM viewport uses a fourth size, which is pretty small. This could be problematic in DLME because we’re using the extra caption line for at least the time period categories and I’m doubtful that all of the time period labels will fit on the SM sized block. So at least for a first-pass, perhaps we should diverge from the browse category/pages widget styling for the SM viewport only, and go with the same styling there as the XS styling.

Longer-term, or if it is feasible to do in the first-pass at this, I think the SM viewport might work well with a 2-up version of the horizontally-scrolling widget. (I can mock that up later to be sure and suggest exact sizing details.)

XS and SM viewport deviations

Although most of the sizing and styling can follow the pattern of the browse categories/pages widgets, there are a few deviations for the XS and SM viewports we need to make:

SM

XS viewport example

XS

Keyboard/screenreader concerns

Below is a preliminary suggestion for dealing with accessibility concerns. I don’t want to delay this ticket while I take the time to understand all the relevant details and possibilities, but I can work with @camillevilla (to leverage her a11y knowledge) and/or whoever else works on this to resolve details around accessibility. For now:

The strategy above basically avoids a potentially confusing and tedious keyboard navigation sequence but does require the keyboard user to do more navigation if they choose to enter a browse group row. But they also have an easy way to bypass the browse group row entirely.

I think a similar strategy will work for the screenreader user; but that user will already have the headings to use to move over a given browse group row. So for both keyboard and screenreaders, I think the basic strategy is to hide the previous and next buttons and present all categories in a given browse group as a full set. I know there are more details to work out, but I hope that's enough to get started on this ticket.

Here’s a blog post that has some rationale for this strategy: https://medium.com/@lsnrae/if-you-must-use-a-carousel-make-it-accessible-977afd0173f4

RTL concerns

I can’t think of any special RTL considerations. It seems like everything should just flip as usual with RTL, such that the next arrow will point left and the blocks will slide from RTL instead of LTR.

jacobthill commented 3 years ago

Error in Arabic view documented https://github.com/sul-dlss/dlme/issues/1172. Leaving this in QA/Stanford until https://github.com/sul-dlss/dlme/issues/1172 is complete.

jacobthill commented 3 years ago

@asmaaalkuwari we need translations for

asmaaalkuwari commented 3 years ago

@jacobthill Items: عنصر/عناصر View all: مشاهدة الكل