Skip to content
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

Canonical Books Page (Merging works & Editions UI) #3553

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

mekarpeles
Copy link
Member

@mekarpeles mekarpeles commented Jul 5, 2020

Closes #684 🎉
Closes #3556 🎉

Change Log

  1. Adds sticky tab bar to books page
  2. Show more / less collapse button
  3. Books page chooses "best" (previewable) edition by default, shows selected edition in editions table
  4. Search result shows cover consistent w/ available edition, sends to (3)
  5. Adds editions table to the books page
  6. Adds filter/search to editions table + ability to change # of results in table w/o reloading
  7. Adds checkbox to List dropdown to control whether to add work v. edition to list
  8. Adds "preview also available in" for various applicable languages
  9. Fun / useless bookcover hover animation
  10. Consolidates calls to action within sidebar + moves sidebar to the left, below bookcover

Technical

  • Merges the UI for /works and /books.
  • URLs are not touched
  • Lists are loaded multiple times on page (to enable showing edition + work results & separating locations of lists management from carousel/showcase)

Code Review Checklist

  • Is everything i18n?
  • no inline styles
  • js in plugins/openlibrary/js/ where possible (except for templates/lists/widget.html)

Known issues

Punting:

Testing

  • For each search result, book cover same as selected ocaid in the work title / borrow btn
  • Clicking on a search result cover goes to the works page w/ correct ocaid selected
  • Check lists behave correctly, both for work + edition
  • LoanStatus: Borrowing, previews, and waitlists should work on books page
  • Changing editions should (currently) go to a /books URL

Screenshot

redesign

Stakeholders

@bfalling @JeffKaplan @tabshaikh @cdrini @seabelis et al

@mekarpeles mekarpeles force-pushed the local/canonical-page-rebased branch from d1fcb3f to 63f7c74 Compare July 5, 2020 11:09
Copy link
Collaborator

@tabshaikh tabshaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through all the files and LGTM

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code; mostly some i18n things/invalid css/etc. Also, was there a bad rebase somewhere? A lot of these changes are about adding that author search bar, which I though was merged separately.

openlibrary/macros/EditionNavBar.html Outdated Show resolved Hide resolved
$_('in') <a title="$(', '.join(doc.languages))">$(len(doc.languages)) $_('languages')</a>
</span>
$if doc.get('ia'):
&mdash; $(len(doc.get('ia'))) $_('previewable')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n number in the string

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&mdash; $(len(doc.get('ia'))) $_('previewable')
&mdash; $_('%s previewable' % len(doc.get('ia')))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use %; use %d.

openlibrary/macros/SearchResultsWork.html Outdated Show resolved Hide resolved
openlibrary/macros/SearchResultsWork.html Show resolved Hide resolved
openlibrary/macros/SearchResultsWork.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/view.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/view.html Show resolved Hide resolved
static/css/components/work.less Outdated Show resolved Hide resolved
static/css/components/work.less Outdated Show resolved Hide resolved
static/css/components/work.less Outdated Show resolved Hide resolved
@cdrini
Copy link
Collaborator

cdrini commented Jul 6, 2020

Small style fixes:

mekarpeles added a commit that referenced this pull request Jul 6, 2020
See: #3553
Screenshot: https://user-images.githubusercontent.com/978325/86527110-9eda7700-be50-11ea-84ea-7b0651a77f79.png

Change Log:
- Adds sticky tab bar to books page
- Show more / less collapse button
- Books page chooses "best" (previewable) edition by default, shows selected edition in editions table
- Search result shows cover consistent w/ available edition, sends to (3)
- Adds editions table to the books page
- Adds filter/search to editions table + ability to change # of results in table w/o reloading
- Adds checkbox to List dropdown to control whether to add work v. edition to list
- Adds "preview also available in" for various applicable languages
- Fun / useless bookcover hover animation
- Consolidates calls to action within sidebar + moves sidebar to the left, below bookcover

Technical:
- Merges the UI for /works and /books.
- URLs are not touched
- Lists are loaded multiple times on page (to enable showing edition + work results & separating locations of lists management from carousel/showcase)

Co-authored-by: tabshaikh <[email protected]>
Co-authored-by: Drini Cami <[email protected]>
Co-authored-by: Michael E. Karpeles (mek) <[email protected]>
@mekarpeles mekarpeles force-pushed the local/canonical-page-rebased branch from 886abe4 to 53cd27d Compare July 6, 2020 23:59
Copy link
Member Author

@mekarpeles mekarpeles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batching PR suggestions

static/css/components/work.less Outdated Show resolved Hide resolved
openlibrary/macros/EditionNavBar.html Outdated Show resolved Hide resolved
$_('in') <a title="$(', '.join(doc.languages))">$(len(doc.languages)) $_('languages')</a>
</span>
$if doc.get('ia'):
&mdash; $(len(doc.get('ia'))) $_('previewable')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&mdash; $(len(doc.get('ia'))) $_('previewable')
&mdash; $_('%s previewable' % len(doc.get('ia')))

