Commit Graph
12 Commits
Author SHA1 Message Date
Donkie 8a5cf7ec73 client_v2: add mobile accessibility audit (Playwright + axe-core)
Adds an npm run audit:a11y target that runs axe-core (WCAG 2.0/2.1 A+AA
plus the 2.2 target-size rule) and a custom tap-target measurement across
the main surfaces under Pixel 5 emulation, reusing the dev server on 5174.
Results are aggregated to a11y-report.md via globalTeardown so they survive
Playwright worker restarts.
2026-07-25 19:07:24 +02:00
DonkieandClaude Opus 4.8 5eb660f420 client_v2: add ESLint + wire lint/format/typecheck into lefthook
client_v2 has matured, so enforce its checks like the old client:

- Add ESLint (typescript-eslint + eslint-plugin-svelte) with a flat
  config; `lint` now runs prettier --check and eslint.
- Add a "Client v2" group to lefthook pre-commit and ci: eslint,
  prettier, and svelte-check type checking (svelte-kit sync first).
- Exclude generated paraglide output from prettier.

Fix the linting warnings this surfaced: drop dead vars and an unused
svelte-ignore, mark intentional reactive reads with `void`, remove a
useless children snippet, and clean up useless string-literal mustaches.

Disable svelte/no-navigation-without-resolve (base-path resolution is
centralized in params.ts helpers, so the rule only false-positives and
wrapping call sites would double-apply the base path). Keep
svelte/prefer-svelte-reactivity on with per-line disables at the
transient-local Set/Map sites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 10:23:17 +02:00
DonkieandClaude Opus 4.8 f69d098473 client_v2: approve esbuild install script for npm 11 allowScripts
npm 11 holds back dependency install scripts unless allow-listed, printing
a notice for esbuild's postinstall. Approve it explicitly so `npm install`
runs cleanly; older npm versions ignore the unknown field harmlessly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 09:00:16 +02:00
Donkie a34d52a597 client_v2: fall back empty locale values to base language
Weblate writes an empty string for every untranslated key. Paraglide
compiles a present-but-empty value into a message function that returns
"", so the site rendered a blank instead of falling back to English. A
key that is absent from a locale, by contrast, is re-exported from the
base locale and falls back correctly.

Add scripts/strip-empty-locales.mjs to delete empty/whitespace-only
leaves from the non-base locales/*/common.json before paraglide compiles
them, turning "present-but-empty" into "absent". Idempotent, base en
untouched, key order and formatting preserved. Wired as predev/prebuild
so builds stay correct if empties reappear from a later Weblate sync;
deliberately not a lint/CI gate, since empties are a benign expected
input to be neutralised, not forbidden.

Cleans 125 existing empties across 10 locales.

Claude-Session: https://claude.ai/code/session_014Cwk5Yyze9yPvkYkUtMAP4
2026-07-20 16:32:04 +02:00
Donkie c72036f650 client_v2: save labels as images, with a configurable DPI
Adds a third mode to the label print panel, alongside Sheet and Label
printer: Image files. It saves one PNG per selected spool at the design's
label size, using the same Konva rasterizer that printing uses. Sheet
geometry and the copy count are ignored there — an exported image is meant
for a label printer or an image editor, where a tiled A4 page would just
have to be cut apart again, and copies would be byte-identical files.

Up to ZIP_THRESHOLD (5) labels download as individual PNGs, spaced apart
because browsers throttle bursts of programmatic downloads; past that they
arrive as a single zip built with fflate, dynamically imported so it stays
out of the main bundle and stored rather than deflated since PNG is already
compressed.

Also adds a per-design DPI setting that applies to printing as well as
export. Printing rasterizes through the same path, so a 300 dpi raster sent
to a 203 dpi thermal printer gets resampled by the driver either way — that
resolution mismatch, not the file format, is what issue #730 was actually
describing. Designs saved before this pick up the default via the
DEFAULT_LAYOUT spread in api/labelDesigns.ts; the v1 migration sets it
explicitly.

Claude-Session: https://claude.ai/code/session_014Cwk5Yyze9yPvkYkUtMAP4
2026-07-19 09:53:35 +02:00
Donkie f7103ec9e2 client_v2: live drag-drop for location cards and spools
Rework the Locations page onto svelte-dnd-action so that container
reordering, reordering spools within a location, and moving spools
between locations all update live while dragging, matching the old
client. Native HTML5 drag couldn't do live cross-card moves because the
dragged node is destroyed when it changes each-block.

Per-location spool order is persisted in the `locations_spoolorders`
setting (keyed by location name, "" for no location), shared with the
old client. Shelf dragging is gated to the grip handle via the library's
dragDisabled pattern so it doesn't hijack the nested spool zones.

Claude-Session: https://claude.ai/code/session_01VQQtwPBPiMCoZCpBbbqS64
2026-07-18 19:02:16 +02:00
Donkie f23f5611b2 client_v2: replace emoji/glyph icons with @lucide/svelte
Swap all emoji and text-glyph icons (✕ + ☑ ⚖ 🏭 🗓 ⌄ ↑↓ ‹› ▾▸ ◱ T ▧ ▭ ⠿ →)
and the custom scan SVG for Lucide icons across the toolbar, library,
add-spool, labels, locations, settings, datetime and QR scanner UIs.
Adds the missing Archive-button icon and strips the arrow from the
"Open filament" string in favour of an ArrowRight icon. Global .lucide
alignment rule in app.css. Purpose-built NumberInput stepper carets kept.

Claude-Session: https://claude.ai/code/session_01VQQtwPBPiMCoZCpBbbqS64
2026-07-18 13:05:58 +02:00
Donkie d65b50d5a2 Use paraglide for i18n in client_v2. Update base path handling 2026-07-16 18:41:01 +02:00
Donkie 4bdebbdded Add localization to v2 client (svelte-i18n)
Introduce full i18n for the Svelte client_v2 using svelte-i18n (ICU/formatjs),
mirroring the old client's language support.

- i18n setup in src/lib/i18n/ (lazy per-language loaders, init + waitLocale boot
  guard, setLocale persisted to localStorage, Intl locale helper); 26-language
  registry ported from the old client.
- Language picker on the Settings page.
- scripts/convert-locales.mjs seeds static/locales/<lang>/common.json from the
  old client's Weblate files: {{var}} -> {var}, escapes literal braces, merges
  i18next plural suffixes into ICU plurals. Existing translations are reused via
  the same keys; new v2-only strings are added to en/common.json only and fall
  back to English until Weblate fills them.
- Extracted all hardcoded UI strings across routes and components to $_ lookups;
  DateTimeField derives month/weekday names from Intl in the active locale.
- static/locales is prettier-ignored (mirrors the old client's public/locales).

Follow-up (maintainer): add a Weblate component pointing at
client_v2/static/locales (nested JSON, ICU MessageFormat, English source).

Claude-Session: https://claude.ai/code/session_01Ne7RsfHejKZX97uAq3aVMn
2026-07-13 14:45:37 +02:00
Donkie cf82d5b68f Add camera QR scanner to v2 client
Restores the old client's built-in scanner: a TopBar button opens a
camera modal (qr-scanner) that reads Spoolman label codes and opens the
matching spool in the Library. Parses both the WEB+SPOOLMAN:S-<id> URI
and the /spool/show/<id> URL forms.

Camera-start errors are reported specifically: an insecure (non-HTTPS)
context is detected up front via isSecureContext, and other failures are
re-probed via getUserMedia to recover the real error (permission
blocked, no camera, camera in use) since qr-scanner collapses them all
into a generic string.
2026-07-13 11:04:20 +02:00
Donkie 46b69808a6 WIP: add label designer and misc v2 client improvements
Adds a label design/print subsystem (canvas editor, QR/logo/paper
helpers, print layout panel) backed by a new label_designs setting,
plus a footer, datetime field component, and assorted fixes across
the library and settings views.
2026-07-13 10:10:40 +02:00
Donkie c82e3911e1 WIP: add v2 client (Svelte) with spool grouping backend
Introduces client_v2, a new SvelteKit-based client, alongside the
backend it depends on: a /spool/group endpoint that returns
per-group aggregates (count, in-use count, remaining weight,
last-used) grouped by filament, vendor, material or location, so the
client can paginate whole groups instead of fetching every spool.

Not yet complete/wired up for release.
2026-07-12 19:21:34 +02:00