Repository navigation
Make the editor respond faster on iPads and phones, and pages paint sooner - #27
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 93934a0d-6fab-49dc-ac63-fbe6313d2f3e) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: e9afd949-e1a7-4421-8fd3-c81a54347957) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af2109d8dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c4dde633-7cb3-494e-8332-0ace10363622) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 2b7487d3-5b02-44ef-82e0-76eb5f81bec2) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 0c1d6db8-ca90-49f3-ae41-5a47d4df1237) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 274b00ea-d547-421b-9e0b-7eb26f715d42) |
…ooner Each change was kept only if removing it measured slower (6x and 10x CPU throttle, slow 4G): - Monaco loads in small steps, so taps during loading stay responsive. - Run, Create File and opening a file start after the tap has painted. - /app prerenders its title bar; signed-out visitors don't wait for Clerk. - PostHog loads once the page is idle; events, early errors and web vitals are held for it. - The stylesheet is inlined into the HTML, and Inter's fallback matches its metrics. - Clerk middleware runs only for /api; locale routing is a next.config rewrite. - The home page holds first paint until its hero window has arrived, so it does not grow after painting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
162164b to
6e28d91
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: d762f252-c926-4ad0-8333-a5d64c91f97a) |
Field data (PostHog, 30 days) puts the bad INP on
/appon iPads and phones. FCP is about 1.3–1.5 s everywhere.Each change was kept only if removing it measured slower: every group was reverted in turn and re-measured with 6× and 10× CPU throttling and slow 4G.
monacoLocalLoader,lib/monaco/*)afterNextPaint)/appprerenders a title-bar skeleton; signed-out visitors don't wait for Clerkexperimental.inlineCss+ Inter fallback-font metricsrel="expect")/api; locale routing asnext.configrewritesAgainst current
main(with #28), on a returning student with 60 files:/appfirst paintPublic pages on slow 4G: FCP 596–824 → 388–584 ms, and TBT 43–49 → 9–15 ms.
Tried and dropped because they made no measurable difference: deferring re-renders while typing, a terminal transcript class, static filtered
/lessonsand/practicepages, moving language registration before mount, and a font preload (that one made FCP about 100 ms worse).Proved with production builds against
main:/lessonsand/practicerender the same text.The Vercel preview fails for an existing reason: the Convex preview deployment lacks
CLERK_JWT_ISSUER_DOMAIN.Reviewed with sol-loop: 2 rounds with gpt-6.1-sol on high. Sol verdict: approved
🤖 Generated with Claude Code
Note
Medium Risk
Locale and middleware routing changes affect every page URL and CDN caching behavior, and workspace load timing now depends on Clerk cookie heuristics alongside deferred Run/editor paths.
Overview
This PR targets Interaction to Next Paint on
/appand first paint on public pages through a mix of routing, loading, and interaction scheduling changes.Routing and static delivery: English locale handling moves from middleware rewrites to
next.configrewrites and redirects (/→/en, bare paths →/en/...,/en/*→ canonical bare URLs). Clerk middleware now runs only on/api, so page HTML can be served from the CDN without a per-request proxy hop.experimental.inlineCssinlines global CSS for initial HTML loads.Editor and
/appresponsiveness: A newafterNextPainthelper defers heavy work until after the next frame—Run, create file, and Monaco mount per document—so taps paint first. Monaco loads in yielded chunks via refactoredmonacoLocalLoaderandlib/monaco/*imports instead of one long synchronous bundle./appshows a hydration-safe title-bar skeleton while the workspace loads, andmayHaveClerkSession(Clerk__client_uatcookie) lets signed-out visitors open an in-memory workspace without waiting for Clerk; Run also tracks the active document when deferred.Public landing:
rel="expect"blocks first paint until the hero section is parsed (pairs with inlined CSS to avoid hero layout shift).Inter Fallbackmetrics reduce font-swap CLS.Analytics: PostHog moves to an idle-loaded dynamic chunk with
startEarlyAnalytics(web vitals + early errors) and a bounded event queue drained when PostHog initializes.Reviewed by Cursor Bugbot for commit 6e28d91. Bugbot is set up for automated code reviews on this repo. Configure here.