Skip to content

Commit 502d494

Browse files
Claudius-Maginificentlklimekclaude
authored
refactor(ui): merge identity screens into the identity module (#972)
* chore(ui): remove the superseded standalone identities screen The Identity Hub covers everything the standalone identities list did, and the nav has not offered a way to reach that list for some time. Four live controls still routed to it, though, and `set_main_screen` persists the choice — so finishing a wallet import and choosing "Create Identity" parked the user on a screen with nothing highlighted in the nav, there and on every later launch. Those controls now point at the hub, and the screen is gone. Rerouted to `RootScreenIdentityHub`: "Create Platform Identity" after wallet creation, "Create Identity" / "Load Existing Identity" on the import success screen, "Register DPNS Name" on the add-identity success screen, and the Register-DPNS breadcrumb. The seven `add_left_panel` arguments that named the retired route highlighted nothing; they now name the hub, matching what `keys_screen` already did. Encoding 0 is retired and decodes to `None`, so a returning user's persisted value falls through to the settings default. That default was DashPay, which is itself absent from the nav — it becomes the hub, matching `app::FALLBACK_ROOT_SCREEN`, under a regression test. `OnboardingAction::ImportIdentity` is dropped: it is absent from `ONBOARDING_CARDS` and constructed nowhere. The `nav_button_specs` doc claimed the retired routes stayed reachable via deep links and MCP tools. Neither exists: there is no URI handler anywhere, and `src/mcp/` and `src/bin/` reference no UI screen type. The deleted kittest file's three app-shell tests move to `startup.rs`; a fourth duplicated `startup::test_app_startup`. Its two Keys-popup regressions are already covered on the live path by `keys_screen.rs` and at model level in `encrypted_key_storage.rs`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * refactor(ui): merge identity screens into the identity module `src/ui/identities/` and `src/ui/identity/` differed by one letter and split one domain across two module trees. Everything from the plural tree now sits flat in `src/ui/identity/`, matching the one-directory-per-UI-domain layout used by `ui/tokens/` and `ui/wallets/`; each screen keeps its own internal multi-file grouping. The plural `mod.rs` contributed no names the singular one already had, so its constants, `removed_identities_banner`, `get_selected_wallet`, and test module merge in byte-identical — only module declarations and the header doc changed. Paths and imports only; no behavior change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 71096fd commit 502d494

57 files changed

Lines changed: 464 additions & 454 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/backend_task/identity/load_identity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::model::qualified_identity::{
1717
DPNSNameInfo, IdentityStatus, IdentityType, QualifiedIdentity,
1818
};
1919
use crate::model::wallet::{Wallet, WalletSeedHash};
20-
use crate::ui::identities::add_new_identity_screen::MAX_IDENTITY_INDEX;
20+
use crate::ui::identity::add_new_identity_screen::MAX_IDENTITY_INDEX;
2121
use dash_sdk::Sdk;
2222
use dash_sdk::dashcore_rpc::dashcore::PrivateKey;
2323
use dash_sdk::dashcore_rpc::dashcore::key::Secp256k1;

src/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ impl AppContext {
13301330
fn owning_wallet_hash(&self, id: Identifier) -> Option<WalletSeedHash> {
13311331
let identities = self.load_local_qualified_identities().ok()?;
13321332
let qi = identities.into_iter().find(|qi| qi.identity.id() == id)?;
1333-
let wallet = crate::ui::identities::get_selected_wallet(&qi, Some(self), None).ok()??;
1333+
let wallet = crate::ui::identity::get_selected_wallet(&qi, Some(self), None).ok()??;
13341334
let hash = wallet.read().ok()?.seed_hash();
13351335
Some(hash)
13361336
}

src/ui/contracts_documents/document_action_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::ui::helpers::{
2020
TransactionType, add_contract_doc_type_chooser_with_filtering, add_key_chooser_with_doc_type,
2121
show_success_screen_with_info,
2222
};
23-
use crate::ui::identities::get_selected_wallet;
23+
use crate::ui::identity::get_selected_wallet;
2424
use crate::ui::theme::{ComponentStyles, DashColors};
2525
use base64::Engine;
2626
use base64::engine::general_purpose::STANDARD;

src/ui/contracts_documents/register_contract_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::ui::components::wallet_unlock_popup::{
1515
};
1616
use crate::ui::components::{BannerHandle, MessageBanner, OptionBannerExt, ResultBannerExt};
1717
use crate::ui::helpers::{TransactionType, add_key_chooser};
18-
use crate::ui::identities::get_selected_wallet;
18+
use crate::ui::identity::get_selected_wallet;
1919
use crate::ui::theme::{ComponentStyles, DashColors};
2020
use crate::ui::{BackendTaskSuccessResult, MessageType, ScreenLike};
2121
use dash_sdk::dpp::data_contract::accessors::v0::DataContractV0Setters;

src/ui/contracts_documents/update_contract_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::ui::components::wallet_unlock_popup::{
1616
};
1717
use crate::ui::components::{BannerHandle, MessageBanner, OptionBannerExt, ResultBannerExt};
1818
use crate::ui::helpers::{TransactionType, add_key_chooser};
19-
use crate::ui::identities::get_selected_wallet;
19+
use crate::ui::identity::get_selected_wallet;
2020
use crate::ui::theme::{ComponentStyles, DashColors};
2121
use crate::ui::{BackendTaskSuccessResult, MessageType, ScreenLike};
2222
use dash_sdk::dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters};

src/ui/dashpay/add_contact_screen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::ui::components::wallet_unlock_popup::{
1919
};
2020
use crate::ui::dashpay::DashPaySubscreen;
2121
use crate::ui::helpers::{TransactionType, add_key_chooser};
22-
use crate::ui::identities::get_selected_wallet;
23-
use crate::ui::identities::keys::add_key_screen::AddKeyScreen;
22+
use crate::ui::identity::get_selected_wallet;
23+
use crate::ui::identity::keys::add_key_screen::AddKeyScreen;
2424
use crate::ui::theme::{DashColors, Typography};
2525
use crate::ui::{MessageType, RootScreenType, Screen, ScreenLike};
2626
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;

src/ui/dashpay/contact_requests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use crate::ui::components::wallet_unlock_popup::{
1414
WalletUnlockPopup, WalletUnlockResult, try_open_wallet_no_password, wallet_needs_unlock,
1515
};
1616
use crate::ui::components::{MessageBanner, ResultBannerExt};
17-
use crate::ui::identities::get_selected_wallet;
18-
use crate::ui::identities::keys::add_key_screen::AddKeyScreen;
17+
use crate::ui::identity::get_selected_wallet;
18+
use crate::ui::identity::keys::add_key_screen::AddKeyScreen;
1919
use crate::ui::theme::DashColors;
2020
use crate::ui::{MessageType, Screen, ScreenLike, ScreenType};
2121
use dash_sdk::dpp::document::DocumentV0Getters;

src/ui/dashpay/profile_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::ui::components::wallet_unlock_popup::{
1717
};
1818
use crate::ui::components::{MessageBanner, ResultBannerExt};
1919
use crate::ui::helpers::{ModalOpeningGuard, clicked_outside_window_after_open};
20-
use crate::ui::identities::get_selected_wallet;
20+
use crate::ui::identity::get_selected_wallet;
2121
use crate::ui::state::AvatarCache;
2222
use crate::ui::theme::{ComponentStyles, DashColors, ResponseExt};
2323
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;

src/ui/dashpay/qr_code_generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use crate::ui::components::wallet_unlock_popup::{
1515
};
1616
use crate::ui::components::{MessageBanner, ResultBannerExt};
1717
use crate::ui::dashpay::dashpay_screen::DashPaySubscreen;
18-
use crate::ui::identities::funding_common::generate_qr_code_image;
19-
use crate::ui::identities::get_selected_wallet;
18+
use crate::ui::identity::funding_common::generate_qr_code_image;
19+
use crate::ui::identity::get_selected_wallet;
2020
use crate::ui::theme::DashColors;
2121
use crate::ui::{MessageType, RootScreenType, ScreenLike};
2222
use eframe::epaint::TextureHandle;

src/ui/dashpay/qr_scanner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::ui::components::wallet_unlock_popup::{
1515
};
1616
use crate::ui::components::{MessageBanner, ResultBannerExt};
1717
use crate::ui::dashpay::dashpay_screen::DashPaySubscreen;
18-
use crate::ui::identities::get_selected_wallet;
18+
use crate::ui::identity::get_selected_wallet;
1919
use crate::ui::{MessageType, RootScreenType, ScreenLike};
2020
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;
2121
use dash_sdk::dpp::identity::{KeyType, Purpose, SecurityLevel};

0 commit comments

Comments
 (0)