feat: align index route with hosted prologue/chapters + PR description#65
Draft
dastratakos wants to merge 6 commits into
Draft
feat: align index route with hosted prologue/chapters + PR description#65dastratakos wants to merge 6 commits into
dastratakos wants to merge 6 commits into
Conversation
Match the hosted Stage index layout: a tabbed Prologue/Description overview sidebar and a card-style chapters list, and surface the detected PR's description as markdown. - Add `body` to the PR wire type and source it from `gh pr view` - New PullRequestBodyCard renders the PR description as a comment-style card - New OverviewSidebar exposes Prologue/Description tabs (each shown only when its content exists); extract shared OverviewColumnHeader - Rewrite the chapters list to hosted's bordered card rows with per-row viewed toggle, line/file counts, and a "Start/Continue reviewing" CTA
|
Ready to review this PR? Stage has broken it down into 9 individual chapters for you: Chapters generated by Stage for commit 9578a7d on Jun 3, 2026 12:35am UTC. |
Cursor Bugbot: when the PR description loaded before the prologue, the sidebar showed Description, then silently switched to Prologue once it arrived. Default the active tab from whatever content exists at mount (via a lazy useState initializer) instead of hardcoding Prologue, so a later-arriving tab can't steal focus.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a965a81. Configure here.
Cursor Bugbot: `gh pr view --json body` emits null (not "") when a PR has no description, like mergedAt. The schema required a plain string, so Zod rejected the whole payload and getPullRequest returned null — dropping all PR context. Accept null at the gh boundary and coerce to "" so the wire type stays a non-null string. Adds a regression test.
Add "Copy" buttons to the Prologue and Chapters headers (markdown to clipboard) — the one generation-independent feature from hosted's header menu. New formatPrologueAsMarkdown / formatAllChaptersAsMarkdown reuse the existing single-chapter formatter. Render the PR description's embedded HTML (the "Open in Stage" / cubic badges bots append) via rehype-raw + rehype-sanitize behind an opt-in allowHtml prop on Markdown, so it shows like hosted instead of dumping raw markup as text. Schema extended for <picture>/<source>; scripts/handlers stripped. Adds unit coverage for the formatters and sanitization.
Mirror hosted Stage: the chapters index uses contained scroll — the page is height-locked, the PR header and tab nav are fixed, and a flex content area fills the rest so the prologue/description and chapters panels scroll independently. Files and chapter detail keep page scroll for their long diff lists. The layout measures the content area to size the panels via --main-height and the index grid fills its height.
…focus Hosted's prologue renders each review-focus location as a plain muted filename, not a link into the files tab. Replace the scrollTo <Link> (and its arrow) with a span and drop the now-unused runId prop down the chain (PrologueSection → OverviewSidebar).
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
Brings the stage-cli index route in line with the hosted Stage app: a tabbed Prologue/Description overview sidebar alongside a card-style chapters list. When a PR is detected for the branch, its description is now surfaced as markdown in the same comment-style card the hosted app uses.
Changes
bodyto the PR wire type and source it fromgh pr viewPullRequestBodyCardrenders the PR description as a GitHub-style comment cardOverviewSidebarwith Prologue/Description tabs (each shown only when its content exists); extract a sharedOverviewColumnHeaderTesting
pnpm typecheck,pnpm lint,pnpm test(299 passing), andpnpm buildall pass.Summary by cubic
Aligns the Stage CLI index with the hosted app: adds a tabbed Prologue/Description sidebar, a card-style chapters list, and shows the branch’s PR description in a GitHub-style comment card. The index is now locked to the viewport so the PR header and tabs stay fixed while the overview and chapters columns scroll independently.
New Features
bodyto the PR API/type fromgh pr view;PullRequestBodyCardrenders it.OverviewSidebarwith Prologue/Description tabs and a shared stickyOverviewColumnHeader.formatPrologueAsMarkdownandformatAllChaptersAsMarkdown.<picture>badges) viarehype-raw+rehype-sanitize.Bug Fixes
Written for commit 9578a7d. Summary will update on new commits.