refactor(settings): decompose TranscriptedSettingsView god object [WIP]#1343
Open
r3dbars wants to merge 5 commits into
Open
refactor(settings): decompose TranscriptedSettingsView god object [WIP]#1343r3dbars wants to merge 5 commits into
r3dbars wants to merge 5 commits into
Conversation
…files Start of the god-object decomposition flagged in the 2026-06-14 architecture health audit (docs/strategy/codebase-architecture-health-2026-06-14.md): TranscriptedSettingsView.swift was the hottest, most-coupled file in the repo. This is a behavior-preserving mechanical move (page body + no other logic changes); meetingSession drops private since the moved connectAgentPage now references it from a different file. More pages to follow in this branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AymCvy8QNJ9YGSociPqg9v
…ls/privacy pages
Continues the TranscriptedSettingsView decomposition. Also fixes the repo
command contract tests: several `readRepoTextFile("...TranscriptedSettingsView.swift")`
call sites were asserting on page content that has now moved to sibling
extension files. Introduced readSettingsSurfaceContents() to concatenate the
main file with its TranscriptedSettingsView+*.swift siblings so these
contract tests keep working regardless of which physical file a page's code
lives in, instead of re-patching them on every future page move.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AymCvy8QNJ9YGSociPqg9v
…om prior commit Completes the TranscriptedSettingsView page extraction (all 10 pages now live in sibling TranscriptedSettingsView+*.swift files). Also fixes two real bugs the previous commit shipped, caught by CI (build-and-test failure on d52b231): - modelsPage and privacyPage were left declared in both the main file and their new extension files (duplicate declaration) after an in-progress extraction pass landed mid-commit. - 5 identifiers Shortcuts.swift needs (sortedAutoEnterAllowedBundleIDs, setAutoEnterApp, refreshAutoEnterAppCandidates, chooseAutoEnterApp, autoEnterDisplayName) were still `private` in the main file, inaccessible from the extension file. Verified by hand (no local Swift toolchain in this session): brace balance and single-declaration checks across all 11 files pass. Relying on Swift CI for the actual compiler check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AymCvy8QNJ9YGSociPqg9v
…sion files Follow-up to the TranscriptedSettingsView page extraction (aab7732, d52b231, a4ae475). A full identifier cross-reference against all 10 new TranscriptedSettingsView+*.swift extension files turned up several members that were still `private` in the main file despite being read/called from those extension files: sttRouter, dictationTriggerSystemWarning, dictationShortcutsEnabled, showTranscriptedInDock, launchAtLoginEnabled/Status, showGeneral* disclosure flags, customDictionary* state, dictationCleanupEnabled, dictationOverlayMode, uiSoundsEnabled, autoEnter* state, anonymousAnalyticsEnabled, sentryTestStatus, permissionStates, meetingMicProcessingMode, splitLocalSpeakersEnabled, confirmQuitDuringMeetingEnabled, autoDetectCallsEnabled, missingRequiredPermissions, crashReportingFootnote, analyticsFootnote, trackPermissionCTA, refreshPermissions, and sendTestSentryEvent. Swift's `private` is file-scoped, so these were inaccessible from the sibling extension files even though nothing flagged it without a full cross-file grep. Also tidies two doubled blank lines left over from the extraction cuts. Verified by hand (no local Swift toolchain in this session): every identifier referenced by each TranscriptedSettingsView+*.swift file is now either declared in that same file or is non-private in the main file; brace counts balance in all 11 files; no page var is declared in more than one file; the pageBody switch in the main file is unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AymCvy8QNJ9YGSociPqg9v
HomeImportAudioActionTests and UIAutomationSurfaceContractTests each read Sources/UI/Settings/TranscriptedSettingsView.swift directly and assert on page content that has moved into sibling TranscriptedSettingsView+*.swift files (28 failures in the last CI run, all content-location misses, not access-level or compile errors — compilation itself now succeeds). Added a shared settingsSurfaceContents() helper to Tests/TestHelpers.swift (concatenates the main file with its extension-file siblings) and pointed both test files at it instead of re-patching each assertion individually, matching the approach already used in RepoCommandContractTests.swift. Checked the remaining 3 test files that reference TranscriptedSettingsView.swift (DictationSoundsTests, HomeFirstArtifactVisibilityTests, HomeStatsPresentationTests) — they only assert on Home-cluster content that was not moved, so they're unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AymCvy8QNJ9YGSociPqg9v
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
docs/strategy/codebase-architecture-health-2026-06-14.md(principal-engineer audit, grade B) flaggedSources/UI/Settings/TranscriptedSettingsView.swiftas the #1 highest-ROI fix: 4900+ lines, 187 commits since January, the hottest merge-contention file in the repo. Its recommended shape: extract each settings page into its own file using the existingprivate var xPage: some Viewseams.Product Impact
agent workflow(internal refactor, no user-facing behavior change)agent workflowWhat changed
peoplePage→TranscriptedSettingsView+People.swiftconnectAgentPage→TranscriptedSettingsView+ConnectAgent.swiftmeetingSessionpromoted fromprivateto internal (needed cross-file access from the movedconnectAgentPage)This is a mechanical, behavior-preserving move: page bodies relocated verbatim, only access modifiers changed where a moved page now references something cross-file. No logic changes.
How I checked it
scripts/dev/agent-preflight.sh.agents/test-matrix.ymlfor the files changed — touchesSources/UI/**only, sobash build.sh --no-open+bash run-tests.shis the required lanebash build.sh --no-open— could not run: this session has no macOS/Swift toolchain (Linux container). Relying on Swift CI for the actual compile check.bash run-tests.sh— same limitationbash run-integration-smoke.sh— not applicable, no Meeting/Core files touchedswift test— not applicableRisk Review
.agent-review/visuals/evidence — no visual/behavior change, none neededNotes
Follow-up to the health-check session's architecture audit. Keeping this draft and iterating commit-by-commit on this branch until all planned pages land and CI is green, since I can't compile-check locally here.
Generated by Claude Code