5831/feature/unified read button dropdown#9544
5831/feature/unified read button dropdown#9544mekarpeles merged 19 commits intointernetarchive:masterfrom
Conversation
1bdefa4 to
e2c8bba
Compare
6829c7d to
d98df44
Compare
49bff57 to
5cc732a
Compare
828eedd to
d26c347
Compare
bbfb5f5 to
9213b63
Compare
Progress towards reworking the read button, currently with major styling issues and lack of functionality. Fix mistyped class name Change from cta-button-groupp to cta-button-group Reduce HTML, overwrite styling Remove some unnecessary div/span tags to simplify the HTML. Overwrite general CSS styling related to margins and list-style with specific rules. Add temp icons and dropper arrow Add temporary icons to the content buttons, and also replace and improve the dropper arrow. Restructure cta button and dropper Move the cta button outside of the summary tag in order to give the summary::after pseudo-element its own container for styling purposes. Has the side effect of moving the dropped content to appear directly below the dropper button, and not align with the left side of the cta button as before. [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Fix positioning of dropper content Change position of dropper content to be aligned with left edge of read button as it was before restructuring of the element hierarchy. Change dropper hover behavior, realign dropper arrow Remove gray color when hovering over dropper content, add dark blue hover color to dropper button; change padding and margin rules to make summary element same size and shape as details element; fix misaligned open dropper arrow. Add icons, listen option Add four new icons to static/images/icons (listen, search, download, and map). Add link to read aloud audio to content dropper Listen button. Make listen option conditional Re-add coniditonal to check for listen-ability of work. Listen button does not show up in content dropper if there is no read aloud option available. Add scroll, highlight to check nearby libraries Clicking the check nearby libraries header in the read button will smoothly scroll the user to the check nearby libraries panel and highlight it with a border animation. See PR 7125 for similar implementation with star ratings. Remove scroll and highlight from check nearby libraries button Remove the scroll to CNL panel and border highlight/pulse after clicking the check nearby libraries button in the dropdown. No longer necessary since the goal of the button is to take the user to a worldcat link for now instead of having multiple options. Minor alignment fixes
Add a Check Nearby Libraries option to the read button dropper if an OCLC or ISBN identifier exists for an edition. Not satisfied with this solution as it adds another argument to LoanStatus.html calls, will probably be changed Rewrite dropper worldcat logic Switch from passing an edition to LoanStatus to using its existing doc parameter when attempting to grab OCLC and ISBN identifiers for generating a worldcat url. Wasn't able to test many situations such as multiple editions with different availability of OCLC/ISBN, etc., so will need further testing in a more robust environment. Light CSS refactor, remove overly specific styles Slightly change read-panel.less (removing .Tools from a styling rule, removing unused summary style rule) to lower specificity requirements in generic-dropper.less and integrate previously isolated rules into main styling block. More specificity fixes Specificity fix fix Remove extra line that unintentionally increased specificity Switch to borrow endpoint-based Worldcat link Refactor the Check Nearby Libraries button (and rename it) to use the OLID instead of OCLC/ISBN/title identifier, making it more robust. Now goes to a new LocateButton.html macro instead of WorldcatURL.html as well. Clarify variable name Change variable from olid to edition_key to make its contents more clear CSS adjustments Adjust width of dropper content to account for shortened longest button label. Return 10px bottom margin to Not in Library button that was removed when .Tools was removed from the main read-panel.less styling rules. Fix Locate Button Redirection Change from using work_key to doc.key in LoanStatus.html to retrieve the correct OLID for searching Worldcat Remove locate link in edition box, locate button fix Remove the worldcat link directly below the Not In Library button in the edition box on the books page, since it is replaced by the locate button. Fix locate button macro complaining about possibility of non-string value for edition key
Simplify HTML structure with the removal of superfluous classes and divs from ReadButton.html and LocateButton.html macros. Simplify or remove many CSS styling rules, move away from mixin-focused styling and unnecessary class descriptors. Overhaul rules for dropper menu positioning to attach it more firmly to details element. [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Add internationalization wrapper for dropdown buttons [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci
Add search inside functionality and input box styling to the read button. Remove Search inside button from books page read column. [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Update search inside CSS in dropper Change search inside form input element to take up whole box in dropper, add highlight on hover, group search inside-related style rules in dropper menu for clarity. Pre-commit specificity fixes Remove descending specificity, add comments to break down stylesheet sections, remove overly specific rules
Remove locate button macro and references in other files, since it has been moved to another branch as part of internetarchive#9952 Smooth hover transition for Search Inside box CSS Adjustments Fix a litany of minor styling issues Restore and remove search inside from Read Button Dropper Fix read button dropper width in edition table
| td.icon.read { | ||
| order: 3; | ||
| .read { | ||
| ul.read { |
|
@mekarpeles I think it's ready for testing! There's a couple unresolved issues I noticed that I listed in the issue, but other than that things seem operational. I've had a harder time testing in the search results and with print-disabled but should be easier on testing. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9544 +/- ##
==========================================
- Coverage 17.43% 17.27% -0.17%
==========================================
Files 88 87 -1
Lines 4811 4845 +34
Branches 853 860 +7
==========================================
- Hits 839 837 -2
- Misses 3447 3477 +30
- Partials 525 531 +6 ☔ View full report in Codecov by Sentry. |
|
|
@mekarpeles Everything but arrows on carousels should be fixed! |
Adjust icon size, text vertical positioning, and z-level bug with multiple droppers on top of each other.
|
When we merge, we should squash with this message: |



Opening draft PR after suggested during today's community call (July 9 2024).
Closes #5831
Feature/refactor: Condenses several "read-y" actions (Read/Borrow/Listen, Search Inside, Download, Check Nearby Libraries) into a dropdown.
Technical
Complete overhaul of
macros/ReadButton.htmland new CSS ingeneric-dropper.lessto facilitate adetailselement-based implementation of a button with dropdown.Testing
WIP
Screenshot
WIP
Stakeholders
@mekarpeles @jimchamp