Skip to content

📡 [src] add --repo persistent view#278

Open
chicks-net wants to merge 3 commits into
mainfrom
chicks/2026-05-21-repo-mode
Open

📡 [src] add --repo persistent view#278
chicks-net wants to merge 3 commits into
mainfrom
chicks/2026-05-21-repo-mode

Conversation

@chicks-net
Copy link
Copy Markdown
Member

Done

  • 📡 [src] add --repo persistent view
  • handle PRs for main
  • try work around rate limits

Meta

(Automated in .just/gh-process.just.)

Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Copilot AI review requested due to automatic review settings May 21, 2026 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new persistent “repo mode” to gh-observer that watches all active PRs for a repository (plus optional non-PR branch workflow runs), with additional rate-limit visibility and new config knobs to control refresh/fade behavior.

Changes:

  • Introduces --repo (persistent repo watcher) and --all-branches (show branch runs across all branches) CLI flags.
  • Adds new TUI model/view/update loop for repo mode, including PR grouping + optional branch-run sections and fade-out behavior.
  • Extends GitHub client helpers (repo parsing/current repo detection, GraphQL PR rollup fetch, REST workflow run fetch) and adds config defaults + examples for repo mode.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
main.go Adds --repo/--all-branches flags and routes execution into persistent repo mode.
internal/tui/view.go Adds a “rate limit critical” indicator when remaining quota is very low.
internal/tui/runview.go Adds a “rate limit critical” indicator when remaining quota is very low.
internal/tui/repoview.go New repo-mode TUI rendering: repo header, PR groups, optional branch run sections, rate-limit line.
internal/tui/repoupdate.go New repo-mode update loop: periodic polling, rate-limit backoff, fade-out filtering, branch-run fetching.
internal/tui/repoupdate_test.go Unit tests covering fade-out behavior for repo-mode PR checks and branch runs.
internal/tui/repomodel.go New repo-mode model/state and constructor.
internal/tui/constants.go Adds rate warning threshold constant used by the views.
internal/github/repo.go Adds parsing for owner/repo or GitHub repo URL and auto-detection from git remote.
internal/github/repo_test.go Tests for repo-argument parsing.
internal/github/repo_runs.go Adds branch workflow run fetching + job enrichment for repo mode.
internal/github/repo_runs_test.go Tests for run inclusion logic and conversion helpers.
internal/github/repo_graphql.go Adds GraphQL query to fetch open PRs and their check-rollups in one call.
internal/github/client.go Adds helper to fetch a repo’s default branch via REST API.
internal/config/config.go Adds repo-mode refresh/fade/show-branch-runs settings with defaults.
.config.example.yaml Documents new repo-mode config keys and their defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.go
Comment on lines +164 to +168
// resolveRepoArg resolves the owner/repo from the --repo flag value.
// If the value is empty, it auto-detects the current repo from git remote.
func resolveRepoArg(val string) (string, string, error) {
if val != "" {
return ghclient.ParseRepoArg(val)
Comment on lines +66 to +70
opts.Status = ""
opts.Created = ">=" + time.Now().Add(-fadeWindow).Format(time.DateOnly)

completedRuns, rateLimit2, err := fetchBranchRunPage(ctx, client, owner, repo, opts)
if err != nil {
Comment thread internal/tui/repomodel.go
Comment on lines +54 to +60
return RepoModel{
ctx: ctx,
token: token,
client: client,
owner: owner,
repo: repo,
prs: make(map[int]PRViewData),
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.

2 participants