add pull request panel
This commit is contained in:
@@ -33,6 +33,7 @@ mod commits;
|
||||
mod diff;
|
||||
mod helpers;
|
||||
mod issues;
|
||||
mod pull_requests;
|
||||
|
||||
use browser::{
|
||||
CodeView, FileContent, MAX_PREVIEW_BYTES, MAX_PREVIEW_CACHE_BYTES, MAX_PREVIEWED_FILES,
|
||||
@@ -42,6 +43,7 @@ use commits::COMMIT_ROW_HEIGHT;
|
||||
use diff::CommitDiffView;
|
||||
use helpers::{TreeItemSeed, build_tree_items, is_markdown_path, track, tree_items};
|
||||
use issues::IssuesView;
|
||||
use pull_requests::PullRequestsView;
|
||||
|
||||
/// What kind of ref the header selectors switch to.
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
@@ -667,10 +669,18 @@ impl RepoDetailView {
|
||||
});
|
||||
}
|
||||
|
||||
/// Open the pull request detail view (not implemented yet).
|
||||
fn open_pull_request_detail(&mut self, _window: &mut Window, _cx: &mut Context<Self>) {
|
||||
// TODO: open a per-PR detail view in the dock area, like
|
||||
// [`Self::open_commit_diff`].
|
||||
/// Open the pull requests panel at the bottom of the dock area.
|
||||
fn open_pull_request_detail(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
let Some(dock_area) = self.dock_area.upgrade() else {
|
||||
return;
|
||||
};
|
||||
|
||||
let panel = cx
|
||||
.new(|cx| PullRequestsView::new(self.store.clone(), self.display_name(cx), window, cx));
|
||||
|
||||
dock_area.update(cx, |dock_area, cx| {
|
||||
dock_area.add_panel(Arc::new(panel), DockPlacement::Center, None, window, cx);
|
||||
});
|
||||
}
|
||||
|
||||
/// Check out `name` (a branch or tag picked in the header) and refresh
|
||||
|
||||
Reference in New Issue
Block a user