Add video picker and Discord video attachments.
CI / test (pull_request) Successful in 6m29s

The picker accepts one MP4 or WebM, the thread lightbox zooms photos, and Discord gets the video as a file on a follow-up message so photo embeds still render.
This commit is contained in:
2026-08-31 02:00:56 -07:00
parent 84dea8ea5d
commit f96df3222d
22 changed files with 1018 additions and 144 deletions
+9 -1
View File
@@ -484,16 +484,19 @@ func TestQuestionPageRendersNestedPostControls(t *testing.T) {
`data-submit-button`,
`enctype="multipart/form-data"`,
`data-image-picker`,
`accept="image/jpeg,image/png,image/webp"`,
`accept="image/jpeg,image/png,image/webp,video/mp4,video/webm,.mp4,.webm"`,
`aria-live="polite"`,
`name="existing_image_id" value="root-photo"`,
`name="existing_image_id" value="reply-photo"`,
`data-image-zoom`,
`href="https://cdn.example/root-photo.jpg"`,
`src="https://cdn.example/root-photo.jpg"`,
`alt="Water pooling below the shutoff valve"`,
`src="https://cdn.example/reply-photo.png"`,
`alt="Photo attached to this post"`,
`src="https://cdn.example/admin-photo.webp"`,
`loading="lazy" decoding="async"`,
`data-image-zoom-dialog`,
`<figcaption>Replacement cartridge orientation</figcaption>`,
`action="/posts/` + root.ID + `/edit"`,
`action="/posts/` + homeownerReply.ID + `/edit"`,
@@ -556,6 +559,9 @@ func TestImagePickerAssetsAreServed(t *testing.T) {
path: "/static/app.js",
wants: []string{
`const pickerSelector = "[data-image-picker]"`,
`video/mp4`,
`video/webm`,
`showModal`,
`new DataTransfer()`,
`addEventListener("drop"`,
`resetImagePicker`,
@@ -569,6 +575,8 @@ func TestImagePickerAssetsAreServed(t *testing.T) {
`.image-dropzone:focus-within`,
`.image-preview-list`,
`.post-image-grid`,
`.post-video`,
`.image-zoom`,
`@media (max-width: 520px)`,
},
},