Skip to content

Conversation

@ComputelessComputer
Copy link
Collaborator

@ComputelessComputer ComputelessComputer commented Nov 3, 2025

Implement dynamic GitHub repository stats fetching using React Query and replace hardcoded values. Extract slash separator pattern into a reusable component to clean up section transitions across the landing page.

Implement dynamic GitHub repository stats fetching using React
Query and replace hardcoded values. Extract slash separator
pattern into a reusable component to clean up section
transitions across the landing page.
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Centralizes GitHub repo stats into a new React Query hook and constants, adds a reusable SlashSeparator component, updates several pages (index, download, pricing) to use the separator and new CTA/FAQ sections, changes booking/CTA routing to a new /founders route that redirects to Cal.com, and updates components to consume dynamic GitHub stats with fallbacks.

Changes

Cohort / File(s) Summary
GitHub stats hook & constants
apps/web/src/queries.ts
New useGitHubStats hook plus exported GITHUB_ORG_REPO, GITHUB_LAST_SEEN_STARS, GITHUB_LAST_SEEN_FORKS and centralized fetch logic for repo stars/forks.
Components using GitHub stats
apps/web/src/components/github-open-source.tsx, apps/web/src/components/github-stars.tsx
Replace hard-coded ORG_REPO and static counts with imports from queries.ts and useGitHubStats; use query data with safe fallbacks; remove previous inline fetch logic.
New presentational separator
apps/web/src/components/slash-separator.tsx
Add SlashSeparator presentational component rendering the decorative slash-pattern div (border, background image /patterns/slash.svg, fixed height).
Download page updates
apps/web/src/routes/_view/download.tsx
Inserted FAQSection and CTASection, added SlashSeparator instances, adjusted layout/padding, changed DownloadCard radius, and updated status label text.
Landing page separators
apps/web/src/routes/_view/index.tsx
Replace many inline decorative separator divs with SlashSeparator and adjust section spacing/layout.
Pricing page updates
apps/web/src/routes/_view/pricing.tsx
Added TeamPricingBanner, replaced InfoCardsSection usage, inserted SlashSeparators, updated CTAs to point to /download (label: "Download for free") and changed team CTA to /founders ("Book a call").
Booking/redirect route
apps/web/src/routes/cal.tsx, apps/web/src/routes/founders.tsx
cal.tsx BookingButton now links to internal /founders; new /founders route created that redirects (beforeLoad) to the external Cal.com booking URL.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Web as Web App
    participant ReactQuery as React Query
    participant GitHub as GitHub API
    participant Cal as Cal.com

    User->>Web: Open page (uses GitHub stats)
    Web->>ReactQuery: useGitHubStats (["github-stats"])
    ReactQuery->>GitHub: GET /repos/{GITHUB_ORG_REPO}
    GitHub-->>ReactQuery: { stargazers_count, forks_count }
    ReactQuery-->>Web: githubStats.data
    alt Data present
        Web->>User: Render stars/forks from githubStats.data
    else No data
        Web->>User: Render GITHUB_LAST_SEEN_* fallback values
    end

    User->>Web: Click booking/CTA
    Web->>Web: Navigate to /founders
    Web->>Cal: beforeLoad redirect -> Cal.com/team/hyprnote/welcome...
    Cal-->>User: Cal.com booking page opens
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Pay special attention to apps/web/src/queries.ts (network error handling, query key consistency, exported constants).
  • Verify github-open-source.tsx and github-stars.tsx correctly use the hook and fallbacks.
  • Check visual integration and spacing for SlashSeparator across index/download/pricing pages.
  • Confirm /founders route redirect behaves correctly in server/client rendering and preserves expected target attributes.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Improve GitHub stats and add slash separators" is directly related to the primary changes in the pull request. The changeset introduces React Query-based dynamic fetching for GitHub repository statistics (in github-open-source.tsx and github-stars.tsx) and extracts a reusable SlashSeparator component to replace hardcoded decorative separators across multiple landing page files (index.tsx, download.tsx, pricing.tsx). The title is concise and clear without vague terminology, accurately summarizing the two main improvements without unnecessary detail.
Description Check ✅ Passed The description is directly related to the changeset and provides meaningful information about the implementation. It accurately describes the two primary objectives: implementing React Query-based dynamic GitHub stats fetching to replace hardcoded values (reflected in the github-open-source.tsx and github-stars.tsx changes) and extracting the slash separator pattern into a reusable component for cleaner section transitions (reflected in the new slash-separator.tsx component and its integration across multiple pages). The description is specific and descriptive rather than vague or generic.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 400eb50 and 4507365.

📒 Files selected for processing (3)
  • apps/web/src/components/github-open-source.tsx (3 hunks)
  • apps/web/src/components/github-stars.tsx (2 hunks)
  • apps/web/src/queries.ts (1 hunks)

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.

Copy link

@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: 3

🧹 Nitpick comments (1)
apps/web/src/components/github-stars.tsx (1)

11-21: Consider adding error handling and query configuration.

The GitHub API has rate limits (60 requests/hour unauthenticated) and may fail. Consider adding error handling and query configuration to improve resilience:

  const githubStats = useQuery({
    queryKey: ["github-stats"],
    queryFn: async () => {
      const response = await fetch(`https://api.github.com/repos/${ORG_REPO}`);
+     if (!response.ok) {
+       throw new Error(`GitHub API error: ${response.status}`);
+     }
      const data = await response.json();
      return {
        stars: data.stargazers_count ?? LAST_SEEN_STARS,
        forks: data.forks_count ?? LAST_SEEN_FORKS,
      };
    },
+   staleTime: 5 * 60 * 1000, // 5 minutes
+   retry: 2,
  });
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1653d0 and 400eb50.

⛔ Files ignored due to path filters (1)
  • apps/web/src/routeTree.gen.ts is excluded by !**/*.gen.ts
📒 Files selected for processing (8)
  • apps/web/src/components/github-open-source.tsx (2 hunks)
  • apps/web/src/components/github-stars.tsx (2 hunks)
  • apps/web/src/components/slash-separator.tsx (1 hunks)
  • apps/web/src/routes/_view/download.tsx (5 hunks)
  • apps/web/src/routes/_view/index.tsx (3 hunks)
  • apps/web/src/routes/_view/pricing.tsx (5 hunks)
  • apps/web/src/routes/cal.tsx (1 hunks)
  • apps/web/src/routes/founders.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
apps/web/src/routes/founders.tsx (4)
apps/web/src/routes/_view/download.tsx (1)
  • Route (8-10)
apps/web/src/routes/_view/index.tsx (1)
  • Route (91-93)
apps/web/src/routes/_view/pricing.tsx (1)
  • Route (8-10)
apps/web/src/routes/cal.tsx (1)
  • Route (5-7)
apps/web/src/routes/_view/pricing.tsx (2)
apps/web/src/components/slash-separator.tsx (1)
  • SlashSeparator (1-8)
packages/utils/src/cn.ts (1)
  • cn (20-22)
apps/web/src/routes/_view/index.tsx (1)
apps/web/src/components/slash-separator.tsx (1)
  • SlashSeparator (1-8)
apps/web/src/routes/_view/download.tsx (1)
apps/web/src/components/slash-separator.tsx (1)
  • SlashSeparator (1-8)
🔇 Additional comments (4)
apps/web/src/components/github-stars.tsx (2)

25-26: LGTM!

The fallback pattern correctly handles both loading and error states by defaulting to LAST_SEEN_STARS.


38-38: LGTM!

The rendering correctly uses the computed starCount value with proper formatting.

apps/web/src/components/github-open-source.tsx (2)

4-4: LGTM!

The import correctly brings in React Query for data fetching functionality.


155-156: LGTM!

The computed values correctly derive from the query data with proper fallbacks, and both are appropriately used in the StatBadge components throughout the layout.

Comment on lines +153 to 158
<SlashSeparator />
<ManifestoSection />
<SlashSeparator />
<BlogSection />
<SlashSeparator />
<CTASection heroInputRef={heroInputRef} />
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid empty double separators when the blog is absent

BlogSection already returns null when there are no articles, but these two surrounding <SlashSeparator /> calls still render. In environments with no blog posts (fresh deploys, local dev), this leaves back-to-back slash bars with nothing between them, which is a visible layout glitch. Please gate the separators alongside the section so they only appear when there’s actual blog content.

Apply this diff to keep a single separator after the manifesto when the blog is empty, and wrap the blog + trailing separator inside the same condition:

@@
         <ManifestoSection />
         <SlashSeparator />
-        <BlogSection />
-        <SlashSeparator />
+        {allArticles.length > 0 && (
+          <>
+            <BlogSection />
+            <SlashSeparator />
+          </>
+        )}
         <CTASection heroInputRef={heroInputRef} />

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In apps/web/src/routes/_view/index.tsx around lines 153 to 158, the two
SlashSeparator components around BlogSection render even when BlogSection
returns null, producing back-to-back separators; guard the separators with the
same condition that BlogSection uses (e.g., derive a hasBlog boolean from the
articles/posts prop or the data source) so that you render: ManifestoSection
followed by a single SlashSeparator always, but render BlogSection together with
its trailing SlashSeparator only when hasBlog is true — move the conditional to
wrap both BlogSection and the following SlashSeparator (or compute hasBlog above
and use it to conditionally render both).

@yujonglee yujonglee merged commit e12f6a1 into main Nov 3, 2025
3 of 4 checks passed
@yujonglee yujonglee deleted the jj-branch-2 branch November 3, 2025 03:42
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.

3 participants