diff --git a/ui/src/lib/inbox.test.ts b/ui/src/lib/inbox.test.ts index 90a4aaaa..27f84470 100644 --- a/ui/src/lib/inbox.test.ts +++ b/ui/src/lib/inbox.test.ts @@ -138,7 +138,6 @@ function makeRun(id: string, status: HeartbeatRun["status"], createdAt: string, logCompressed: false, errorCode: null, externalRunId: null, - processGroupId: null, processPid: null, processStartedAt: null, retryOfRunId: null, diff --git a/ui/src/lib/optimistic-issue-runs.test.ts b/ui/src/lib/optimistic-issue-runs.test.ts index f8614a64..bd7c4225 100644 --- a/ui/src/lib/optimistic-issue-runs.test.ts +++ b/ui/src/lib/optimistic-issue-runs.test.ts @@ -22,6 +22,7 @@ function createLiveRun(overrides: Partial = {}): LiveRunForIssu function createActiveRun(overrides: Partial = {}): ActiveRunForIssue { return { id: "run-1", + companyId: "company-1", agentId: "agent-1", agentName: "CodexCoder", adapterType: "codex_local", diff --git a/ui/src/lib/router.tsx b/ui/src/lib/router.tsx index 5cf81c8d..77fab046 100644 --- a/ui/src/lib/router.tsx +++ b/ui/src/lib/router.tsx @@ -2,12 +2,19 @@ import * as React from "react"; import * as RouterDom from "react-router-dom"; import type { NavigateOptions, To } from "react-router-dom"; import { useCompany } from "@/context/CompanyContext"; +import { IssueLinkQuicklook } from "@/components/IssueLinkQuicklook"; import { applyCompanyPrefix, extractCompanyPrefixFromPath, normalizeCompanyPrefix, } from "@/lib/company-routes"; +function parseIssuePathIdFromPath(pathname: string | null | undefined): string | null { + if (!pathname) return null; + const match = pathname.match(/(?:^|\/)issues\/([^/?#]+)/); + return match?.[1] ?? null; +} + function resolveTo(to: To, companyPrefix: string | null): To { if (typeof to === "string") { return applyCompanyPrefix(to, companyPrefix); @@ -40,10 +47,23 @@ function useActiveCompanyPrefix(): string | null { export * from "react-router-dom"; -export const Link = React.forwardRef>( - function CompanyLink({ to, ...props }, ref) { +type CompanyLinkProps = React.ComponentProps & { + disableIssueQuicklook?: boolean; +}; + +export const Link = React.forwardRef( + function CompanyLink({ to, disableIssueQuicklook = false, ...props }, ref) { const companyPrefix = useActiveCompanyPrefix(); - return ; + const resolvedTo = resolveTo(to, companyPrefix); + const issuePathId = disableIssueQuicklook + ? null + : parseIssuePathIdFromPath(typeof resolvedTo === "string" ? resolvedTo : resolvedTo.pathname); + + if (issuePathId) { + return ; + } + + return ; }, ); diff --git a/ui/src/pages/Inbox.test.tsx b/ui/src/pages/Inbox.test.tsx index 22932945..e5f7beef 100644 --- a/ui/src/pages/Inbox.test.tsx +++ b/ui/src/pages/Inbox.test.tsx @@ -98,7 +98,6 @@ describe("FailedRunInboxRow", () => { logCompressed: false, errorCode: null, externalRunId: null, - processGroupId: null, processPid: null, processStartedAt: null, retryOfRunId: null,