Skip to content

feat(site): oss friends page#7715

Open
aidankmcalister wants to merge 2 commits intomainfrom
feat/oss-friends-page
Open

feat(site): oss friends page#7715
aidankmcalister wants to merge 2 commits intomainfrom
feat/oss-friends-page

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Mar 27, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a new OSS Friends page showcasing open-source partner projects
    • Displays partner information in a responsive card grid
    • Each partner card includes name, description, and a link to learn more
    • Links open in new tabs for seamless browsing

@vercel
Copy link

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Mar 27, 2026 2:25pm
docs Ready Ready Preview, Comment Mar 27, 2026 2:25pm
eclipse Ready Ready Preview, Comment Mar 27, 2026 2:25pm
site Ready Ready Preview, Comment Mar 27, 2026 2:25pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 27, 2026

Walkthrough

A new Next.js page is added at apps/site/src/app/oss-friends/page.tsx that serves as a dedicated route for displaying a collection of OSS friends. The page fetches friend data from an external API with hourly revalidation, implements flexible JSON parsing with fallback handling, and renders the results as a responsive grid of outbound link cards.

Changes

Cohort / File(s) Summary
New OSS Friends Page
apps/site/src/app/oss-friends/page.tsx
Introduces async server component with page metadata, type definition for OSSOFriend, API fetching logic (getOSSFriends()) that handles flexible JSON responses and parsing errors, and responsive grid rendering with line-clamped descriptions and external link behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: introducing a new OSS friends page to the site.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

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: 2

🧹 Nitpick comments (2)
apps/site/src/app/oss-friends/page.tsx (2)

53-82: No empty state when no friends are returned.

If the API fails or returns an empty array, users see a blank section with no feedback. A simple empty state message improves the user experience and aids debugging.

💡 Proposed improvement
       <section className="px-4 pb-16 md:pb-20">
         <div className="mx-auto max-w-[1024px] grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
+          {friends.length === 0 && (
+            <p className="col-span-full text-center text-foreground-neutral-weak">
+              No friends to display at the moment.
+            </p>
+          )}
           {friends.map((friend) => (
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/site/src/app/oss-friends/page.tsx` around lines 53 - 82, The page
currently renders nothing when the friends array is empty or undefined (the
friends.map block inside the section), so add an explicit empty-state render
path: check friends (or friends.length) before mapping and when empty render a
styled fallback (e.g., a Card or div with a brief message like "No friends
found" and optional retry/link) in place of the grid; update the JSX around the
friends.map usage in page.tsx to conditionally render either the grid of friend
anchor Cards or the empty-state element so users get feedback when the API
returns no items.

55-80: Consider using a stable key instead of array index.

Using idx as a key works here since the list is fetched once and doesn't reorder, but friend.href or friend.name would be more semantically meaningful and resilient if the data ever changes shape or order. This also aligns with React's recommendation to use stable, unique identifiers when available.

♻️ Proposed improvement
-          {friends.map((friend, idx) => (
+          {friends.map((friend) => (
             <a
-              key={idx}
+              key={friend.href}
               href={friend.href}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/site/src/app/oss-friends/page.tsx` around lines 55 - 80, Replace the
unstable array index key used in the friends.map render with a stable unique
identifier from each friend object; instead of key={idx} in the map inside
friends.map(...) (the <a ...> element wrapping Card), use a stable prop such as
friend.href or friend.name (prefer friend.href if it is unique) so React can
track list items reliably when the data changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/site/src/app/oss-friends/page.tsx`:
- Line 2: Remove the unused import symbol Button from the import statement that
currently reads "import { Button, Card } from \"@prisma/eclipse\""; keep only
the used Card export to eliminate the lint warning and unused-symbol noise
(i.e., update the import to import Card only).
- Around line 20-31: Update getOSSFriends to explicitly check the fetch response
status: after awaiting fetch (variable res in getOSSFriends), verify res.ok and
if false either throw or return [] (and optionally log the status/body) before
calling res.json(); only parse JSON and derive list (raw -> raw.data ??
raw.friends) when res.ok is true so error responses (4xx/5xx) don't get treated
as normal data.

---

Nitpick comments:
In `@apps/site/src/app/oss-friends/page.tsx`:
- Around line 53-82: The page currently renders nothing when the friends array
is empty or undefined (the friends.map block inside the section), so add an
explicit empty-state render path: check friends (or friends.length) before
mapping and when empty render a styled fallback (e.g., a Card or div with a
brief message like "No friends found" and optional retry/link) in place of the
grid; update the JSX around the friends.map usage in page.tsx to conditionally
render either the grid of friend anchor Cards or the empty-state element so
users get feedback when the API returns no items.
- Around line 55-80: Replace the unstable array index key used in the
friends.map render with a stable unique identifier from each friend object;
instead of key={idx} in the map inside friends.map(...) (the <a ...> element
wrapping Card), use a stable prop such as friend.href or friend.name (prefer
friend.href if it is unique) so React can track list items reliably when the
data changes.
🪄 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: CHILL

Plan: Pro

Run ID: 05ba53b0-086c-4d97-9969-1a3550fafd3a

📥 Commits

Reviewing files that changed from the base of the PR and between 6f79795 and 48fddeb.

📒 Files selected for processing (1)
  • apps/site/src/app/oss-friends/page.tsx

@@ -0,0 +1,85 @@
import type { Metadata } from "next";
import { Button, Card } from "@prisma/eclipse";
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

Unused import: Button is imported but never used.

This will likely trigger linting warnings. Remove it to keep imports clean.

🧹 Proposed fix
-import { Button, Card } from "@prisma/eclipse";
+import { Card } from "@prisma/eclipse";
📝 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 { Button, Card } from "@prisma/eclipse";
import { Card } from "@prisma/eclipse";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/site/src/app/oss-friends/page.tsx` at line 2, Remove the unused import
symbol Button from the import statement that currently reads "import { Button,
Card } from \"@prisma/eclipse\""; keep only the used Card export to eliminate
the lint warning and unused-symbol noise (i.e., update the import to import Card
only).

Comment on lines +20 to +31
async function getOSSFriends(): Promise<OSSFriend[]> {
try {
const res = await fetch("https://formbricks.com/api/oss-friends", {
next: { revalidate: 3600 },
});
const raw = await res.json();
const list = Array.isArray(raw) ? raw : (raw.data ?? raw.friends ?? []);
return list as OSSFriend[];
} catch {
return [];
}
}
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 | 🟠 Major

Missing res.ok check before parsing JSON response.

If the external API returns a 4xx or 5xx status, the code still attempts to parse the body as JSON. While the outer catch handles parse failures, a non-OK response might return valid JSON with an error structure (e.g., { "error": "rate limited" }) that would pass through silently, potentially yielding unexpected data shapes or an empty grid with no indication of failure.

Checking res.ok makes the failure mode explicit and ensures you only process successful responses.

🛡️ Proposed fix
 async function getOSSFriends(): Promise<OSSFriend[]> {
   try {
     const res = await fetch("https://formbricks.com/api/oss-friends", {
       next: { revalidate: 3600 },
     });
+    if (!res.ok) {
+      console.error(`Failed to fetch OSS friends: ${res.status}`);
+      return [];
+    }
     const raw = await res.json();
     const list = Array.isArray(raw) ? raw : (raw.data ?? raw.friends ?? []);
     return list as OSSFriend[];
   } catch {
     return [];
   }
 }
📝 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
async function getOSSFriends(): Promise<OSSFriend[]> {
try {
const res = await fetch("https://formbricks.com/api/oss-friends", {
next: { revalidate: 3600 },
});
const raw = await res.json();
const list = Array.isArray(raw) ? raw : (raw.data ?? raw.friends ?? []);
return list as OSSFriend[];
} catch {
return [];
}
}
async function getOSSFriends(): Promise<OSSFriend[]> {
try {
const res = await fetch("https://formbricks.com/api/oss-friends", {
next: { revalidate: 3600 },
});
if (!res.ok) {
console.error(`Failed to fetch OSS friends: ${res.status}`);
return [];
}
const raw = await res.json();
const list = Array.isArray(raw) ? raw : (raw.data ?? raw.friends ?? []);
return list as OSSFriend[];
} catch {
return [];
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/site/src/app/oss-friends/page.tsx` around lines 20 - 31, Update
getOSSFriends to explicitly check the fetch response status: after awaiting
fetch (variable res in getOSSFriends), verify res.ok and if false either throw
or return [] (and optionally log the status/body) before calling res.json();
only parse JSON and derive list (raw -> raw.data ?? raw.friends) when res.ok is
true so error responses (4xx/5xx) don't get treated as normal data.

@argos-ci
Copy link

argos-ci bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Mar 27, 2026, 2:30 PM

Comment on lines +21 to +22
const res = await fetch("https://formbricks.com/api/oss-friends", {
next: { revalidate: 3600 },
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove Prisma from the list in formbricks ?
just a nit

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