openlibrary/macros/SubjectTags.html Outdated Show resolved Hide resolved
openlibrary/macros/SubjectTags.html Show resolved Hide resolved
openlibrary/macros/databarView.html Outdated Show resolved Hide resolved
openlibrary/plugins/openlibrary/js/editions-table/index.js Outdated Show resolved Hide resolved
openlibrary/plugins/upstream/utils.py Outdated Show resolved Hide resolved
openlibrary/templates/lists/widget.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/book_title.html Outdated Show resolved Hide resolved
@mekarpeles mekarpeles force-pushed the local/canonical-page-rebased branch 2 times, most recently from 1ac4112 to 1aafef1 Compare July 7, 2020 04:51
@mekarpeles mekarpeles changed the title Local/canonical page rebased Canonical Books Page (Merging works & Editions UI) Jul 7, 2020
@mekarpeles
Copy link
Member Author

#3553 (comment)
Fixes book pages w/ no edition available, fixed blue shadow on SERP + added dotted underline under search page "languages"

See: #3553
Screenshot: https://user-images.githubusercontent.com/978325/86527110-9eda7700-be50-11ea-84ea-7b0651a77f79.png

Change Log:
- Adds sticky tab bar to books page
- Show more / less collapse button
- Books page chooses "best" (previewable) edition by default, shows selected edition in editions table
- Search result shows cover consistent w/ available edition, sends to (3)
- Adds editions table to the books page
- Adds filter/search to editions table + ability to change # of results in table w/o reloading
- Adds checkbox to List dropdown to control whether to add work v. edition to list
- Adds "preview also available in" for various applicable languages
- Fun / useless bookcover hover animation
- Consolidates calls to action within sidebar + moves sidebar to the left, below bookcover

Technical:
- Merges the UI for /works and /books.
- URLs are not touched
- Lists are loaded multiple times on page (to enable showing edition + work results & separating locations of lists management from carousel/showcase)

Co-authored-by: tabshaikh <[email protected]>
Co-authored-by: Drini Cami <[email protected]>
Co-authored-by: Michael E. Karpeles (mek) <[email protected]>
@mekarpeles mekarpeles force-pushed the local/canonical-page-rebased branch from cb13ba7 to 0fe6135 Compare July 7, 2020 06:16
@mekarpeles
Copy link
Member Author

Thank you both!

I think I've addressed all of the blocking feedback and even most of the suggestions on this issue. At this point, I think we're pretty close. Not thrilled about the PR being having been squashed but I think the description of the commit and the scope is pretty thorough. A lot of the intermediary work was also scratch (and given what we had I think I prefer it being squashed, especially since the major refactors -- the Lists -- were done in a separate branch).

@tabshaikh, so we're ready for tomorrow's deploy, if you're comfortable, can you please do a final pass, making sure we didn't miss any of @cdrini's feedback and that there are no blockers? When you feel confident please merge and we can discuss during ABC to see if any followups are necessary to the PR before a deploy goes out.

There are 2 known issues remaining; the first is a formatting issue which I agree doesn't look amazing, but I'd prefer tackling this as a followup once the main branch is landed. The other is an edge case re: books w/ missing authors which has an issue open for it.

@tabshaikh
Copy link
Collaborator

As @mekarpeles pointed out there are 2 known issues remaining; the first is a formatting issue which I agree doesn't look amazing, but I'd prefer tackling this as a followup once the main branch is landed. The other is an edge case re: books w/ missing authors which has an issue open for it.
Also, we would like the sticky tab to change upon which content is in view.
Screenshot from 2020-07-07 18-13-53
Also Clear My Rating should be centered
Screenshot from 2020-07-07 18-13-39
Other than that LGTM :) merging

@tabshaikh tabshaikh merged commit 37ddfc9 into master Jul 7, 2020
cdrini added a commit that referenced this pull request Jul 7, 2020
(Note: The history is funny because everything was squashed initially, and then reverted to be added back unsquashed)

Change Log:
- Adds sticky tab bar to the books page
- Show more / less collapse button
- Books page chooses "best" (previewable) edition by default, shows selected edition in editions table
- Search result shows cover consistent w/ available edition, sends to (3)
- Adds editions table to the books page
- Adds filter/search to editions table + ability to change # of results in table w/o reloading
- Adds a checkbox to List dropdown to control whether to add work v. edition to list
- Adds "preview also available in" for various applicable languages
- Fun / useless book cover hover animation
- Consolidates calls to action within sidebar + moves sidebar to the left, below the book cover

Technical:
- Merges the UI for /works and /books.
- URLs are not touched
- Lists are loaded multiple times on page (to enable showing edition + work results & separating locations of lists management from carousel/showcase)

Co-authored-by: tabshaikh <[email protected]>
Co-authored-by: Michael E. Karpeles (mek) <[email protected]>
@cdrini cdrini deleted the local/canonical-page-rebased branch March 4, 2021 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants