MoriUI: GitHub PR status strip on the selected worktree#94
Merged
Conversation
1cdaec0 to
81602de
Compare
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.
81602de to
cb2ddef
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PullRequestInfomodel + JSON parser handling gh's mixedCheckRun/StatusContextcheck rollup; transientAppState.pullRequestscache (never persisted). Parser unit-tested.GitHubBackendactor — a thin, read-onlygh pr viewwrapper.WorkspaceManagerrefreshes the selected worktree's PR on selection + each poll. Local worktrees only; remote (SSH) skipped.PullRequestStriprendered only on the selected row, so unselected rows stay quiet.Behavior
gh; nothing renders when there's no PR orghisn't installed.Verification