diff --git a/apps/web/src/components/PullRequestThreadDialog.tsx b/apps/web/src/components/PullRequestThreadDialog.tsx
index a057ed204..ad843af85 100644
--- a/apps/web/src/components/PullRequestThreadDialog.tsx
+++ b/apps/web/src/components/PullRequestThreadDialog.tsx
@@ -191,7 +191,7 @@ export function PullRequestThreadDialog({
Pull request
{
setReferenceDirty(true);
diff --git a/apps/web/src/components/merge-conflicts/MergeConflictShell.logic.ts b/apps/web/src/components/merge-conflicts/MergeConflictShell.logic.ts
index d9c1ce1bf..23575dbd2 100644
--- a/apps/web/src/components/merge-conflicts/MergeConflictShell.logic.ts
+++ b/apps/web/src/components/merge-conflicts/MergeConflictShell.logic.ts
@@ -76,9 +76,9 @@ export function buildConflictRecommendation(input: {
candidateId: null,
recommendedAction: null,
tone: "neutral",
- title: "Resolve a pull request link to start.",
+ title: "Resolve a pull request to start.",
detail:
- "Paste a GitHub pull request URL to inspect mergeability, pull candidate resolutions, and stage a human-readable handoff note.",
+ "Paste a GitHub pull request URL or enter 123 / #123 to inspect mergeability, pull candidate resolutions, and stage a human-readable handoff note.",
};
}
diff --git a/apps/web/src/components/merge-conflicts/MergeConflictShell.tsx b/apps/web/src/components/merge-conflicts/MergeConflictShell.tsx
index f8bdd8e90..c0747c149 100644
--- a/apps/web/src/components/merge-conflicts/MergeConflictShell.tsx
+++ b/apps/web/src/components/merge-conflicts/MergeConflictShell.tsx
@@ -38,6 +38,7 @@ import {
import { cn } from "~/lib/utils";
import { ensureNativeApi } from "~/nativeApi";
import { parsePullRequestReference } from "~/pullRequestReference";
+import { findProjectMatchingPullRequestReference } from "~/pullRequestProjectMatch";
import type { Project } from "~/types";
import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert";
import { toastManager } from "~/components/ui/toast";
@@ -409,6 +410,11 @@ export function MergeConflictShell({
(debouncerState) => ({ isPending: debouncerState.isPending }),
);
+ const matchedProjectForReference = useMemo(
+ () => findProjectMatchingPullRequestReference(projects, reference),
+ [projects, reference],
+ );
+ const matchedProjectIdForReference = matchedProjectForReference?.id ?? null;
const parsedReference = parsePullRequestReference(reference);
const parsedDebouncedReference = parsePullRequestReference(debouncedReference);
const resolvedPullRequestQuery = useQuery(
@@ -493,8 +499,13 @@ export function MergeConflictShell({
});
useEffect(() => {
- setReference("");
- setReferenceDirty(false);
+ if (matchedProjectIdForReference && matchedProjectIdForReference !== project.id) {
+ onProjectChange(matchedProjectIdForReference);
+ return;
+ }
+ }, [matchedProjectIdForReference, onProjectChange, project.id]);
+
+ useEffect(() => {
setPreparedWorkspace(null);
setSelectedCandidateId(null);
setInspectorOpen(false);
@@ -547,9 +558,9 @@ export function MergeConflictShell({
const validationMessage = !referenceDirty
? null
: reference.trim().length === 0
- ? "Paste a GitHub pull request URL."
+ ? "Paste a GitHub pull request URL or enter 123 / #123."
: parsedReference === null
- ? "Use a GitHub pull request URL."
+ ? "Use a GitHub pull request URL, 123, or #123."
: null;
const resolveErrorMessage =
validationMessage ??
@@ -570,10 +581,10 @@ export function MergeConflictShell({
: null;
const steps = [
{
- title: "Resolve pull request link",
+ title: "Resolve pull request",
detail: resolvedPullRequest
? `PR #${resolvedPullRequest.number} is resolved against ${projectLabel(project)}.`
- : "Paste a GitHub pull request URL to fetch metadata and conflict status.",
+ : "Paste a GitHub pull request URL or enter 123 / #123 to fetch metadata and conflict status.",
status: resolvedPullRequest
? ("done" as const)
: isResolvingPullRequest
@@ -674,8 +685,8 @@ export function MergeConflictShell({
- Resolve conflicts from a GitHub PR link, then let OK Code guide the safest
- next action.
+ Resolve conflicts from a GitHub PR URL or PR number. A full URL auto-matches
+ the repository before OK Code prepares the workspace.
}
@@ -706,9 +717,9 @@ export function MergeConflictShell({
{isResolvingPullRequest ? (
@@ -877,11 +892,11 @@ export function MergeConflictShell({
-
Paste a pull request link
+
Enter a pull request
- This panel is intentionally narrow: it resolves one GitHub PR link, checks
- whether conflicts exist, and walks you through the safest conflict resolution
- path.
+ Paste a GitHub PR URL to auto-match the repository, or use `#42` / `42` against
+ the selected repo. This panel resolves one PR, checks whether conflicts exist,
+ and walks you through the safest conflict resolution path.