Skip to content

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

@grantfox-oss

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

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions