Skip to content

[Frontend] Remove unsafe casts and type the theme union #14

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

src/app/[locale]/settings/page.tsx calls setTheme(opt as any) and src/instrumentation.ts uses any for log args. These casts defeat the type checker on a settings control that changes global state. Typing them properly prevents invalid theme values.

Acceptance criteria

  • Define a Theme union type (for example light, dark, system) and use it in the store and setter
  • Remove the as any in settings so invalid options fail type checking
  • Replace any[] in src/instrumentation.ts with a precise type
  • Grep for other as any in src and fix or justify each with a comment

Files to touch

  • src/app/[locale]/settings/page.tsx
  • src/app/stores/useThemeStore.ts
  • src/instrumentation.ts

Out of scope

  • Adding new themes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions