Consolidate and simplify account pages #2462

Merged
zachgoll merged 6 commits from zachgoll/maybe-914-simplify-account-page-routes-and-template into main 2025-07-18 17:52:18 +08:00
zachgoll commented 2025-07-18 08:57:44 +08:00 (Migrated from github.com)

A quick refactor in preparation for updating the account activity views and other forms.

We previously had a "show" page per-accountable type, which led to a confusing view hierarchy of:

show.html.erb -> _template.html.erb -> _chart.html.erb -> chart.html.erb (turbo frame)

This is all now simplified into the shared accounts_controller as:

show.html.erb -> UI::AccountPage (VC)


Also adds a basic pattern for using ViewComponent for more complex views that either have a lot of view logic or need to be broadcast from background jobs. All "application components" live under the UI:: namespace, a useful pattern for avoiding the need to suffix every component with _component.rb

A quick refactor in preparation for updating the account activity views and other forms. We previously had a "show" page per-accountable type, which led to a confusing view hierarchy of: `show.html.erb` -> `_template.html.erb` -> `_chart.html.erb` -> `chart.html.erb` (turbo frame) This is all now simplified into the shared `accounts_controller` as: `show.html.erb` -> `UI::AccountPage` (VC) --- Also adds a basic pattern for using ViewComponent for more complex views that either have a lot of view logic or need to be broadcast from background jobs. All "application components" live under the `UI::` namespace, a useful pattern for avoiding the need to suffix every component with `_component.rb`
Sign in to join this conversation.