Update the `MigrateToMyItemsViewModel` to replace placeholder data with actual repository logic, state persistence, and dialog management.
The view model now initializes by fetching the active organization details related to the personal ownership policy. It handles the "Continue" action by displaying a loading state (simulated for now) and processing the result to either navigate to the vault or show an error. Additionally, the help link now points to the correct documentation URL.
- Inject `AuthRepository`, `PolicyManager`, and `SavedStateHandle` into `MigrateToMyItemsViewModel`.
- Initialize `MigrateToMyItemsState` by resolving the `organizationId` via `PolicyManager` and retrieving the corresponding organization name from `AuthRepository` user state.
- Implement state persistence using `SavedStateHandle`.
- Refactor `MigrateToMyItemsState` to include a nested `ViewState` and a `DialogState` sealed class (supporting `Loading` and `Error` states).
- Update `handleContinueClicked` to set the dialog state to `Loading` and initiate a coroutine that currently simulates migration delay.
- Add `Internal` action handling to process migration results:
- On success: Clears the dialog and triggers navigation to the vault.
- On failure: Updates the dialog state to show an error message.
- Update `handleHelpLinkClicked` to launch the specific "transfer-ownership" help URI.
- Add new string resources `migrating_items_to_x` and `failed_to_migrate_items_to_x` for the new dialog states.
Renames the VaultTakeover screen, ViewModel, and related classes to MigrateToMyItems to better reflect the feature's purpose. This includes:
- Renamed package from vaulttakeover to migratetomyitems
- Updated all class names: VaultTakeoverScreen -> MigrateToMyItemsScreen, VaultTakeoverViewModel -> MigrateToMyItemsViewModel, etc.
- Renamed sealed classes for State, Event, and Action
- Updated all navigation functions and routes
- Renamed drawable resource from ill_organization_takeover to ill_migrate_to_my_items
- Updated all test files to match new naming
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add placeholder TODO comments to the `VaultTakeoverViewModel` for future implementation work.
This commit clarifies upcoming tasks by:
- Adding a reference to a ticket (PM-28468) for fetching the organization name.
- Noting that the help link URL needs to be updated once it becomes available.
- Performing minor code formatting for better readability.
Replace the generic passkey icon with a specific organization takeover illustration in the Vault Takeover screen.
- Add `ill_organization_takeover.xml` vector drawable.
- Update `VaultTakeoverHeader` in `VaultTakeoverScreen.kt` to use the new illustration.
- Adjust layout modifiers by moving horizontal alignment to the parent Column, adding standard horizontal margins, and setting the content scale.
Use existing continue_text resource instead of duplicate continue_label.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Create comprehensive unit tests for VaultTakeover feature:
VaultTakeoverViewModelTest:
- Test ContinueClicked sends NavigateToVault event
- Test DeclineAndLeaveClicked sends NavigateToLeaveOrganization event
- Test HelpLinkClicked sends LaunchUri event with help URL
VaultTakeoverScreenTest:
- Test title displays with organization name
- Test description text is displayed correctly
- Test Continue button sends ContinueClicked action
- Test Decline and leave button sends DeclineAndLeaveClicked action
- Test Help link sends HelpLinkClicked action
- Test navigation events trigger callbacks
Tests follow established patterns using BitwardenComposeTest and BaseViewModelTest.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Create VaultTakeoverNavigation with type-safe routing:
- VaultTakeoverRoute: Serializable data object for type-safe navigation
- navigateToVaultTakeover(): NavController extension for navigation
- vaultTakeoverDestination(): NavGraphBuilder extension to register screen
Uses composableWithSlideTransitions for consistent navigation animations.
Follows established navigation patterns in the codebase.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Create the VaultTakeoverScreen composable and ViewModel following MVVM + UDF architecture:
- VaultTakeoverViewModel: Handles user actions (Continue, Decline, Help) and emits navigation events
- VaultTakeoverScreen: Full-screen informational UI with organization transfer messaging
- VaultTakeoverState: Holds organization name (stubbed with TODO)
- VaultTakeoverEvent: Navigation events for vault, leave org, and help URI
- VaultTakeoverAction: User action types
Screen UI includes:
- Placeholder illustration (using ic_bw_passkey temporarily)
- Title and description text with org name placeholders
- Continue button (primary action)
- Decline and leave button (secondary action)
- Help link ("Why am I seeing this?")
- Proper spacing and scrollable layout
- Extracted text and action components for code length compliance
Also fixed: Renamed 'continue' string resource to 'continue_label' to avoid Java keyword conflict.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add five new string resources required for the vault takeover screen:
- transfer_items_to_org: Title with organization name placeholder
- transfer_items_description: Body text explaining the takeover
- continue: Primary action button label
- decline_and_leave: Secondary action button label
- why_am_i_seeing_this: Help link text
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>