Skip to content

Cleanup: split the editor's two largest files, de-flake the menu test, auth forms into the model - #87

Merged
freethinkel merged 7 commits into
mainfrom
cleanup/review-items
Oct 24, 2026
Merged

freethinkel merged 7 commits into
mainfrom
cleanup/review-items

Conversation

@freethinkel

Copy link
Copy Markdown
Owner

A sweep over the issues a review turned up. Each commit stands on its own.

Editor structure

  • editor.svelte 1329 → 1016 lines: canvas overlay drawing and drag/resize/nudge geometry move into pure modules, with a unit test for the geometry. The selection and snap-guide colours become tokens (--color-selection, --color-guide) instead of hardcoded hex.
  • edit.model.ts 1289 → 707 lines: widget creation (number, image, progress line, slot, ring art, font frames, AOD screen) moves to create.model.ts, re-exported through editor.model.ts, so components still import one editorModel.

Flaky menu test
ui-menu.browser.test.ts › the menu animates shut sampled the 100ms outro frame by frame after await click(). Under a loaded suite the click's round trip can outlast the fade, so sampling began after the menu was gone. Reproduced by adding a 250ms delay after the click. The test now freezes the animation as Svelte starts it and checks the midpoint. It passes with the same delay and still fails when the transition is removed.

Auth

  • Login/signup fields move from component $state into $loginForm/$signupForm. The password-confirmation check moves into auth.model, before registerFx.
  • pbErrorMessage(e, ...fields) in shared/api replaces three any-typed copies of the PocketBase error parsing.

Small

  • rem/oklch where px/hex had slipped in. The slider thumb's offset is now computed from the track size, so the thumb sits centred (it was ~1.6px off).
  • Cleared the three lint warnings.
  • Dependencies updated within their semver ranges only (vite 8.3, svelte 5.57, oxlint 1.89, playwright 1.64, …). Majors are left for their own branches.

Verification: pnpm check, lint, format:check and build are clean. pnpm test: 60 files, 343 passed, 1 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC

freethinkel and others added 7 commits October 25, 2026 00:12
The fade lasts 100ms; under a loaded suite the outside click's round trip
can outlast it, so the per-frame sampling started after the menu was
already gone and saw no frames at all. Freeze the animation as Svelte
starts it and check its midpoint instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
The login and signup fields lived in component $state, with the password
confirmation checked in the signup form. They are now $loginForm and
$signupForm, patched like the profile form, and the mismatch is decided in
auth.model before registerFx is called. The three copies of
`e.data?.data?.<field>?.message || e.message` become pbErrorMessage in
shared/api, typed against ClientResponseError instead of `any`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
The watchface page's face width, the slider thumb's offset (now computed
from the track and thumb sizes, so it is actually centred) and two hex
colours. The rest are blank-line-after-vars warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
Minor and patch releases only (vite 8.3, svelte 5.57, oxlint 1.89,
playwright 1.64, pocketbase 0.27.3, …). The majors — Kit 3,
adapter-static 4, vitest 5, TypeScript 7, @beacio/core 2, pixelmatch 8 —
are left for their own branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
The selection chrome (boxes, handles, pivot cross, snap guides) now lives in
core/render/overlay.ts and the drag/resize/rotate/nudge math in shared/drag.ts,
both pure. editor.svelte keeps the pointer and key handlers as glue and fires
the same events as before. The selection colour becomes the --color-selection
token, read once from CSS. tests/editor-drag.test.ts covers a corner resize.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
edit.model mixed actions on the existing layer tree with making new
things from scratch. The creation half — number/image/widget, progress
line and its recolour, slot and its metric icons, group/procedural ring,
a ring's first bitmap, glyph rasterizing, adding/removing the AOD screen
— moves to create.model, re-exported through editor.model so components
still import a single editorModel. Removing a slot metric edits a slot
that exists, so slotMetricRemoved stays in edit.model.

create.model imports selectAdded and withAssets from edit.model; edit
imports nothing back, so there is no cycle. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
GUIDE_COLOR leaves shared/constants.ts for --color-guide in tokens.css, read
alongside --color-selection when the canvas loop starts. The snap browser test
now loads tokens.css, since it mounts the page without the app's stylesheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013y6z25YoKDW67GVGCFrXGC
@freethinkel
freethinkel merged commit 688f891 into main Oct 24, 2026
1 check passed
@freethinkel
freethinkel deleted the cleanup/review-items branch October 24, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant