Notes Float: split editing.svelte.ts / ComposerBody under size budgets (ADR 0070) #1123

Closed
kayg wants to merge 0 commits from port/notes-float-size into port/notes-float
Owner

Pure refactor (ADR 0070), no behaviour change. Base port/notes-float @ 2eb533862.

Moves

  • lib/page-style.ts (new): Width/PageStyle/Separator types, MIN_OPACITY, widthOf, pageStyle. editing.svelte.ts re-exports them, so no import changes elsewhere. editing.svelte.ts: 504 → under 500.
  • composer/PreviewCard.svelte (new): the palette preview pane with its pvReady two-frame mount and styles, cut out of ComposerBody.svelte (533, ceiling 509 → under). Renders into the same .preview flex column with no wrapper.
  • Backdrop.svelte 636 → 635 ceiling: four frostPicture.* assignments became one Object.assign (same writes).

Whole-branch size script (node ci/check-size-budgets.mjs), over on port/notes-float vs on origin/dev (796d80cba):

file notes-float dev action
editing.svelte.ts 504/500 ok fixed here
ComposerBody.svelte 533/509 ok fixed here
Backdrop.svelte 636/635 ok fixed here
NoteList.svelte 582/567 same 582/567 already over on dev, untouched
Sidebar.svelte 528/500 530/500 over on dev (branch is 2 smaller), untouched
crates/fsio/src/lib.rs, notes/{home,lib,meta}.rs, write_executor/home.rs over identical numbers pre-existing on dev, untouched
Not over on notes-float but over on dev: Shell.svelte (507/506) is fine on the branch.

Gates (built from this head 21b4be68c)

  • node ci/check-size-budgets.mjs: editing/ComposerBody/Backdrop/page-style/PreviewCard no longer reported.
  • bun run check (svelte-check): 0 errors (19 pre-existing warnings); bunx vitest run: 295/295.
  • Bundle (scripts/bundle-size.mjs, raw/gzip/brotli): first-paint JS 805.3 / 269.9 / 229.3 KB vs base 805.3 / 269.9 / 229.2 KB; first-paint CSS identical. Raw and gzip unchanged; brotli +0.1 KB (one more module wrapper in the lazy-loaded palette/editing chunks' packing, shown at 0.1 KB rounding). No new first-paint code.
  • Playwright (width, style-*, switching, keys-no-motion; I also ran composer-open/composer/composer-tasks listed in e2e only via the file name filter, not selected): chromium-1440 40 pass/1 skip, chromium-390 17 pass/24 skip (dev-01, x86); webkit-1440 39 pass/2 skip, webkit-390 17 pass/24 skip (dev-02). Server binary built from this branch. 0 failures, retries 0.

No perf run: identical runtime work: the same functions with the same bodies and the same store reads, moved between modules (a re-export and a component boundary that renders the same DOM). The one micro-change (Object.assign for four writes into one $state proxy) runs once per backdrop change in an effect, not on a hot path.

Palette / preview specs (composer, composer-open, composer-tasks, search-palette, search-preview-cheap, search-shots, shortcuts, lazy-ui, keys-no-motion; --workers=1 --retries=0, own --output, server built from 21b4be68c): chromium-1440 58 pass/9 skip, chromium-390 32/35 skip (dev-01); webkit-390 31/36 skip, webkit-1440 57 pass/1 fail/9 skip (dev-02).
The one failure, composer-open.spec.ts:105 ("fetch nothing after the input", 3 image fetches) on webkit-1440, is pre-existing/flaky: --repeat-each=4 twice per ref on webkit-1440 gave base 2eb533862: 4/4 and 3/4 fail; this head: 3/4 and 3/4 fail. Not caused by this PR.

⌘K open path: PreviewCard holds the unchanged pvReady state and the same two-rAF mount, so the open runs the same work: one extra component instance (a pass-through), no extra effects, fetches, observers or DOM. Only difference: composer.peek is now read in ComposerBody's template as a prop expression on open, instead of inside the {#if pvReady} block (the hints footer already reads it); one getter read. Argued from the code, no trace taken.

🤖 Generated with Claude Code

Pure refactor (ADR 0070), no behaviour change. Base `port/notes-float` @ 2eb533862. **Moves** - `lib/page-style.ts` (new): `Width`/`PageStyle`/`Separator` types, `MIN_OPACITY`, `widthOf`, `pageStyle`. `editing.svelte.ts` re-exports them, so no import changes elsewhere. editing.svelte.ts: 504 → under 500. - `composer/PreviewCard.svelte` (new): the palette preview pane with its `pvReady` two-frame mount and styles, cut out of `ComposerBody.svelte` (533, ceiling 509 → under). Renders into the same `.preview` flex column with no wrapper. - `Backdrop.svelte` 636 → 635 ceiling: four `frostPicture.*` assignments became one `Object.assign` (same writes). **Whole-branch size script** (`node ci/check-size-budgets.mjs`), over on `port/notes-float` vs on `origin/dev` (796d80cba): | file | notes-float | dev | action | |---|---|---|---| | editing.svelte.ts | 504/500 | ok | fixed here | | ComposerBody.svelte | 533/509 | ok | fixed here | | Backdrop.svelte | 636/635 | ok | fixed here | | NoteList.svelte | 582/567 | same 582/567 | already over on dev, untouched | | Sidebar.svelte | 528/500 | 530/500 | over on dev (branch is 2 smaller), untouched | | crates/fsio/src/lib.rs, notes/{home,lib,meta}.rs, write_executor/home.rs | over | identical numbers | pre-existing on dev, untouched | Not over on notes-float but over on dev: Shell.svelte (507/506) is fine on the branch. **Gates** (built from this head 21b4be68c) - `node ci/check-size-budgets.mjs`: editing/ComposerBody/Backdrop/page-style/PreviewCard no longer reported. - `bun run check` (svelte-check): 0 errors (19 pre-existing warnings); `bunx vitest run`: 295/295. - Bundle (`scripts/bundle-size.mjs`, raw/gzip/brotli): first-paint JS 805.3 / 269.9 / 229.3 KB vs base 805.3 / 269.9 / 229.2 KB; first-paint CSS identical. Raw and gzip unchanged; brotli +0.1 KB (one more module wrapper in the lazy-loaded palette/editing chunks' packing, shown at 0.1 KB rounding). No new first-paint code. - Playwright (width, style-*, switching, keys-no-motion; I also ran composer-open/composer/composer-tasks listed in e2e only via the file name filter, not selected): chromium-1440 40 pass/1 skip, chromium-390 17 pass/24 skip (dev-01, x86); webkit-1440 39 pass/2 skip, webkit-390 17 pass/24 skip (dev-02). Server binary built from this branch. 0 failures, retries 0. **No perf run:** identical runtime work: the same functions with the same bodies and the same store reads, moved between modules (a re-export and a component boundary that renders the same DOM). The one micro-change (`Object.assign` for four writes into one `$state` proxy) runs once per backdrop change in an effect, not on a hot path. **Palette / preview specs** (composer, composer-open, composer-tasks, search-palette, search-preview-cheap, search-shots, shortcuts, lazy-ui, keys-no-motion; `--workers=1 --retries=0`, own `--output`, server built from 21b4be68c): chromium-1440 58 pass/9 skip, chromium-390 32/35 skip (dev-01); webkit-390 31/36 skip, webkit-1440 57 pass/1 fail/9 skip (dev-02). The one failure, `composer-open.spec.ts:105` ("fetch nothing after the input", 3 `image` fetches) on webkit-1440, is **pre-existing/flaky**: `--repeat-each=4` twice per ref on webkit-1440 gave base 2eb533862: 4/4 and 3/4 fail; this head: 3/4 and 3/4 fail. Not caused by this PR. **⌘K open path:** PreviewCard holds the unchanged `pvReady` state and the same two-rAF mount, so the open runs the same work: one extra component instance (a pass-through), no extra effects, fetches, observers or DOM. Only difference: `composer.peek` is now read in ComposerBody's template as a prop expression on open, instead of inside the `{#if pvReady}` block (the hints footer already reads it); one getter read. Argued from the code, no trace taken. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Split page style out of editing.svelte.ts; PreviewCard out of ComposerBody; trim Backdrop (ADR 0070, no behaviour change)
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
21b4be68c4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Merged into port/notes-float with --no-ff by the orchestrator (pure refactor; palette specs green except composer-open:105 on webkit-1440, which fails on the base too and is handled separately). Closing.

Merged into `port/notes-float` with `--no-ff` by the orchestrator (pure refactor; palette specs green except composer-open:105 on webkit-1440, which fails on the base too and is handled separately). Closing.
kayg closed this pull request 2026-11-14 04:53:52 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!1123
No description provided.