feat(uploads): accessible image alt text (LC-537) #512
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-537-image-alt-text"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
LC-537: accessible image alt text. Images used the filename as their
alt; now the author can attach real descriptive alt text, and it renders as the image'salt(falling back to the filename when unset).Why
Filename-as-alt is close to useless for screen-reader users (
IMG_4032.png). Letting the author describe the image is the standard accessibility affordance (Slack/Mastodon/Twitter all have it).How
Three commits, each compiles + tests green on its own:
Storage. New
file_uploads.alt_textcolumn (migration 0083, additive).Attachmentcarries it;alt()returns the author text or falls back to the filename (v1 behaviour),has_alt()reports whether one is set.db::uploads::set_upload_alt_textwrites/clears it. Lib unit tests cover the fallback + blank-is-unset logic.Editor + live re-render. Images render with their effective
alt, and the author gets an inline "Add / Edit alt text" disclosure under their own images (no-JS friendly: it degrades to a plain form POST).POST /api/files/{id}/altis uploader-gated, caps at 1000 chars, rejects non-images and not-yet-posted uploads, then broadcasts a newAttachmentAltChangedevent so every viewer's message re-renders through the existingrender_edited_messagepath (same shape asVoiceTranscribed). en + es strings.Tests. Storage round-trip (set / read-back / clear-to-fallback) plus route authz: author sets alt and gets the re-rendered message back, non-author 403, anon redirected.
Notes
ADD COLUMN); no operator action.Testing
just check,just test,just test-saasall green.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q1pu1NZoT3Uxb7AcxVyTgu
Render images with their effective alt (author text, else filename) and give the author an inline "Add / Edit alt text" disclosure under their own images (no-JS friendly: plain POST fallback). New POST /api/files/{id}/alt is uploader-gated, caps at 1000 chars, rejects non-images and not-yet-posted uploads, then broadcasts a new AttachmentAltChanged event so every viewer's message re-renders via the existing render_edited_message path (same shape as VoiceTranscribed). en + es strings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q1pu1NZoT3Uxb7AcxVyTgu