Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add url parameter to playground modal #7270

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

10tacion
Copy link

@10tacion 10tacion commented Mar 25, 2025

Description

This PR adds URL parameters to the Playground modal, allowing users to directly open and share the Playground state via URLs. Previously, the Playground state was only managed internally, which made sharing specific states or opening directly to a state impossible.

Changes Made

  • src/frontend/src/components/core/flowToolbarComponent/index.tsx

    • Integrated React Router's useSearchParams to synchronize the Playground modal state with the URL parameter (playground=true).

    • Updated state management logic to toggle the modal state based on URL parameters, ensuring consistency between UI and URL. Modified keyboard shortcuts handling to respect the new URL-based modal state. Adjusted the analytics tracking to properly reflect modal state changes based on URL parameters.

  • src/frontend/src/pages/FlowPage/index.tsx

    • Enhanced the navigation blocking logic (useBlocker) to prevent unintended navigation away from the Playground modal when changes are unsaved or building is in progress.
    • Implemented a new function checkIsPlaygroundModalNavigation to specifically handle navigation checks related to the Playground modal, ensuring navigation is allowed when switching between modal states without leaving the page.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Mar 25, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 25, 2025
@10tacion 10tacion force-pushed the feat-add-url-parameter-to-playground-modal branch from 29121ee to 31a47d2 Compare March 25, 2025 16:25
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 25, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant