enhance: Alt text in image viewer #178

Manually merged
norm merged 1 commit from nullobsi/FoundKey:improve-alt-text into main 2022-10-01 14:32:58 +00:00
Contributor

Add text box to PhotoSwipe image viewer when activated.

See:
https://github.com/misskey-dev/misskey/pull/9109
https://fedi.nullob.si/notes/95q4yywihr

Add text box to PhotoSwipe image viewer when activated. See: https://github.com/misskey-dev/misskey/pull/9109 https://fedi.nullob.si/notes/95q4yywihr
Owner

Looks nice!

I'm pretty sure I've said this before somewhere, but I don't think it is a good idea to fall back to file names, because if there is no image description, the file name is probably automatically generated as well. And IMHO a filename like image.png or worse 31054d0f9a876caf4ca07a106aea16a698221554954fd448e91946e604a77156.mp4 & co is not helpful for anyone.

Yes there may be helpful filenames but I don't think it is worth displaying the filenames in all the other cases. To check my suspicions I had a look at my instance's database to check:

SQL query and result

The query picks 20 random file names where there is no image description.

misskey=> SELECT name FROM drive_file WHERE comment IS NULL ORDER BY RANDOM() LIMIT 20;
                        name
----------------------------------------------------
 0b230f67dc2c741b.jpg
 webpublic-431ce24d-64c5-4a7c-b897-6c7305d099dc
 webpublic-6fd8cc30-3de5-4f90-95b7-b2f547c2d738
 dd3da907a7a735eb.jpg
 8cdacd63b9a81649.jpg
 08aee635-f383-4e99-84e0-bc113313963b.jpg
 517c71f8f5c366b7.png
 3514c1480b5d92e8.jpg
 webpublic-27d410a2-8cd1-4f6b-8a41-f13051ae2c3e
 c949c529743a8ab2.gif
 47c978c5b19ffba6.jpeg
 webpublic-2f43e63d-7bc2-4089-83c5-ac8662cc1e60
 webpublic-e7e4bfd6-b698-45d0-ae2c-361d09e3d333
 78bf3ba6711bec89.png
 webpublic-42a96959-af87-4c5a-8875-80a59521453d.jpg
 webpublic-c9d773e5-61dc-4671-82bb-1309cb00dc95.png
 webpublic-4df9adcb-e9c7-4477-94e3-b5fdb0fcb875.jpg
 webpublic-2f0e686a-cd63-471c-a676-5762cd0087b3
 webpublic-10b98343-02f9-47f7-acff-2cfc8751509c
 8458aa8d-e939-40ed-823e-045ec76a481e
(20 rows)
Looks nice! I'm pretty sure I've said this before somewhere, but I don't think it is a good idea to fall back to file names, because if there is no image description, the file name is probably automatically generated as well. And IMHO a filename like `image.png` or worse `31054d0f9a876caf4ca07a106aea16a698221554954fd448e91946e604a77156.mp4` & co is not helpful for anyone. Yes there *may* be helpful filenames but I don't think it is worth displaying the filenames in all the other cases. To check my suspicions I had a look at my instance's database to check: <details> <summary>SQL query and result</summary> The query picks 20 random file names where there is no image description. ``` misskey=> SELECT name FROM drive_file WHERE comment IS NULL ORDER BY RANDOM() LIMIT 20; name ---------------------------------------------------- 0b230f67dc2c741b.jpg webpublic-431ce24d-64c5-4a7c-b897-6c7305d099dc webpublic-6fd8cc30-3de5-4f90-95b7-b2f547c2d738 dd3da907a7a735eb.jpg 8cdacd63b9a81649.jpg 08aee635-f383-4e99-84e0-bc113313963b.jpg 517c71f8f5c366b7.png 3514c1480b5d92e8.jpg webpublic-27d410a2-8cd1-4f6b-8a41-f13051ae2c3e c949c529743a8ab2.gif 47c978c5b19ffba6.jpeg webpublic-2f43e63d-7bc2-4089-83c5-ac8662cc1e60 webpublic-e7e4bfd6-b698-45d0-ae2c-361d09e3d333 78bf3ba6711bec89.png webpublic-42a96959-af87-4c5a-8875-80a59521453d.jpg webpublic-c9d773e5-61dc-4671-82bb-1309cb00dc95.png webpublic-4df9adcb-e9c7-4477-94e3-b5fdb0fcb875.jpg webpublic-2f0e686a-cd63-471c-a676-5762cd0087b3 webpublic-10b98343-02f9-47f7-acff-2cfc8751509c 8458aa8d-e939-40ed-823e-045ec76a481e (20 rows) ``` </details>
nullobsi force-pushed improve-alt-text from b5afb0b495 to e9ab42c10a 2022-09-30 20:59:40 +00:00 Compare
Author
Contributor

Okay, I made it disappear when there's no actual image description. Also, for longer image descriptions, I made it overflow: auto.

Okay, I made it disappear when there's no actual image description. Also, for longer image descriptions, I made it overflow: auto.
norm approved these changes 2022-10-01 14:29:00 +00:00
norm manually merged commit 40c2e8f846 into main 2022-10-01 14:32:58 +00:00
Owner

I don't understand why you still added/left in the change that uses the filename as fallback elsewhere. I've reverted that part in f571f61c2d.

I don't understand why you still added/left in the change that uses the filename as fallback elsewhere. I've reverted that part in f571f61c2d3afd9bb3a252620733d2b0368a4d9d.
Owner

Must have missed that before merging.

Must have missed that before merging.
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#178
No description provided.