Skip to content

feat: PR git-log (l) & diff (d) overlays + fix bulk-search 502#9

Merged
zombocoder merged 2 commits into
mainfrom
feat/pr-log-diff-overlays
Jul 1, 2026
Merged

feat: PR git-log (l) & diff (d) overlays + fix bulk-search 502#9
zombocoder merged 2 commits into
mainfrom
feat/pr-log-diff-overlays

Conversation

@zombocoder

Copy link
Copy Markdown
Owner

Summary

Two related changes surfaced while testing the recently merged CI/merge-state PRs.

1. Fix: repos showed 0 PRs (bulk-search 502)

The nav sidebar showed repo [5] but selecting it showed No open pull requests. Root cause: repo PR lists are filtered from a single "all open PRs" search that spans every configured org/user at once. The merged features added mergeStateStatus (expensive, computed, and unused by the list) plus per-PR statusCheckRollup, pushing each request past GitHub's search complexity budget → 502 Bad Gateway → empty all_open_prs → every repo shows 0.

  • Drop mergeStateStatus from the bulk search/repo queries (kept in the on-demand PR_DETAIL_QUERY).
  • Halve the search page size (100 → 50) to cut per-request complexity.
  • Retry transient 5xx in the GraphQL query path with backoff.

2. Feature: git-log (l) and diff (d) overlays

Content-pane keys acting on the highlighted PR:

Context l d
Nav tree expand/select (unchanged)
Content pane git-log overlay (PR's commits) diff overlay
Overlay open switch to log switch to diff
  • Git log: the PR's recent commits (reuses the debounced on-demand detail fetch).
  • Diff: full unified diff via REST (Accept: application/vnd.github.v3.diff), +/-/@@/header coloring, scrollable with j/k. Esc/h closes; Enter/o still opens in the browser.
  • New Overlay enum (replaces detail_open), pr_diffs cache, fetch_pr_diff + rest_base (Enterprise-aware), generalized on-highlight debounce. Both caches clear on refresh.

Testing

cargo build, cargo clippy --all-targets --all-features, cargo fmt --check, cargo test (36 passed) all clean. Replaced the old detail-toggle tests with coverage for log/diff toggle, switching, and Esc-closes.

The live diff fetch needs the interactive TUI + a token, so please verify by running the app: highlight a PR, press l for commits and d for the diff.

The bulk all-open-PRs search spans every configured org/user at once. The
merged CI/merge-state features added mergeStateStatus (an expensive computed
field, unused by the list) plus per-PR statusCheckRollup, pushing each request
past GitHub's search complexity budget and returning 502 Bad Gateway. With the
result empty, repos showed 0 PRs despite nav counts.

- Drop mergeStateStatus from the bulk search/repo queries (kept in the
  on-demand PR_DETAIL_QUERY that the overlay fetches fresh).
- Halve the search page size (100 -> 50) to cut per-request complexity.
- Retry transient 5xx in the GraphQL query path with backoff.
Content-pane keys for the highlighted PR:
- l  -> git-log overlay: the PR's recent commits (reuses the on-demand
        detail fetch; nav tree keeps l = expand/select)
- d  -> diff overlay: full unified diff via REST (Accept: v3.diff), with
        +/-/@@ coloring, scrollable with j/k
- while an overlay is open, l/d switch between the two; Esc/h closes

Adds an Overlay enum (replacing detail_open), a pr_diffs cache, a
fetch_pr_diff REST call with a rest_base helper, and a generalized
on-highlight debounce that fetches commits or diff by active overlay.
Both caches clear on refresh.
@zombocoder zombocoder merged commit d6d1be9 into main Jul 1, 2026
4 checks passed
sashml added a commit to sashml/ghdash that referenced this pull request Jul 1, 2026
Rebased onto current main and reconciled with the git-log/diff overlay
rework (zombocoder#9): the filter + help are additive and independent of the per-PR
Overlay state.

- `f` cycles the merge filter: all -> conflicting -> clean; active filter
  shown in the table title. Composes with `/` search (applied in filtered_prs).
- `?` opens a help overlay documenting all keybindings (incl. l: log, d: diff)
  and the State/CI glyph legends (accessibility: glyphs are now documented).
- state: MergeFilter enum + merge_filter/help_open; Esc/h close help first.
- tests: cycle order, help toggle, back-closes-help, filter + search composition.

Refs: zombocoder#10, zombo-sash-eco-pp0u
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