openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Best Book Awards

Open mekarpeles opened this issue 1 year ago β€’ 3 comments

Feature: Best Books

https://docs.google.com/document/d/1Ddeg-fWWZ0iCFzVtZR0yGY_vCPttIUrd4tCIWwvYj6g/edit#heading=h.hwsgbba3g9bn

A feature called "Best Book Awards", where a patron who has Already Read a book may nominate it as the Best Book on a Topic.

Requirements

  • [x] Formalize the schema for Best Books
  • [ ] Core Models for Best Book Nominations
    • https://github.com/internetarchive/openlibrary/tree/master/openlibrary/core awards.py
  • [ ] JSON API (similar for ratings) for submitting, updating, and deleting nominations
  • [ ] Adding πŸ† total counts to the Community Interest Bar
  • [ ] Updating the Review Section to include πŸ† counts-per-topic
  • [ ] Updating the Already Read Reading Log form to allow Best Book nominations
  • [ ] Creating a form for submitting Best Book nominations

Known Bugs

  • [ ] Currently, as of Oct 8, 2024, if you submit an award w/o having marked the book as "Already Read", you see a toast error like: "You can award only if you have read the bookNonemekarpeles". (this has been on front-end but not on backend)

Design Feedback

  • [ ] The "Comments" section of the bestbook-modal should be larger / resizable (e.g. a textarea?)
  • [ ]

Next Steps

  • [ ] Fix pre-commit errors
  • [x] Make it so when you click the awards icon, it pulls up a new modal named bestbook_modal_link (because previously it was observations_modal_link)
    • [x] Add js handlers to respond to bestbook_modal_link for modal toast messages
  • [x] When we submit the form, we need some way to take the data and submit to the backend without refreshing the page β†’ we’re using a click handler on the submit button + fetch POST
  • [x] Add caution message if award is clicked but book is not yet marked as "already read"
  • [x] CSS cleanup: Consolidate + decrease duplicated styles in our less using & nesting and cleaning up classes
  • [ ] DRY & Update APIs: Get the awards and count together (needs discussion)
  • [ ] Mobile responsiveness & review (needs discussion)

Schema

table best_book_nominations:

  • id serial
  • submitter
  • work_id
  • edition_id (optional)
  • topic (name or Tag key)
  • comment (optional)
  • created
  • updated

mekarpeles avatar Jul 03 '24 02:07 mekarpeles

We may wish to consider (during design call) ideas for merging Star Ratings, Review Tags, and Best Book trophies into the same submit form/component so there aren't so many competing features.

EDIT: It looks like goodreads had a similar idea: image

mekarpeles avatar Jul 03 '24 02:07 mekarpeles

@noobCoderVP can I assign you to this one?

mekarpeles avatar Jul 05 '24 18:07 mekarpeles

Yes sure

EDIT: @mekarpeles + @noobCoderVP are using this message for Project Managing this issue:

Feature: Best Books

https://docs.google.com/document/d/1Ddeg-fWWZ0iCFzVtZR0yGY_vCPttIUrd4tCIWwvYj6g/edit#heading=h.hwsgbba3g9bn

A feature called "Best Book Awards", where a patron who has Already Read a book may nominate it as the Best Book on a Topic.

Requirements

  • [x] Formalize the schema for Best Books
  • [ ] Core Models for Best Book Nominations
    • https://github.com/internetarchive/openlibrary/tree/master/openlibrary/core awards.py
  • [ ] JSON API (similar for ratings) for submitting, updating, and deleting nominations
  • [ ] Adding πŸ† total counts to the Community Interest Bar
  • [ ] Updating the Review Section to include πŸ† counts-per-topic
  • [ ] Updating the Already Read Reading Log form to allow Best Book nominations
  • [ ] Creating a form for submitting Best Book nominations
  • [ ] Complete autocomplete integration for topic

Test Cases

  • [ ] What happens if a patron loads the page, uses JS to mark book as "Already Read" (without refreshing) and then clicks on "award" and tries to submit best book?

Known Bugs

  • [x] Currently, as of Oct 8, 2024, if you submit an award w/o having marked the book as "Already Read", you see a toast error like: "You can award only if you have read the bookNonemekarpeles". (this has been on front-end but not on backend)

Design Feedback

  • [ ] The "Comments" section of the bestbook-modal should be larger / resizable (e.g. a textarea?)

Next Steps

  • [ ] Fix pre-commit errors
  • [x] Make it so when you click the awards icon, it pulls up a new modal named bestbook_modal_link (because previously it was observations_modal_link)
    • [x] Add js handlers to respond to bestbook_modal_link for modal toast messages
  • [x] When we submit the form, we need some way to take the data and submit to the backend without refreshing the page β†’ we’re using a click handler on the submit button + fetch POST
  • [x] Add caution message if award is clicked but book is not yet marked as "already read"
  • [x] Fix submit logic, close bestbook modal, and open the community review tags form
  • [x] CSS cleanup: Consolidate + decrease duplicated styles in our less using & nesting and cleaning up classes
  • [ ] DRY & Update APIs: Get the awards and count together (needs discussion)
  • [ ] Mobile responsiveness & review (needs discussion)
  • [ ] Complete autocomplete integration for topic

Schema

table best_book_nominations:

  • id serial
  • submitter
  • work_id
  • edition_id (optional)
  • topic (name or Tag key)
  • comment (optional)
  • created
  • updated

noobCoderVP avatar Jul 06 '24 01:07 noobCoderVP