update issue panel
This commit is contained in:
@@ -32,6 +32,7 @@ mod browser;
|
||||
mod commits;
|
||||
mod diff;
|
||||
mod helpers;
|
||||
mod issues;
|
||||
|
||||
use browser::{
|
||||
CodeView, FileContent, MAX_PREVIEW_BYTES, MAX_PREVIEW_CACHE_BYTES, MAX_PREVIEWED_FILES,
|
||||
@@ -40,6 +41,7 @@ use browser::{
|
||||
use commits::COMMIT_ROW_HEIGHT;
|
||||
use diff::CommitDiffView;
|
||||
use helpers::{TreeItemSeed, build_tree_items, is_markdown_path, track, tree_items};
|
||||
use issues::IssuesView;
|
||||
|
||||
/// What kind of ref the header selectors switch to.
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
@@ -217,9 +219,9 @@ impl RepoDetailView {
|
||||
tag_select,
|
||||
switching_ref: false,
|
||||
ref_generation: 0,
|
||||
_subscriptions: subscriptions,
|
||||
focus_handle: cx.focus_handle(),
|
||||
tasks: Vec::new(),
|
||||
_subscriptions: subscriptions,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,10 +649,17 @@ impl RepoDetailView {
|
||||
});
|
||||
}
|
||||
|
||||
/// Open the issue detail view (not implemented yet).
|
||||
fn open_issue_detail(&mut self, _window: &mut Window, _cx: &mut Context<Self>) {
|
||||
// TODO: open a per-issue detail view in the dock area, like
|
||||
// [`Self::open_commit_diff`].
|
||||
/// Open the issues panel at the bottom of the dock area.
|
||||
fn open_issue_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| IssuesView::new(self.store.clone(), self.display_name(cx), cx));
|
||||
|
||||
dock_area.update(cx, |dock_area, cx| {
|
||||
dock_area.add_panel(Arc::new(panel), DockPlacement::Bottom, None, window, cx);
|
||||
});
|
||||
}
|
||||
|
||||
/// Open the pull request detail view (not implemented yet).
|
||||
@@ -906,8 +915,8 @@ impl RepoDetailView {
|
||||
fn render_header(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
let store = self.store.read(cx);
|
||||
let announcement = store.announcement.as_ref().unwrap_or(&self.initial);
|
||||
let issue_count = store.issues.len();
|
||||
let pull_request_count = store.pull_requests.len();
|
||||
let issue_count = store.open_issue_count();
|
||||
let pull_request_count = store.open_pull_request_count();
|
||||
|
||||
let name = self.display_name(cx);
|
||||
let description = announcement.description();
|
||||
|
||||
Reference in New Issue
Block a user