Skip to content

Refactor: extract SettingsTab metadata out of PreferencesView#14

Merged
GamalAnwar merged 1 commit into
masterfrom
claude/solid-refactor-settings-tab
Jun 18, 2026
Merged

Refactor: extract SettingsTab metadata out of PreferencesView#14
GamalAnwar merged 1 commit into
masterfrom
claude/solid-refactor-settings-tab

Conversation

@GamalAnwar

Copy link
Copy Markdown
Contributor

Summary

Target 3 (PreferencesWindow decomposition), first step. PreferencesView nested a private SettingsTab enum carrying each pane's presentation metadata — sidebar icon/tint/label and the page subtitle. This lifts it to a top-level value type (Views/SettingsTab.swift) so the mapping is plain, reusable, and testable instead of buried in view-private code.

Only one reference needed touching: SettingsPage's qualified PreferencesView.SettingsTabSettingsTab. All other uses (@State selectedTab, ForEach(SettingsTab.allCases), the detail switch) resolve to the top-level enum unchanged.

Scope / safety

  • Behavior-preserving — identical icons, labels, tints, subtitles.

Tests

SettingsTabTests (4 cases): all six tabs present in order, non-empty icon/label/subtitle for every case, unique labels & icons, and spot checks.

Note on the rest of target 3

The remaining part — splitting the six inline tab bodies (generalTabadvancedTab) into separate View structs — is pure mechanical churn with no test-coverage benefit (it's view code), and a bulk ~450-line move carries real compile risk without a local build. The tabs already compose the shared SettingsCard/SettingsRow/ToggleRow components, so they're not as monolithic as the line count suggests. I scoped this PR to the testable extraction; happy to do the body split as a focused follow-up (one tab per PR to keep each reviewable) if you want it — just say so.

🤖 Generated with Claude Code


Generated by Claude Code

PreferencesView nested a private SettingsTab enum carrying each pane's
presentation metadata (sidebar icon/tint/label + page subtitle). Lift it to a
top-level value type so the mapping is plain, reusable, and testable instead of
buried in view-private code. Only SettingsPage's qualified reference
(PreferencesView.SettingsTab) needed updating.

Behavior-preserving. Adds SettingsTabTests (4 cases): all six tabs in order,
non-empty metadata for each, unique labels/icons, and spot checks.
@GamalAnwar GamalAnwar merged commit ddc8ef3 into master Jun 18, 2026
1 check passed
@GamalAnwar GamalAnwar deleted the claude/solid-refactor-settings-tab branch June 18, 2026 07:36
GamalAnwar added a commit that referenced this pull request Jun 18, 2026
Lift PreferencesView's nested private SettingsTab enum (sidebar icon/tint/label
+ page subtitle for each pane) to a top-level testable value type. Only
SettingsPage's qualified reference needed updating. Behavior-preserving. Adds
SettingsTabTests (4 cases). CI green.
GamalAnwar added a commit that referenced this pull request Jun 18, 2026
Lift PreferencesView's nested private SettingsTab enum (sidebar icon/tint/label
+ page subtitle for each pane) to a top-level testable value type. Only
SettingsPage's qualified reference needed updating. Behavior-preserving. Adds
SettingsTabTests (4 cases). CI green.
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.

2 participants