feat(github): pull request tool window, timeline and review flow (#477)

Replaces the Pull Requests tool window with a full review workflow on top of gh's authentication.

- List with search, quick filters and paging; a tab per pull request and a New Pull Request tab.
- Details: commit picker, changes tree with viewed state, CI and reviewer status, merge, close and reopen.
- Timeline editor: comments, review threads, reactions and suggested changes.
- Review in the diff viewer and, for the checked-out branch, in the editor (review mode).
- New generic vcs extension points: registerDiffViewerProvider, lineInlays, reviewGutter, branch widget extensions; new vcs_merge_base and gh_api commands.
- CSP: img-src allows https://avatars.githubusercontent.com for avatars.

Fixed while testing against a real repository: remotes behind an SSH host alias, mergeability stuck on UNKNOWN, Apply Locally staying disabled after a checkout, relative links navigating the app's page, and review inlays wider than the pane.

Co-authored-by: imacross <[email protected]>
Цей коміт міститься в:
imacross authored and GitHub committed 2026-10-31 07:50:43 +08:00
1 джерело 696377acc2
коміт 059fd8a69b
192 files changed
+23668 -2076

No files matched your search

+9 -1
Переглянути файл
@@ -3,7 +3,7 @@
use crate::state::AppState;
use ide_core::{IdeError, IdeResult, RequestId};
use ide_github::{
CreatePullRequest, GhAvailability, PrDiffRevisions, PrListQuery, PrReviewComment, PullRequestDetails,
CreatePullRequest, GhApiRequest, GhAvailability, PrDiffRevisions, PrListQuery, PrReviewComment, PullRequestDetails,
PullRequestSummary, ReviewEvent,
};
use std::path::PathBuf;
@@ -128,6 +128,14 @@ pub async fn gh_pr_comment(window: Window, state: State<'_, AppState>, number: u
blocking(move || ide_github::add_comment(&root, number, &body)).await
}
/// A GitHub GraphQL / REST call through `gh api`; returns the response body.
#[tauri::command]
#[specta::specta]
pub async fn gh_api(window: Window, state: State<'_, AppState>, request: GhApiRequest) -> IdeResult<String> {
let root = root(&window, &state)?;
blocking(move || ide_github::api(&root, &request)).await
}
/// Fetches what is missing to diff a pull request locally; returns the revisions to compare.
#[tauri::command]
#[specta::specta]
+2
Переглянути файл
@@ -265,6 +265,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
vcs::vcs_remove_worktree,
vcs::vcs_diff_with_worktree,
vcs::vcs_diff_revisions,
vcs::vcs_merge_base,
vcs::vcs_create_patch,
vcs::vcs_patch_preview,
vcs::vcs_apply_patch,
@@ -415,6 +416,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
docker::docker_registry_login,
docker::docker_run_env,
github::gh_availability,
github::gh_api,
github::gh_pr_list,
github::gh_pr_view,
github::gh_pr_review_comments,
+13
Переглянути файл
@@ -535,6 +535,19 @@ pub async fn vcs_diff_revisions(
ide_host::ops::vcs::vcs_diff_revisions(&state.host, window.label(), repo, from, to).await
}
/// The best common ancestor of `a` and `b` (`git merge-base`), if any.
#[tauri::command]
#[specta::specta]
pub async fn vcs_merge_base(
window: Window,
state: State<'_, AppState>,
repo: Option<PathBuf>,
a: String,
b: String,
) -> IdeResult<Option<String>> {
ide_host::ops::vcs::vcs_merge_base(&state.host, window.label(), repo, a, b).await
}
#[tauri::command]
#[specta::specta]
pub async fn vcs_create_patch(