Skip to content

Move subscription settings page content into a LiveView#6170

Merged
sanne-san merged 11 commits intomasterfrom
sanne-subscription-settings-liveview
Mar 19, 2026
Merged

Move subscription settings page content into a LiveView#6170
sanne-san merged 11 commits intomasterfrom
sanne-subscription-settings-liveview

Conversation

@sanne-san
Copy link
Contributor

Changes

Prepares the page to host the choose_plan modal as a LiveComponent in a follow-up PR. Pure refactor, no UX changes.

  • Extract subscription page content into a new SubscriptionSettings LiveView
  • Move data loading out of the controller and into the LiveView
  • Embed the LiveView in the existing settings layout via live_render

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

Prepares the page to host the choose_plan modal as a LiveComponent in a follow-up PR. Pure refactor, no UX changes.
- Extract subscription page content into a new SubscriptionSettings LiveView
- Move data loading out of the controller and into the LiveView
- Embed the LiveView in the existing settings layout via live_render
@sanne-san sanne-san requested a review from a team March 17, 2026 15:46
Copy link
Contributor

@ukutaht ukutaht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple comments

- Render SubscriptionSettings LiveView directly from the router instead of via a controller action and template
- Update the shared settings layout to work without a request object
- Move view helpers from SettingsView to the billing components module
@sanne-san sanne-san force-pushed the sanne-subscription-settings-liveview branch from eabfad4 to 11ad786 Compare March 18, 2026 11:24
@sanne-san sanne-san requested a review from ukutaht March 18, 2026 11:49
sanne-san and others added 4 commits March 18, 2026 15:14
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
@sanne-san sanne-san force-pushed the sanne-subscription-settings-liveview branch from 499427c to 73ab60f Compare March 18, 2026 15:13
- Move billing helpers to a dedicated Helpers module
- Add a CurrentPath plug to the settings pipeline so we can avoid all the branching in the layout template
- Remove conn dependency from the settings layout
@sanne-san sanne-san force-pushed the sanne-subscription-settings-liveview branch from 73ab60f to 2c9f483 Compare March 18, 2026 15:25
@sanne-san sanne-san requested a review from zoldar March 18, 2026 15:49
- Use `conn.request_path` instead of `Path.join` in CurrentPath plug
- Remove unused `%Plug.Conn{}` clause from `account_settings_sidebar`
- Use dot notation for always-present assigns in `account_settings_sidebar`
Comment on lines +99 to +100
current_team = assigns.current_team
current_team_role = assigns.current_team_role
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These assigns are indeed always set if AuthPlug is present in the pipeline - we just need to keep in mind that they both might be nil. But we should be good here 👍

Copy link
Contributor

@zoldar zoldar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🙌

@sanne-san
Copy link
Contributor Author

@zoldar thanks for all the improvements!

@sanne-san sanne-san added this pull request to the merge queue Mar 19, 2026
Merged via the queue into master with commit 592d2b2 Mar 19, 2026
41 of 43 checks passed
@sanne-san sanne-san deleted the sanne-subscription-settings-liveview branch March 19, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants