Skip to content

Perf (iPad): trip carousel swipe and panel opening restyle far less - #773

Draft
BSoDium wants to merge 4 commits into
mainfrom
ccr-67bf8caf-31a6j6
Draft

BSoDium wants to merge 4 commits into
mainfrom
ccr-67bf8caf-31a6j6

Conversation

@BSoDium

@BSoDium BSoDium commented Nov 29, 2026

Copy link
Copy Markdown
Owner

What

Owner's report from an iPad: the trip carousel is laborious to swipe, and the frame rate drops when a place is opened (the panel) and when the map moves. Full write-up in docs/performance.md ("iPad: the trip carousel and the panel").

Measured in Chrome for Testing 158 on Linux with a 4x CPU slowdown (no iPad or Safari in the session), on /dev/trip-cards:

  • Root cause: a :has() whose anchor is any div ([data-panel] div:has(> [data-slot="site-footer"]) > *) made the browser restyle the whole document whenever an element with a class or an attribute was added or removed anywhere: a panel opening, a map label, a carousel arrow. Swipes showed six 20,000-element restyles (3.3 s of the 4.3 s of style work). Appending one element on a real place page: 8 to 11 ms before, 1.7 ms after.
  • Carousel arrows are now hidden at the ends instead of mounted and unmounted mid-swipe (both carousels).
  • Trip card type weights move in 12 steps (--gw); the poster's route, dots and names fade as one group each; place() no longer forces a layout by reading scrollWidth.
  • Result: 6 swipes take 4.4 to 4.7 s instead of 7.3 to 9.5 s, longest main-thread frame 115 to 175 ms instead of 700 to 1,050 ms (both at 4x).
  • The panel is pixel-identical (screenshots, tablet size); the cards differ by under 1 % of pixels.

Not measured (please check on the iPad)

  • On touch screens ((hover: none) and (pointer: coarse)) the panel is opaque and the nav scrim has no blur. This is reasoned from the project's own precedent, not measured.
  • About a quarter of swipe frames still take over 33 ms at 4x; next steps are listed in the doc.

Board

No linked issue. I could not reach the "Open-source development" project board from this session (no gh project access), so this PR still needs to be added to it with its fields filled in.


Generated by Claude Code

- A `:has()` anchored on any `div` (`[data-panel] div:has(> [data-slot="site-footer"]) > *`)
  restyled the whole document each time an element with a class or an attribute was
  added or removed: replaced by a `.panel-scroll` class on the panel's scroll area.
- The carousels' arrows are hidden at the ends of the row instead of mounted and
  unmounted in the middle of a swipe.
- The trip cards' weights move in 12 steps (`--gw`), the poster's route, dots and
  names fade as one group each, and `place()` no longer reads `scrollWidth`.
- Touch screens: no backdrop filter on the panel and the nav scrim (not measured).
- Tooling: `scripts/perf/carousel*.mjs`, `panel-shot.mjs`; findings in docs/performance.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ub8ohUbepiRvEfmHHCSehX
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
catalyst-v2 Ready Ready Preview Dec 2, 2026 7:33am UTC
1 Skipped Deployment
Project Deployment Actions Updated
catalyst-v2-api Ignored Ignored Preview Dec 2, 2026 7:33am UTC

…e layer, coarser steps

- The street map's first-appearance wave (hidden until tiles, then dithered squares) is for
  a page that opens on a place: a map made while the visitor zooms in has no entrance.
- Trip cards: route, dots and names are one svg whose opacity follows the card (no repaint
  per step); fades in 8 steps, weights in 6; the subject's shadow on the word only on the
  card in front.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ub8ohUbepiRvEfmHHCSehX
…estore the side cards' shadow rule

- Title and word are drawn twice (data-weight) in the carousel and crossfade by opacity with --g
  instead of moving the weight of a variable face; figures keep one weight.
- --gw removed, fades in 12 steps, --edge and --lb registered as non-inherited.
- The `.trip-slide:not([data-front])` rule that hides the subject's shadow on side cards had been
  dropped by an earlier edit: restored.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ub8ohUbepiRvEfmHHCSehX

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – catalyst-v2 — 40293f38 Deployed Dec 2, 2026 by vercel[bot]
Preview – catalyst-v2-api — 7b9a4ccf Deployed Dec 1, 2026 by vercel[bot]
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.

2 participants