Skip to content

feat(website): add Star on GitHub button to hero CTA row#316

Merged
rohitg00 merged 1 commit into
mainfrom
feat/website-hero-github-star
May 12, 2026
Merged

feat(website): add Star on GitHub button to hero CTA row#316
rohitg00 merged 1 commit into
mainfrom
feat/website-hero-github-star

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented May 12, 2026

Why

Hero CTA row had START IN 60 SECONDS + SEE IT MOVE but no GitHub star path. Visitors landing from X / Reddit / HN have nowhere obvious to bookmark before they leave to install.

What

Adds GitHubStarButton next to the existing ghost button.

  • Ghost-style button matching the existing visual register — no new design surface
  • Inline SVG star icon (currentColor, matches button text)
  • STAR label + live star count
  • Count fetches once on mount from api.github.com/repos/rohitg00/agentmemory (unauthenticated, 60 req/h per IP — plenty for a marketing page)
  • 30-minute localStorage cache keyed by repo so repeat visits don't re-hit the API
  • Graceful degradation: if fetch fails (offline, rate-limited, blocked), button still renders without the count

"use client" because the count is live. No deps added.

Files

  • website/components/GitHubStarButton.tsx — new
  • website/components/GitHubStarButton.module.css — new
  • website/components/Hero.tsx — adds <GitHubStarButton repo="rohitg00/agentmemory" /> after SEE IT MOVE

Test plan

  • cd website && npm run build — Next 16 static export clean, no type errors.
  • Visual check on Vercel preview deploy: third button appears in hero CTA row, star count shows current stargazer count, button links to https://github.com/rohitg00/agentmemory in new tab.
  • Throttle network in DevTools, reload — button renders without count, no console errors.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a GitHub star button to the hero section displaying the live star count
  • Chores
    • Version bumped from 0.9.7 to 0.9.10
    • Enhanced test coverage (898 tests passing)

Review Change Stack

Hero only had START IN 60 SECONDS + SEE IT MOVE. Missing the obvious
CTA for visitors who landed via X/Reddit and want to bookmark before
installing.

Adds GitHubStarButton component next to the existing ghost button:

- ghost-style button matching the existing visual register
  (no new design surface introduced)
- star icon (inline SVG, currentColor) + STAR label + live
  star count
- count fetches once on mount from api.github.com/repos/<repo>
  (unauthenticated, 60 req/h limit per IP — fine for a marketing page)
- 30-minute localStorage cache keyed by repo so repeat visits don't
  re-hit the API
- graceful degradation: if fetch fails (offline, rate-limited,
  blocked), button still renders without the count

Only client-side ("use client") because we want the live count.
No deps added. Build clean (Next 16 static export).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

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

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment May 12, 2026 10:55pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5fa9e6c1-600c-4fb3-b58a-d35036f0027b

📥 Commits

Reviewing files that changed from the base of the PR and between 48b11e8 and ea5e778.

📒 Files selected for processing (4)
  • website/components/GitHubStarButton.module.css
  • website/components/GitHubStarButton.tsx
  • website/components/Hero.tsx
  • website/lib/generated-meta.json

📝 Walkthrough

Walkthrough

Adds a new GitHub Star Button component that fetches stargazer counts via GitHub API with localStorage caching, integrates it into the hero section, and updates build metadata for version 0.9.10 with 898 passing tests.

Changes

GitHub Star Button Feature

Layer / File(s) Summary
GitHub Star Button Component
website/components/GitHubStarButton.module.css, website/components/GitHubStarButton.tsx
Defines styling and a client-side React component that fetches repository stargazer counts from the GitHub REST API. The component reads from and writes to a localStorage cache with 30-minute TTL, formats large counts into compact "k" notation, prevents state updates after unmount, and tolerates network errors by falling back to cached or null display. Renders an SVG-linked button with icon, label, and conditional count badge using CSS-module classes and accessibility attributes.
Hero Section Integration
website/components/Hero.tsx
Imports and renders the GitHubStarButton component in the hero call-to-action area, configured with the rohitg00/agentmemory repository.
Version and Build Metadata
website/lib/generated-meta.json
Updates version from 0.9.7 to 0.9.10, increases passing tests from 880 to 898, and refreshes the build timestamp; other metadata fields remain unchanged.

Sequence Diagram

sequenceDiagram
  participant GitHubStarButton
  participant LocalStorage
  participant GitHubAPI
  participant UI as Rendered UI
  GitHubStarButton->>LocalStorage: Check cached stars (30-min TTL)
  alt Cache hit and valid
    LocalStorage-->>GitHubStarButton: Return cached count
  else Cache miss or expired
    GitHubStarButton->>GitHubAPI: Fetch repo stargazers_count
    GitHubAPI-->>GitHubStarButton: Return count
    GitHubStarButton->>LocalStorage: Update cache with new count
  end
  GitHubStarButton->>GitHubStarButton: Format count to "k" notation
  GitHubStarButton->>UI: Render button with formatted count
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

✨ A button born beneath the stars so bright,
Fetching counts from GitHub's API light,
Cached and formatted with grace divine,
The hero shines with agentmemory's sign! 🐰⭐

🚥 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 summarizes the main change: adding a GitHub star button component to the hero CTA row, which is the primary objective of the PR.
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/website-hero-github-star

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.

@rohitg00 rohitg00 merged commit 3f661d2 into main May 12, 2026
3 of 5 checks passed
rohitg00 added a commit that referenced this pull request May 12, 2026
… website star button (#317)

Three landed PRs since v0.9.10:
- #311 — Codex plugin support (manifest + marketplace + Codex-shaped
  hooks subset, sharing the same scripts as the Claude Code plugin
  via CLAUDE_PLUGIN_ROOT OOTB-compat injection on Codex's hook
  engine)
- #310 — OpenClaw plugins.slots.memory now actually claimed via
  api.registerMemoryCapability({ promptBuilder }); older builds
  without the capability API still load via the existing hook-only
  path
- #316 — Star on GitHub button in the website hero CTA row, live
  stargazer count via api.github.com, 30-minute localStorage cache,
  graceful degrade on API failure

Bumping 0.9.10 -> 0.9.11 across the 8 standard files:
- package.json
- packages/mcp/package.json
- plugin/.claude-plugin/plugin.json
- plugin/.codex-plugin/plugin.json
- src/version.ts
- src/types.ts (ExportData.version literal)
- src/functions/export-import.ts (supportedVersions)
- test/export-import.test.ts (round-trip expectation)
- CHANGELOG.md (new 0.9.11 entry)

877 / 877 tests pass. Build clean.
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