Skip to content

Community section in the nav with live GitHub and Discord counts - #142

Open
kixelated wants to merge 4 commits into
mainfrom
claude/github-stars-social-links-dae52a
Open

kixelated wants to merge 4 commits into
mainfrom
claude/github-stars-social-links-dae52a

Conversation

@kixelated

@kixelated kixelated commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Builds on #135 (merged into this branch, so this supersedes it).

What changed

  • Nav: a divider after Demo/Blog/Docs/Pro, then GitHub and Discord with a live count underneath (1,515 stars, 1,495 chatters), then a row of Email/X/Bluesky/LinkedIn icons. The divider is hidden on mobile where the nav wraps.
  • Counts are fetched in the browser from the GitHub and Discord invite APIs and cached in localStorage for an hour (src/stats.ts). Both APIs allow anonymous CORS. If a fetch fails the text stays empty and the links still work.
  • Refactor: the repeated nav markup is now nav-link.astro; the socials list lives in src/socials.ts, shared by the nav and <Author />; pro.svg is renamed pro-word.svg to match the other word images.
  • Use Cases on the home page become a <Feature> list with an icon each. The four icons in public/home/use-case/ are placeholders, same as public/social/, until hand-drawn versions replace them.

Gotchas

  • Discord's API echoes the origin in Access-Control-Allow-Origin and caches for 5 minutes without Vary: Origin, so a response cached for moq.dev would fail CORS on doc.moq.dev. Both fetches use cache: "no-store".
  • The Astro dev server emits broken script URLs on nested pages (/blog//src/...) because of vite.base: "./". Pre-existing and production is unaffected, but counts won't render on blog pages under just dev. Separate fix.

just check and bun run build pass. Companion PR for doc.moq.dev: moq-dev/moq#3677.

🤖 Generated with Claude Code

(written by Claude Opus 5)

kixelated and others added 4 commits September 8, 2026 16:43
Every post ended with a bare avatar image, and most also carried a
hand-written "Written by [@kixelated](...)" line that had drifted --
some pointed at GitHub, some at a mailto for an address that isn't the
one I hand out. Replace both with a single <Author /> component so
there's one place to change.

The component renders the avatar plus icon links for email, X, Bluesky,
LinkedIn, and Discord. Icons live in public/social/ as single-path SVGs
filled with the same green as public/layout/, so hand-drawn versions can
replace them one file at a time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…nt-18883f' into claude/github-stars-social-links-dae52a
GitHub and Discord move below a divider in the sidebar, each with a live
count underneath: stars from the GitHub API and members from the Discord
invite API, fetched in the browser and cached in localStorage for an hour.
The personal social links from the <Author /> sign-off join them as a row
of small icons, sharing one list in src/socials.ts.

The repeated nav markup is now a NavLink component, and pro.svg is renamed
pro-word.svg to match the other word images.

Use Cases on the home page become a Feature list with an icon each. The
four use-case icons are placeholders, same as the social icons, until
hand-drawn versions replace them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Discord echoes the requesting origin in Access-Control-Allow-Origin but
marks the response cacheable without Vary: Origin, so a response cached
for moq.dev fails the CORS check on doc.moq.dev for five minutes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T05:08:13.439478Z 8cb7317 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cb73177c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/stats.ts
// links around them still work.
export async function renderStats() {
const stats = readCache() ?? (await fetchStats());
if (stats.stars !== undefined || stats.chatters !== undefined) writeCache(stats);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the original timestamp on cache hits

When a visitor returns or navigates within the one-hour TTL, readCache() supplies the cached stats but this unconditional call writes them back with at: Date.now(). Consequently, anyone who loads a page at least once per hour continually extends the cache and may never receive updated community counts; only write the cache after fetchStats() returns fresh data.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f4dd6494-7fe4-4877-ba84-452735aa2acd

📥 Commits

Reviewing files that changed from the base of the PR and between 8848bfd and 8cb7317.

⛔ Files ignored due to path filters (10)
  • public/home/use-case/conferencing.svg is excluded by !**/*.svg
  • public/home/use-case/contribution.svg is excluded by !**/*.svg
  • public/home/use-case/distribution.svg is excluded by !**/*.svg
  • public/home/use-case/robotics.svg is excluded by !**/*.svg
  • public/layout/pro-word.svg is excluded by !**/*.svg
  • public/social/bluesky.svg is excluded by !**/*.svg
  • public/social/discord.svg is excluded by !**/*.svg
  • public/social/email.svg is excluded by !**/*.svg
  • public/social/linkedin.svg is excluded by !**/*.svg
  • public/social/x.svg is excluded by !**/*.svg
📒 Files selected for processing (35)
  • src/components/author.astro
  • src/components/feature.astro
  • src/components/nav-link.astro
  • src/layouts/global.astro
  • src/pages/blog/application-first.mdx
  • src/pages/blog/be-the-outlier.mdx
  • src/pages/blog/cars2.mdx
  • src/pages/blog/demoqed.mdx
  • src/pages/blog/distribution-at-twitch.mdx
  • src/pages/blog/first-app.mdx
  • src/pages/blog/first-cdn.mdx
  • src/pages/blog/forward-error-correction.mdx
  • src/pages/blog/hash-tag-community.mdx
  • src/pages/blog/monte-video.mdx
  • src/pages/blog/moq-boy.mdx
  • src/pages/blog/moq-onion.mdx
  • src/pages/blog/moqbs.mdx
  • src/pages/blog/never-use-datagrams.mdx
  • src/pages/blog/on-a-boat.mdx
  • src/pages/blog/open-for-business.mdx
  • src/pages/blog/quic-powers.mdx
  • src/pages/blog/replacing-hls-dash.mdx
  • src/pages/blog/replacing-webrtc.mdx
  • src/pages/blog/tls-and-quic.mdx
  • src/pages/blog/to-wasm.mdx
  • src/pages/blog/transfork.mdx
  • src/pages/blog/update-00.mdx
  • src/pages/blog/update-01.mdx
  • src/pages/blog/webrtc-is-the-problem.mdx
  • src/pages/blog/you-dont-need-it.mdx
  • src/pages/index.mdx
  • src/pages/issues.mdx
  • src/pages/source.mdx
  • src/socials.ts
  • src/stats.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The PR adds shared author and social-link components, then applies the Author component across blog posts and site pages. It replaces global navigation anchors with NavLink components and adds cached GitHub and Discord statistics. It expands Feature artwork for four homepage use cases and renders those use cases with Feature components.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 8cb73

The navigation, author attribution, statistics, and homepage feature updates have no identified merge-blocking risk.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (33 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the primary change: adding a Community navigation section with live GitHub and Discord counts.
Description check ✅ Passed The description is detailed and directly covers the navigation changes, live count fetching, caching, refactoring, social links, and Use Cases updates.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (33 skipped: 33 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/github-stars-social-links-dae52a

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.

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