MLTSHP / mltshp

Source for the application that runs mltshp.com
https://mltshp.com/
Mozilla Public License 2.0
50 stars 21 forks source link

Alt text #710

Closed dphiffer closed 1 year ago

dphiffer commented 1 year ago

Overview

Adds an alt text mechanism for images and videos (see: #549). The interface for creating a new post works the same, but this PR adds new user interfaces for reading/editing alt text.

See also: https://github.com/MLTSHP/mltshp-patterns/pull/1024

Screenshots

A screengrab of an example teapot.jpg before alt text has been entered, light gray text says 'add alt text'. Screenshot 2023-06-30 at 9 10 51 AM A screengrab showing the visual alt text toggle below the image.

Todo list

jessamynwest commented 1 year ago

We can add a little "about alt text" in to the FAQ (and I agree probably shouldn't be linking to twitter, even though that Robot Hugs thing is perfect) how about this page that @spaceninja mentioned above? https://axesslab.com/alt-texts/

bradchoate commented 1 year ago

Thanks for picking this up! It looks pretty good. I see you have some things left to do. If it isn't too much to ask, you might include these as well:

And a usability issue that is a holdover for other "quick edit" fields. Clicking the prompt that displays the input should cause the input to receive focus.

dphiffer commented 1 year ago

Yeah, I think I can get those things in. Adding to the Todo punch list. Thanks @bradchoate!

BTW do you happen to know what the hash-looking things are in the db migration filenames?

bradchoate commented 1 year ago

The migration file name is generated by the yoyo new command:

usage: yoyo new [-h] [--config CONFIG] [-v] [-b] [--no-config-file] [--message MESSAGE] [--sql] [--migration-table MIGRATION_TABLE] [-d DATABASE]
                [sources ...]

It looks like it formats a filename as yyyymmdd_nn_xxxx-message.py Where "nn" is "01" or more if there are other scripts for that same date. The "xxxxx" part is just a random alphanumeric string (not really sure why they include it). "message" portion is the lowercased translation of the "--message" switch. Source for the routine that makes the filename can be found here.

dphiffer commented 1 year ago

Ah thank you, that makes sense!

dphiffer commented 1 year ago

Thank you for those text edits @spaceninja!

bradchoate commented 1 year ago

Not a big deal, but migration files should generally not be renamed, since it's possible someone has at this point run a migration on their local dev installation (like me!). Changing the name makes it appear as an un-processed migration since yoyo keeps the migration states in a table and records the migration file name there. So, running the migration step afterward will fail.

If you have to revise a migration, or anything like that, include instructions in the PR to anyone that may be needing them. Yoyo has commands to reapply a migration (useful for changing the content of a migration -- issues a rollback for it, then runs it again), and also commands to unmark and mark a migration (useful in this case since it doesn't do anything but update the migration table).

dphiffer commented 1 year ago

Got it, thanks @bradchoate. I probably should've just left it as 0000!

dphiffer commented 1 year ago

I removed the "Draft" from the title, and uploaded a short demo video to show how it works: https://mltshp.com/p/1P4TE

spaceninja commented 1 year ago

~Related pattern library changes have been merged, and I just opened #711 to update the pattern library here to the new version.~

Whoops, should have looked closer, you've already done that as part of this. Nice work!