refactor: consolidate settings lookups and secrets loading
- Extract fetch_setting/1 in Settings (4 callsites → 1 repo lookup) - Replace hardcoded load_stripe_config with registry-driven load_all - Adding new secrets is now a one-line @secret_registry entry - Mark DRY refactor plan as complete (all 8 items done) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -202,9 +202,9 @@ See: [ROADMAP.md](ROADMAP.md) for design notes
|
||||
See: [docs/plans/products-context.md](docs/plans/products-context.md) for schema design
|
||||
|
||||
### DRY Refactor
|
||||
**Status:** Planned
|
||||
**Status:** Complete
|
||||
|
||||
Codebase analysis identified ~380 lines of duplication across LiveViews, templates, and the theme editor. Top priorities: extract `ThemeHook` for shared mount logic, extract `<.shop_layout>` wrapper component, consolidate preview assigns. Also: split `shop_components.ex` (4,400 lines) into focused modules.
|
||||
All 8 items from the plan done. Key wins: ThemeHook eliminated mount duplication, shop_layout saved ~195 lines, shop_components split into 5 focused modules (largest file dropped from 4,487 to ~1,600 lines), Settings repo lookups consolidated via `fetch_setting/1`, secrets loading made scalable via registry pattern.
|
||||
|
||||
See: [docs/plans/dry-refactor.md](docs/plans/dry-refactor.md) for full analysis and plan
|
||||
|
||||
|
||||
Reference in New Issue
Block a user