add inbox view with notifications panel
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
Rust / build (macos-latest, stable) (pull_request) Canceled after 0s
Rust / build (ubuntu-latest, stable) (pull_request) Canceled after 0s
Rust / build (windows-latest, stable) (pull_request) Canceled after 0s
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
Rust / build (macos-latest, stable) (pull_request) Canceled after 0s
Rust / build (ubuntu-latest, stable) (pull_request) Canceled after 0s
Rust / build (windows-latest, stable) (pull_request) Canceled after 0s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use gpui::{App, AppContext as _, SharedString, WeakEntity, Window};
|
||||
use gpui_native_kit::layout::dock::DockState;
|
||||
use nostr::prelude::EventId;
|
||||
use signed_core::{Announcement, RepoAddr};
|
||||
use signed_state::RepoStore;
|
||||
|
||||
use crate::repo::RepoDetailView;
|
||||
use crate::shared::panels;
|
||||
@@ -30,3 +32,62 @@ pub fn open_repo_panel(
|
||||
cx,
|
||||
);
|
||||
}
|
||||
|
||||
/// An item of a repository to open from outside its detail panel.
|
||||
pub enum RepoItem {
|
||||
Issue(EventId),
|
||||
PullRequest(EventId),
|
||||
Patch,
|
||||
}
|
||||
|
||||
/// Opens an issue or pull request using a store built here.
|
||||
pub fn open_repo_item(
|
||||
dock: &WeakEntity<DockState>,
|
||||
addr: &RepoAddr,
|
||||
hint: Option<&Announcement>,
|
||||
item: RepoItem,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) {
|
||||
let store = cx.new(|cx| RepoStore::new(addr.clone(), hint.cloned(), cx));
|
||||
match item {
|
||||
RepoItem::Issue(issue_id) => {
|
||||
let id = SharedString::from(format!("issue:{issue_id}"));
|
||||
let store = store.clone();
|
||||
panels::open(
|
||||
dock,
|
||||
id,
|
||||
move |_, cx| {
|
||||
cx.new(|cx| {
|
||||
crate::issues::detail::IssueDetailView::new(store.clone(), issue_id, cx)
|
||||
})
|
||||
},
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
}
|
||||
RepoItem::PullRequest(pr_id) => {
|
||||
let id = SharedString::from(format!("pr:{pr_id}"));
|
||||
let dock_for_build = dock.clone();
|
||||
let store = store.clone();
|
||||
panels::open(
|
||||
dock,
|
||||
id,
|
||||
move |window, cx| {
|
||||
cx.new(|cx| {
|
||||
crate::pull_requests::PullRequestDetailView::new(
|
||||
dock_for_build.clone(),
|
||||
store.clone(),
|
||||
pr_id,
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
})
|
||||
},
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
}
|
||||
RepoItem::Patch => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,12 @@ impl CreateRepoDialog {
|
||||
let grasp_settings = settings.read(cx).settings().grasp_servers.clone();
|
||||
|
||||
let name_input = InputState::new(cx);
|
||||
let desc_input = InputState::new(cx);
|
||||
desc_input.update(cx, |state, cx| state.set_multiline(true, cx));
|
||||
let folder_input = InputState::new_with_text(default_folder.to_string_lossy(), cx);
|
||||
let desc_input = InputState::builder().multiline().build(cx);
|
||||
let folder_input = InputState::builder()
|
||||
.text(default_folder.to_string_lossy())
|
||||
.build(cx);
|
||||
folder_input.update(cx, |state, cx| state.set_read_only(true, cx));
|
||||
|
||||
let relay_input = InputState::new(cx);
|
||||
let state = cx.new(|_| DialogProgress::default());
|
||||
let grasp_state = cx.new(|_| GraspServersState::new_default(&grasp_settings));
|
||||
|
||||
@@ -54,10 +54,11 @@ impl InitRepoDialog {
|
||||
|
||||
let state = cx.new(|_| DialogProgress::default());
|
||||
let grasp_state = cx.new(|_| GraspServersState::new_default(&grasp_settings));
|
||||
let name_input = InputState::new_with_text(default_name, cx);
|
||||
|
||||
let name_input = InputState::builder().text(default_name).build(cx);
|
||||
name_input.update(cx, |state, cx| state.set_read_only(true, cx));
|
||||
let desc_input = InputState::new(cx);
|
||||
desc_input.update(cx, |state, cx| state.set_multiline(true, cx));
|
||||
|
||||
let desc_input = InputState::builder().multiline().build(cx);
|
||||
let relay_input = InputState::new(cx);
|
||||
|
||||
load_user_grasp_servers(grasp_state.clone(), window, cx);
|
||||
|
||||
Reference in New Issue
Block a user