fix: laat de beeldcarrousel via ImageService kiezen in plaats van zelf #559

Merged
brenno merged 1 commit from fix/carousel-web into main 2026-07-22 13:57:32 +00:00
Owner

Summary

The carousel made its own FilePicker call and read .path from it. On web that is a blob: URL — it looks like a path, points nowhere, and the rest of the app expects a mem: key there. The chosen image landed in the slide as a broken reference.

Closes #526

Why this one is fixed rather than hidden

The logo picker (#506) was hidden, because a logo is stored as a filesystem path in the theme profile and a browser has nothing to put there. That reasoning does not transfer. A carousel exists to hand an image back to a slide, and ImageService.pickImageDetailed already does exactly that on both platforms — with the bytes branch for the browser, the size cap, and the check that the bytes really are an image.

Maintaining a second FilePicker call meant missing all three. The fix removes the duplicate rather than gating it.

filePickerPathBaseline drops from 8 to 7 — progress on #528 as a side effect, not by touching the baseline by hand.

The new class ratchet earned its keep immediately

#518's per-class ratchet fired on my own comment: four lines over the ceiling for _ImageCarouselPickerState. I shortened the comment rather than raising the baseline. That is what the gate is for, and it is worth saying out loud — the tempting move is always the other one.

Verification

make check green. No new test: the broken branch is the web one, and kIsWeb is always false under flutter test — the same structural limit recorded in #505/#506. What guards it now is that the call site is gone entirely, which check_conventions confirms by no longer finding it.

## Summary The carousel made its own `FilePicker` call and read `.path` from it. On web that is a `blob:` URL — it looks like a path, points nowhere, and the rest of the app expects a `mem:` key there. The chosen image landed in the slide as a broken reference. Closes #526 ## Why this one is fixed rather than hidden The logo picker (#506) was hidden, because a logo is stored as a filesystem path in the theme profile and a browser has nothing to put there. That reasoning does not transfer. **A carousel exists to hand an image back to a slide**, and `ImageService.pickImageDetailed` already does exactly that on both platforms — with the bytes branch for the browser, the size cap, and the check that the bytes really are an image. Maintaining a second `FilePicker` call meant missing all three. The fix removes the duplicate rather than gating it. `filePickerPathBaseline` drops from 8 to 7 — progress on #528 as a side effect, not by touching the baseline by hand. ## The new class ratchet earned its keep immediately #518's per-class ratchet fired on **my own comment**: four lines over the ceiling for `_ImageCarouselPickerState`. I shortened the comment rather than raising the baseline. That is what the gate is for, and it is worth saying out loud — the tempting move is always the other one. ## Verification `make check` green. No new test: the broken branch is the web one, and `kIsWeb` is always `false` under `flutter test` — the same structural limit recorded in #505/#506. What guards it now is that the call site is gone entirely, which `check_conventions` confirms by no longer finding it.
fix(carrousel): laat het kiezen van een afbeelding via ImageService lopen
Some checks failed
CI / Gate (Linux) · Format · Analyze · Coverage (pull_request) Failing after 4s
CI / Web hardening (pull_request) Failing after 4s
CI / Docs links (pull_request) Failing after 4s
CI / Supply-chain (Trivy · advisory) (pull_request) Failing after 5s
CI / Gate (Linux) · Format · Analyze · Coverage (push) Failing after 5s
CI / Web hardening (push) Failing after 4s
CI / Docs links (push) Failing after 5s
CI / Supply-chain (Trivy · advisory) (push) Failing after 5s
CI / Test (macos-latest) (pull_request) Has been cancelled
CI / Test (windows-latest) (pull_request) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
6b2b45bc41
De carrousel deed zijn eigen FilePicker-aanroep en las daar `.path` uit.
Op web is dat een blob:-URL: hij ziet eruit als een pad, wijst nergens
heen, en de rest van de app verwacht daar juist een mem:-sleutel. Het
gekozen beeld belandde zo als kapotte verwijzing in de dia.

Anders dan bij de logokiezer (#506) is verbergen hier het verkeerde
antwoord: een carrousel bestáát om een afbeelding voor een dia terug te
geven, en ImageService.pickImageDetailed kent die route al — inclusief de
bytes-tak voor de browser, de groottegrens en de controle dat het
werkelijk een afbeelding is. Een tweede FilePicker-aanroep onderhouden
betekende die drie dingen missen.

Daarmee krimpt filePickerPathBaseline van 8 naar 7.

De klasseratchet uit #518 ging hierbij meteen af op mijn eigen
commentaar — vier regels boven het plafond. Ingekort in plaats van de
basislijn opgehoogd; dat is waar die poort voor is.

Closes #526

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
brenno merged commit f4d09ba53c into main 2026-07-22 13:57:32 +00:00
brenno deleted branch fix/carousel-web 2026-07-22 13:57:33 +00:00
Sign in to join this conversation.
No description provided.