Skip to content

feat(website): hero rebuild — npx CTA + inline validation + SSR star count#425

Merged
rohitg00 merged 1 commit into
mainfrom
feat/hero-redesign-v0917
May 16, 2026
Merged

feat(website): hero rebuild — npx CTA + inline validation + SSR star count#425
rohitg00 merged 1 commit into
mainfrom
feat/hero-redesign-v0917

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented May 16, 2026

Summary

Five issues caught on agent-memory.dev v0.9.16:

  1. Title was eating ~half the viewport → FeaturedIn lived below the fold. Tightened the clamp.
  2. Generic 'START IN 30 SECONDS' button → replaced with copyable $ npx @agentmemory/agentmemory terminal command as primary CTA (gold border, click-to-copy, transient 'COPIED' state).
  3. FeaturedIn validation (AlphaSignal · AAIF · Trendshift) was below the fold. Now inlined inside the hero in compact mode (no border, no own padding) so it sits above the fold.
  4. Star count was invisible. Component fetched client-side from rate-limited unauthenticated github.com api → first paint always had no count, especially on mobile. Hero is now async server component; calls lib/github.ts fetchRepoStats (same path Nav uses) and passes the SSR'd value into a new initialStars prop on GitHubStarButton.
  5. Mobile breakpoint shored up. Title font drops, chip shrinks, hero padding tightens at 760px. NPX command cell hides 'CLICK TO COPY' hint and stretches to full width at 640px.

Test plan

  • npm run build clean
  • Vercel preview will redeploy on push
  • Live verify: desktop 1920 / 1440 / 1280 — all 3 hero blocks (title, CTA, FeaturedIn) above the fold
  • Live verify: mobile 375 / 414 — title stacks, NPX command stretches, FeaturedIn stacks to 1-col
  • Live verify: star count visible on first paint, no flash-of-missing-state
  • Live verify: click NPX cell → clipboard contains the exact string

Summary by CodeRabbit

  • New Features

    • Added one-click copy functionality for install command.
    • GitHub repository stats now display dynamically in the hero section.
  • Improvements

    • Refined hero layout, typography sizing, and spacing.
    • Updated responsive design breakpoints and mobile optimizations.
    • Enhanced component styling and structure for better visual presentation.

Review Change Stack

…count

Five user-reported issues against agent-memory.dev v0.9.16:

1. AGENT/MEMORY title was clamp(54px, 12vw, 160px) — eating ~half the
   viewport on most desktop widths and forcing FeaturedIn below the
   fold. Reduced to clamp(44px, 9vw, 124px). Mobile-stacked variant
   now clamp(40px, 14vw, 72px) — cleaner.

2. Primary CTA was a generic "START IN 30 SECONDS" button that
   anchored to #install. Replaced with a copyable terminal command —
   `$ npx @agentmemory/agentmemory` rendered as a gold-bordered cell
   with "CLICK TO COPY" affordance. Copy → clipboard, transient
   "COPIED" state. Matches what users actually type.

3. FeaturedIn was a standalone section below the fold. Now inlined
   inside the hero (compact mode — no border, no own padding,
   transparent background) so AlphaSignal / Agentic AI Foundation /
   Trendshift validation lands above the fold.

4. Star count was missing from the hero CTA button. The component
   only fetched client-side from unauthenticated github.com/api which
   is rate-limited to ~60 req/hr/IP — first paint had no count, often
   forever on mobile (which is what the user screenshot showed).
   Hero is now an async server component; calls lib/github.ts
   fetchRepoStats (same path Nav already uses), passes the SSR'd
   count into GitHubStarButton via new optional initialStars prop.
   Client-side refetch still fires in useEffect as a best-effort
   refresh.

5. Mobile layout was unverified. Tightened all clamp() values,
   added explicit @media (max-width: 760px) breakpoint that drops
   padding, stacks the title, and reduces the chip size. The new
   HeroNpxCommand has its own mobile breakpoint at 640px that hides
   the "CLICK TO COPY" hint and stretches to full width.

CTA stacks vertically now: copyable command (primary, gold border)
on row 1, then "SEE IT MOVE" + STAR-with-count on row 2. FeaturedIn
strip sits below row 2 as part of the above-the-fold validation.

Build clean. No new deps.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

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

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment May 16, 2026 9:01am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

The PR refactors the homepage hero section by introducing a new interactive copy-to-clipboard component for the npx install command, enhancing SSR support for GitHub star counts, making the FeaturedIn component configurable, converting Hero to async data fetching, and comprehensively updating layout and responsive styling.

Changes

Hero Section Interactive Components & SSR Optimization

Layer / File(s) Summary
HeroNpxCommand Component
website/components/HeroNpxCommand.tsx, website/components/HeroNpxCommand.module.css
New client component renders a button with npx @agentmemory/agentmemory`` install command; on click, attempts clipboard copy via navigator.clipboard.writeText(), shows transient "COPIED" feedback for 1.6 seconds, and silently keeps default hint if clipboard access is blocked.
GitHubStarButton SSR Hydration
website/components/GitHubStarButton.tsx
Adds optional initialStars prop for server-side rendering, initializes star count state from this value, updates aria-label to include formatted star count when available, and preserves SSR/cached values on network errors.
FeaturedIn Configurability
website/components/FeaturedIn.tsx, website/components/FeaturedIn.module.css, website/app/page.tsx
FeaturedIn accepts optional compact prop to render alternate styling with different spacing; component removed from root page JSX while remaining available for conditional placement in other sections.
Hero Async Data Fetching & Composition
website/components/Hero.tsx
Hero converted to async component, fetches GitHub stats at build time, restructures CTA layout with new ctaSecondary container holding HeroNpxCommand and repositioned GitHubStarButton, integrates FeaturedIn component, and passes fetched star count to initialize button state.
Hero Layout & Responsive Styling
website/components/Hero.module.css
Padding reduced, chip/title/lede typography updated via new clamp ranges and line-heights, .cta converted to vertical flex layout, .ctaSecondary uses inline-flex with updated gap/wrapping, responsive breakpoint shifted from 640px to 760px with corresponding mobile overrides for padding, font sizing, and spacing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • rohitg00/agentmemory#415: Introduces/modifies the FeaturedIn component and its placement on the homepage homepage layout and styling.
  • rohitg00/agentmemory#316: Modifies Hero.tsx and GitHubStarButton.tsx integration, establishing the GitHub star button as a hero child component.
  • rohitg00/agentmemory#167: Updates Hero.tsx to compute and use GitHub/project metadata for rendering hero chip and related components.

Poem

🐰 A copy button hops into the hero's frame,
Stars hydrate early, no flicker of shame,
FeaturedIn goes compact, responsive and spry,
The layout evolves with a fresh, nimble sigh! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: hero component rebuild with new npx CTA command, inline FeaturedIn component, and SSR-provided GitHub star count.
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/hero-redesign-v0917

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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
Copy Markdown

@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

🤖 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 `@website/components/Hero.tsx`:
- Line 11: The call to fetchRepoStats() in the Hero component can throw and
break the render; wrap the await fetchRepoStats() call in a try/catch (or use
.catch) and assign a safe fallback (e.g., an empty stats object or zeros) to the
stats variable so rendering can proceed; also guard any subsequent reads of
stats in the Hero render logic (e.g., when accessing stats.stars or stats.forks)
to use the fallback values when fetchRepoStats fails.
🪄 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: e93bdb8a-b7a5-4b15-88fe-0d978f72e60a

📥 Commits

Reviewing files that changed from the base of the PR and between 705321b and 44f6c4b.

📒 Files selected for processing (9)
  • website/app/page.tsx
  • website/components/FeaturedIn.module.css
  • website/components/FeaturedIn.tsx
  • website/components/GitHubStarButton.tsx
  • website/components/Hero.module.css
  • website/components/Hero.tsx
  • website/components/HeroNpxCommand.module.css
  • website/components/HeroNpxCommand.tsx
  • website/lib/generated-meta.json
💤 Files with no reviewable changes (1)
  • website/app/page.tsx

export function Hero() {
export async function Hero() {
const meta = getProjectMeta();
const stats = await fetchRepoStats();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard the stats fetch to prevent render-path failure.

At Line 11, await fetchRepoStats() has no local fallback. If that call throws, the hero can fail to render. Add a safe fallback so the page still ships core content.

Proposed fix
 export async function Hero() {
   const meta = getProjectMeta();
-  const stats = await fetchRepoStats();
+  const stats = await fetchRepoStats().catch(() => ({ stars: 0 }));
📝 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
const stats = await fetchRepoStats();
export async function Hero() {
const meta = getProjectMeta();
const stats = await fetchRepoStats().catch(() => ({ stars: 0 }));
🤖 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 `@website/components/Hero.tsx` at line 11, The call to fetchRepoStats() in the
Hero component can throw and break the render; wrap the await fetchRepoStats()
call in a try/catch (or use .catch) and assign a safe fallback (e.g., an empty
stats object or zeros) to the stats variable so rendering can proceed; also
guard any subsequent reads of stats in the Hero render logic (e.g., when
accessing stats.stars or stats.forks) to use the fallback values when
fetchRepoStats fails.

@rohitg00 rohitg00 merged commit f1fbea3 into main May 16, 2026
5 checks passed
@rohitg00 rohitg00 deleted the feat/hero-redesign-v0917 branch May 16, 2026 09:09
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.

1 participant