Skip to content

fix: resolve news image zoom flickering on hover#526

Merged
bluestreak01 merged 2 commits into
mainfrom
vi_fix_clicker
Jan 12, 2026
Merged

fix: resolve news image zoom flickering on hover#526
bluestreak01 merged 2 commits into
mainfrom
vi_fix_clicker

Conversation

@bluestreak01
Copy link
Copy Markdown
Member

@bluestreak01 bluestreak01 commented Jan 11, 2026

Summary

  • Fixed flickering issue when hovering over news thumbnail images in the right panel
  • The zoom magnification was rapidly appearing and disappearing due to hover state issues
  • Added click-to-dismiss functionality on both the overlay and zoomed image

Root Cause

The hoverTimeout variable was declared as a local variable inside the component function, causing it to reset to undefined on every re-render. When the zoom overlay appeared with pointer-events: auto, it intercepted mouse events, triggering onMouseOut on the thumbnail, which dismissed the zoom - creating a flickering loop.

Changes

  • src/scenes/News/index.tsx:
    • Use useRef for hover timeout to persist across re-renders
    • Track imageToZoom state with a ref to prevent dismissal when zoom is already visible
  • src/scenes/News/image-zoom.tsx:
    • Add click handlers on overlay and zoomed image wrapper to dismiss
    • Add cursor: pointer for better UX

Test plan

  • Open the news panel (bell icon)
  • Hover over a news item thumbnail for 500ms
  • Verify the zoomed image appears without flickering
  • Verify clicking the overlay dismisses the zoom
  • Verify clicking the zoomed image dismisses the zoom
  • Verify pressing Escape dismisses the zoom

🤖 Generated with Claude Code

bluestreak01 and others added 2 commits January 11, 2026 23:02
The hover timeout variable was declared as a local variable inside the
component function, causing it to reset on every re-render. When the
zoom overlay appeared, it intercepted mouse events, triggering onMouseOut
on the thumbnail, which then dismissed the zoom and caused flickering.

Changes:
- Use useRef for hover timeout to persist across re-renders
- Track imageToZoom state with a ref to prevent dismiss when zoom is visible
- Add click-to-dismiss on both overlay and zoomed image
- Add cursor: pointer for better UX

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bluestreak01 bluestreak01 merged commit ac41c13 into main Jan 12, 2026
3 checks passed
@bluestreak01 bluestreak01 deleted the vi_fix_clicker branch January 12, 2026 00:52
@emrberk emrberk mentioned this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant