Skip to content

perf(marketing): cut flow-sprite keyframes so the home glide holds 60fps in WebKit - #1220

Merged
athvin merged 1 commit into
mainfrom
perf/marketing-flow-keyframes
Nov 25, 2026
Merged

athvin merged 1 commit into
mainfrom
perf/marketing-flow-keyframes

Conversation

@athvin

@athvin athvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #1219

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

useFlowMotion now keeps only the keyframes linear interpolation cannot reproduce (new pure simplifySamples, ≤0.5px / ≤1% opacity drift). Sprites go from 83–603 keyframes to 6–27; the motion is unchanged.

Why

The home page's Next-chapter glide ran at ~5fps in WebKit/Safari: WebKit re-resolves every keyframe of all 50 sprites on each scroll frame, even when they are paused. Chrome was unaffected, which is why Chrome profiles looked clean.

Proof

New unit test tests/unit/flow-keyframes.test.ts passes, and it fails when simplification is disabled (seen failing). WebKit A/B of two build:preview exports is in Context. make frontend was not run to completion locally; CI is the gate for this PR, at the owner's request.

Risk & rollback

Visual only, and only on marketing flow animations. Worst case, a sprite drifts by ≤0.5px at a corner. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:a6b4a198-683e-4e70-ad0b-986e4470df62 on brians-MacBook-Pro · 2026-11-25T09:41:17Z

Specific to this change

  • re-ran WebKit Next-click against live dupezero.com — 0 frames >33ms on all 5 chapters, p95 17–18ms
Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Playwright WebKit, DPR 2, 1512×860; frames recorded by an in-page rAF loop.

main build this branch
700ms scripted scroll, frames rendered (×4 ranges) 4–5 (max 250–320ms) 42–43 (max 23–41ms)
Next-button glide, frames >33ms (×5 chapters) 7–8 each, p95 154–213ms 0, p95 18–19ms
keyframes per sprite 83–603 6–27

Chromium on the same build: 60fps locked before and after.

Bisect on live dupezero.com: hiding .story-wires sprites alone restored 60fps. Pausing or cancelling animations, removing will-change, contain: strict, hiding SVGs or whole sections did not. Decimating keyframes did, which pinned the cause as keyframe count.

Files

  • frontend/src/components/marketing/demo/flow-keyframes.ts (new)
  • frontend/src/components/marketing/demo/flow-motion.tsx
  • frontend/tests/unit/flow-keyframes.test.ts (new)

🤖 Generated with Claude Code

…fps in WebKit

useFlowMotion sampled every path each 4px, giving each of the home page's
50 sprites 83-603 keyframes. WebKit re-resolves them on every scroll frame,
paused or not, so the Next-chapter glide rendered at ~5fps in Safari.
simplifySamples keeps only the samples linear interpolation cannot
reproduce (<=0.5px, <=1% opacity drift): 6-27 keyframes per sprite.

Closes #1219

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The marketing preview was removed because this PR is closed or merged.

@athvin
athvin merged commit 53e2192 into main Nov 25, 2026
42 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 25, 2026 09:25 — with GitHub Actions Inactive
athvin pushed a commit that referenced this pull request Nov 27, 2026
…the unmerge, the rule holding

Section 06 was an SVG diagram a visitor could only play. It never showed
how to decide a close call or how to undo a merge, and its packets
sampled 60 WAAPI keyframes each, which is the WebKit scroll-cost trap
from #1220.

It becomes a short film about Meridian Supply with two decisions the
visitor makes. Each step is one the product verifiably takes:

1. The gray zone. The run's pairs settle onto the threshold scale, and
   three wait between 0.80 and 0.95.
2. Your call, on Salesforce ↔ API at 0.93.
   - Match writes an always-match rule, and the API card folds under
     the Salesforce card into E-1042.
   - Not a match writes a never-match rule, and the API record stays
     E-2077 (resolve_review in the er-cli drain).
3. Unmerge. A week later Meridian Supply Ltd (London) joins on its own
   at 0.99: it carries the parent's account number and orders@ mailbox.
   The visitor selects it and presses "Unmerge 1 selected". One
   never-match rule is written against a kept member, as
   unmerge_entity does, and the split lands with the reconcile job.
4. It holds. The next run scores both pairs the same, and the rules
   decide.

The record's history fills in beside the window.

- Playback. The film starts once 40% of it is on screen and waits at
  each decision. "Play it for me" makes the usual choices. Pause,
  Replay and a step rail are there too.
- Timing. One WAAPI clock times each moment, so pausing, scrolling
  away and hiding the tab all hold it.
- Fallbacks. Reduced motion and the page without JavaScript show step
  4 as the poster, the whole story in one frame.
- Layout. The four shots share one grid cell, so the window never
  changes height as it cuts. A container query gives phones their own
  layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin pushed a commit that referenced this pull request Nov 27, 2026
…the unmerge, the rule holding

Section 06 was an SVG diagram a visitor could only play. It never showed
how to decide a close call or how to undo a merge, and its packets
sampled 60 WAAPI keyframes each, which is the WebKit scroll-cost trap
from #1220.

It becomes a short film about Meridian Supply with two decisions the
visitor makes. Each step is one the product verifiably takes:

1. The gray zone. The run's pairs settle onto the threshold scale, and
   three wait between 0.80 and 0.95.
2. Your call, on Salesforce ↔ API at 0.93.
   - Match writes an always-match rule, and the API card folds under
     the Salesforce card into E-1042.
   - Not a match writes a never-match rule, and the API record stays
     E-2077 (resolve_review in the er-cli drain).
3. Unmerge. A week later Meridian Supply Ltd (London) joins on its own
   at 0.99: it carries the parent's account number and orders@ mailbox.
   The visitor selects it and presses "Unmerge 1 selected". One
   never-match rule is written against a kept member, as
   unmerge_entity does, and the split lands with the reconcile job.
4. It holds. The next run scores both pairs the same, and the rules
   decide.

The record's history fills in beside the window.

- Playback. The film starts once 40% of it is on screen and waits at
  each decision. "Play it for me" makes the usual choices. Pause,
  Replay and a step rail are there too.
- Timing. One WAAPI clock times each moment, so pausing, scrolling
  away and hiding the tab all hold it.
- Fallbacks. Reduced motion and the page without JavaScript show step
  4 as the poster, the whole story in one frame.
- Layout. The four shots share one grid cell, so the window never
  changes height as it cuts. A container query gives phones their own
  layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin added a commit that referenced this pull request Nov 27, 2026
… zone, unmerge, the rule holds (#1298)

* wip: claim #1297 — home 06 interactive audit film

* feat(marketing): home 06 — an interactive audit film: the gray zone, the unmerge, the rule holding

Section 06 was an SVG diagram a visitor could only play. It never showed
how to decide a close call or how to undo a merge, and its packets
sampled 60 WAAPI keyframes each, which is the WebKit scroll-cost trap
from #1220.

It becomes a short film about Meridian Supply with two decisions the
visitor makes. Each step is one the product verifiably takes:

1. The gray zone. The run's pairs settle onto the threshold scale, and
   three wait between 0.80 and 0.95.
2. Your call, on Salesforce ↔ API at 0.93.
   - Match writes an always-match rule, and the API card folds under
     the Salesforce card into E-1042.
   - Not a match writes a never-match rule, and the API record stays
     E-2077 (resolve_review in the er-cli drain).
3. Unmerge. A week later Meridian Supply Ltd (London) joins on its own
   at 0.99: it carries the parent's account number and orders@ mailbox.
   The visitor selects it and presses "Unmerge 1 selected". One
   never-match rule is written against a kept member, as
   unmerge_entity does, and the split lands with the reconcile job.
4. It holds. The next run scores both pairs the same, and the rules
   decide.

The record's history fills in beside the window.

- Playback. The film starts once 40% of it is on screen and waits at
  each decision. "Play it for me" makes the usual choices. Pause,
  Replay and a step rail are there too.
- Timing. One WAAPI clock times each moment, so pausing, scrolling
  away and hiding the tab all hold it.
- Fallbacks. Reduced motion and the page without JavaScript show step
  4 as the poster, the whole story in one frame.
- Layout. The four shots share one grid cell, so the window never
  changes height as it cuts. A container query gives phones their own
  layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(marketing): the audit film's model, island and specs; shots that never change the page's height

- Unit (marketing-audit-model): the film's numbers agree with score.ts
  (0.93 in review, 0.99 over auto-join), and three pairs wait in the
  band. A match writes always and Not a match writes never. Unmerge
  needs a selection and writes exactly one never rule against a member
  that stays. Both branches hold on the next run. A jump fills in the
  usual choices. The narration never claims an automatic flag, and the
  records are fictional (Ofcom's drama range, .example mail).
- Component: the server render is the poster with no dead controls,
  both branches can be driven through the rail, the AI recommendation
  is opt-in, and only the current shot is reachable.
- Functional: the three audit specs are rewritten for the film. This is
  a deliberate behaviour change, because it now waits at a decision, so
  its clock test plays on with "Play it for me". A new marketing-scenes
  block covers starting when seen, waiting for the call, both branches,
  and one window height across every cut.

That last spec failed first, on both phone profiles (87px). The record
view and the next run drew some rows only in some states, and the same
87px broke the footer spec on WebKit through the status bar growing at
hydration.

- Every shot now draws one structure in every state.
- The status line reserves its longest sentence: all of them sit in its
  cell, invisible.
- The controls row reserves one button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(marketing): the audit never moves the page under a reader, WebKit included

The footer spec failed on mobile-safari: with the reader already parked
at the foot of the page, hydration moved the scroll by 104px. The page
height did not change, no script scrolled, and `overflow-anchor: none`
did nothing. Bisecting with injected styles found two element swaps:

- 56px from the step rail, where a <span> became a <button>;
- 48px from the London row, where a <span> became a <label>.

WebKit clamps a reader at the maximum scroll when an in-flow element is
replaced. Pure insertions into reserved space did nothing.

- The rail keeps its words, and a transparent button is laid over them
  once hydrated.
- The row is a <label> from the server render on, and only its 18px box
  becomes the checkbox.
- The film stays the still poster until it comes within a screen of
  the viewport, so it does not change state at hydration either.
- The member list always keeps four slots, and the history card
  reserves both branches' full records, so no step changes the
  window's height on any phone (it varied by 56px).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(marketing): the audit history's entries sit at the top of their reserved space

The history card reserves the height of the longest full record. The real
list shared that grid cell, stretched to it, and spread its entries down
the card (a filmed desktop frame showed "YOU" floating far above its
sentence). Each list now sits at the top at its own height.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(marketing): the audit film's poster baselines, and the CTA's on phones

Regenerated in the pinned Linux image (mcr.microsoft.com/playwright:v1.63.0-jammy).

- marketing-audit x3: the new poster, step 4 of the film.
- marketing-cta, mobile-chrome and mobile-safari: the section moved up
  by a fraction of a pixel, because the audit section above it changed
  height. Its antialiasing shifts by a row (4.8-6.2% of pixels), over
  the comparison's 1% tolerance.

The run also rewrote reviews-mobile-chrome and marketing-hero-mobile-chrome
(two rows at the top, 0.24%). This diff does not explain either, so they
are not committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(marketing): on a phone the audit's call comes before its evidence

Filmed in WebKit on the iPhone 15 profile (659px tall): with the stage at
the top of the screen, Match and Not a match sat at the very bottom, under
the floating next-chapter button. On narrow stages the score, its sentence
and the decision now come first and the evidence bars follow as the
reasons, so the call is on the first screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
marketing-preview — f5042b89 Deployed Nov 25, 2026 by athvin via remove closed PR previews #46
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.

perf(marketing): home page glide runs at ~5fps in WebKit — flow sprites carry up to 600 keyframes

2 participants