Simplify settings option props - #1654
skyfallwastaken wants to merge 1 commit into
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a05ac8-0041-768e-bd0b-04ca32dcf22a Co-authored-by: Amp <amp@ampcode.com>
Greptile SummaryThis PR removes the shared settings-option registry and moves each option payload to its sole owning controller while retaining the cached timezone list and legacy timezone pinning.
Confidence Score: 5/5The PR appears safe to merge with no actionable regressions identified. The inline builders preserve the removed registry’s option shapes and ordering, no callers remain for the removed API, and legacy timezone pinning continues without mutating the shared cached options. Important Files Changed
Reviews (1): Last reviewed commit: "Simplify settings option props" | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR removes the generic settings option registry and moves responsibility for building settings “options” props into each owning settings controller (Profile, Appearance, Editors). It keeps the shared cached timezone options in Settings::BaseController and preserves legacy timezone pinning in the Profile settings page, with added controller tests to lock down the new payload contracts.
Changes:
- Removed the shared options registry (
BASE_OPTION_BUILDERS/base_options) and made each settings controller build its own explicitoptionspayload. - Kept cached timezone option generation in
Settings::BaseControllerand preserved legacy timezone pinning viaProfileController#pin_current_timezone. - Added focused integration tests asserting Inertia component selection and
optionspayload structure for Profile, Appearance and Editors pages.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
app/controllers/settings/base_controller.rb |
Removes the generic options registry while keeping the shared cached timezone options method. |
app/controllers/settings/profile_controller.rb |
Builds explicit countries/timezones props and continues pinning legacy timezones. |
app/controllers/settings/appearance_controller.rb |
Builds explicit themes options instead of using the removed registry. |
app/controllers/settings/editors_controller.rb |
Builds explicit extension_text_types options instead of using the removed registry. |
test/controllers/settings_profile_controller_test.rb |
Adds coverage for the Profile “options” payload and legacy timezone pinning behaviour. |
test/controllers/settings_appearance_controller_test.rb |
Adds coverage asserting the Appearance “themes” options payload. |
test/controllers/settings_editors_controller_test.rb |
Adds coverage asserting the Editors “extension_text_types” options payload. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
f1786c8 to
6101271
Compare
Summary of the problem
Settings option props are assembled through a generic registry even though each option set has one page owner. This obscures ownership and leaves an unused default-all path.
Describe your changes
Remove the option registry and have Profile, Appearance and Editors build their own explicit option props. Keep the cached timezone calculation in the shared settings base and preserve legacy timezone pinning. Add focused controller coverage for the payload contracts.
Screenshots / Media
Not applicable. There are no visual changes.