GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(web): navigate pull request dependencies by kalvenschraut · Pull Request #29 · RTVision/t3code

feat(web): navigate pull request dependencies #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
kalvenschraut merged 7 commits into stacks/navigation-model from stacks/dependency-navigator
Sep 8, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat(web): navigate pull request dependencies #29

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit Hold shift + click to select a range
b0043bd
feat(web): navigate pull request dependencies
kalvenschraut Sep 5, 2026
4c986ca
fix(web): navigate dependencies in the displayed repository
kalvenschraut Sep 8, 2026
5cda093
Merge branch 'repair/pr-28' into repair/pr-29
kalvenschraut Sep 8, 2026
e040f68
Merge branch 'repair/pr-28' into repair/pr-29
kalvenschraut Sep 8, 2026
c8d6b97
Merge branch 'repair/pr-28' into repair/pr-29
kalvenschraut Sep 8, 2026
2708d32
Merge branch 'repair/pr-28' into repair/pr-29
kalvenschraut Sep 8, 2026
6f6130a
Merge branch 'repair/pr-28' into repair/pr-29
kalvenschraut Sep 8, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(web): navigate dependencies in the displayed repository
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@kalvenschraut
kalvenschraut committed Sep 8, 2026
commit 4c986ca1f8cce4504b9ad772a349ae15f31eb124

There are no files selected for viewing

8 changes: 7 additions & 1 deletion 8 apps/web/src/components/ChatView.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ import {
} from "../previewMiniPlayerStore";
import { isThreadOwnPullRequest } from "./pullRequest/pullRequestDetail.logic";
import { PullRequestDetailPanel } from "./pullRequest/PullRequestDetailPanel";
import { usePanelPullRequestNavigation } from "./pullRequest/usePanelPullRequestNavigation";
import { PullRequestDetailGhost } from "./pullRequest/PullRequestGhosts";
import { PullRequestsUnavailableState } from "./pullRequest/PullRequestsUnavailableState";
import { RightPanelTabs, type PullRequestTabStatus } from "./RightPanelTabs";
Expand Down Expand Up @@ -3792,6 +3793,11 @@ export default function ChatView(props: ChatViewProps) {
])
: null;
const threadRepository = linkedThreadPullRequest?.repository ?? activeProjectRepository;
const openPanelPullRequest = usePanelPullRequestNavigation(
activeThreadRef,
renderedRightPanelSurface,
supportsPullRequests,
);
const openThreadPullRequest = useCallback(
(number: number) => {
if (!supportsPullRequests || !activeThreadRef) {
Expand Down Expand Up @@ -7624,7 +7630,7 @@ export default function ChatView(props: ChatViewProps) {
: "page"
}
composerDraftTarget={composerDraftTarget}
onOpenPullRequest={openThreadPullRequest}
onOpenPullRequest={openPanelPullRequest}
{...(linkedThreadPullRequest === null
? { onStateChange: handlePullRequestTabStatusChange }
: {})}
Expand Down
89 changes: 89 additions & 0 deletions 89 apps/web/src/components/pullRequest/usePanelPullRequestNavigation.test.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { scopeThreadRef } from "@t3tools/client-runtime/environment";
import { type EnvironmentId, ThreadId } from "@t3tools/contracts";
import { act } from "react";
import { create, type ReactTestRenderer } from "react-test-renderer";
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";

import {
pullRequestSurface,
selectActiveRightPanelSurface,
selectThreadRightPanelState,
type RightPanelSurface,
useRightPanelStore,
} from "../../rightPanelStore";
import { usePanelPullRequestNavigation } from "./usePanelPullRequestNavigation";

const threadRef = scopeThreadRef("remote-environment" as EnvironmentId, ThreadId.make("thread"));
const threadPullRequest = pullRequestSurface({
projectId: "thread-project",
repository: "acme/web",
number: 42,
});
const displayedPullRequest = pullRequestSurface({
projectId: "linked-project",
repository: "acme/api",
number: 12,
});
let renderer: ReactTestRenderer | null = null;

function NavigationProbe({ surface }: { surface: RightPanelSurface | null }) {
const openDependency = usePanelPullRequestNavigation(threadRef, surface, true);
return <button onClick={() => openDependency(42)}>Open dependency</button>;
}

function activeSurface() {
return selectActiveRightPanelSurface(useRightPanelStore.getState().byThreadKey, threadRef);
}

beforeEach(() => {
vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
useRightPanelStore.setState({ byThreadKey: {} });
});

afterEach(async () => {
await act(() => renderer?.unmount());
renderer = null;
vi.unstubAllGlobals();
});

describe("thread panel dependency navigation", () => {
it("opens the dependency in the displayed repository and retains the thread's same-number PR", async () => {
useRightPanelStore.getState().openPullRequest(threadRef, threadPullRequest);
useRightPanelStore.getState().openPullRequest(threadRef, displayedPullRequest);
await act(() => {
renderer = create(<NavigationProbe surface={displayedPullRequest} />);
});

await act(() => renderer!.root.findByType("button").props.onClick());

const dependency = pullRequestSurface({
projectId: "linked-project",
repository: "acme/api",
number: 42,
});
expect(activeSurface()).toEqual(dependency);
expect(
selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, threadRef).surfaces,
).toEqual([threadPullRequest, displayedPullRequest, dependency]);

// Switching back to the thread's PR must also switch the dependency destination.
useRightPanelStore.getState().activateSurface(threadRef, threadPullRequest.id);
await act(() => renderer!.update(<NavigationProbe surface={threadPullRequest} />));
await act(() => renderer!.root.findByType("button").props.onClick());
expect(activeSurface()).toEqual(threadPullRequest);
});

it("uses the rendered repository while panel transitions retain the previous surface", async () => {
useRightPanelStore.getState().openPullRequest(threadRef, displayedPullRequest);
await act(() => {
renderer = create(<NavigationProbe surface={displayedPullRequest} />);
});
useRightPanelStore.getState().openPullRequest(threadRef, threadPullRequest);

await act(() => renderer!.root.findByType("button").props.onClick());

expect(activeSurface()).toEqual(
pullRequestSurface({ projectId: "linked-project", repository: "acme/api", number: 42 }),
);
});
});
23 changes: 23 additions & 0 deletions 23 apps/web/src/components/pullRequest/usePanelPullRequestNavigation.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { ScopedThreadRef } from "@t3tools/contracts";
import { useCallback } from "react";

import { type RightPanelSurface, useRightPanelStore } from "../../rightPanelStore";

/** Dependency numbers belong to the displayed pull request's repository, even beside another project. */
export function usePanelPullRequestNavigation(
threadRef: ScopedThreadRef | null,
surface: RightPanelSurface | null,
supportsPullRequests: boolean,
) {
return useCallback(
(number: number) => {
if (!supportsPullRequests || threadRef === null || surface?.kind !== "pull-request") return;
useRightPanelStore.getState().openPullRequest(threadRef, {
projectId: surface.projectId,
repository: surface.repository,
number,
});
},
[threadRef, surface, supportsPullRequests],
);
}
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.
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.