Skip to content

perf: cut heavy admin/dialog/results modules from the eager dashboard bundle (round 2, phase 1)#475

Merged
BigSimmo merged 1 commit into
claude/site-performance-speed-61d154from
claude/perf-r2-bundle-hygiene
Jul 11, 2026
Merged

perf: cut heavy admin/dialog/results modules from the eager dashboard bundle (round 2, phase 1)#475
BigSimmo merged 1 commit into
claude/site-performance-speed-61d154from
claude/perf-r2-bundle-hygiene

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

Phase 1 of the round-2 performance initiative (stacked on #458). Six modules leave the home route's eager JS — including two leaks discovered during verification that were silently defeating existing dynamic() splits:

Module Before After
DocumentManagerPanel suite (710 lines) eager loads when an admin drawer opens
SettingsDialog (585) / AccountSetupDialog (336) always mounted, eager own chunks, mount on first open (state preserved after)
applications-launcher-page (849) eager via applicationsLauncherItemCount value import count reads toolCatalogRecords.length (data-only catalog)
document-admin (~1,100) eager via a 3-line DrawerGroupLabel value import — defeated the existing DocumentDrawer split DrawerGroupLabel moved to dashboard-shell; remaining imports type-only
document-search-results (1,129) eager via the clinical-dashboard barrel the shell imported — defeated round 1's lazy results panel barrel deleted; shell imports ClinicalDashboard directly
Dead wrappers clinical-dashboard-lazy/client.tsx shipped, zero importers deleted

Proof (dev SSR script-tag set, home route): document-admin, document-search-results, DocumentManagerPanel, settings-dialog, account-setup-dialog, applications-launcher all absent from the eager set (35 script tags).

Webpack prod build: the 337.1 KB chunk mixing the admin panel + settings dialog is gone — admin code now in a 253.2 KB drawer-time chunk, settings in a 19.5 KB first-open chunk.

Deliberately NOT done: ssr:false on the whole dashboard (blanks FCP); splitting GuideDialog (shares dashboard-shell with the eagerly-used UtilityDrawer — no win).

Verification

  • tsc, eslint, prettier clean; targeted vitest (dashboard suites) green
  • verify:ui: 120 passed, 4 failures — all navigation-timing flakes from dev on-demand compile latency (first-hit compiles of 6–10s vs 10–15s expect windows); all 4 pass on a warmed targeted re-run
  • Dialog behavior unchanged: Sheet renders null while closed, and the useHasEverBeenTrue latch keeps dialogs mounted after first open so dialog-local state persists across close/reopen exactly as before

🤖 Generated with Claude Code

… bundle

Round-2 phase 1 (bundle & mount hygiene). Six modules leave the home route's
eager JS, proven by the dev SSR script-tag set:

- DocumentManagerPanel suite (SetupChecklist/UploadPanel/IndexingMonitor/
  IngestionQualityConsole/LibraryHealthStrip) loads via next/dynamic when an
  admin drawer opens; its data-only types/helpers move to
  document-manager-model.ts so consumers never pull the component module.
- SettingsDialog and AccountSetupDialog load on first open (useHasEverBeenTrue
  latch keeps them mounted afterwards, preserving dialog-local state). Sheet
  renders null while closed, so first-open behavior is unchanged. GuideDialog
  stays static: it shares dashboard-shell with the eagerly-used UtilityDrawer.
- applications-launcher-page: the tools count now reads
  toolCatalogRecords.length from the data-only catalog instead of a value
  import that dragged the whole 849-line launcher into the eager chunk.
- document-admin: DrawerGroupLabel (3-line presentational) moves to
  dashboard-shell; its value import was defeating the existing DocumentDrawer
  dynamic() split. Remaining imports are type-only.
- document-search-results: deleting the clinical-dashboard barrel (index.ts +
  one-line ClinicalDashboard re-export) removes the re-export chain through
  which the shell eagerly pulled the results panel, un-defeating the round-1
  lazy-loading split. The shell now imports ClinicalDashboard directly.
- Deletes the dead clinical-dashboard-lazy.tsx / clinical-dashboard-client.tsx
  wrappers (zero importers).

Webpack prod build: the 337.1 KB chunk that mixed the admin panel with the
settings dialog is gone (admin code now in a 253.2 KB drawer-time chunk,
settings in its own 19.5 KB first-open chunk).

Verified: tsc, eslint, prettier, targeted vitest, and verify:ui (120 passed;
4 navigation-timing flakes from dev on-demand compile latency all pass on a
warmed targeted re-run).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@supabase

supabase Bot commented Jul 10, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d52f3eb-f3e6-4a4e-84d6-f9bd0c7d8cf8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/perf-r2-bundle-hygiene
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/perf-r2-bundle-hygiene

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo merged commit cb0bcf3 into claude/site-performance-speed-61d154 Jul 11, 2026
3 checks passed
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.

1 participant