From b623cd388df30903098af942d1b6e9e04b1ff03f Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Mon, 2 Nov 2026 19:55:32 +0100 Subject: [PATCH] perf: leave the Pro frame's panes empty on standard pages --- .../boot-skeleton/__tests__/pro-skeleton.test.tsx | 6 +++--- components/boot-skeleton/pro-skeleton.tsx | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/boot-skeleton/__tests__/pro-skeleton.test.tsx b/components/boot-skeleton/__tests__/pro-skeleton.test.tsx index 9d72e116f..8d032a377 100644 --- a/components/boot-skeleton/__tests__/pro-skeleton.test.tsx +++ b/components/boot-skeleton/__tests__/pro-skeleton.test.tsx @@ -55,9 +55,9 @@ describe('AppShellSkeleton under the Pro interface', () => { const [strip, body] = [...pane.children]; expect(strip.querySelectorAll('[data-sk-pro-tab]')).toHaveLength(8); expect(classes(strip)).toEqual(expect.arrayContaining(['h-9', 'bg-secondary'])); - // A page Pro takes over only draws its own body: the redirect focuses - // its tab. (The /pro page draws all of them, see ProSkeleton below.) - expect([...body.children].map((b) => b.getAttribute('data-sk-pro-body'))).toEqual(['calendar', 'other']); + // A page Pro takes over draws its panes empty, to keep its HTML small. + // (The /pro page draws every body, see ProSkeleton below.) + expect([...body.children].map((b) => b.getAttribute('data-sk-pro-body'))).toEqual(['other']); } // The split pane only shows with a split. expect(classes(panes[1])).toEqual(expect.arrayContaining(['hidden', 'boot-pro-split:flex'])); diff --git a/components/boot-skeleton/pro-skeleton.tsx b/components/boot-skeleton/pro-skeleton.tsx index 317097e2d..a5294ee56 100644 --- a/components/boot-skeleton/pro-skeleton.tsx +++ b/components/boot-skeleton/pro-skeleton.tsx @@ -96,13 +96,15 @@ export function ProFrameSkeleton({ }: ProSkeletonProps & { className?: string; /** - * The page Pro is taking over. Its tab is the one the redirect focuses, so - * only its body is drawn (a pane whose stored tab shows another page stays - * empty), which keeps every standard page's HTML from carrying all five. + * Set when this frame stands in for a standard page Pro is about to take + * over. Its panes are then drawn empty (tab strips only): the frame doesn't + * move on the hop to /pro, and the page's body, which would otherwise be in + * every standard page's HTML a second and third time for the few who use + * Pro, fills in once /pro has loaded. /pro's own HTML draws the bodies. */ surface?: BootSurface; }) { - const bodies = surface && BODIES.includes(surface) ? [surface] : BODIES; + const bodies = surface ? [] : BODIES; return (