Skip to content

refactor(site/src/pages/AgentsPage): carry diff status in git panel PR tab - #29904

Closed
DanielleMaywood wants to merge 1 commit into
mainfrom
nullability/git-pr-diff-status
Closed

DanielleMaywood wants to merge 1 commit into
mainfrom
nullability/git-pr-diff-status

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

RemoteDiffPanel only renders for a PR tab, and a PR tab only exists when a PR number can be derived from chat.diff_status (pr_number or parsed from url). AgentChatPageView now builds prTab with that diffStatus inside it, GitPanel's RemoteContent passes prTab.diffStatus down, and RemoteDiffPanel.diffStatus is required, removing its diffStatus?. guards.

Still nullable on purpose: GitPanel.remoteDiffStats (branch pushed without a PR) and diffStatus.url with the query enabled guard (a PR number can exist without a URL). The dead agentId && check was dropped because agentId is chat.id.

Stories: PR stories use a makePrArgs helper that builds prTab and remoteDiffStats from one object, as production does. EmptyState passed a prTab without any diff status, which production cannot produce; it now uses a diff status with pr_number and no URL, which renders the same.

AgentChatPageView.tsx is also edited by #29890, but in other regions (props types, ~131-180, 301, 1057-1075). This diff only touches the prTab region (~344-350, 691, 701), so the two should merge cleanly.

Verified: pnpm lint:types, check, lint:oxlint, lint:compiler, lint:knip, pnpm test src/pages/AgentsPage (1877 passed), and pnpm test:storybook for GitPanel and AgentChatPageView stories (81 passed).

Part of the AgentsPage nullability cleanup; see #29888 for the methodology.

Plan excerpt

8. Top-down pass proposals

Analysed on a local, unpushed merge of all cleanup branches; after the bottom-up PRs only 43 dead slots remain, so what's left is nullability that is real at its origin. Two read-only agents reviewed the top origins in code. Guard counts from the tool overstate the win: many "guards" are real branches (loading, no workspace, first/last row).

# Change Guards removed Size Risk
T5 Git panel: carry diff_status inside prTab, make RemoteDiffPanel.diffStatus required (it can only render when a PR exists) 6 4 files / ~35 lines Low; EmptyState story fixed

This PR was generated by Coder Agents on behalf of @DanielleMaywood.

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

CODAGT-1258

Base automatically changed from nullability/right-panel to main October 6, 2026 07:35
@DanielleMaywood
DanielleMaywood force-pushed the nullability/git-pr-diff-status branch from 034704d to 4543343 Compare October 6, 2026 08:07
@DanielleMaywood
DanielleMaywood force-pushed the nullability/git-pr-diff-status branch from 4543343 to 87f329f Compare October 6, 2026 11:13
@github-actions github-actions Bot added the stale This issue is like stale bread. label Nov 1, 2026
@github-actions github-actions Bot closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant