Skip to content

Optimize render performance across core dashboard views#53

Merged
stylessh merged 3 commits intomainfrom
stylessh/perf-core-views
Apr 10, 2026
Merged

Optimize render performance across core dashboard views#53
stylessh merged 3 commits intomainfrom
stylessh/perf-core-views

Conversation

@stylessh
Copy link
Copy Markdown
Owner

Summary

  • Eliminate waterfalls: Parallelize review page loader fetches, prefetch first page of diff files in route loader, eagerly preload @pierre/diffs chunks at module scope
  • Reduce bundle size: Lazy load CommandPalette (75KB), GitHubAccessDialog, Agentation (dev-only), and Markdown (59KB) in pull request rows
  • Fix re-render cascades: Extract StickyGroupHeader in pulls/issues pages to isolate sticky state, replace activeFile useState with ActiveFileStore + useSyncExternalStore for surgical file tree updates, extract memoized ReviewToolbar/ReviewSidebar, stabilize callbacks with ref patterns, remove history.replaceState from scroll observer to stop topbar re-renders
  • Improve perceived load: Add estimated diff height placeholders to prevent layout shift while diffs load on the review page, add content-visibility to pull/issue group sections
  • Remove unnecessary delays: Drop hasMounted gate on files query (now has initialData from loader), remove 250ms artificial timeout for review comments loading

Test plan

  • Hard reload a large PR review page — diffs should load without layout shift
  • Scroll through pulls/issues lists — verify no unnecessary re-renders via React Scan
  • Scroll through review page diffs — sidebar file highlight should update without re-rendering the diff pane
  • Verify CommandPalette, Markdown preview, and GitHubAccessDialog still load correctly on first use
  • Toggle unified/split diff view — estimated heights should adjust

- Eliminate waterfalls: parallelize review page loader fetches, prefetch
  first page of diff files in route loader, eagerly preload diff chunks
- Reduce bundle size: lazy load CommandPalette, GitHubAccessDialog,
  Agentation, and Markdown in pull request rows
- Fix re-render cascades: extract StickyGroupHeader in pulls/issues pages,
  use ActiveFileStore with useSyncExternalStore for review file tree,
  extract ReviewToolbar and ReviewSidebar as memoized components,
  stabilize callbacks with ref patterns, stop history.replaceState on scroll
- Add estimated diff height placeholders to prevent layout shift while
  diffs load on the review page
- Add content-visibility to pull/issue group sections
- Memo list row components (PullRequestRow, IssueRow, DetailTab)
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 10, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
diffkit 1853fd6 Commit Preview URL

Branch Preview URL
Apr 10 2026, 07:37 PM

… re-renders

Move statusQuery into a dedicated MergeStatusSection component so polling
only re-renders the merge card, not the header, body, timeline, or sidebar.
Also guard Shiki theme registration to prevent duplicate registration warnings.
@stylessh stylessh merged commit 1d50fe7 into main Apr 10, 2026
3 of 4 checks passed
stylessh added a commit that referenced this pull request Apr 18, 2026
* Optimize core view performance across dashboard

- Eliminate waterfalls: parallelize review page loader fetches, prefetch
  first page of diff files in route loader, eagerly preload diff chunks
- Reduce bundle size: lazy load CommandPalette, GitHubAccessDialog,
  Agentation, and Markdown in pull request rows
- Fix re-render cascades: extract StickyGroupHeader in pulls/issues pages,
  use ActiveFileStore with useSyncExternalStore for review file tree,
  extract ReviewToolbar and ReviewSidebar as memoized components,
  stabilize callbacks with ref patterns, stop history.replaceState on scroll
- Add estimated diff height placeholders to prevent layout shift while
  diffs load on the review page
- Add content-visibility to pull/issue group sections
- Memo list row components (PullRequestRow, IssueRow, DetailTab)

* Reduce diff files page size from 50 to 25 for faster initial load

* Isolate merge status polling from PullDetailPage to prevent full-page re-renders

Move statusQuery into a dedicated MergeStatusSection component so polling
only re-renders the merge card, not the header, body, timeline, or sidebar.
Also guard Shiki theme registration to prevent duplicate registration warnings.
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