This commit is contained in:
2026-09-04 08:16:05 +07:00
parent 212f35d6bb
commit 17de4f6376
43 changed files with 376 additions and 721 deletions
@@ -24,9 +24,6 @@ pub struct CreateRepoState {
}
/// Open the Create Repository dialog.
/// Loads the user's default grasp servers, a kind `10317` grasp list.
/// Falls back to the shared defaults when none are set.
/// On success the dialog closes and the new repository opens in the dock.
pub fn open(dock_area: WeakEntity<DockArea>, window: &mut Window, cx: &mut App) {
let settings = SettingsStore::global(cx);
let default_folder = settings
@@ -160,8 +157,6 @@ pub fn open(dock_area: WeakEntity<DockArea>, window: &mut Window, cx: &mut App)
}
/// Pick the repository's storage folder with the platform's native folder picker.
/// Show the result in the disabled folder input.
/// The settings remember the picked folder as the default next time.
fn choose_folder(folder_input: &Entity<InputState>, window: &mut Window, cx: &mut App) {
let handle = window.window_handle();
let folder_input = folder_input.clone();
@@ -197,6 +192,7 @@ fn choose_folder(folder_input: &Entity<InputState>, window: &mut Window, cx: &mu
}
/// Run the create-repository flow.
///
/// Opens the new working copy and the repository panel on success.
#[allow(clippy::too_many_arguments)]
fn create_repository(
@@ -23,6 +23,7 @@ pub struct GraspServersState {
impl GraspServersState {
/// Defaults used until the user's grasp list loads, which replaces them when non-empty.
///
/// Persisted settings supply the defaults, an empty list falls back to the built-ins.
pub fn new_default(settings: &GraspServersSettings) -> Self {
let urls: Vec<String> = if settings.default_servers.is_empty() {
@@ -46,8 +47,6 @@ impl GraspServersState {
}
/// The Grasp servers form field shared by the publish dialogs.
/// An expandable toggle, the configured servers each removable, and an add-relay input.
/// Shows a loading hint while the user's kind `10317` grasp list is fetched.
pub fn grasp_servers_field(
state: &Entity<GraspServersState>,
relay_input: &Entity<InputState>,
@@ -223,6 +222,7 @@ fn add_relay(
}
/// Load the user's grasp list of kind `10317` from the local database.
///
/// It replaces the defaults when it lists any servers.
pub fn load_user_grasp_servers(
state: Entity<GraspServersState>,
@@ -2,7 +2,6 @@ use gpui::{App, Window, px};
use gpui_component::WindowExt;
/// Open the Import Identity dialog.
/// Currently a placeholder, the dialog only shows a title.
pub fn open(window: &mut Window, cx: &mut App) {
window.open_dialog(cx, move |dialog, _window, _cx| {
dialog.title("Import identity").width(px(400.))
@@ -15,8 +15,6 @@ pub struct OnboardingState {
}
/// Open the Onboarding dialog for creating a new identity.
/// The caller creates the input and state entities and passes them in.
/// This function only builds the dialog UI and wires up the continue-button handler.
pub fn open(
name_input: Entity<InputState>,
pass_input: Entity<InputState>,
@@ -18,8 +18,6 @@ pub struct PassphraseState {
}
/// Open the dialog asking for the passphrase that protects the stored identity.
/// The identity is NIP-49 encrypted, for example `ncryptsec1...`.
/// Called when the backend emits [`signed_state::BackendEvent::PassphraseRequired`].
pub fn open(window: &mut Window, cx: &mut App) {
let pass_input = cx.new(|cx| {
InputState::new(window, cx)
@@ -98,8 +96,6 @@ pub fn open(window: &mut Window, cx: &mut App) {
}
/// Submit the passphrase to the backend.
/// On success the dialog closes.
/// On failure the error is rendered inline and the dialog stays open.
fn unlock(
pass_input: &Entity<InputState>,
state: &Entity<PassphraseState>,
@@ -49,7 +49,6 @@ fn theme_options(cx: &App) -> (Vec<SelectOption>, Vec<SelectOption>) {
}
/// Stateful controls of the settings dialog, created once when it opens.
/// Their values survive re-renders of the dialog content.
struct SettingsControls {
appearance: Entity<SelectState<Vec<SelectOption>>>,
light_theme: Entity<SelectState<Vec<SelectOption>>>,