Skip to content

add window_event_listener#5568

Merged
adhami3310 merged 2 commits into
mainfrom
lendemor/window-event-listener
Jul 17, 2025
Merged

add window_event_listener#5568
adhami3310 merged 2 commits into
mainfrom
lendemor/window-event-listener

Conversation

@Lendemor
Copy link
Copy Markdown
Contributor

@Lendemor Lendemor commented Jul 12, 2025

fix #1314

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added a new WindowEventListener component to handle window-level events with proper lifecycle management and TypeScript support.

  • Implemented window event handlers for resize, scroll, focus, blur, visibility_change, before_unload, and keydown events in reflex/components/core/window_events.py
  • Integrated proper event cleanup using React's useEffect to prevent memory leaks
  • Component extends Fragment and excludes event handler props from prop drilling
  • Added component exports via rx.window_event_listener in main module

4 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Comment thread reflex/components/core/window_events.py
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jul 12, 2025

CodSpeed Performance Report

Merging #5568 will not alter performance

Comparing lendemor/window-event-listener (4f1a242) with main (69d6eb5)

Summary

✅ 8 untouched benchmarks

Copy link
Copy Markdown
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

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

code looks good. can we try to get @devin-ai-integration to write an AppHarness test to make sure all the features keep working

Copy link
Copy Markdown
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

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

lets merge it and do the app harness test in another PR as a separate devin task

@adhami3310 adhami3310 merged commit 3154987 into main Jul 17, 2025
39 of 41 checks passed
@adhami3310 adhami3310 deleted the lendemor/window-event-listener branch July 17, 2025 00:20
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.

[REF-3186] Support window event handlers on_focus and on_blur

3 participants