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 PlaygroundButton component to flow toolbar #4712

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

Cristhianzl
Copy link
Member

This pull request introduces a new PlaygroundButton component to the flow toolbar in the frontend. The PlaygroundButton component replaces the existing logic for displaying the playground button, providing a cleaner and more modular implementation.

This PR also fixes a bug in which the icon on Playground was the old one when we didn't have ChatInput or ChatOutput on Canvas.

Key changes include:

New Component Addition:

  • Added PlaygroundButton component in src/frontend/src/components/flowToolbarComponent/components/playground-button.tsx. This component handles the display logic for the playground button, including active and disabled states.

Integration with Flow Toolbar:

  • Updated FlowToolbar component in src/frontend/src/components/flowToolbarComponent/index.tsx to use the new PlaygroundButton component instead of directly embedding the button logic. [1] [2]

Styling Adjustments:

  • Added new CSS class .playground-btn-flow-toolbar to src/frontend/src/style/applies.css to style the playground button within the toolbar.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 19, 2024
@Cristhianzl Cristhianzl requested review from anovazzi1 and lucaseduoli and removed request for anovazzi1 November 19, 2024 16:55
@Cristhianzl Cristhianzl self-assigned this Nov 19, 2024
@dosubot dosubot bot added bug Something isn't working enhancement New feature or request labels Nov 19, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request bug Something isn't working labels Nov 19, 2024
Copy link
Collaborator

@lucaseduoli lucaseduoli left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 19, 2024
@ogabrielluiz ogabrielluiz force-pushed the cz/fix-playground-icon branch from 52aaa3d to 1178e8d Compare November 19, 2024 20:08
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

lgtm

@ogabrielluiz ogabrielluiz force-pushed the cz/fix-playground-icon branch 2 times, most recently from 4c75ec2 to 54d6121 Compare November 22, 2024 03:15
…e flowToolbarComponent to handle the display of the Playground button based on the presence of Chat Input or Chat Output components.

📝 (index.tsx): Import and use the PlaygroundButton component in the FlowToolbar component to replace the previous implementation of the Playground button display.
🔧 (applies.css): Add styling for the playground-btn-flow-toolbar class to ensure consistent styling for the Playground button in the toolbar.
@ogabrielluiz ogabrielluiz force-pushed the cz/fix-playground-icon branch from 1753d07 to 8aa2660 Compare November 22, 2024 15:16
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) November 22, 2024 15:16
@ogabrielluiz ogabrielluiz merged commit 5ed32cb into main Nov 22, 2024
18 checks passed
@ogabrielluiz ogabrielluiz deleted the cz/fix-playground-icon branch November 22, 2024 15:30
diogocabral pushed a commit to headlinevc/langflow that referenced this pull request Nov 26, 2024
* ✨ (playground-button.tsx): Add a new PlaygroundButton component to the flowToolbarComponent to handle the display of the Playground button based on the presence of Chat Input or Chat Output components.
📝 (index.tsx): Import and use the PlaygroundButton component in the FlowToolbar component to replace the previous implementation of the Playground button display.
🔧 (applies.css): Add styling for the playground-btn-flow-toolbar class to ensure consistent styling for the Playground button in the toolbar.

* 📝 (playground-button.tsx): update import path for IOModal to point to the newModal file instead of the old one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants