Skip to content

chore(events): remove dead UPDATE_THEME event and onSystemThemeUpdate API#2848

Merged
setchy merged 1 commit intomainfrom
drop-dead-update-theme
May 7, 2026
Merged

chore(events): remove dead UPDATE_THEME event and onSystemThemeUpdate API#2848
setchy merged 1 commit intomainfrom
drop-dead-update-theme

Conversation

@afonsojramos
Copy link
Copy Markdown
Member

Summary

EVENTS.UPDATE_THEME and the window.gitify.onSystemThemeUpdate registration shim are dead code:

  • No code in src/main/ ever calls sendRendererEvent(mb, EVENTS.UPDATE_THEME, …) — there is no producer.
  • No code in src/renderer/ ever calls window.gitify.onSystemThemeUpdate(…) — there is no consumer.
  • Only the registration plumbing and its test exist, plus a vi.fn() stub in the renderer test setup.

Theme handling currently happens entirely on the renderer side via @primer/react's useTheme and the OS-level prefers-color-scheme media query. The IPC channel was never wired up.

Removed

  • EVENTS.UPDATE_THEME and its EventContracts entry.
  • window.gitify.onSystemThemeUpdate from src/preload/index.ts.
  • The corresponding test in src/preload/index.test.ts.
  • The onSystemThemeUpdate mock from the renderer test setup.

Verified

pnpm tsc --noEmit clean, pnpm test 937/937, pnpm lint:check 0 errors.

If OS theme tracking is wanted in future, the right shape is nativeTheme.on('updated', …) on the main side, not this listener-without-a-producer.

@github-actions github-actions Bot added the chore Miscellaneous tasks label May 7, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown
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.

🧹 🧼

@setchy setchy merged commit 282bc21 into main May 7, 2026
17 checks passed
@setchy setchy deleted the drop-dead-update-theme branch May 7, 2026 12:41
@github-actions github-actions Bot added this to the Release 7.0.0 milestone May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Miscellaneous tasks

Development

Successfully merging this pull request may close these issues.

2 participants