Skip to content

Conversation

@Sherin-2711
Copy link
Member

@Sherin-2711 Sherin-2711 commented Dec 19, 2025

Summary by CodeRabbit

  • Style

    • Particle effect now uses fixed positioning so it stays steady while scrolling.
  • New Features

    • Loading skeletons shown during data fetch across project and member views.
    • Dedicated error UI and per-tab empty/error states.
    • Unified rendering for project and member lists; member tooltips and conditional grid span behavior preserved.
  • Bug Fixes

    • More robust fetch/error handling with reset on fetch start and a short delay before hiding the loading state to reduce flicker.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Walkthrough

Added explicit loading and error handling and centralized render helpers to the Projects page and Members tab, introduced skeleton loaders and a 500ms delayed loading teardown, and changed Particles positioning from absolute to fixed. Error states are set on fetch failures and reset at fetch start.

Changes

Cohort / File(s) Summary
Projects page & UI
app/projects/page.tsx
Added loading and error states, reset error at fetch start, throw on non-ok responses, centralized rendering via renderProjects(), show skeletons while loading, display integrated error and empty UIs, add 500ms delayed loading teardown, and change Particles from absolute to fixed.
Members tab UI
components/Members-Text.tsx
Added per-tab loading and tabError state, reset them at fetch start, set errors on fetch failure, centralized tab rendering via renderMembersTab with TAB_LABELS, show skeleton grid while loading, and unified empty/error UI handling for present/seniors/founders tabs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on:
    • app/projects/page.tsx: fetch error throwing, the 500ms delayed loading teardown and potential race conditions with aborts, and correctness of the renderProjects mapping (member tooltips, conditional grid spans).
    • components/Members-Text.tsx: correctness of renderMembersTab, TAB_LABELS, tab-specific flags (founder handling), and per-tab error flow.

Possibly related PRs

Suggested reviewers

  • i-am-that-guy
  • Harish-Naruto

Poem

🐰
I hopped through fetches, soft and slow,
Laid skeleton petals where loaders grow,
If errors whispered, I set them right,
Fixed the particles to watch the night,
Now projects bloom in gentle light. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title focuses on fixing particles positioning, but the changeset also includes major refactoring of error handling, loading states, and component rendering logic across two files. Update the title to reflect the primary changes, such as 'Add error handling and loading states to Projects page and Members component' or split into multiple PRs to match the scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch animation-fixes

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8f49ab and 9d6893b.

📒 Files selected for processing (2)
  • app/projects/page.tsx (3 hunks)
  • components/Members-Text.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/Members-Text.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
app/projects/page.tsx (3)

38-38: LGTM! Clean error state management.

The addition of explicit error state tracking and resetting both loading and error states at the start of the fetch is good practice and prevents stale states from previous fetch attempts.

Also applies to: 41-42


67-140: LGTM! Excellent refactor with centralized rendering logic.

The renderProjects helper cleanly handles all four rendering states (loading, error, empty, populated) and significantly improves maintainability. The error UI with gradient icon is well-designed, and the skeleton loading pattern provides good UX.


148-148: LGTM! Correct fix for background particles.

Changing Particles from absolute to fixed positioning ensures they remain stationary relative to the viewport during scrolling, which aligns with the PR objective to fix the background particles behavior.


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 and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 20, 2025

Deploying call-of-code with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9d6893b
Status: ✅  Deploy successful!
Preview URL: https://76f16c7a.call-of-code.pages.dev
Branch Preview URL: https://animation-fixes.call-of-code.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/projects/page.tsx (1)

40-64: Error handling flow is correct but consider abort handling.

The fetch logic properly resets states and handles errors. However, unlike Members-Text.tsx which uses an AbortController to cancel in-flight requests on unmount, this component lacks abort handling. If the component unmounts before the fetch completes, state updates on an unmounted component could occur.

🔎 Suggested improvement with AbortController
  useEffect(() => {
+   const abortController = new AbortController();
    setLoading(true);
    setError(false);
    const fetchProjects = async () => {
      try {
-       const res = await fetch("/api/projects-with-members");
+       const res = await fetch("/api/projects-with-members", {
+         signal: abortController.signal,
+       });
        const data = await res.json();
        if (data.success) {
          setProjects(data.data as Project[]);
        } else {
          console.error("Error loading project data");
          throw new Error("Network response was not ok");
        }
      } catch (err) {
+         if (err instanceof Error && err.name === "AbortError") {
+           return;
+         }
          console.error("Error fetching projects:", err);
          setError(true);
      } finally{
          setTimeout(() => {
            setLoading(false);
          }, 500);
      }
    };

    fetchProjects();
+   return () => {
+     abortController.abort();
+   };
  }, []);
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44f299e and c8f49ab.

📒 Files selected for processing (2)
  • app/projects/page.tsx (4 hunks)
  • components/Members-Text.tsx (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/projects/page.tsx (2)
components/ui/BentoCard.tsx (2)
  • BentoGrid (7-21)
  • BentoGridItem (23-103)
app/projects/skeletonLoader.tsx (1)
  • SkeletonLoader (19-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (9)
components/Members-Text.tsx (5)

123-123: LGTM on error state addition.

Adding an error state to track fetch failures is appropriate for providing user feedback.


150-214: LGTM on the fetch logic with loading/error state management.

The implementation correctly:

  • Resets loading and error states at the start of the fetch
  • Sets error to true on fetch failure while preserving abort handling
  • Uses a 500ms delayed loading teardown for smoother UX

One minor observation: the delay in finally block (lines 211-213) will still execute after an abort, which may cause a brief flash if the component remounts quickly. However, since the component is unmounting anyway, the state update will be a no-op in most cases.


256-270: Clean consolidation of rendering logic.

The renderMembersTab helper effectively centralizes the loading, error, empty, and populated state rendering. This reduces duplication across tabs and aligns with the similar renderProjects pattern in the projects page.


273-288: Tabs array correctly uses the unified render helper.

Each tab now delegates to renderMembersTab, passing the appropriate member list and isFounder flag for the founders tab.


299-306: Particles positioning fix applied correctly.

The Particles component uses fixed inset-0 z-0 positioning, which ensures the background particles remain in place during scrolling. This aligns with the PR objective to fix the Projects page background particles.

app/projects/page.tsx (4)

38-38: LGTM on error state addition.

Adding an error state to track fetch failures provides appropriate user feedback when the API call fails.


66-139: Well-structured render helper with one potential edge case.

The renderProjects function cleanly handles all UI states. However, the className logic at line 134 uses hardcoded indices (3 and 6) for spanning columns, which could behave unexpectedly if the projects array order changes or items are filtered.

Consider whether the spanning logic should be based on project properties rather than array position.


144-151: Particles positioning fix correctly applied.

Changing from absolute to fixed positioning ensures the background particles remain in place during scrolling, which is the primary objective of this PR.


173-174: Clean invocation of the render helper.

The previous inline rendering logic is now consolidated into a single renderProjects() call, improving readability.

Comment on lines +70 to +72
{Array.from({ length: 6 }).map((_, i) => (
<SkeletonLoader key={i} />
))}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Note: Related SkeletonLoader component has a bug.

The SkeletonLoader component being used here (from ./skeletonLoader.tsx) contains a bug at line 27 where class is used instead of className in JSX. This will cause the flex styling to not be applied.

Based on the relevant code snippet:

<div class="flex">  // Should be className="flex"

Consider fixing this in a follow-up or as part of this PR.

🤖 Prompt for AI Agents
In app/projects/page.tsx around lines 70 to 72 the page maps SkeletonLoader
components; the referenced bug is in ./skeletonLoader.tsx at line 27 where JSX
uses class instead of className, preventing React from applying the flex styling
— open ./skeletonLoader.tsx and change the <div class="flex"> to <div
className="flex"> (and scan for any other incorrect JSX attribute usages such as
for/htmlFor and fix them similarly), then run the app to confirm the flex layout
is applied.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/projects/page.tsx (1)

44-62: Critical: setTimeout executes even on fetch failure.

The setTimeout (lines 54-56) is placed outside the if (data.success) block, which causes it to execute even when the fetch fails. This creates two problems:

  1. When data.success is false, the error is thrown (line 52) but the setTimeout has already been queued, causing a race condition with the catch block's setLoading(false).
  2. Failed fetches experience an unnecessary 500ms delay before showing the error.

The setTimeout should only execute on successful fetches.

🔎 Proposed fix
       const res = await fetch("/api/projects-with-members");
       const data = await res.json();
       if (data.success) {
         setProjects(data.data as Project[]);
+        setTimeout(() => {
+          setLoading(false);
+        }, 500);
       } else {
         console.error("Error loading project data");
         throw new Error("Network response was not ok");
       }
-        setTimeout(() => {
-          setLoading(false);
-        }, 500);
     } catch (err) {
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8f49ab and 9d6893b.

📒 Files selected for processing (2)
  • app/projects/page.tsx (3 hunks)
  • components/Members-Text.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/Members-Text.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
app/projects/page.tsx (3)

38-38: LGTM! Clean error state management.

The addition of explicit error state tracking and resetting both loading and error states at the start of the fetch is good practice and prevents stale states from previous fetch attempts.

Also applies to: 41-42


67-140: LGTM! Excellent refactor with centralized rendering logic.

The renderProjects helper cleanly handles all four rendering states (loading, error, empty, populated) and significantly improves maintainability. The error UI with gradient icon is well-designed, and the skeleton loading pattern provides good UX.


148-148: LGTM! Correct fix for background particles.

Changing Particles from absolute to fixed positioning ensures they remain stationary relative to the viewport during scrolling, which aligns with the PR objective to fix the background particles behavior.

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.

2 participants