Skip to content

Add loading skeletons across pages#117

Merged
bhavik-mangla merged 2 commits into
AOSSIE-Org:mainfrom
Ri1tik:feat/loading-skeletons
Jul 10, 2026
Merged

Add loading skeletons across pages#117
bhavik-mangla merged 2 commits into
AOSSIE-Org:mainfrom
Ri1tik:feat/loading-skeletons

Conversation

@Ri1tik

@Ri1tik Ri1tik commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #
Currently these pages show a blank screen / generic spinner while data loads (repo list, contributor stats, network graph, etc). On slower connections this blank gap can last long enough that it looks like the app has crashed or frozen, rather than just loading. Layout-matched skeletons reduce that perceived load time and avoid layout shift once real data arrives.

Screenshots/Recordings:

Before
Screenshot 2026-07-09 002305

Video:

Recording.2026-07-08.NO.Skeleton.mp4

After:
Screenshot 2026-07-09 002344

Video:

Recording.2026-07-08.With.Skeleton.mp4

Additional Notes:

Changes

  • OverviewSkeleton — header, 4 stat cards, language distribution + high-impact repos, 6 nav cards
  • RepositorySkeleton — banner, search/filter row, tab pills, table rows
  • ContributorSkeleton — bus factor + freshness cards, contributor table
  • NetworkSkeleton — toggle controls + scattered pulsing nodes
  • AnalyticsSkeleton — filter row, chart placeholder, advanced analytics controls
  • GovernanceSkeleton — stat cards, resolution list, tab bar, status panel
  • Shared primitives (Bar, Box, Circle, Pill) built on Tailwind's animate-pulse, no extra CSS needed

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • New Features
    • Added animated loading skeleton screens for Overview, Repositories, Contributors, Network, Analytics, and Governance pages.
    • Network loading now shows a visual placeholder with animated pulsing nodes.
  • Bug Fixes
    • Pages now switch immediately to placeholder content while data is loading, preventing partial/blank rendering.
    • Improved loading behavior on the Analytics page by rendering the skeleton UI during loading.

@Ri1tik Ri1tik added the gsoc GSoC students label Jul 8, 2026
@github-actions github-actions Bot added no-issue-linked PR has no linked issue frontend Frontend changes javascript JavaScript/TypeScript changes size/L 201-500 lines changed external-contributor External contributor labels Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cf1d7529-d65c-42b1-a0e1-30f08273dd0e

📥 Commits

Reviewing files that changed from the base of the PR and between f350774 and fa3c10b.

📒 Files selected for processing (2)
  • src/pages/AnalyticsPage.jsx
  • src/pages/GovernancePage.jsx
💤 Files with no reviewable changes (1)
  • src/pages/GovernancePage.jsx

Walkthrough

A new Orgexplorerskeletons.jsx file adds reusable animated primitives and six page-specific loading skeletons. Analytics, Contributors, Governance, Network, Overview, and Repositories now return their corresponding skeleton while loading is true.

Changes

Skeleton components and page wiring

Layer / File(s) Summary
Skeleton components and shared building blocks
src/components/Orgexplorerskeletons.jsx
Adds animated Bar, Box, Circle, and Pill primitives plus composed skeleton layouts for six pages.
Page loading-state integration
src/pages/*.jsx
Imports the matching skeleton into six pages and returns it before normal model and UI rendering when loading is true.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

Suggested labels: Typescript Lang

Suggested reviewers: Zahnentferner, bhavik-mangla

Poem

Hop, hop, placeholders bloom,
Pulsing softly through each room.
Circles, bars, and cards align,
While loading waits in gentle time.
A rabbit cheers: “The UI shines!” 🐇

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding loading skeletons across multiple pages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added size/L 201-500 lines changed and removed size/L 201-500 lines changed labels Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Orgexplorerskeletons.jsx`:
- Line 1: Add the "use client" directive at the top of Orgexplorerskeletons so
React treats it as a client component; this file uses NetworkSkeleton with
Math.random(), so update the module header before the React import and keep the
rest of the component logic unchanged.
- Around line 188-193: NetworkSkeleton is generating node coordinates with
Math.random() during render, which causes SSR hydration mismatches and re-render
jitter. Update the NetworkSkeleton component to initialize the nodes once using
the already-imported useState lazy initializer (or equivalent one-time
initialization) so the positions stay stable for the lifetime of the mount and
the render output remains deterministic.

In `@src/pages/AnalyticsPage.jsx`:
- Around line 55-58: The hook order in AnalyticsPage is unstable because
useAdvancedMetrics is called after the early returns, so move the
useAdvancedMetrics(filteredPulls) call above the loading/model guard to keep
hooks invoked consistently on every render. Update the AnalyticsPage component
so all hooks, including useAdvancedMetrics, run before any conditional returns,
and leave the loading and null checks after the hook declarations.

In `@src/pages/OverviewPage.jsx`:
- Line 9: The loading skeleton width is mismatched with the actual OverviewPage
layout, causing a layout shift when content loads. Update the skeleton sizing in
OverviewSkeleton (and any related skeleton components it reuses) to match the
page’s maxWidth of 1100 rather than the current w-295 width, so the placeholder
and final content align consistently on wide viewports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7d0e707a-a795-4dbf-9aac-72652268ed5b

📥 Commits

Reviewing files that changed from the base of the PR and between 1eef5dc and f350774.

📒 Files selected for processing (7)
  • src/components/Orgexplorerskeletons.jsx
  • src/pages/AnalyticsPage.jsx
  • src/pages/ContributorsPage.jsx
  • src/pages/GovernancePage.jsx
  • src/pages/NetworkPage.jsx
  • src/pages/OverviewPage.jsx
  • src/pages/RepositoriesPage.jsx

@@ -0,0 +1,313 @@
import React, { useState } from "react";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add "use client" directive.

As per path instructions, ensure that "use client" is being used for files matching **/*.{jsx}. This file uses Math.random() in NetworkSkeleton, which is a client-only feature that will cause hydration mismatches under SSR.

🔧 Proposed fix
+"use client";
+
 import React, { useState } from "react";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import React, { useState } from "react";
"use client";
import React, { useState } from "react";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Orgexplorerskeletons.jsx` at line 1, Add the "use client"
directive at the top of Orgexplorerskeletons so React treats it as a client
component; this file uses NetworkSkeleton with Math.random(), so update the
module header before the React import and keep the rest of the component logic
unchanged.

Source: Path instructions

Comment on lines +188 to +193
export function NetworkSkeleton() {
const nodes = Array.from({ length: 26 }).map(() => ({
x: 8 + Math.random() * 84,
y: 10 + Math.random() * 75,
size: 8 + Math.random() * 10,
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Math.random() in render body causes hydration mismatch and visual instability.

NetworkSkeleton generates random node positions on every render. Under SSR, server and client produce different values → hydration mismatch. On the client, every re-render regenerates positions → visual jitter. The already-imported useState should be used to memoize the nodes once per mount.

🔒 Proposed fix using useState lazy initializer
 export function NetworkSkeleton() {
-  const nodes = Array.from({ length: 26 }).map(() => ({
-    x: 8 + Math.random() * 84,
-    y: 10 + Math.random() * 75,
-    size: 8 + Math.random() * 10,
-  }));
+  const [nodes] = useState(() =>
+    Array.from({ length: 26 }).map(() => ({
+      x: 8 + Math.random() * 84,
+      y: 10 + Math.random() * 75,
+      size: 8 + Math.random() * 10,
+    }))
+  );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Orgexplorerskeletons.jsx` around lines 188 - 193,
NetworkSkeleton is generating node coordinates with Math.random() during render,
which causes SSR hydration mismatches and re-render jitter. Update the
NetworkSkeleton component to initialize the nodes once using the
already-imported useState lazy initializer (or equivalent one-time
initialization) so the positions stay stable for the lifetime of the mount and
the render output remains deterministic.

Comment thread src/pages/AnalyticsPage.jsx Outdated
import { AiOutlineInfoCircle } from "react-icons/ai";
import AnalysisBanner from '../components/AnalysisBanner'

import { OverviewSkeleton } from '../components/Orgexplorerskeletons'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Skeleton wiring is correct; flagging a width mismatch between skeleton and page layout.

The early return at line 32 is placed after all hooks (useState, useRef, useEffect), so no Rules of Hooks violation. The OverviewSkeleton is prop-less and safe to render during loading.

However, the skeleton uses w-295 (≈1180px) while the actual page uses maxWidth: 1100 (inline style). This 80px difference will cause a visible layout shift when the skeleton is replaced by real content on wider viewports. This applies to all six skeleton components.

Also applies to: 32-32

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/OverviewPage.jsx` at line 9, The loading skeleton width is
mismatched with the actual OverviewPage layout, causing a layout shift when
content loads. Update the skeleton sizing in OverviewSkeleton (and any related
skeleton components it reuses) to match the page’s maxWidth of 1100 rather than
the current w-295 width, so the placeholder and final content align consistently
on wide viewports.

@github-actions

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@github-actions github-actions Bot added size/L 201-500 lines changed and removed PR has merge conflicts size/L 201-500 lines changed labels Jul 10, 2026
@bhavik-mangla
bhavik-mangla merged commit d83fe88 into AOSSIE-Org:main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor External contributor frontend Frontend changes gsoc GSoC students javascript JavaScript/TypeScript changes no-issue-linked PR has no linked issue size/L 201-500 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants