Skip to content

refactor: migrate TypedSign component from JS to TypeScript#596

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1777406604-migrate-typedsign-to-ts
Open

refactor: migrate TypedSign component from JS to TypeScript#596
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1777406604-migrate-typedsign-to-ts

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 28, 2026

Summary

Migrates app/components/Views/confirmations/legacy/components/TypedSign/index.js from JavaScript to TypeScript (index.tsx).

Changes

  • Renamed index.jsindex.tsx
  • Removed PropTypes in favor of TypeScript interfaces (TypedSignProps, TypedSignState)
  • Imported and used existing repo types: MessageParams, PageMeta, SecurityAlertResponse, IUseMetricsHook, RootState
  • Added proper typing for:
    • Event handlers (LayoutChangeEvent)
    • Style arrays (ViewStyle[])
    • Signature error callback ({ error?: Error })
    • Version-based indexing (keyof typeof typedSign)
    • mapStateToProps function signature
  • Added eslint-disable comments for necessary any usages (theme colors, navigation, V1 data, signatureRequest state) following existing repo conventions (e.g. PersonalSign.tsx)
  • Changed onLayout={truncateMessage ? null : ...} to onLayout={truncateMessage ? undefined : ...} for TS compatibility

Notes

  • No behavioral changes — this is a pure type migration
  • Existing test file (index.test.tsx) and snapshots are unchanged

Review & Testing Checklist for Human

  • Verify the TypeScript interfaces match the actual runtime prop shapes (especially MessageParams.data which is string for V3/V4 but an array for V1)
  • Confirm existing snapshot tests still pass in CI

Link to Devin session: https://app.devin.ai/sessions/68aec0ea9fbe49758a5f1655a53e3bd8
Requested by: @shayanshafii


Open in Devin Review

- Rename index.js to index.tsx
- Replace PropTypes with TypeScript interfaces (TypedSignProps, TypedSignState)
- Import and use existing types: MessageParams, PageMeta, SecurityAlertResponse, IUseMetricsHook, RootState
- Add proper typing for event handlers (LayoutChangeEvent), style arrays (ViewStyle[]), and callback signatures
- Use 'keyof typeof typedSign' for version-based indexing
- Add eslint-disable comments for necessary 'any' usages (colors theme, navigation, V1 data, signatureRequest state) following existing repo conventions

Co-Authored-By: shayan <shayan@cognition.ai>
@staging-devin-ai-integration
Copy link
Copy Markdown

Devin Review

Status Commit
⚪ Not started

Open in Devin Review (Staging)

💡 Connect your GitHub account to enable automatic code reviews.

@devin-ai-integration
Copy link
Copy Markdown
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

devin-ai-integration[bot]

This comment was marked as resolved.

The children (typed message View and onLayout handler) were
accidentally dropped during the JS-to-TS migration, which would
have caused users to see an empty message area. Also changed
onLayout null to undefined for TS compatibility.

Co-Authored-By: shayan <shayan@cognition.ai>
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.

1 participant