Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

Motivation

Overdue TODO, we decide to be type-safe in the custom events.

@AntonioVentilii AntonioVentilii marked this pull request as ready for review December 1, 2025 12:39
@AntonioVentilii AntonioVentilii requested review from a team as code owners December 1, 2025 12:39
Copilot AI review requested due to automatic review settings December 1, 2025 12:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request successfully addresses the overdue TODO by introducing type safety for custom events in the frontend. The changes replace generic any types with specific, well-defined types for custom event details, improving type safety across the application.

Key Changes:

  • Defined custom event types in a centralized location (custom-events.ts)
  • Updated event handler declarations to use specific types instead of any
  • Updated event handler implementations in Svelte components to use the new types

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/frontend/src/lib/types/custom-events.ts Added type definitions for custom events: NoParamEvent, OisySyncStatusEvent, OisyIndexCanisterBalanceOutOfSyncEvent
src/frontend/src/custom-events.d.ts Removed TODO comment and replaced all any types with specific custom event types from the new type definitions
src/frontend/src/icp/components/transactions/IcTransactionsEthereumStatus.svelte Updated event handlers to use OisySyncStatusEvent type instead of SyncState directly
src/frontend/src/icp/components/transactions/IcTransactionsBitcoinStatusBalance.svelte Updated event handler to use OisySyncStatusEvent type for consistency
src/frontend/src/icp/components/transactions/IcIndexCanisterStatus.svelte Updated event handler to use OisyIndexCanisterBalanceOutOfSyncEvent type instead of raw boolean

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AntonioVentilii AntonioVentilii added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit f840624 Dec 2, 2025
85 checks passed
@AntonioVentilii AntonioVentilii deleted the feat-frontend/Define-types-for-custom-events branch December 2, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants