Hero-module: Application Design (componenten, methoden, services, afhankelijkheden); antwoorden van Bryan verwerkt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
| 5 | A | Field `display`: `single` or `slideshow` |
|
||||
| 6 | A | Slide: image, required alt text (or explicitly decorative), order, on/off |
|
||||
| 7 | A + extra | Upload; host keeps the original, reads the size, makes variants for `srcset` (WebP/AVIF); **the administrator can set a focus point and/or crop per image and per use/ratio, with a preview in the admin** |
|
||||
| 8 | A + extra | JPEG, PNG, WebP up to 10 MB; real file type check; strip metadata (GPS); **the CMS resizes, compresses and optimises for the intended size**; reuse what the Decks/SDA session already has (library, settings) without duplicating code |
|
||||
| 8 | A + extra, widened by Bryan (design answer Q2) | Input: as many formats as possible, mainly the common ones (jpg/jpeg, png, webp and, where the library can, gif, bmp, tiff, heic/avif), up to 10 MB, with a real file type check and metadata stripping (GPS). Output: the system chooses what is best per platform (WebP required, AVIF when it can). **The CMS resizes, compresses and optimises for the intended size**; the Decks/SDA session has nothing to reuse |
|
||||
| 9 | C | One language now; the data model allows more languages later without migrating existing data |
|
||||
| 10 | A | As banners and packages: 60 s cache, invalidated directly on every CMS change |
|
||||
| 11 | A | Saving is publishing (no draft) |
|
||||
@@ -65,10 +65,10 @@
|
||||
|
||||
| ID | Requirement |
|
||||
|---|---|
|
||||
| FR-10 | Upload in the admin of JPEG, PNG and WebP, max 10 MB. The type is decided from the file content (signature and a successful decode), never from the file name or the `Content-Type`. Other types, including SVG, are rejected. |
|
||||
| FR-10 | Upload in the admin, max 10 MB, of the common image formats: JPEG, PNG and WebP always, and where the chosen library supports them GIF, BMP, TIFF, HEIC and AVIF (the supported list is fixed in NFR Requirements and shown in the admin). The type is decided from the file content (signature and a successful decode), never from the file name or the `Content-Type`. Anything else, including SVG, is rejected. An animated input (GIF, WebP) is reduced to its first frame. |
|
||||
| FR-11 | All metadata (EXIF including GPS, ICC beyond what is needed for colour, XMP) is removed from every stored and published file. |
|
||||
| FR-12 | The host keeps the original (after validation) and reads its pixel size. It generates optimised variants: several widths and WebP and AVIF (the format set is settled in Application Design with the image library; if AVIF is not feasible on every platform, WebP plus the original format is the minimum). Variants are resized, compressed and sized for the intended use, not the full upload. |
|
||||
| FR-13 | **Focus point and crop.** Per image the administrator can set a focus point (the subject that must not be cut off) and/or a crop rectangle (move and zoom), per use or aspect ratio (for example wide desktop hero and tall mobile hero), with a live preview of the result in the admin. The default focus is the centre. The public data contains the focus point (and the ratio variants) so that a site can use it (for example as `object-position`) and the generated variants respect it. |
|
||||
| FR-13 | **Focus point and crop.** Per image the administrator can set a focus point (the subject that must not be cut off) and/or a crop rectangle (move and zoom), per use or aspect ratio (for example wide desktop hero and tall mobile hero), with a live preview of the result in the admin. The default focus is the centre for every ratio; per ratio (`tall`, `wide`) a separate focus point (and zoom) can optionally be set, otherwise the general point (the centre) applies (Bryan, design answer Q6). The public data contains the general focus point and the ratio variants so that a site can use it (for example as `object-position`) and the generated variants respect the per-ratio settings. |
|
||||
| FR-14 | Images are served by the host from the site's own address (same origin, no change in CSP `img-src`), at an address that contains the content hash, so they can be cached for a long time (`Cache-Control: public, max-age=31536000, immutable`). Uploading a new image gives a new address. |
|
||||
| FR-15 | The preload address for the LCP image is exactly the address used in the `img` (or the same `srcset`/`sizes` pair in the preload), so the browser does not download it twice. |
|
||||
| FR-16 | Deleting a slide or replacing its image removes files that nothing references any more (no orphans). |
|
||||
@@ -103,7 +103,7 @@
|
||||
| NFR-03 (page weight) | The first slide delivered to a phone is a small variant (target: well below the 220 to 440 KB JPG of today at the same visual quality); the exact budgets are set in NFR Requirements. |
|
||||
| NFR-04 (upload safety) | The decode is bounded: maximum pixel count and maximum memory per upload (decompression-bomb protection), a timeout, at most a few uploads processed in parallel, an upload rate limit per user, a body size limit of 10 MB at the framework level. A corrupt or oversized image never takes the host down. |
|
||||
| NFR-05 (platforms) | The chosen library works on win-x64 self-contained (IIS production) and linux-arm64 (the Pi test hosts) and in the CI (linux x64), with a licence that suits a commercial site. This is verified, not assumed. |
|
||||
| NFR-06 (storage) | The stored images survive a deploy (releases are replaced), are part of the backup, and work on the Pi and on IIS; whether bytes live in the database or in a shared directory is decided in Application Design. |
|
||||
| NFR-06 (storage) | Decided (design answer Q1): the images live in a **directory outside the release**, behind an own storage interface so that database storage can follow if the hosting demands it. The directory survives a deploy (Pi: `releases/current/shared`; IIS: a data directory), is part of the backup, and the host account has write permission there. Write permission on the ASF production hosting (MijnHostingPartner, IIS) is not known and is tested by Bryan with ASF; Bryan is asked again if that test fails. |
|
||||
| NFR-07 (accessibility) | The CMS requires alt text or an explicit decorative flag; the sites keep their slider accessibility (pause, reduced motion, screen-reader texts). |
|
||||
| NFR-08 (compatibility) | The public shapes of packages, banners and the injection markers do not change; existing golden files stay green. |
|
||||
| NFR-09 (resilience) | A failing CMS never produces an empty or broken hero: the baked hero stays. |
|
||||
@@ -138,7 +138,7 @@ Layouts or sketch choice; the code line of SLS; socials; the timing, animation,
|
||||
| # | Item | Owner |
|
||||
|---|---|---|
|
||||
| A1 | Image library and AVIF feasibility on win-x64 and linux-arm64; licence. The SDA session has nothing to reuse (see FR-17). Candidates to compare in design: ImageSharp, SkiaSharp, NetVips, Magick.NET | CMS session |
|
||||
| A2 | Storage of originals and variants (database vs shared directory) | Application Design |
|
||||
| A2 | ~~Storage~~ Decided: directory outside the release behind an interface (see NFR-06); the hosting test is open | Bryan with ASF |
|
||||
| A3 | Exact crop/focus model: focus point only, crop per ratio, or both; which ratios (for example 16:9 and 3:4); who applies the crop (host-generated variants vs site `object-position`) | Application Design with ASF and SLS sessions |
|
||||
| A4 | Public JSON shape and marker names: agree with ASF (their proposal and golden files) and SLS | CMS, ASF and SLS sessions |
|
||||
| A5 | SLS renders the title lines and derives the screen-reader text from them; Bryan wants to see the result on SLP Software | SLS session |
|
||||
|
||||
Reference in New Issue
Block a user