Skip to content

Add a read-only GitHub preview to project pages - #46

Merged
meddlin merged 1 commit into
mainfrom
claude/multi-repo-project-tracking-1a3852
Nov 5, 2026
Merged

meddlin merged 1 commit into
mainfrom
claude/multi-repo-project-tracking-1a3852

Conversation

@meddlin

@meddlin meddlin commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What

Projects could already hold several repos, but a project page only showed gitlib's own planning issues. This adds an On GitHub section to each project page that previews, for every repo with a GitHub remote:

  • open pull requests
  • open issues
  • the latest commits on the default branch

It starts with a one-line summary across the project (total open PRs and issues), and each repo expands to its lists.

Keeping gitlib data and GitHub data apart

GitHub is a preview here, not a source of truth:

  • Separate sections with their own wording. The local one is now headed "Gitlib issues" (and the Projects list says "gitlib issues"); the GitHub one carries a "Read-only preview" badge.
  • GitHub rows are named owner/repo#12 and link out to GitHub, so they can't be mistaken for a gitlib repo#3. There is nothing to edit, assign or file on them.
  • Only GET requests are made. The planning database is never read from or written to by the preview.
  • Nothing is persisted. The only copy is a five-minute in-memory cache; Refresh skips it and a restart empties it.

Things to know when reviewing

  • GITHUB_TOKEN is optional. Without it, GitHub allows 60 requests an hour and each repo costs three, so large projects can hit the limit; the page says so. Lookups run four repos at a time and repos sharing a remote are fetched once.
  • A repo with no GitHub remote, one gitlib no longer finds, or one GitHub can't show (not found, rate limited) is reported on its own line and doesn't affect the others. A repo whose three requests all fail the same way shows the message once.
  • getPullRequests and getIssues (the repo page tabs) now call shared fetchers in github-lists.server.ts. Their output is unchanged.
  • The preview loads client-side after the page renders, so the local sections never wait on GitHub.
  • Not included: cross-project views, merged-PR history, CI or review state, GitLab.

Testing

  • npm run typecheck and npm test pass (563 tests), including nine new tests in apps/web/test/project-github.test.ts. They cover the shape of the data, GET-only requests, planning data being left untouched, repos with no remote or unknown, partial failures, empty repos, caching and refresh, failed lookups not being cached, and shared remotes.
  • Checked in the browser (desktop and mobile width, no horizontal overflow) against public GitHub repos, using a throwaway gitlib home.

🤖 Generated with Claude Code

A project page now shows, for each repo with a GitHub remote, the open pull
requests, open issues and latest commits on the default branch, so progress
across several repos can be seen in one place.

The preview is kept apart from gitlib's own issues so the two cannot be
confused: it is a separate "On GitHub" section, rows are named owner/repo#N and
link out to GitHub, and nothing in it can be edited or assigned. It only issues
GET requests, never touches planning.db, and keeps its data in a five-minute
in-memory cache (Refresh bypasses it). Repos with no GitHub remote or that
GitHub cannot show are reported individually.

The repo-level Pull requests and Issues tabs now share the same fetch code.
Local issue labels on the Projects pages say "gitlib issues".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@meddlin
meddlin merged commit 2a48326 into main Nov 5, 2026
1 check passed
@meddlin
meddlin deleted the claude/multi-repo-project-tracking-1a3852 branch November 5, 2026 22:16
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