feat(desktop): show workspace pages in the PR pane summary rail

Merged
AV
2mo ago
+647-17

Summary

  • The workspace PR pane's Summary tab gets a Pages section under the info rail: up to three page cards for the workspace, a count badge, and a "View all (+N more)" link to the pages route.
  • Page cards with no captured thumbnail show a placeholder surface that stands out from the card, and hovering a card shows a wash in both themes.

Why / Context

Agents publish pages (test results, screenshots, CDP captures) for the work behind a PR, but the PR pane had no way to reach them. Reviewers had to leave the pane and hunt through the pages list. Showing the workspace's pages beside the PR summary keeps the evidence next to the thing it supports.

How It Works

  • usePullRequestEvidence runs the cloud page.listPaginated (limit 3) and page.counts queries for the workspace, only while the pane shows a linked PR on the Summary tab. Both refetch every 30 s and on window focus.
  • PullRequestEvidence renders the section with loading skeletons, an empty state, an error state with retry, and the view-all link when a next cursor exists.
  • EvidencePageCard opens the page in a page pane through the existing openPagePaneInStore; view-all navigates to /pages scoped to the workspace.
  • PullRequestPageBody now measures its own width with a ResizeObserver and renders one info variant instead of both (it used to render rows and column and hide one in CSS, so the rail mounted twice). A new aside slot renders once: under the info column when wide, after the content when narrow. PullRequestSummaryContent passes the Pages section through it, and PullRequestDetailContent threads it in as summaryAside. The shared route view passes none, so the standalone PR page only gains the single-mount change.
  • PageThumbnail accepts a className. The card sits on bg-muted, and in the dark theme muted, accent, and border are the same hex, so the default bg-muted/40 placeholder and the hover:bg-accent state were both invisible there. The card passes bg-fill-hover for the placeholder and uses a fill-hover overlay for hover, which reads in both themes.

Manual QA Checklist

  • Open the PR pane for the workspace's linked PR: a Pages section with up to three cards in one row appears under the info rail
  • A page without a captured thumbnail shows a lighter placeholder tile, not a flat card
  • Hovering a card shows a visible wash in dark mode
  • Clicking a card opens that page in a page pane
  • With more than three pages, "View all (+N more)" opens the pages list for this workspace
  • Narrow the pane below 52rem: the info folds into rows under the header and the Pages section moves after the content, mounted once
  • A PR that is not the workspace's linked PR shows no Pages section
  • The standalone pull-requests route renders as before

Testing

  • bun test --isolate on the pull-requests folder (48) and the PullRequestPane folder (10) pass. The pane suite also passes in one shared process, which is what the fixture rewrite fixes. A new PullRequestPageBody test checks one info variant and one aside at 600px and 1000px.
  • bun run check:i18n: clean. The only new string reuses the existing "Pages" entry.
  • bun run typecheck in apps/desktop: 28 errors, all the pre-existing local Better Auth type split in packages/auth and packages/trpc, none in changed files.
  • biome check on every changed desktop file: clean.
  • Not yet verified visually in the running app. The dev stack is up with CDP enabled, so that is the next step before merge.

Design Decisions

  • Translucent hover wash instead of a replacement color: every muted-surface hover in the desktop swaps to another token, and in dark mode the candidate tokens equal the card's resting color. An overlay stacks on whatever the card is, so it works without caring about the parent surface.
  • aside slot on the summary component instead of rendering in the pane: keeps the pages section inside the info rail's layout at both rail variants rather than bolting a second column onto the pane.

Known Limitations

  • The view-all arrow in the section header was removed for now; the link under the grid is the only entry point.
  • The fixture in PullRequestPane/fixtures/checks.tsx still module-mocks @superset/workspace-client. That predates this branch and is left for a separate cleanup.

Summary by cubic

Shows a workspace's pages (test results, screenshots, CDP captures) as up to three cards in the PR pane Summary tab's info rail, with a count badge and a "View all" link to the pages route. The section renders only for the workspace's linked PR; the standalone pull-requests route is unchanged.

  • Cards open the page in a page pane; view-all navigates to the pages list scoped to the workspace.
  • The page list and count queries run only while the Summary tab shows a linked PR and refetch every 30 s and on window focus.
  • Page cards without a captured thumbnail show a placeholder that stands out from the card, and a hover wash that reads in dark mode.
  • The "View all (+N more)" string is translated count-neutrally in fr, it, and cs.
  • The summary rail now measures the body's width and renders a single info variant, so the aside mounts once and lands after the content in narrow panes instead of above it.

Summary by CodeRabbit

  • New Features
    • Pull request summaries can show related workspace pages with thumbnails, titles, and the number of additional pages available.
    • Select a page to open it in the workspace, or choose View all to browse the complete page list.
    • Evidence panels display loading, empty, and error states, with an option to retry after an error.
  • Localization
    • Added translations for the View all label in supported languages.