Skip to content

refactor: extract Settings UI into src/settings - #691

Merged
enaboapps merged 1 commit into
mainfrom
refactor/settings-module-683
Sep 8, 2026
Merged

enaboapps merged 1 commit into
mainfrom
refactor/settings-module-683

Conversation

@enaboapps

Copy link
Copy Markdown
Contributor

Closes #683.

Moves the Settings UI out of App.tsx into src/settings/ as a pure mechanical refactor, so the tabbed-sections restructure in #685 lands with a readable diff.

Moved verbatim

From App.tsx To
SettingsView src/settings/SettingsView.tsx
SettingGroup, Toggle, option constants, movementValue src/settings/controls.tsx
UpdateControls, updateProgress, updateDescription, UpdateAction src/settings/UpdatesSection.tsx
changedSettingKeys, applyLocalSettings src/settings/diff.ts

UpdateBanner stays in App.tsx as shell-level UI and imports updateProgress back from the new module. The autosave state machine stays in App.tsx in full — only the two pure helpers moved.

App.tsx: 838 → 684 lines. No DOM changes. No AppSettings changes.

Tests

The 19 Settings tests move to src/settings/settings.test.tsx with no assertion changes. They still render <App />, so the full save pipeline stays under test.

The two banner-level updater it.each blocks stay in App.test.tsx — UpdateBanner did not move, and they assert banner behavior rather than Settings content.

Test titles were diffed against main as a set: identical, so nothing was dropped in the move.

Validation

Run from the repository root:

Check Result
npm run lint pass
npm test pass — 75 tests, 4 files (settings.test.tsx 19, App.test.tsx 45, plus api/overlay)
npm run build pass
cargo fmt --check pass
cargo clippy --all-targets -- -D warnings pass (exit 0)
cargo test pass (exit 0) — 263 + 7 tests

No Rust files are touched by this change; the Rust gates are run per AGENTS.md.

Notes for review

  • The plan estimated App.tsx would land near 600 lines; the actual is 684.
  • Per-section components (GeneralSection.tsx, PointerSection.tsx, …) are not created here. Those sections do not exist as separate components yet, so creating them would have meant editing behavior rather than moving it. They arrive with Restructure Settings into accessible tabbed sections #685.
  • Ref was dropped from the App.tsx React type import and AppSettings from App.test.tsx, both now unused there.

🤖 Generated with Claude Code

Move the Settings view and its supporting pieces out of App.tsx without
changing behavior, so the tabbed-sections restructure that follows has a
readable diff.

Moved verbatim:
- SettingsView -> src/settings/SettingsView.tsx
- SettingGroup, Toggle, option constants, movementValue -> controls.tsx
- UpdateControls, updateProgress, updateDescription, UpdateAction
  -> UpdatesSection.tsx
- changedSettingKeys, applyLocalSettings -> diff.ts

UpdateBanner stays in App.tsx as shell-level UI and imports updateProgress.
The autosave state machine stays in App.tsx; only the two pure helpers move.

The 19 Settings tests move to src/settings/settings.test.tsx with no
assertion changes. They still render <App /> so the full save pipeline
stays under test. The banner-level updater tests stay with the banner.

App.tsx: 838 -> 684 lines. No DOM changes, no AppSettings changes.

Refs #683

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review September 8, 2026 12:54
@enaboapps
enaboapps merged commit 288c282 into main Sep 8, 2026
6 checks passed
@enaboapps
enaboapps deleted the refactor/settings-module-683 branch September 8, 2026 13:28
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.

Extract Settings UI from App.tsx into src/settings/ (no behavior change)

2 participants