Split notification-settings.tsx into a hook and section components#799
Merged
Merged
Conversation
notification-settings.tsx was 646 lines mixing all notification state and logic with the full render tree. Extracted: - use-notification-settings.ts — all state (15 useState), refs, effects, and handlers (save/test/toggle/permission) as a single logic hook - notification-settings-constants.ts — NotifyEventType, response type, EVENT_OPTIONS - notification-device-sections.tsx — SoundCuesSection + TipsSection (device-only local toggles) - browser-notifications-section.tsx — Browser Notifications region (owns its platform detection) - slack-notifications-section.tsx — Slack webhook + event toggles + save/test actions NotificationSettings is now a 75-line composition shell. Pure structural refactor — DOM, classes, testids, and behavior are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 20, 2026
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.
What
Refactors
apps/web/src/components/app/notification-settings.tsx(646 lines) into a logic hook plus focused presentational components. Pure structural refactor — no behavior, DOM, class, or testid changes.Why it was a candidate
The file mixed three unrelated concerns in one 646-line module:
useState, 5 refs, 3useEffect, 8 handlers)Flagged in the componentizer backlog as "settings form with multiple sections."
New file structure
notification-settings.tsxuse-notification-settings.tsbrowser-notifications-section.tsxslack-notifications-section.tsxnotification-device-sections.tsxSoundCuesSection+TipsSection(device-only toggles)notification-settings-constants.tsNotifyEventType, response type,EVENT_OPTIONSSections communicate only through the hook's return value and props — no cross-dependencies. Section wrappers (
border-t/gap-8layout) are preserved exactly; the Slack group renders as a fragment of its three sibling divs so spacing is unchanged.Validation
pnpm run finalize:web— type check + production build passpnpm run test:e2e— 168 passed, 13 skipped (pre-existing terminal-live/tmux skips);settings.spec.tssuite greenhasChangesflows through the extracted hook)Next up
Queued for the next run:
agent-card.tsx(825 lines) — extract distinct card sections (status, actions, metadata) into subcomponents.🤖 Generated with Claude Code