Skip to content

Release vv1.5.4

Choose a tag to compare

@doublegate doublegate released this 08 Jan 00:10
· 1 commit to master since this release

Summary

Critical bug fix release that finally resolves the Ctrl+I sidebar toggle functionality with the correct contextBridge callback pattern.

This is the fourth attempt at fixing the sidebar toggle (v1.5.1, v1.5.2 skipped fix, v1.5.3, v1.5.4), and this one finally gets it right by understanding how Electron's context isolation actually works.

Root Cause

With Electron's contextIsolation: true, there are TWO completely separate JavaScript contexts:

  1. Preload context - Has access to Node.js and Electron APIs
  2. Page context - The renderer/React application

Why Previous Approaches Failed

Version Approach Why It Failed
v1.5.1 Callback-based IPC Timing issues, callbacks not properly stored
v1.5.2 Technical debt focus Sidebar fix not addressed
v1.5.3 CustomEvent in preload preload's window is NOT the page's window
v1.5.4 contextBridge callback Works! Electron creates a proxy

Technical Solution

The correct pattern uses contextBridge callbacks which CAN be proxied across the isolation boundary:

Main Process (Ctrl+I detected via globalShortcut)
    |
    v
IPC "sidebar-toggle" message sent to webContents
    |
    v
Preload receives IPC (ipcRenderer.on listener set up on load)
    |
    v
Preload invokes stored callback (registered via contextBridge)
    |
    v
Callback executes in page context (Electron proxies the call)
    |
    v
React state updates, sidebar toggles

Files Changed

  • src/electron/preload.ts - IPC listener + callback storage pattern
  • src/overlay/index.tsx - Callback registration via electronAPI.onSidebarToggle()
  • CHANGELOG.md - v1.5.4 release notes with detailed technical explanation
  • README.md - Updated latest release section
  • package.json - Version bump to 1.5.4
  • VERSION - Version bump to 1.5.4

Quality Checks

  • TypeScript: 0 errors
  • ESLint: 0 warnings
  • Build: Successful
  • Tests: 8/8 passing

Testing Instructions

  1. Install the update
  2. Launch GeForce Infinity
  3. Press Ctrl+I to toggle the sidebar
  4. The sidebar should appear and disappear reliably

Technical Notes for Electron Developers

This fix demonstrates the ONLY correct pattern for main-to-renderer communication in Electron with context isolation:

  1. Main -> Preload: Use webContents.send() and ipcRenderer.on()
  2. Preload -> Page: Use callback functions registered via contextBridge
  3. NEVER rely on: Shared window object, CustomEvent, or direct DOM manipulation across contexts

Full Changelog

See CHANGELOG.md for complete release notes.


Generated with Claude Opus 4.5