Multi-step account forms + clearer balance editing #2427

Merged
zachgoll merged 13 commits from zachgoll/maybe-888-use-multi-step-add-account-forms-to-help-the-user-understand into main 2025-07-03 21:33:08 +08:00
zachgoll commented 2025-07-01 02:48:06 +08:00 (Migrated from github.com)

This PR is somewhat of an intermediate step to make Account value / details editing much clearer. To this point, we've had very little controls around how users create the starting balance graph of an account and how they edit various details about that account after creation. This has caused confusion for users and has been something we've planned to revisit for quite some time now.

The main goals of this PR are:

  • Initial migration towards multi-step account forms - This PR implements the Property account form as a multi-step wizard. In order to do this, we needed better state transitions on the Account model, inline form alert messages, and a proper "balance updater" that houses all the domain logic for updating an account balance.
  • Clearer form labels and help text - This PR adds native tooltip support for form fields, which will make it much easier for us to explain to the user what value they should be entering. Our existing UI has very generic terminology that has confused users.
  • Encapsulate balance updates - previously, we allowed users to edit Valuation records independently, regardless of domain invariants. This PR brings all balance updates (account creation, account editing, activity timeline edits) into a single class that enforces these domain invariants through the Account model

Change summary

  1. Account Status State Machine
  • Replaced boolean is_active flag with AASM state machine (draft, active, disabled, pending_deletion)
  • Renamed active scope to visible (includes both draft and active accounts)
  • Added graceful error recovery for failed deletions
  1. Multi-Step Property Forms
  • Split property creation into tabs: Overview, Value, Address
  • Added AlertComponent for inline form feedback
  • Enhanced form builder with tooltip support and improved field layouts
  • Improved money field component with better formatting and structure
  1. Balance Management
  • Extracted balance update logic to Account::BalanceUpdater service
  • Simplified account update flow by removing complex update_with_sync! method
  • Better separation of concerns for balance and valuation updates
  1. Controller Updates
  • Updated all controllers to use new visible scope instead of active
  • Enhanced property controller with multi-step form actions
  • Added proper turbo frame handling for modal workflows

Future work

Follow up PRs will include:

  • Refactor of the multi-step property form to be more generic and support other accountables
  • Extraction of the name field from Entry, and dynamically generate for Valuation and Trade
  • Overall thinning out of AccountableResource
This PR is somewhat of an _intermediate_ step to make Account value / details editing much clearer. To this point, we've had very little controls around how users create the starting balance graph of an account and how they edit various details about that account after creation. This has caused confusion for users and has been something we've planned to revisit for quite some time now. The main goals of this PR are: - **Initial migration towards multi-step account forms** - This PR implements the Property account form as a multi-step wizard. In order to do this, we needed better state transitions on the Account model, inline form alert messages, and a proper "balance updater" that houses all the domain logic for updating an account balance. - **Clearer form labels and help text** - This PR adds native tooltip support for form fields, which will make it much easier for us to explain to the user what value they should be entering. Our existing UI has very generic terminology that has confused users. - **Encapsulate balance updates** - previously, we allowed users to edit `Valuation` records independently, regardless of domain invariants. This PR brings all balance updates (account creation, account editing, activity timeline edits) into a single class that enforces these domain invariants through the `Account` model ## Change summary 1. **Account Status State Machine** - Replaced boolean is_active flag with AASM state machine (draft, active, disabled, pending_deletion) - Renamed active scope to visible (includes both draft and active accounts) - Added graceful error recovery for failed deletions 2. **Multi-Step Property Forms** - Split property creation into tabs: Overview, Value, Address - Added AlertComponent for inline form feedback - Enhanced form builder with tooltip support and improved field layouts - Improved money field component with better formatting and structure 3. **Balance Management** - Extracted balance update logic to Account::BalanceUpdater service - Simplified account update flow by removing complex update_with_sync! method - Better separation of concerns for balance and valuation updates 4. **Controller Updates** - Updated all controllers to use new visible scope instead of active - Enhanced property controller with multi-step form actions - Added proper turbo frame handling for modal workflows ## Future work Follow up PRs will include: - Refactor of the multi-step property form to be more generic and support other accountables - Extraction of the `name` field from `Entry`, and dynamically generate for `Valuation` and `Trade` - Overall thinning out of AccountableResource
Sign in to join this conversation.