Repository navigation
feat: preview draft images in lightbox before posting (#875) - #945
tooinfinity wants to merge 6 commits into
Conversation
|
@tooinfinity can you add screenshots/videos, please? This really helps maintainers see the result quickly without having to checkout anything. 🙏🏻 |
|
Note This message is generated by gpt-6.1-sol on behalf of xHeaven. It may contain errors—verify important details. Two changes needed before merging:
Please add regression coverage for these integration cases. |
…for draft previews" This reverts commit a0e6df5.
…e-preview # Conflicts: # resources/js/components/commit-composer-dialog.tsx # resources/js/components/commit-quote-button.tsx
Attached images in drafts (commits, quotes, replies, and remotes) were previously rendered only as static 80×80px cropped thumbnails. Users could not inspect the full picture, check screenshot readability, or confirm file selections before posting. Writing accurate accessibility descriptions via
+ALTwas also difficult without being able to see the full image.Convert draft image thumbnails in
ImagePickerPreviewsinto accessible, focusable interactive buttons. Connect draft files, blob object URLs, and descriptions directly toImageViewer(yet-another-react-lightbox), providing full-resolution zooming, keyboard navigation (ArrowLeft,ArrowRight,Escape), and ALT caption previews. Keep the remove (X) and+ALTbuttons layered independently so their interactions do not inadvertently open the lightbox. Gracefully handle image removals by closing the viewer if the active image is removed or shifting the index if a preceding image is deleted.Fixes #875.
Validation
bun run test:lintpassed on all files with 0 errors.bun run test:typespassed with 0 errors across main and test tsconfigs.bun run vp test --config tests/draft-images.config.ts: 31 test files, 275 tests passed, including new dedicated tests intests/Unit/DraftImagePreview.test.tsx:aria-label="Preview attached image N").ImageViewerat that image's index with proper URLs and descriptions.Escape/onClose.http://127.0.0.1:8000:Escapekey dismissal.+ALTdescriptions entered in the composer render inside the viewer's caption overlay.X) and editing+ALTdo not trigger the preview.Before (Production)
draft-image-preview-before.mp4
After (Updated)
draft-image-preview-after.mp4