Skip to content

Refactor App composition helpers#82

Merged
Dimillian merged 1 commit intomainfrom
codex/refactor-app.tsx-to-reduce-complexity
Jan 18, 2026
Merged

Refactor App composition helpers#82
Dimillian merged 1 commit intomainfrom
codex/refactor-app.tsx-to-reduce-complexity

Conversation

@Dimillian
Copy link
Owner

Motivation

  • Reduce imperative logic in the composition root by extracting window-label detection and localStorage-backed transparency state into dedicated hooks to improve testability and separation of concerns.

Description

  • Add useWindowLabel in src/features/layout/hooks/useWindowLabel.ts to encapsulate getCurrentWindow() label lookup and return a stable window label via a hook.
  • Add useTransparencyPreference in src/features/layout/hooks/useTransparencyPreference.ts to encapsulate the reduceTransparency localStorage state and its persistence.
  • Update src/App.tsx to import and use useWindowLabel and useTransparencyPreference, removing the inline getCurrentWindow logic and the manual localStorage effect.

Testing

  • Ran npm run lint, which executed but reported a TypeScript compatibility warning from @typescript-eslint due to the local TypeScript version; no new lint errors introduced.
  • Ran npm run typecheck, which completed successfully with no type errors.

Codex Task

@Dimillian
Copy link
Owner Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit f90dbbb into main Jan 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant