Skip to content

feat(resources): add curated design galleries page#493

Merged
hari merged 4 commits into
mainfrom
feat/resources-page
Jun 9, 2026
Merged

feat(resources): add curated design galleries page#493
hari merged 4 commits into
mainfrom
feat/resources-page

Conversation

@sudhashrestha

@sudhashrestha sudhashrestha commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Add /resources with OG previews, outbound ref tags, and a gallery grid.

Summary by CodeRabbit

  • New Features
    • Added a dedicated Resources page with improved page title and social preview metadata.
    • Curated resources shown in a responsive grid with image, title, domain and short descriptions.
    • “Suggest one” link to recommend new resources.
    • Decorative grid backdrop with subtle fade for improved visual polish.
    • Resources now exposed via a single source, including a displayed total count.

Add /resources with OG previews, outbound ref tags, and a gallery grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sudhashrestha sudhashrestha requested a review from hari June 9, 2026 17:05
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b6912162-6ebe-46ba-80d2-3b076a97e61a

📥 Commits

Reviewing files that changed from the base of the PR and between d3f6481 and 9866971.

📒 Files selected for processing (1)
  • lib/outbound-ref.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/outbound-ref.ts

📝 Walkthrough

Walkthrough

This PR adds a Resources page: a typed resource dataset and getter, an outbound-ref URL helper, grid UI components (backdrop, grid, item), a ResourcesShell that assembles them, and a Next.js page exporting metadata and rendering the shell.

Changes

Resources Page

Layer / File(s) Summary
Resource data contract and utilities
lib/resources.ts, lib/outbound-ref.ts
Resource type and RESOURCES array with RESOURCES_INTRO, RESOURCES_DISCLAIMER, RESOURCES_CLOSING; RESOURCE_COUNT and getResources(). OUTBOUND_REF and withOutboundRef() add a ref query param to HTTP(S) URLs when missing.
Grid UI components
components/resources/grid-backdrop.tsx, components/resources/resource-grid-item.tsx, components/resources/resource-grid.tsx
GridBackdrop renders a styled gradient grid overlay with configurable fade mask. ResourceGridItem renders external-link item cards with image, title, and domain using withOutboundRef. ResourceGrid maps resources into ResourceGridItems.
Page orchestration and routing
components/resources/resources-shell.tsx, app/(main)/resources/page.tsx
ResourcesShell retrieves resources via getResources(), renders intro/disclaimer/closing text, the ResourceGrid, and a "Suggest one" outbound link. Page exports typed metadata and default ResourcesPage rendering the shell.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • hari

Poem

🐰 I hopped through lists and links today,
Gridlines shimmer where the resources play,
I tuck a little ref in every trail,
So every outbound tells our tale,
A tiny hop, design on display ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly and specifically describes the main change: adding a curated design galleries page under resources.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/resources-page

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.

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

🧹 Nitpick comments (4)
lib/resources.ts (1)

484-486: 💤 Low value

Consider removing the wrapper function.

getResources() directly returns the RESOURCES array without transformation or side effects. Consumers can import RESOURCES directly, simplifying the API.

♻️ Simplification option

Consumers can use:

-import { getResources } from "`@/lib/resources`";
-const resources = getResources();
+import { RESOURCES } from "`@/lib/resources`";
+const resources = RESOURCES;
🤖 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 `@lib/resources.ts` around lines 484 - 486, Remove the trivial wrapper
getResources and have callers use the RESOURCES array directly: delete the
getResources() function (and its export) and ensure RESOURCES remains exported;
then update any imports/usages of getResources() to import RESOURCES and
reference it directly (search for getResources and replace calls with
RESOURCES).
components/resources/resource-grid-item.tsx (1)

14-20: ⚡ Quick win

Consider using Next.js Image component.

The native <img> tag bypasses Next.js image optimization. While the eslint-disable suggests this is intentional, using next/image would provide automatic optimization, better performance, and proper srcset generation for external OG images.

⚡ Proposed migration to Next.js Image
+import Image from "next/image";
 import { withOutboundRef } from "`@/lib/outbound-ref`";
 import type { Resource } from "`@/lib/resources`";

         <div className="overflow-hidden rounded-md bg-[hsl(var(--surface-alt))] ring-1 ring-foreground/[0.08]">
-          {/* eslint-disable-next-line `@next/next/no-img-element` */}
-          <img
+          <Image
             src={resource.ogImage}
             alt=""
-            loading="lazy"
+            width={1200}
+            height={630}
+            unoptimized={false}
             className="aspect-[1200/630] w-full object-cover object-top opacity-90 transition-opacity group-hover:opacity-100"
           />
         </div>

Note: If external images are not configured in next.config.js, you may need to add the domains or use unoptimized prop.

🤖 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 `@components/resources/resource-grid-item.tsx` around lines 14 - 20, Replace
the native img element in resource-grid-item.tsx with Next.js's Image: import
Image from 'next/image', swap the <img src={resource.ogImage} ... /> usage to
<Image ... /> using resource.ogImage as src and a meaningful alt (e.g.,
resource.title), preserve the class-based styling via layout/priority/sizes or
the fill prop and object-fit support, and if external OG domains aren’t
configured in next.config.js add unoptimized to the Image or add the domain to
images.domains; ensure loading="lazy" behavior is preserved via Image props if
needed.
components/resources/resources-shell.tsx (1)

33-40: ⚡ Quick win

Consider using brand yellow for the "Suggest one" link.

According to coding guidelines, brand yellow #ffcc00 should be used for highlights and badges. The "Suggest one" call-to-action link is a natural candidate for this accent color to draw attention.

🎨 Proposed brand color application
         <Link
           href={withOutboundRef("https://github.com/codse/animata")}
           target="_blank"
           rel="noopener noreferrer"
-          className="text-sm text-foreground underline decoration-foreground/20 underline-offset-4 hover:decoration-foreground/50"
+          className="text-sm text-[`#ffcc00`] underline decoration-[`#ffcc00`]/20 underline-offset-4 hover:decoration-[`#ffcc00`]/50"
         >
           Suggest one
         </Link>

As per coding guidelines, use brand yellow #ffcc00 (from logo) for highlights and badges.

🤖 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 `@components/resources/resources-shell.tsx` around lines 33 - 40, Update the
"Suggest one" Link so it uses the brand yellow highlight instead of the current
foreground color: locate the Link element (withOutboundRef(...), text "Suggest
one") and replace or extend its className to apply the brand color (hex `#ffcc00`)
for the text and adjust decoration on hover (e.g., text-[`#ffcc00`] and
decoration-[`#ffcc00`]/50 or equivalent utility) while preserving underline and
accessibility attributes (target, rel). Ensure the color change is applied only
to this Link and does not affect surrounding elements.

Source: Coding guidelines

app/(main)/resources/page.tsx (1)

5-12: ⚡ Quick win

Add Open Graph image metadata.

The metadata includes title and description for Open Graph but omits images. Adding an OG image will improve social media previews when this page is shared.

🖼️ Proposed enhancement
 export const metadata: Metadata = {
   title: "Resources",
   description: "Sites we use while building animata.",
   openGraph: {
     title: "Resources",
     description: "Sites we use while building animata.",
+    type: "website",
+    images: [
+      {
+        url: "/og-resources.png",
+        width: 1200,
+        height: 630,
+        alt: "Animata Resources",
+      },
+    ],
   },
 };

Note: Create the corresponding /public/og-resources.png image.

🤖 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 `@app/`(main)/resources/page.tsx around lines 5 - 12, The Open Graph metadata
is missing an images entry; update the exported const metadata (specifically the
openGraph property) to include an images array pointing to the new OG image (for
example "/og-resources.png" or a full URL) and create the corresponding file in
public (e.g., public/og-resources.png); ensure the openGraph.images entry
contains at least url and optionally alt/width/height for better previews.
🤖 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 `@lib/outbound-ref.ts`:
- Around line 5-16: The withOutboundRef function currently calls new URL(href)
which can throw for malformed hrefs (e.g., invalid port) and crash callers; wrap
the URL construction in a try/catch inside withOutboundRef (referencing
withOutboundRef and OUTBOUND_REF) and on error simply return the original href
(or href unchanged) so rendering doesn't crash, while still preserving existing
behavior of adding the ref param when URL parsing succeeds.

---

Nitpick comments:
In `@app/`(main)/resources/page.tsx:
- Around line 5-12: The Open Graph metadata is missing an images entry; update
the exported const metadata (specifically the openGraph property) to include an
images array pointing to the new OG image (for example "/og-resources.png" or a
full URL) and create the corresponding file in public (e.g.,
public/og-resources.png); ensure the openGraph.images entry contains at least
url and optionally alt/width/height for better previews.

In `@components/resources/resource-grid-item.tsx`:
- Around line 14-20: Replace the native img element in resource-grid-item.tsx
with Next.js's Image: import Image from 'next/image', swap the <img
src={resource.ogImage} ... /> usage to <Image ... /> using resource.ogImage as
src and a meaningful alt (e.g., resource.title), preserve the class-based
styling via layout/priority/sizes or the fill prop and object-fit support, and
if external OG domains aren’t configured in next.config.js add unoptimized to
the Image or add the domain to images.domains; ensure loading="lazy" behavior is
preserved via Image props if needed.

In `@components/resources/resources-shell.tsx`:
- Around line 33-40: Update the "Suggest one" Link so it uses the brand yellow
highlight instead of the current foreground color: locate the Link element
(withOutboundRef(...), text "Suggest one") and replace or extend its className
to apply the brand color (hex `#ffcc00`) for the text and adjust decoration on
hover (e.g., text-[`#ffcc00`] and decoration-[`#ffcc00`]/50 or equivalent utility)
while preserving underline and accessibility attributes (target, rel). Ensure
the color change is applied only to this Link and does not affect surrounding
elements.

In `@lib/resources.ts`:
- Around line 484-486: Remove the trivial wrapper getResources and have callers
use the RESOURCES array directly: delete the getResources() function (and its
export) and ensure RESOURCES remains exported; then update any imports/usages of
getResources() to import RESOURCES and reference it directly (search for
getResources and replace calls with RESOURCES).
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f54274a-58fd-4556-8562-13e596a03f3b

📥 Commits

Reviewing files that changed from the base of the PR and between 5e0a651 and d3f6481.

📒 Files selected for processing (8)
  • app/(main)/resources/page.tsx
  • components/resources/grid-backdrop.tsx
  • components/resources/resource-grid-item.tsx
  • components/resources/resource-grid.tsx
  • components/resources/resources-shell.tsx
  • lib/outbound-ref.ts
  • lib/resources.ts
  • public/resources/unsection.webp

Comment thread lib/outbound-ref.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploying animata with  Cloudflare Pages  Cloudflare Pages

Latest commit: e201078
Status:⚡️  Build in progress...

View logs

@hari

hari commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

remove the unsection image

Co-authored-by: Cursor <cursoragent@cursor.com>
@hari hari merged commit 09c544a into main Jun 9, 2026
4 of 5 checks passed
@hari hari deleted the feat/resources-page branch June 9, 2026 17:23
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