From 4c9d4bbc8fe4ba565963fb295eafeac3bee245bb Mon Sep 17 00:00:00 2001 From: Viktor Petersson Date: Wed, 10 Jun 2026 04:31:28 +0000 Subject: [PATCH] docs(server): attribute single-file limit to the endpoint, not htmx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comments said htmx "would only ever send the first file", but htmx includes every selected file in the multipart body — the real single-file constraint is assets_upload reading request.FILES.get. Reword both comments. Comment-only. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/anthias_server/app/static/src/home.ts | 15 ++++++++------- .../app/templates/_asset_modal.html | 14 ++++++++------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/anthias_server/app/static/src/home.ts b/src/anthias_server/app/static/src/home.ts index 316d263d..77daff8c 100644 --- a/src/anthias_server/app/static/src/home.ts +++ b/src/anthias_server/app/static/src/home.ts @@ -223,13 +223,14 @@ function homeApp(): HomeAppData { }, // Multi-file upload (issue #3045). The server's assets_upload - // endpoint takes exactly one file per POST, so a multi-select - // batch is uploaded sequentially — one XHR per file — rather - // than via htmx's single-form submit. Driving it from JS (instead - // of hx-post on the
) is what makes "X of N" progress and - // per-file failure handling possible; htmx would only ever see - // the first file in the input. Mirrors the pre-#2818 React - // behaviour added in #2778. + // endpoint reads exactly one file per request + // (request.FILES.get('file_upload')), so a single htmx form POST — + // which would carry every selected file in the multipart body — + // would still only create one asset. uploadFiles() instead uploads + // the batch sequentially, one XHR (one file) per request. Driving + // it from JS (instead of hx-post on the ) is also what makes + // "X of N" progress and per-file failure handling possible. Mirrors + // the pre-#2818 React behaviour added in #2778. async uploadFiles(input: HTMLInputElement) { const files = input.files ? Array.from(input.files) : [] const form = input.form diff --git a/src/anthias_server/app/templates/_asset_modal.html b/src/anthias_server/app/templates/_asset_modal.html index 0d481d2d..91f50780 100644 --- a/src/anthias_server/app/templates/_asset_modal.html +++ b/src/anthias_server/app/templates/_asset_modal.html @@ -66,12 +66,14 @@
- {% comment %} The file tab is NOT htmx-managed. assets_upload takes - one file per POST, so a multi-select batch is uploaded - sequentially by uploadFiles() in home.ts (one XHR per file) — - htmx's single-form submit would only ever send the first file. - The action / enctype attributes stay so uploadFiles() can read - the endpoint URL off the form and the CSRF token off its input. + {% comment %} The file tab is NOT htmx-managed. assets_upload reads + one file per request (request.FILES.get('file_upload')), so a + single htmx form POST — even though it would carry every + selected file in the multipart body — would only ever get one + asset created. uploadFiles() in home.ts instead uploads the + batch sequentially, one XHR (one file) per request. The action + / enctype attributes stay so uploadFiles() can read the endpoint + URL off the form and the CSRF token off its input. {% endcomment %}