#29

Show loading skeletons and prefetch open tabs

MergedstylesshOwnermerged intofrom

Summary

  • render the existing inbox toolbar and message-row skeleton inside the initial mail shell instead of leaving its pane empty
  • use that inbox skeleton as the folder route Suspense fallback during first loads and uncached folder changes
  • use the existing conversation skeleton for cold conversation navigation instead of a blank pane
  • fully prefetch restored conversation tabs as soon as they appear, so their URL-specific cached thread payloads are ready before the user switches tabs

Why

The data work was faster after the previous performance changes, but uncached loads could still leave the main pane visually empty while the server response streamed. These fallbacks provide immediate, layout-matched feedback without adding another request to the active route.

Restored workspace tabs previously used intent-only prefetching, so a reload did not warm their conversation payloads until hover or focus. The workspace rail is a small, bounded set of explicitly retained views, making it the right place to opt into Next's full per-link prefetch scheduler.

Verification

  • pnpm test (117 passed)
  • pnpm exec tsc --noEmit
  • focused ESLint on all changed components
  • pnpm build
  • production-mode browser with a temporary 2.5-second mailbox delay: inbox skeleton remained visible, exposed Loading messages through a status region, then swapped to the real inbox with aria-busy removed
  • production-mode browser after a hard reload with three restored conversation tabs: all three emitted full URL-aware RSC prefetch requests; switching to a prefetched tab emitted zero additional requests and rendered the cached conversation/title immediately
  • current production baseline after the same hard reload: zero conversation-tab prefetch requests
  • skeleton motion remains guarded by prefers-reduced-motion: no-preference

Activity

7
mikeyreviewed2mo ago
mikey2mo ago

Summary

Reviewed the diff for app/mail/a/[accountId]/[folder]/page.tsx, app/mail/a/[accountId]/[folder]/thread/[threadId]/page.tsx, and components/shell/mail-shell-loading.tsx against the existing components/mail/loading-state.tsx skeleton components.

  • The two page.tsx changes (swapping fallback={null} for <MailFolderLoading /> / <MailThreadLoading />) are straightforward and correct: both skeleton components already carry aria-busy, a role="status" live region, and aria-hidden on the decorative bones, so they behave correctly when mounted directly as a Suspense fallback.
  • mail-shell-loading.tsx's new pane flex styles are needed for MailFolderLoading's internal flex: 1 layout to size correctly and look right.
  • One non-blocking accessibility note left inline: MailShellLoading mounts <MailFolderLoading /> inside a div that itself carries aria-hidden, which silently drops MailFolderLoading's own live-region announcement ("Loading messages") from the accessibility tree in that one call site. Behavior isn't broken today because the outer shell already exposes its own "Loading mail" status region, but worth a deliberate decision either way.
  • No test files changed for this PR; the described manual/production verification (aria-busy toggling, status region announcement, reduced-motion guard) is reasonable coverage for a presentational change like this, and I didn't find a case that needs automated coverage beyond what's already there.

No blocking correctness, security, or data-safety issues found. CI is green (Validate application passed; deploy jobs skipped as expected for a PR).

stylessh changed the title from Show inbox skeleton while mail loads to Show loading skeletons and prefetch open tabs2mo ago
stylessh merged commit 2217dd1 into main2mo ago

Branch stylessh/show-inbox-loading-skeleton has been merged.

Checking branch