Skip to content

add popup option for redirect#5764

Merged
adhami3310 merged 2 commits intomainfrom
khaleel/eng-7564-add-option-to-pop-up-for-rxredirect
Sep 5, 2025
Merged

add popup option for redirect#5764
adhami3310 merged 2 commits intomainfrom
khaleel/eng-7564-add-option-to-pop-up-for-rxredirect

Conversation

@adhami3310
Copy link
Member

No description provided.

@linear
Copy link

linear bot commented Sep 4, 2025

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

Greptile Summary

This PR adds a popup option to the redirect function in Reflex, allowing external URLs to open in popup windows instead of regular browser tabs. The implementation includes both backend and frontend changes.

On the backend (reflex/event.py), the PR introduces function overloads to provide type safety - when is_external=True, a popup parameter becomes available, while when is_external=False, the existing replace parameter is used instead. This design prevents invalid parameter combinations and ensures developers can only use the popup option where it makes sense (external redirects only). The overloads use Python's Literal types for parameter validation.

On the frontend (reflex/.templates/web/utils/state.js), the JavaScript code is modified to handle the popup option by appending ,popup to the window.open() features string when event.payload.popup is true. This leverages the browser's built-in popup window functionality.

This change integrates well with Reflex's existing event system and follows the framework's patterns for handling browser navigation. The popup functionality is particularly useful for OAuth flows, payment gateways, and other third-party integrations where a popup window provides better user experience than full tab navigation. The implementation maintains backward compatibility since the popup option is opt-in.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it adds optional functionality without breaking existing behavior
  • Score reflects well-structured type safety implementation and straightforward frontend changes, though lacks comprehensive testing coverage
  • Pay close attention to the function overloads in reflex/event.py to ensure the type constraints work as expected

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 4, 2025

CodSpeed Performance Report

Merging #5764 will not alter performance

Comparing khaleel/eng-7564-add-option-to-pop-up-for-rxredirect (8f3ee24) with main (dd993fd)

Summary

✅ 8 untouched benchmarks

@adhami3310 adhami3310 merged commit 737e427 into main Sep 5, 2025
41 checks passed
@adhami3310 adhami3310 deleted the khaleel/eng-7564-add-option-to-pop-up-for-rxredirect branch September 5, 2025 18:14
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.

2 participants