Repository navigation
feat(tui): pull request panel with Summary, Timeline and Checks tabs - #35
Merged
Merged
Conversation
ctrl+y opens the current thread's linked pull requests in the right panel. Summary shows state, author, branches, changes, checks, mergeability, reviewers and the description as terminal markdown. Timeline groups events by day, folds commit runs and dims sync merges. Checks groups checks and shows a GitHub Actions job log with theme-mapped ANSI colors. Features add more tabs through prPanelTabs (the Code tab uses order 40).
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.
Summary
The TUI gets a right panel for the pull requests linked to the open thread, with Summary, Timeline and Checks tabs. Other features add tabs through a new
prPanelTabsfield; the Code tab from #32 uses it.Preview
Summary:
Timeline (newest first, the rail stops at the last event, commit runs folded):
Checks with a GitHub Actions job log open:
Captured headless from a playground server with pingdotgg/t3code#33263 linked to a thread in the copy (read-only GitHub calls).
Changes
features/pr-panel/(new):PrPanel.tsx: the panel. Shows the PR line (1/2 · n nextwhen the thread has more than one link), the tab bar with a checks count badge, and the active tab. Empty states for no thread and no linked PR.SummaryTab.tsx: title, state or draft, author,base ← head, files and +/-, checks summary, mergeability (open PRs), reviewers with their latest verdict, labels, and the description as terminal markdown.TimelineTab.tsx: events grouped by local day, marker glyph and color per type, review verdicts, review threads as one row withpath:lineand reply count, runs of 3+ commits folded (eexpands), repeated "Merge branch 'main' into" commits merged into one dimmed row. The rail runs from the first marker to the last and stops there. Comment bodies show 8 lines, then "N more lines".ChecksTab.tsx: summary line ("21 passed · 13 skipped" wording from fix(web): end the PR timeline line at the last event and name skipped checks #12), sections Needs attention / Running / Completed,j/kselect,enteropens the job log. Every log state (loading, error, host-only, no log, empty, loaded) uses the same frame with one header line, as in fix(web): align check log states in the Checks tab #13.ansi.ts: log lines keep SGR colors mapped onto theme tokens (bold, italic, underline too). 256-color and RGB codes, cursor moves, OSC (titles, links) and other control characters are dropped.##[error]and##[warning]lines get danger and warning colors.model.ts: thread links to targets, checks grouping and wording, timeline building and rows. Trimmed copies ofpullRequestDetail.logic.tsandpullRequestPresentation.tsx; the web file imports web-only modules (~/reviewCommentContext, composer helpers), so I could not import it. Candidate for client-runtime.view.tsx: data hook (detail with newer checks merged throughresolvePullRequestDetailChecks, as web does), a line viewport, scroll keys, and PR markdown without raw HTML blocks.app/feature.ts,app/registry.ts:prPanelTabs?: TuiPrPanelTab[]onTuiFeature({ id, title, order, component }, component gets{ target, focused, width, height }). The registry merges them sorted byorderand throws on duplicate ids.state/pullRequests.ts(new):pullRequestAtoms = createPullRequestEnvironmentAtoms(connectionAtomRuntime), shared with the Code tab.connection/runtime.ts:PullRequestDiffLoader.layerinlayerSnapshotLoaders, whichcreatePullRequestEnvironmentAtomsneeds.features/index.ts: one line.CONTRIBUTING-TUI.md: "Pull request panel tabs" section (the tab contract, key order, shared atoms).README.md: panel keys.Keys added:
ctrl+ytoggles the panel (pr-panel.toggle, also in the palette) and focuses it on open.[/]and1-9switch tabs,nnext linked PR,rreloads detail, activity and checks.j/k, arrows,ctrl+d/ctrl+u, page keys andg/Gscroll. Timeline:eexpands commit runs. Checks:enter/spacetoggle the log,escapehides it,rreloads the open log.Tests
features/pr-panel/model.test.ts(fixture PR data): thread link targets (newest first,stack-dismissedhidden, legacy fallback), check summary wording (passed/skipped, failing, running, workflow approval), timeline rows (commit run folding, sync commit merging), the rail ending at the last marker, and the ANSI parser (theme colors, escapes and controls stripped, style carried across lines).app/App.test.tsxstill passes with the new feature registered (catches id and key conflicts).vp run check:changed: format, lint, knip, typecheck (41 packages), tests (19 files) pass.Scope affected
TUI only. Shell files touched:
app/feature.tsandapp/registry.ts(new optional field),connection/runtime.ts(one layer). No web, mobile, server or contract changes. #32 has the samestate/pullRequests.tsand runtime line; whichever merges second keeps one copy and #32 swaps its stand-in panel forprPanelTabs.Reasoning
n/pfor hunks while a diff is open.ctrl+y: the webrightPanel.togglekey (mod+alt+b) does not reach most terminals, and the other free ctrl keys are taken or are terminal controls.rreloads on demand. Polling can follow if it is needed.Summary by cubic
Adds a right panel to the TUI showing the pull requests linked to the open thread, with Summary, Timeline and Checks tabs.
ctrl+ytoggles the panel;[/]and1-9switch tabs,ncycles linked PRs,rreloads.prPanelTabsfield; the Code tab uses it withorder: 40.Written for commit 5a75a52. Summary will update on new commits.