fix(web): desk Share loads the sheet on press; sheet helpers in their own chunk (lazy-offline red from #842) #1036

Closed
kayg wants to merge 0 commits from fix/deskpills-lazy-share into dev
Owner

Fixes a dev red that #842 introduced: lazy-offline.spec:3 at chromium-1440 (5/5 on dev 40280cd20; 0/3 on 1b971419f, the merge before #842).

Cause

DeskPills (the wide-screen [Share ⋯] toolbar) imported share-open statically. On wide screens, the Share sheet and the shared idle-screens chunk it depended on arrived at startup, ahead of the idle warm-up. The spec reads the chunk list as soon as the first chunk shows, so it saw only idle-screens, where it expects Palette, ListSearch and idle-screens together. Separately, Share depending on idle-screens meant an idle-screens stylesheet failure could be swallowed outside the lazy() retry (lazy-ui.spec:70 at webkit-1440 once Share warmed at idle).

Fix

  1. DeskPills takes Share from the page share registry (pageShare, plugins/note.ts), as the phone pill does. The sheet is imported on the press and warmed at idle, never with the toolbar.
  2. A new small JS-only chunk sheet-kit (apps/web/vite.config.ts, placed before idle-screens) holds the helpers the idle screens and the Share sheet share: portal, tap-catcher, morph-in and Svelte's legacy flag module. share-open now imports dates, index and sheet-kit only, never idle-screens.

Gates (head below)

gate result
svelte-check 0 errors
bundle gate pass. first_js_brotli 222.960 KB, the same as dev (no first-screen change). idle-screens 56.50 (−0.5), sheet-kit 1.00 (new), DeskPills 0.435. Budget lines updated under the 11-08 lazy ceiling (WhenField +0.02 hash jitter)
lazy-offline.spec chromium-1440 ×5 0/5 failed (dev 5/5)
admin-sharing + preload + lazy-ui + lazy-offline, chromium-1440 18 passed
same, webkit-1440 / webkit-390 17 / 19 passed, 0 failed (incl. lazy-ui:70)
admin-webkit-1440 / 390 (sharing) 3 / 3 passed
chromium-390, admin-chromium-1440/390 following in a comment

🤖 Generated with Claude Code

Fixes a dev red that #842 introduced: `lazy-offline.spec:3` at chromium-1440 (5/5 on dev `40280cd20`; 0/3 on `1b971419f`, the merge before #842). ## Cause `DeskPills` (the wide-screen [Share ⋯] toolbar) imported `share-open` statically. On wide screens, the Share sheet and the shared `idle-screens` chunk it depended on arrived at startup, ahead of the idle warm-up. The spec reads the chunk list as soon as the first chunk shows, so it saw only `idle-screens`, where it expects Palette, ListSearch and idle-screens together. Separately, Share depending on `idle-screens` meant an idle-screens stylesheet failure could be swallowed outside the `lazy()` retry (`lazy-ui.spec:70` at webkit-1440 once Share warmed at idle). ## Fix 1. `DeskPills` takes Share from the page share registry (`pageShare`, plugins/note.ts), as the phone pill does. The sheet is imported on the press and warmed at idle, never with the toolbar. 2. A new small JS-only chunk `sheet-kit` (`apps/web/vite.config.ts`, placed before idle-screens) holds the helpers the idle screens and the Share sheet share: portal, tap-catcher, morph-in and Svelte's legacy flag module. `share-open` now imports `dates`, `index` and `sheet-kit` only, never `idle-screens`. ## Gates (head below) | gate | result | |---|---| | svelte-check | 0 errors | | bundle gate | pass. first_js_brotli 222.960 KB, the same as dev (no first-screen change). idle-screens 56.50 (−0.5), sheet-kit 1.00 (new), DeskPills 0.435. Budget lines updated under the 11-08 lazy ceiling (WhenField +0.02 hash jitter) | | `lazy-offline.spec` chromium-1440 ×5 | **0/5 failed** (dev 5/5) | | admin-sharing + preload + lazy-ui + lazy-offline, chromium-1440 | 18 passed | | same, webkit-1440 / webkit-390 | 17 / 19 passed, 0 failed (incl. `lazy-ui:70`) | | admin-webkit-1440 / 390 (sharing) | 3 / 3 passed | | chromium-390, admin-chromium-1440/390 | following in a comment | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DeskPills imported share-open (and so the Share sheet and its shared
chunk) statically, so on wide screens they arrived at startup, ahead of
the idle warm-up. lazy-offline.spec reads the chunk list as soon as the
first chunk shows and failed 5/5 on dev 40280cd20 (0/3 on 1b971419f, the
merge before #842). Share now comes from the page share registry
(plugins/note.ts): imported on the press, warmed at idle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
perf(budgets): sheet-kit 1.05 out of idle-screens (56.55); WhenField hash jitter
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
0bf996e37c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

READY FOR MERGE: head 0bf996e37

The remaining projects at the same head: chromium-390 20 passed, 0 failed; admin-chromium-1440 3 passed; admin-chromium-390 3 passed (admin-sharing + preload + lazy-ui + lazy-offline).

All four projects plus the admin projects are green. lazy-offline is 0/5 at chromium-1440 (dev 5/5), and the bundle gate passes with first paint unchanged.

## READY FOR MERGE: head `0bf996e37` The remaining projects at the same head: chromium-390 20 passed, 0 failed; admin-chromium-1440 3 passed; admin-chromium-390 3 passed (admin-sharing + preload + lazy-ui + lazy-offline). All four projects plus the admin projects are green. `lazy-offline` is 0/5 at chromium-1440 (dev 5/5), and the bundle gate passes with first paint unchanged.
Author
Owner

Merged into dev locally (head 0bf996e37 is in origin/dev); closing.

Merged into dev locally (head `0bf996e37` is in origin/dev); closing.
kayg closed this pull request 2026-11-09 18:55:13 +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!1036
No description provided.