Carry host on smart-submit link intents

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinjing
2026-07-16 22:32:05 -07:00
co-authored by Orca
parent 75398ed56e
commit b5b5416364
14 changed files with 201 additions and 77 deletions
+6 -1
View File
@@ -55,6 +55,7 @@ import {
GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR,
isGitHubProjectRefInputTooLarge
} from '../../shared/github-project-ref-input'
import { githubProjectHost } from '../../shared/github-project-identity'
// Re-export the public API so existing call sites (`./project-view`) keep
// working unchanged. The split is internal-only.
@@ -1384,6 +1385,7 @@ export async function getProjectViewTable(
const table: GitHubProjectTable = {
project: {
id: project.id,
host: githubProjectHost(args.host),
owner: args.owner,
ownerType: args.ownerType,
number: args.projectNumber,
@@ -1429,7 +1431,7 @@ type RawViewerDiscovery = {
export async function listAccessibleProjects(
args?: ListAccessibleProjectsArgs
): Promise<ListAccessibleProjectsResult> {
const host = args?.host
const host = githubProjectHost(args?.host)
const viewerProjects: GitHubProjectSummary[] = []
const orgProjects: GitHubProjectSummary[] = []
// Why: per-org failures are collected so the picker can render a "some orgs
@@ -1488,6 +1490,7 @@ export async function listAccessibleProjects(
n.owner?.__typename === 'Organization' ? 'organization' : 'user'
viewerProjects.push({
id: n.id,
host,
owner: ownerLogin,
ownerType,
number: n.number,
@@ -1574,6 +1577,7 @@ export async function listAccessibleProjects(
}
orgProjects.push({
id: n.id,
host,
owner: login,
ownerType: 'organization',
number: n.number,
@@ -1794,6 +1798,7 @@ export async function resolveProjectRef(
ownerType,
number: parsed.number,
title: p.title ?? '',
host: githubProjectHost(args.host),
// Why: forward the parsed view number from /views/{n} URLs so the
// renderer can skip the view-pick step. parsed.kind === 'bare' has no
// viewNumber (owner/number shorthand carries no view).