Skip to content

feat(#6315): combine History and Pull Requests in Repository (3/4) - #25

Open
Defmon3 wants to merge 1 commit into
stack/6315-series-historyfrom
stack/6315-series-repository
Open

Defmon3 wants to merge 1 commit into
stack/6315-series-historyfrom
stack/6315-series-repository

Conversation

@Defmon3

@Defmon3 Defmon3 commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Series and review order

Part Review Base
1 Server API Bilal's feat/issues-page
2 History client Part 1
3 Repository pane Part 2
4 Issues integration Part 3

These are open review units for one proposal, stacked on pingdotgg/t3code#6315. Part 1 targets Bilal's fork; parts 2–4 target the preceding branch in our fork. The complete series is available at the final branch. The series is open for review; feedback on product direction and implementation is welcome.

Short demo: History paging, Pull Requests, Issues, and retained History state.

Prior discussion: the original proposal and Bilal's invitation to stack it. This records the invitation, not upstream acceptance of the design.

What changed

Groups History and the existing linked Pull Requests view into one Repository surface. Switching tabs preserves the mounted History state.

Why

Repository navigation belongs together beside the coding thread. This reuses the existing Pull Requests implementation.

Dependency and review

Part 3 of 4, based on stack/6315-series-history. This PR's diff contains the Repository integration only. Issues integration belongs to part 4. This review PR lives in our fork because that is where the preceding branch exists.

Verification

This exact cumulative layer passed dev-server checks: History and Pull Requests were the only Repository tabs, an existing linked PR rendered, and switching away and back preserved 200 loaded commits. No page exceptions were captured. Earlier independent layer verification passed web typecheck and 106 focused pane/tab/store tests; the later server-only edit did not alter this patch.

UI

Before: History as a separate surface in part 2.
Separate History surface

After: History and Pull Requests share Repository.
Repository Pull Requests

The old combined proposal and original images remain available.

Developed with Astra 6 in Codex/T3 Code and reviewed with Fable 5.1.

Summary by Sourcery

Unify repository history and linked pull requests under a persistent Repository right-panel surface.

New Features:

  • Combine Git History and linked Pull Requests into a unified Repository panel with switchable views.
  • Preserve mounted History state while switching between Repository views.
  • Add keyboard navigation for Repository tabs and route existing pull-request entry points through the Repository surface.

Bug Fixes:

  • Migrate persisted right-panel state safely from separate History and linked Pull Requests surfaces to Repository, including validation and malformed-state handling.

Enhancements:

  • Replace separate History and linked pull-request right-panel entries with a single Repository entry available when either view is supported.
  • Update proactive panel opening, command palette actions, sidebar badges, and branch controls to target the selected Repository view.

Documentation:

  • Update source-control documentation to describe Repository as the entry point for history and linked pull requests.

Tests:

  • Add coverage for Repository tab keyboard navigation and persisted right-panel migration, validation, view preservation, and deduplication.

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR replaces separate History and linked Pull Requests right-panel surfaces with a singleton Repository surface containing accessible History and Pull Requests tabs, retaining mounted History state while switching views. It updates all navigation and proactive-opening paths, adds persisted-state migration and schema validation for legacy layouts, and expands focused tests and documentation.

Sequence diagram for switching Repository views while retaining History state

sequenceDiagram
    participant User
    participant RepositoryPanel
    participant rightPanelStore
    participant GitHistoryPanel
    participant ThreadPullRequestsPanel

    User->>RepositoryPanel: click Pull Requests tab
    RepositoryPanel->>rightPanelStore: selectRepositoryView(ref, pull-requests)
    rightPanelStore-->>RepositoryPanel: update view
    RepositoryPanel->>GitHistoryPanel: Activity mode hidden
    RepositoryPanel->>ThreadPullRequestsPanel: Activity mode visible
    User->>RepositoryPanel: click History tab
    RepositoryPanel->>rightPanelStore: selectRepositoryView(ref, history)
    rightPanelStore-->>RepositoryPanel: update view
    RepositoryPanel->>GitHistoryPanel: Activity mode visible
    Note over GitHistoryPanel: Mounted History state is retained
Loading

State diagram for migrating legacy Repository panels

stateDiagram-v2
    [*] --> LegacySurfaces
    LegacySurfaces --> RepositoryHistory: active legacy surface is git-history
    LegacySurfaces --> RepositoryPullRequests: active legacy surface is pull-requests
    LegacySurfaces --> RepositoryHistory: legacy surfaces exist without active pull-requests
    RepositoryHistory --> RepositorySurface
    RepositoryPullRequests --> RepositorySurface
    RepositorySurface: id = repository
    RepositorySurface: view = history or pull-requests
    RepositorySurface --> [*]
Loading

File-Level Changes

Change Details Files
Combines Git History and linked Pull Requests into a single Repository right-panel surface with tabbed navigation and preserved mounted state.
  • Adds a lazy-loaded Repository panel with History and Pull Requests tabs, keyboard navigation, and Activity-based visibility.
  • Routes toolbar, sidebar, command palette, proactive PR opening, and panel-menu actions through Repository views.
  • Updates panel rendering and availability labels so Repository replaces the separate History and linked Pull Requests entries.
apps/web/src/components/RepositoryPanel.tsx
apps/web/src/components/ChatView.tsx
apps/web/src/components/RightPanelTabs.tsx
apps/web/src/components/Sidebar.tsx
apps/web/src/components/BranchToolbarBranchSelector.tsx
apps/web/src/components/CommandPalette.tsx
apps/web/src/routes/_chat.issues.tsx
apps/web/src/routes/_chat.pull-requests.tsx
Extends right-panel state and persistence to represent, migrate, and validate the combined Repository surface.
  • Introduces repository surface/view types plus open and view-selection store actions.
  • Migrates legacy git-history and pull-requests surfaces into one Repository surface while preserving the active view and tab ordering.
  • Adds schema-based validation and normalization for persisted panel state and bumps the storage version.
apps/web/src/rightPanelStore.ts
apps/web/src/rightPanelStore.test.ts
Adds coverage for Repository tab behavior and History state retention across view switches.
  • Tests keyboard traversal across Repository tabs.
  • Verifies filtered commits and selected commit details survive returning to History.
  • Updates existing Right Panel test fixtures for the consolidated API.
apps/web/src/components/RepositoryPanel.test.tsx
apps/web/src/components/GitHistoryPanel.filters-details.test.tsx
apps/web/src/components/RightPanelTabs.test.tsx
Updates user-facing documentation to describe Repository as the entry point for history and linked pull requests.
  • Renames the panel-menu entry and explains the nested History view.
docs/user/source-control.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="apps/web/src/components/RightPanelTabs.tsx" line_range="405-406" />
<code_context>
       shortcut: "H",
-      available: props.gitHistoryAvailable ?? false,
+      available: props.repositoryAvailable ?? false,
       disabledReason: SURFACE_UNAVAILABLE_HINTS.gitHistory,
-      onClick: props.onAddGitHistory ?? (() => undefined),
+      onClick: props.onAddRepository ?? (() => undefined),
       badgeCount: 0,
     },
</code_context>
<issue_to_address>
**nitpick:** The new Repository action keeps the old `gitHistory` disabled reason and hint, so threads with only linked pull requests are told that the surface is available only for Git repositories on updated servers even though `repositoryAvailable` is true because Pull Requests are available.

**Triggers:** When a non-Git thread has linked pull requests and opens the right-panel surface picker.

**Suggested fix:** Add Repository-specific disabled text and use it for the combined surface.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread apps/web/src/components/RightPanelTabs.tsx
@Defmon3
Defmon3 force-pushed the stack/6315-series-history branch from cd3ad6e to c021011 Compare September 21, 2026 22:35
@Defmon3
Defmon3 force-pushed the stack/6315-series-repository branch from c4256db to 98c657c Compare September 21, 2026 22:35
@Defmon3
Defmon3 force-pushed the stack/6315-series-repository branch from 98c657c to 0de5387 Compare September 21, 2026 22:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL Estimated size XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant