Skip to content

Conversation

@afonsojramos
Copy link
Member

@afonsojramos afonsojramos commented Dec 29, 2025

Summary

Refactors the notification type system to use a unified GitifyNotification type throughout the application, introducing a transformation layer at the API boundary to convert raw GitHub responses to the internal type format.

Closes #828

Changes

  • Created transformation layer (transform.ts) to convert raw GitHub API responses to GitifyNotification format
  • Renamed properties from snake_case to camelCase for consistency
  • Updated all components, utilities, and tests to use the new type
  • Fixed test mocks and snapshots to reflect type changes

Testing

  • All 692 tests passing
  • Build completes successfully
  • No TypeScript errors

Introduce a clean separation between raw GitHub API types and internal
Gitify notification types:

- Add transform.ts at API boundary to convert raw GitHub responses
- Define GitifyNotification, GitifySubject, GitifyRepository, GitifyOwner
  types with camelCase properties
- Update all components, handlers, filters, and utilities to use new types
- Update GraphQL schema aliases for consistent property naming
- Remove Notification type alias from typesGitHub.ts

Closes #828
@github-actions github-actions bot added the refactor Refactoring of existing feature label Dec 29, 2025
@setchy
Copy link
Member

setchy commented Dec 29, 2025

Close #828

@setchy
Copy link
Member

setchy commented Dec 29, 2025

After we land this PR, I'd love to start pulling out some of the formatting / logic within the UI components and pushing them into this api/transformation layer. eg: things like formatting notification titles, and so forth...

Signed-off-by: Adam Setch <adam.setch@outlook.com>
Signed-off-by: Adam Setch <adam.setch@outlook.com>
Signed-off-by: Adam Setch <adam.setch@outlook.com>
Signed-off-by: Adam Setch <adam.setch@outlook.com>
@sonarqubecloud
Copy link

Copy link
Member

@setchy setchy left a comment

Choose a reason for hiding this comment

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

Awesome, @afonsojramos - nice work! 👏

@setchy setchy merged commit 5e086ae into main Dec 29, 2025
18 checks passed
@setchy setchy deleted the refactor/gitify-notification-type branch December 29, 2025 05:32
@github-actions github-actions bot added this to the Release 6.15.0 milestone Dec 29, 2025
afonsojramos added a commit that referenced this pull request Dec 30, 2025
* refactor: use GitifyNotification type with transformation layer

Introduce a clean separation between raw GitHub API types and internal
Gitify notification types:

- Add transform.ts at API boundary to convert raw GitHub responses
- Define GitifyNotification, GitifySubject, GitifyRepository, GitifyOwner
  types with camelCase properties
- Update all components, handlers, filters, and utilities to use new types
- Update GraphQL schema aliases for consistent property naming
- Remove Notification type alias from typesGitHub.ts

Closes #828

* further type refactoring

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* further type refactoring

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* further type refactoring

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* further type refactoring

Signed-off-by: Adam Setch <adam.setch@outlook.com>

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
Co-authored-by: Adam Setch <adam.setch@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of existing feature

Development

Successfully merging this pull request may close these issues.

refactor to use Gitify Notification type

3 participants