feat: fork-aware issue/PR listing & OpenCode startup loading indicator (#1061)
* Add design spec: OpenCode readiness loading indicator * Add implementation plan: OpenCode readiness loading indicator * feat: add useOpenCodeReadiness hook * feat: add i18n keys for common.loading * feat: add loading state to ModelSelector * feat: add loading state to AgentSelector * feat: add loading state to ModelControls chat selectors * update package-lock * feat(github): add shared fork detection utility * feat(github): make issue listing fork-aware * feat(github): make PR listing fork-aware * feat(types): add sourceRepo to issue/PR summary types * feat(ui): add source badges to GitHub integration dialog * feat(ui): add source badges to issue/PR picker dialogs * feat(github): pass headRemote in PR creation for fork support * feat(ui): add source→target label in PR tab for fork workflows * fix(github): allow PR section on base branch when upstream remote exists * fix(github): show PR section on any branch including main for fork→upstream PRs * fix(github): allow PullRequestSection to render on base branch when upstream remote exists * feat(github): auto-detect upstream repo for fork→upstream PR creation - Add GET /api/github/repo/upstream endpoint to discover fork's upstream - Fix PullRequestSection canShow to allow PR creation on base branch when repo is a fork - Add virtual upstream target in remote dropdown (no explicit upstream remote needed) - Add targetRepo parameter to /api/github/pr/create for direct upstream targeting - Add repoUpstream() API client method and GitHubRepoUpstreamResult type * feat(github): auto-detect upstream repo for fork→upstream PR creation - Add GET /api/github/repo/upstream endpoint to discover fork's upstream - Fix PullRequestSection canShow to allow PR creation on base branch when repo is a fork - Add virtual upstream target in remote dropdown (no explicit upstream remote needed) - Add targetRepo parameter to /api/github/pr/create for direct upstream targeting - Add repoUpstream() API client method and GitHubRepoUpstreamResult type * fix: complete fork→upstream PR workflow - Server: return defaultBranch from /api/github/repo/upstream endpoint - Server: fix cross-repo head ref construction (compare repos, not remote names) - Server: filterActiveRemoteBranches checks all remotes, not just origin - UI: set targetBaseBranch to upstream's default branch when using detected upstream - UI: include all remote branches in base branch dropdown when using detected upstream - UI: skip base===head check for cross-repo PRs (same branch name on different repos is valid) - Types: add defaultBranch to GitHubRepoUpstreamResult * chore: delete superpowers folder * feat: add (local)/(remote) labels to PR branch display and adapt Repository button to selected remote * feat: Repository button adapts to selected remote (upstream vs origin) * fix: complete fork→upstream PR feature gaps Server: - Extend /api/github/repo/upstream to return defaultBranchSha and remoteName - Reuse headRepo result instead of redundant resolveGitHubRepoFromDirectory call - Return clear error when headRepo is null (invalid GitHub URL) UI: - Add upstream's default branch to availableBaseBranches when using detected upstream - Use upstream's default branch SHA in git log for generate description (fixes 'No commits found in range main...main') - Show qualified names (owner/repo · branch) in base branch dropdown when using detected upstream Types: - Add defaultBranchSha and remoteName to GitHubRepoUpstreamResult * fix: move detectedUpstream state before availableBaseBranches to fix temporal dead zone * fix: fetch upstream branches from GitHub API for base branch dropdown - Add GET /api/github/repo/branches endpoint to fetch branches via Octokit - Add repoBranches() to GitHub API client and interface - Fetch upstream branches on detection and store in upstreamBranches state - Include upstreamBranches in availableBaseBranches when using detected upstream - Re-add availableBaseBranches memo and auto-correction effect that were lost - Remove unnecessary qualified names from dropdown (upstream is already selected) * fix: restore prStatusKey and statusEntry declarations lost during refactor * fix: cleanly re-apply all fork→upstream PR UI changes Restored PullRequestSection.tsx from clean base and re-applied: - Expand detectedUpstream type with defaultBranch, defaultBranchSha, remoteName - Add upstreamBranches state and fetch on upstream detection - Include upstream branches in availableBaseBranches when using detected upstream - Use upstream default branch SHA in generate description (fixes 'No commits found') - Adapt Repository button URL to selected remote - Add (local)/(remote)/(upstream) labels to branch display * fix: move detectedUpstream/upstreamBranches before availableBaseBranches to fix TDZ * style: add pill badge styling to upstream repo source labels * fix: don't cache error PR status responses, allow force-bypass of server cache * fix: resolve PR status cache bugs, stale directory fallback, and upstream re-detection * fix: keep collapse button visible when scrolling long user messages - Collapse button now sticks to top of scrollable user message content instead of scrolling away * fix: checkbox focus ring blends into sidebar background * fix: polish fork PR follow-ups * fix: remove user message collapse artifact * fix: tighten fork PR internals * fix: check all remotes for fork PR status * fix: recover sidebar PR status misses --------- Signed-off-by: Islam Nofl <islamnofl.official@gmail.com> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
17650becc0
commit
21253d7fc2
@@ -779,6 +779,7 @@ export type GitHubPullRequestSummary = GitHubPullRequest & {
|
||||
updatedAt?: string;
|
||||
headLabel?: string;
|
||||
headRepo?: GitHubPullRequestHeadRepo | null;
|
||||
sourceRepo?: (GitHubRepoSelector & { source: string }) | null;
|
||||
};
|
||||
|
||||
export type GitHubPullRequestFile = {
|
||||
@@ -844,6 +845,8 @@ export type GitHubPullRequestCreateInput = {
|
||||
remote?: string;
|
||||
/** Remote where the head branch lives (source repo, e.g., 'origin' for forks) */
|
||||
headRemote?: string;
|
||||
/** Explicit target repo (alternative to remote, for auto-detected upstream) */
|
||||
targetRepo?: { owner: string; repo: string };
|
||||
};
|
||||
|
||||
export type GitHubPullRequestUpdateInput = {
|
||||
@@ -878,6 +881,11 @@ export type GitHubIssueLabel = {
|
||||
color?: string;
|
||||
};
|
||||
|
||||
export type GitHubRepoSelector = {
|
||||
owner: string;
|
||||
repo: string;
|
||||
};
|
||||
|
||||
export type GitHubIssueSummary = {
|
||||
number: number;
|
||||
title: string;
|
||||
@@ -885,6 +893,7 @@ export type GitHubIssueSummary = {
|
||||
state: 'open' | 'closed';
|
||||
author?: GitHubUserSummary | null;
|
||||
labels?: GitHubIssueLabel[];
|
||||
sourceRepo?: (GitHubRepoSelector & { source: string }) | null;
|
||||
};
|
||||
|
||||
export type GitHubIssue = GitHubIssueSummary & {
|
||||
@@ -911,6 +920,12 @@ export type GitHubIssuesListResult = {
|
||||
hasMore?: boolean;
|
||||
};
|
||||
|
||||
export type GitHubRepoUpstreamResult = {
|
||||
connected: boolean;
|
||||
isFork: boolean;
|
||||
upstream: { owner: string; repo: string; url: string; defaultBranch: string; defaultBranchSha: string | null; remoteName: string | null } | null;
|
||||
};
|
||||
|
||||
export type GitHubIssueGetResult = {
|
||||
connected: boolean;
|
||||
repo?: GitHubRepoRef | null;
|
||||
@@ -959,7 +974,7 @@ export interface GitHubAPI {
|
||||
authActivate(accountId: string): Promise<GitHubAuthStatus>;
|
||||
me?(): Promise<GitHubUserSummary>;
|
||||
|
||||
prStatus(directory: string, branch: string, remote?: string): Promise<GitHubPullRequestStatus>;
|
||||
prStatus(directory: string, branch: string, remote?: string, options?: { force?: boolean }): Promise<GitHubPullRequestStatus>;
|
||||
prCreate(payload: GitHubPullRequestCreateInput): Promise<GitHubPullRequest>;
|
||||
prUpdate(payload: GitHubPullRequestUpdateInput): Promise<GitHubPullRequest>;
|
||||
prMerge(payload: GitHubPullRequestMergeInput): Promise<GitHubPullRequestMergeResult>;
|
||||
@@ -969,12 +984,14 @@ export interface GitHubAPI {
|
||||
prContext(
|
||||
directory: string,
|
||||
number: number,
|
||||
options?: { includeDiff?: boolean; includeCheckDetails?: boolean }
|
||||
options?: { includeDiff?: boolean; includeCheckDetails?: boolean; sourceRepo?: GitHubRepoSelector | null }
|
||||
): Promise<GitHubPullRequestContextResult>;
|
||||
|
||||
issuesList(directory: string, options?: { page?: number }): Promise<GitHubIssuesListResult>;
|
||||
issueGet(directory: string, number: number): Promise<GitHubIssueGetResult>;
|
||||
issueComments(directory: string, number: number): Promise<GitHubIssueCommentsResult>;
|
||||
issueGet(directory: string, number: number, options?: { sourceRepo?: GitHubRepoSelector | null }): Promise<GitHubIssueGetResult>;
|
||||
issueComments(directory: string, number: number, options?: { sourceRepo?: GitHubRepoSelector | null }): Promise<GitHubIssueCommentsResult>;
|
||||
repoUpstream(directory: string): Promise<GitHubRepoUpstreamResult>;
|
||||
repoBranches(owner: string, repo: string): Promise<string[]>;
|
||||
}
|
||||
|
||||
export interface RuntimeAPIs {
|
||||
|
||||
@@ -2,6 +2,8 @@ import { settingsDict } from './en.settings';
|
||||
|
||||
export const dict = {
|
||||
...settingsDict,
|
||||
'common.loading': 'Loading...',
|
||||
'common.unavailable': 'Unavailable',
|
||||
'common.language.english': 'English',
|
||||
'common.language.simplifiedChinese': 'Chinese (Simplified)',
|
||||
'common.language.ukrainian': 'Ukrainian',
|
||||
@@ -566,6 +568,8 @@ export const dict = {
|
||||
'gitView.pr.actions.shareComments': 'Share comments',
|
||||
'gitView.pr.actions.shareCommentsAria': 'Send pull request comments to agent',
|
||||
'gitView.pr.actions.toggleDraftAria': 'Toggle draft state',
|
||||
'gitView.pr.actions.refresh': 'Refresh PR status',
|
||||
'gitView.pr.actions.refreshAria': 'Refresh pull request status',
|
||||
'gitView.pr.additionalContext.added': 'Added',
|
||||
'gitView.pr.additionalContext.hint': 'Add extra context for better review quality.',
|
||||
'gitView.pr.additionalContext.optional': 'Optional',
|
||||
|
||||
@@ -3,6 +3,8 @@ import { settingsDict } from './es.settings';
|
||||
|
||||
export const dict: Record<I18nKey, string> = {
|
||||
...settingsDict,
|
||||
"common.loading": "Cargando...",
|
||||
"common.unavailable": "No disponible",
|
||||
"common.language.english": "Inglés",
|
||||
"common.language.simplifiedChinese": "Chino (simplificado)",
|
||||
"common.language.ukrainian": "Ucraniano",
|
||||
@@ -567,6 +569,8 @@ export const dict: Record<I18nKey, string> = {
|
||||
"gitView.pr.actions.shareComments": "Compartir comentarios",
|
||||
"gitView.pr.actions.shareCommentsAria": "Enviar comentarios de la PR al agente",
|
||||
"gitView.pr.actions.toggleDraftAria": "Alternar estado de borrador",
|
||||
"gitView.pr.actions.refresh": "Actualizar estado de la PR",
|
||||
"gitView.pr.actions.refreshAria": "Actualizar estado del pull request",
|
||||
"gitView.pr.additionalContext.added": "Añadido",
|
||||
"gitView.pr.additionalContext.hint": "Añade contexto adicional para una revisión más efectiva.",
|
||||
"gitView.pr.additionalContext.optional": "Opcional",
|
||||
|
||||
@@ -3,6 +3,8 @@ import { settingsDict } from './ko.settings';
|
||||
|
||||
export const dict: Record<I18nKey, string> = {
|
||||
...settingsDict,
|
||||
'common.loading': '로딩 중...',
|
||||
'common.unavailable': '사용할 수 없음',
|
||||
'common.language.english': '영어',
|
||||
'common.language.simplifiedChinese': '중국어(간체)',
|
||||
'common.language.ukrainian': '우크라이나어',
|
||||
@@ -567,6 +569,8 @@ export const dict: Record<I18nKey, string> = {
|
||||
'gitView.pr.actions.shareComments': 'Share 댓글',
|
||||
'gitView.pr.actions.shareCommentsAria': '보내기 PR 댓글로 에이전트',
|
||||
'gitView.pr.actions.toggleDraftAria': '토글 draft state',
|
||||
'gitView.pr.actions.refresh': 'PR 상태 새로고침',
|
||||
'gitView.pr.actions.refreshAria': '풀 리퀘스트 상태 새로고침',
|
||||
'gitView.pr.additionalContext.added': '추가됨',
|
||||
'gitView.pr.additionalContext.hint': '더 나은 리뷰를 위해 추가 컨텍스트를 넣으세요.',
|
||||
'gitView.pr.additionalContext.optional': '선택 사항',
|
||||
|
||||
@@ -3,6 +3,8 @@ import { settingsDict } from './pt-BR.settings';
|
||||
|
||||
export const dict: Record<I18nKey, string> = {
|
||||
...settingsDict,
|
||||
"common.loading": "Carregando...",
|
||||
"common.unavailable": "Indisponível",
|
||||
"common.language.english": "Inglês",
|
||||
"common.language.simplifiedChinese": "Chinês (simplificado)",
|
||||
"common.language.ukrainian": "Ucraniano",
|
||||
@@ -567,6 +569,8 @@ export const dict: Record<I18nKey, string> = {
|
||||
"gitView.pr.actions.shareComments": "Compartilhar comentários",
|
||||
"gitView.pr.actions.shareCommentsAria": "Enviar comentários da PR ao agente",
|
||||
"gitView.pr.actions.toggleDraftAria": "Alternar status de rascunho",
|
||||
"gitView.pr.actions.refresh": "Atualizar status da PR",
|
||||
"gitView.pr.actions.refreshAria": "Atualizar status do pull request",
|
||||
"gitView.pr.additionalContext.added": "Adicionado",
|
||||
"gitView.pr.additionalContext.hint": "Adicione contexto adicional para melhorar a qualidade da revisão.",
|
||||
"gitView.pr.additionalContext.optional": "Opcional",
|
||||
|
||||
@@ -3,6 +3,8 @@ import { settingsDict } from './uk.settings';
|
||||
|
||||
export const dict: Record<I18nKey, string> = {
|
||||
...settingsDict,
|
||||
"common.loading": "Завантаження...",
|
||||
"common.unavailable": "Недоступно",
|
||||
"common.language.english": "англійська",
|
||||
"common.language.simplifiedChinese": "Китайська (спрощена)",
|
||||
"common.language.ukrainian": "Українська",
|
||||
@@ -567,6 +569,8 @@ export const dict: Record<I18nKey, string> = {
|
||||
"gitView.pr.actions.shareComments": "Поділитися коментарями",
|
||||
"gitView.pr.actions.shareCommentsAria": "Надсилати агенту коментарі PR",
|
||||
"gitView.pr.actions.toggleDraftAria": "Перемкнути стан чернетки",
|
||||
"gitView.pr.actions.refresh": "Оновити статус PR",
|
||||
"gitView.pr.actions.refreshAria": "Оновити статус pull request",
|
||||
"gitView.pr.additionalContext.added": "Додано",
|
||||
"gitView.pr.additionalContext.hint": "Додати додатковий контекст для кращої якості огляду.",
|
||||
"gitView.pr.additionalContext.optional": "Додатково",
|
||||
|
||||
@@ -3,6 +3,8 @@ import { settingsDict } from './zh-CN.settings';
|
||||
|
||||
export const dict: Record<I18nKey, string> = {
|
||||
...settingsDict,
|
||||
'common.loading': '加载中...',
|
||||
'common.unavailable': '不可用',
|
||||
'common.language.english': 'English',
|
||||
'common.language.simplifiedChinese': '简体中文',
|
||||
'common.language.ukrainian': '乌克兰语',
|
||||
@@ -567,6 +569,8 @@ export const dict: Record<I18nKey, string> = {
|
||||
'gitView.pr.actions.shareComments': '分享评论',
|
||||
'gitView.pr.actions.shareCommentsAria': '将拉取请求评论发送给智能体',
|
||||
'gitView.pr.actions.toggleDraftAria': '切换草稿状态',
|
||||
'gitView.pr.actions.refresh': '刷新 PR 状态',
|
||||
'gitView.pr.actions.refreshAria': '刷新拉取请求状态',
|
||||
'gitView.pr.additionalContext.added': '已添加',
|
||||
'gitView.pr.additionalContext.hint': '添加额外上下文可提升审查质量。',
|
||||
'gitView.pr.additionalContext.optional': '可选',
|
||||
|
||||
Reference in New Issue
Block a user