Skip to content

Comments

chore(js-ts): Convert app/reducers/alert to TypeScript#314

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770924277-convert-alert-reducer-to-typescript
Open

chore(js-ts): Convert app/reducers/alert to TypeScript#314
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1770924277-convert-alert-reducer-to-typescript

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 12, 2026

chore(js-ts): Convert app/reducers/alert to TypeScript

Summary

Converts the alert Redux reducer from JavaScript to TypeScript as part of the incremental TS migration. Replaces the any type for alert in the RootState interface with a proper AlertState type.

Changes:

  • app/reducers/alert/index.jsindex.ts: Adds typed state, action enum (AlertActionType), and action types (ShowAlertAction, HideAlertAction). Exports initialAlertState.
  • app/reducers/alert/types.ts (new): Defines the AlertState interface.
  • app/reducers/index.ts: Imports AlertState and replaces the any type + TODO comment for the alert field in RootState.
  • app/util/test/initial-root-state.ts: Uses initialAlertState instead of undefined to satisfy the new type.

Review & Testing Checklist for Human

  • Verify data type is not too narrow: data is typed as { msg: string } | null. Confirm all existing callers of showAlert() across the codebase always pass data with only a msg: string field (grep for showAlert( to spot-check). If any caller passes additional or different properties, this type will silently discard them at the type level.
  • Action creators file left as JS: app/actions/alert/index.js was not converted in this PR — it still uses raw 'SHOW_ALERT'/'HIDE_ALERT' string literals. Verify this is acceptable for an incremental migration, or if it should be included.
  • Test plan: Run yarn lint:tsc (passes locally). Run yarn test:unit on any alert-related tests if they exist. Verify the app still shows/hides alert banners (e.g., "address copied to clipboard" toast) after the change.

Notes


Open with Devin

Co-Authored-By: Shannon Hittson <shannon.hittson@cognition.ai>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants