Skip to content

feat: Anchor feedback via GitHub Discussions (upvotes + comments) #210

@raifdmueller

Description

@raifdmueller

Problem

Users have no way to give feedback on individual anchors — no voting, no commenting, no signal which anchors are most useful.

Proposed Solution

Use GitHub Discussions as a feedback backend. Each anchor gets its own Discussion post. GitHub's built-in upvote button serves as voting, comments provide qualitative feedback.

Implementation Plan

1. Setup

  • Create a new Discussion category "Anchor Feedback" (or reuse "Ideas")
  • Create one Discussion per anchor (~104) via script using gh api graphql
  • Consistent title format: ⚓ <Anchor Title> (e.g. "⚓ arc42")
  • Body: short description + link back to website

2. Website Integration (Anchor Modal)

  • Add a feedback section at the bottom of the anchor modal
  • Show upvote count (fetched at build time, cached in a JSON file)
  • Two buttons:
    • 👍 Vote → opens the Discussion on GitHub
    • 💬 Discuss → same link, scrolls to comments
  • Small text: "Requires GitHub login"

3. Website Integration (Card Grid)

  • Show upvote count on each anchor card
  • Indicate non-empty discussions (comment count > 0) with a 💬 badge
  • Enable "Most popular" sort option using cached vote counts

4. Build-Time Data Pipeline

  • New build script: scripts/fetch-discussion-votes.js
  • Queries GitHub GraphQL API for all Discussions in the "Anchor Feedback" category
  • Outputs website/public/data/discussion-votes.json mapping anchor IDs to { upvoteCount, commentCount, url }
  • Runs as part of npm run build (or separately via npm run fetch-votes)
  • GitHub Actions: use GITHUB_TOKEN for authenticated requests (5000 req/h)

5. Daily Cache Refresh

  • Add scheduled GitHub Actions workflow (cron, daily at 06:00 UTC)
  • Runs fetch-discussion-votes.js and commits updated discussion-votes.json
  • Triggers redeploy with fresh vote counts

API Details

GitHub GraphQL returns upvoteCount per Discussion:

{
  repository(owner: "LLM-Coding", name: "Semantic-Anchors") {
    discussions(categoryId: "...", first: 100) {
      nodes {
        title
        upvoteCount
        comments { totalCount }
        url
      }
    }
  }
}

Advantages

  • No custom backend, no database
  • Privacy-first (no tracking on our side)
  • GitHub login as spam filter
  • Discussions also serve as improvement suggestions per anchor
  • Vote counts enable "most popular anchors" feature

Decisions

  • No downvoting — GitHub Discussions only support upvotes (feature, not limitation)
  • Vote cache refresh — daily via scheduled GitHub Actions build
  • Card grid — show vote counts and non-empty discussion indicator on all cards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions