internetarchive / internetarchive/openlibrary

Develop Tag Plugin System: Enhance Subjects page by Integrating Tags

Open
#8,279 5 comments 0 reactions 0 assignees View on GitHub
Lead: @mekarpeles Needs: Breakdown Needs: Detail Needs: Response Priority: 2 State: Blocked Theme: Book Tags Theme: Subjects Type: Epic
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

Once the basic ability to CRUD (create, read, update, delete) Tags has been achieved in #7766 and basic infrastructure is in place to connect/associate subject strings and Tags, the next step is to create a generic schema / DSL (domain specific language) for Tags that lets librarians define metadata to enhance how the subject page renders.

@JaydenTeoh has drafted/prototyped a plugins idea in #7928 that lets librarians associate Tags with any number of plugins (which are ostensibly macros or templates). #7928 is an amazing proof of concept, which achieves the goal of extending the capabilities of subject pages by defining a list of plugins which the subject page integrates. The concept is close but I think we may want to abstract as much of the implementation/code logic **out** of the Tag document and into the subject page (as a means of defining an implementation of the relationships specified within the Tag).

At minimum, we want to be able to (a) add more named carousels to Subject pages and (b) present patrons with a few librarian-chosen facets (`related_tags` or `related_subjects`) -- similar to the search page -- that the patron can click on to narrow their search.

This issue has 3 parts, all of which are prototyped by #7928:
* [ ] Prototype Tag Schema MVP -- schema/DSL that allows librarians to add queries and relationships to a Tag. Each Tag might have...
* A `primary_query` for the Tag/subject (by default / if not specified is just `subject:whatever-the-subject-is`)
* interesting `related_tags` a patron might click to drill down and further narrow what is shown by the `primary_query`
* [ ] Update the create/edit Tag UI that enables librarians to specify Tag plugins to customize a subject page'
* [ ] Integrate the subject page to implement each Tag plugin

![image](https://github.com/internetarchive/openlibrary/assets/978325/25a2b955-c70f-4933-a14f-8c757d019c09)

![image](https://github.com/internetarchive/openlibrary/assets/978325/5ce3d79e-d1a9-4855-a053-e7e7cb25d4e4)

## Notes
Screenshot 2023-09-18 at 3 28 45 PM

Contributor guide

Open the contributing guide

Research direction

Start by reading prototypes #7928 and #7766, then compare their Tag relationships with the three requested parts: the Tag schema/DSL, create/edit Tag UI, and subject-page integration. Done means librarians can define Tag queries and relationships, configure plugins in the UI, and see added carousels and selectable facets on subject pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
full-stack, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.