openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Author merge endpoint should show the first few lines of the author's description

Open cdrini opened this issue 1 year ago • 11 comments

Currently, when doing an author merge, it can be easy to merge authors that share a common name:

image

But these should not be merged! The description of the first author is:

Rev. Archibald Alexander was a British clergyman. He is not to be confused with the theologian of the same name, active in the early 1800s and professor at Princeton Theological Seminary.

Including the first... say 250 characters of the description in this form will help librarians disambiguate authors, and avoid accidentally merging folks that shouldn't be merged.

Expected behaviour / screenshots (ex: Figma design screenshots for UI feature)

Adding this description here should do nicely! Add a <p> element just before the <ul> of books, or write No description.

image

Related files

  • https://github.com/internetarchive/openlibrary/blob/7592a6186153fab65eb55abcb5b00e9052dca71b/openlibrary/templates/merge/authors.html#L89

  • Use the truncate macro: $macros.TruncateString(a.description, 250)

Stakeholders

@RayBB @davidscotson @purplem00n

Note: Before making a new branch or updating an existing one, please ensure your branch is up to date.

cdrini avatar Jun 13 '24 13:06 cdrini

May I work on this?

louisv20 avatar Jun 13 '24 13:06 louisv20

@louisv20 you're assigned.

@cdrini how would you feel about either:

  1. Always showing the Wikidata short description too.
  2. Only showing Wikidata short description when there is no OL author description?

RayBB avatar Jun 14 '24 08:06 RayBB

I've been unable to install openlibrary. Followed installation instructions and watched video. Any assistance would be appreciated. Running into errors when building olbase image Screenshot (396)

louisv20 avatar Jun 15 '24 00:06 louisv20

Hmm you shouldn't need to run that command @louisv20 ; where did you see it?

The instructions here are the ones you want: https://github.com/internetarchive/openlibrary/blob/master/docker/README.md

cdrini avatar Jun 15 '24 01:06 cdrini

Hmm you shouldn't need to run that command @louisv20 ; where did you see it?

The instructions here are the ones you want: https://github.com/internetarchive/openlibrary/blob/master/docker/README.md

Thanks, I will try that.

Got instructions from video tutorial at the bottom of openlibrary's main page Screenshot (398)

louisv20 avatar Jun 15 '24 01:06 louisv20

Ah it seems like that video has fallen out of date! Good find. The written instructions I linked to are our new methods. Let us know if you hit any issues with those!

Would you mind creating a new issue saying the video in the readme is out of date? Thank you!

cdrini avatar Jun 15 '24 07:06 cdrini

Ah it seems like that video has fallen out of date! Good find. The written instructions I linked to are our new methods. Let us know if you hit any issues with those!

Would you mind creating a new issue saying the video in the readme is out of date? Thank you!

I was able to complete the installation successfully, thank you.

I also created a new issue for the video tutorial #9434

Question. How can I recreate an author merge scenario in development version? I've tried searching for the author mentioned in the example above but I get no hits.

louisv20 avatar Jun 15 '24 21:06 louisv20

@louisv20, you can use copydocs.py to copy production data to your local developer instance. The author IDs are a bit small in the screenshots, but here it would be something like:

$ docker compose web exec bash
WARN[0000] The "HOST" variable is not set. Defaulting to a blank string. 
openlibrary@af88db9ddf59:/openlibrary$ PYTHONPATH=. ./scripts/copydocs.py /authors/OL2102479A /authors/OL2851848A
fetching ['/authors/OL2102479A', '/authors/OL2851848A']
saving ['/authors/OL2102479A', '/authors/OL2851848A']
[{'key': '/authors/OL2102479A', 'revision': 1}, {'key': '/authors/OL2851848A', 'revision': 1}]

From there, after a minute or two (or three...), you'll be able search for archibald and they'll both show up.

Once they're visible in the search results, you can click on each author's name and select them for merging (see the bottom right): image

This should get you to the point @cdrini shared in the original screenshot, minus the books (which you could copy in if you wanted, using copydocs.py, but they shouldn't be relevant here).

scottbarnes avatar Jun 16 '24 01:06 scottbarnes

Is the author's description automatically fetched with the author? I'm able to get the "No description" text under each author but description isn't fetched. Screenshot (406)

code that was added to openlibrary/openlibrary/templates/merge/authors.html Screenshot (407)

louisv20 avatar Jun 17 '24 05:06 louisv20

@louisv20 trying a.bio instead of a.description

RayBB avatar Jun 19 '24 15:06 RayBB

FW(little)IW:

Always showing the Wikidata short description too.

I’d be in favour of this. The more information provided at merge time, the better. :) This might be better for a separate issue, though, as the UI might be desired to be different (e.g., maybe show it in grey next to the years rather than in the spot of the bio/description?) – and also just to keep issues (and thus PRs and commits) a bit more atomic.

Freso avatar Jun 21 '24 14:06 Freso