Repository: bookwyrm-social/bookwyrm

Issue:
Remove the "Cover" text from the alt text of book covers if one is present
Currently, when a book cover is present and is displayed, it's alt text consists of the book title, the text *Cover*, edition name, and the first published date.

For example, via VoiceOver under Safari:

```
image The Night Circus cover (Hardcover, 2011)
```

The fact that this is a cover image is redundant, because users are already notified about the presence of an image. In this case, the textual data is actually more important, e.g. book title and edition name, since the presence of a cover does not add more information when using a screen reader.

The expected result, via VoiceOver (and possibly other screen readers as well) is:

```
image The Night Circus (Hardcover, 2011)
```


Discussion:
I agree. Can't believe I didn't notice this. I guess I've become used to it, but I agree.

Resolving patch:
diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py
--- a/bookwyrm/models/book.py
+++ b/bookwyrm/models/book.py
@@ -91,7 +91,7 @@ def edition_info(self):
     @property
     def alt_text(self):
         ''' image alt test '''
-        text = '%s cover' % self.title
+        text = '%s' % self.title
         if self.edition_info:
             text += ' (%s)' % self.edition_info
         return text


Test patch:
diff --git a/bookwyrm/tests/models/test_book_model.py b/bookwyrm/tests/models/test_book_model.py
--- a/bookwyrm/tests/models/test_book_model.py
+++ b/bookwyrm/tests/models/test_book_model.py
@@ -81,7 +81,7 @@ def test_get_edition_info(self):
         book.save()
         self.assertEqual(book.edition_info, 'worm, Glorbish language, 2020')
         self.assertEqual(
-            book.alt_text, 'Test Edition cover (worm, Glorbish language, 2020)')
+            book.alt_text, 'Test Edition (worm, Glorbish language, 2020)')
 
 
     def test_get_rank(self):
diff --git a/bookwyrm/tests/models/test_status_model.py b/bookwyrm/tests/models/test_status_model.py
--- a/bookwyrm/tests/models/test_status_model.py
+++ b/bookwyrm/tests/models/test_status_model.py
@@ -150,7 +150,7 @@ def test_generated_note_to_pure_activity(self, _):
         self.assertEqual(activity['attachment'][0].url, 'https://%s%s' % \
                 (settings.DOMAIN, self.book.cover.url))
         self.assertEqual(
-            activity['attachment'][0].name, 'Test Edition cover')
+            activity['attachment'][0].name, 'Test Edition')
 
     def test_comment_to_activity(self, _):
         ''' subclass of the base model version with a "pure" serializer '''
@@ -177,7 +177,7 @@ def test_comment_to_pure_activity(self, _):
         self.assertEqual(activity['attachment'][0].url, 'https://%s%s' % \
                 (settings.DOMAIN, self.book.cover.url))
         self.assertEqual(
-            activity['attachment'][0].name, 'Test Edition cover')
+            activity['attachment'][0].name, 'Test Edition')
 
     def test_quotation_to_activity(self, _):
         ''' subclass of the base model version with a "pure" serializer '''
@@ -207,7 +207,7 @@ def test_quotation_to_pure_activity(self, _):
         self.assertEqual(activity['attachment'][0].url, 'https://%s%s' % \
                 (settings.DOMAIN, self.book.cover.url))
         self.assertEqual(
-            activity['attachment'][0].name, 'Test Edition cover')
+            activity['attachment'][0].name, 'Test Edition')
 
     def test_review_to_activity(self, _):
         ''' subclass of the base model version with a "pure" serializer '''
@@ -238,7 +238,7 @@ def test_review_to_pure_activity(self, _):
         self.assertEqual(activity['attachment'][0].url, 'https://%s%s' % \
                 (settings.DOMAIN, self.book.cover.url))
         self.assertEqual(
-            activity['attachment'][0].name, 'Test Edition cover')
+            activity['attachment'][0].name, 'Test Edition')
 
     def test_favorite(self, _):
         ''' fav a status '''