Skip to content

Add primitive radix dialog#5848

Merged
adhami3310 merged 4 commits intomainfrom
add-primitive-radix-dialog
Oct 3, 2025
Merged

Add primitive radix dialog#5848
adhami3310 merged 4 commits intomainfrom
add-primitive-radix-dialog

Conversation

@adhami3310
Copy link
Member

No description provided.

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 Overview

Summary

This PR adds a complete primitive Dialog component implementation to Reflex's Radix UI primitives collection. The change introduces a new `RadixPrimitiveTriggerComponent` base class in `base.py` that handles trigger components with special click event behavior, mirroring the existing pattern from the themes module. This base class automatically wraps children in a Flex component when they have `on_click` event handlers to prevent them from overriding the primitive's internal trigger functionality.

The main addition is a comprehensive Dialog component in dialog.py that provides all essential dialog elements: Root, Portal, Overlay, Trigger, Content, Title, Description, and Close. These primitive components offer lower-level control compared to the existing themes-based dialog, exposing additional props like force_mount, container, modal, and as_child that aren't available in the themes version. The implementation follows established patterns from other primitive components in the codebase with proper inheritance structure and event handling.

The component is properly integrated into the lazy loading system through updates to __init__.py and includes updated TypeScript type definitions in pyi_hashes.json. This addition completes the suite of fundamental UI primitives in Reflex, providing developers with maximum flexibility for modal dialog implementations while maintaining consistency with the existing architectural patterns.

Important Files Changed

Changed Files
Filename Score Overview
reflex/components/radix/primitives/base.py 5/5 Adds RadixPrimitiveTriggerComponent base class with click event handling logic
reflex/components/radix/primitives/dialog.py 5/5 Complete primitive Dialog component implementation with all dialog elements
reflex/components/radix/primitives/init.py 4/5 Registers new dialog component in lazy loading system through manual dictionary merge
pyi_hashes.json 5/5 Updates TypeScript definition hashes for new and modified primitive components

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it adds well-structured new functionality without modifying existing behavior
  • Score reflects clean architectural implementation following established patterns and comprehensive component coverage
  • No files require special attention as all changes follow existing codebase conventions

Sequence Diagram

sequenceDiagram
    participant User
    participant DialogTrigger as "Dialog.Trigger"
    participant DialogRoot as "Dialog.Root"
    participant DialogPortal as "Dialog.Portal"
    participant DialogOverlay as "Dialog.Overlay"
    participant DialogContent as "Dialog.Content"
    participant DialogClose as "Dialog.Close"

    User->>DialogTrigger: "Click trigger button"
    DialogTrigger->>DialogRoot: "Trigger open state change"
    DialogRoot->>DialogRoot: "Set open=true"
    DialogRoot->>DialogPortal: "Create portal container"
    DialogPortal->>DialogOverlay: "Mount overlay layer"
    DialogOverlay->>DialogContent: "Display dialog content"
    Note over DialogContent: Dialog content with title, description rendered
    User->>DialogClose: "Click close button"
    DialogClose->>DialogRoot: "Trigger close state change"
    DialogRoot->>DialogRoot: "Set open=false"
    DialogRoot->>DialogPortal: "Unmount dialog components"
    DialogPortal->>DialogOverlay: "Remove overlay"
    DialogPortal->>DialogContent: "Remove content"
Loading

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 2, 2025

CodSpeed Performance Report

Merging #5848 will not alter performance

Comparing add-primitive-radix-dialog (09748e8) with main (09c33a8)

Summary

✅ 8 untouched

@adhami3310 adhami3310 merged commit 978f5ea into main Oct 3, 2025
39 of 41 checks passed
@adhami3310 adhami3310 deleted the add-primitive-radix-dialog branch October 3, 2025 20:23
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