Skip to content

MoriUI: GitHub PR status strip on the selected worktree#94

Merged
vaayne merged 3 commits into
mainfrom
feat/github-companion
Jun 24, 2026
Merged

MoriUI: GitHub PR status strip on the selected worktree#94
vaayne merged 3 commits into
mainfrom
feat/github-companion

Conversation

@vaayne

@vaayne vaayne commented Jun 24, 2026

Copy link
Copy Markdown
Owner

The selected worktree row expands a one-line GitHub PR strip — number, state (open/draft/review/approved/changes/merged) and a CI rollup (✓/✕/⧗) for that branch. Click opens the PR in the browser; the heavy review/merge work stays on github.com. No embedded WebView, no new TUI.

Why

You're almost always asking one thing about the branch you're on: is my PR passing, can I merge it? This pins that answer to the worktree you're already looking at — glance in Mori, act in the browser.

Changes

  • MoriCore: PullRequestInfo model + JSON parser handling gh's mixed CheckRun/StatusContext check rollup; transient AppState.pullRequests cache (never persisted). Parser unit-tested.
  • App: GitHubBackend actor — a thin, read-only gh pr view wrapper. WorkspaceManager refreshes the selected worktree's PR on selection + each poll. Local worktrees only; remote (SSH) skipped.
  • MoriUI: PullRequestStrip rendered only on the selected row, so unselected rows stay quiet.

Behavior

  • Fetched live via gh; nothing renders when there's no PR or gh isn't installed.
  • Only the selected worktree expands its strip.

Verification

  • debug + release build pass; tests green (677 assertions)
  • gh JSON contract verified against this PR (open + all-green checks → green "open" + ✓)

Note: an earlier iteration also added a gh dash companion tool (⇧⌘G); dropped from this PR — the contextual strip covers the daily need and the TUI dashboard wasn't pulling its weight.

@vaayne vaayne force-pushed the feat/github-companion branch from 1cdaec0 to 81602de Compare June 24, 2026 06:07
@vaayne vaayne changed the title MoriUI: add gh dash as a GitHub companion tool (⇧⌘G) MoriUI: GitHub PR status strip on the selected worktree Jun 24, 2026
The selected worktree row carries a compact, tappable PR badge — `#number`
tinted by state (open/draft/review/approved/changes/merged) plus a CI glyph
(✓/✕/⧗), full state in the tooltip. Inline on the row, so the sidebar stays
two levels (no PR sub-row). Click opens the PR in the browser.

- MoriCore: PullRequestInfo model + JSON parser (gh's mixed CheckRun /
  StatusContext rollup), transient AppState.pullRequests cache. Parser tested.
- App: GitHubBackend actor (thin read-only gh wrapper); WorkspaceManager
  refreshes the selected worktree's PR on selection + each poll, local only.
- MoriUI: PullRequestBadge rendered inline on the row.
@vaayne vaayne force-pushed the feat/github-companion branch from 81602de to cb2ddef Compare June 24, 2026 06:33
vaayne added 2 commits June 24, 2026 14:38
The hover overflow menu and the context menu had drifted into two copies of
the same items; the GitHub/DiffsHub PR actions only landed in one. Extract a
single WorktreeContextActions view both render, and hang the github.com→
diffshub.com host swap off PullRequestInfo so there's one definition of each.
- Throttle the gh fetch to ~1/min; the 5s poll was spawning a subprocess
  every tick. Selection still forces an immediate refresh.
- Derive the badge's display state once so its label and color can't diverge,
  instead of two copies of the isDraft→state→reviewDecision tree.
- Move the github.com→diffshub.com host swap into the menu view; it's a
  presentation concern, not something the core PullRequestInfo model should know.
@vaayne vaayne merged commit 3734e1e into main Jun 24, 2026
4 checks passed
@vaayne vaayne deleted the feat/github-companion branch June 26, 2026 01:55
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