Skip to content

Fix extra space share button#8896

Closed
rodrigosnader wants to merge 4 commits into
mainfrom
fix/button-gap
Closed

Fix extra space share button#8896
rodrigosnader wants to merge 4 commits into
mainfrom
fix/button-gap

Conversation

@rodrigosnader
Copy link
Copy Markdown
Contributor

@rodrigosnader rodrigosnader commented Jul 7, 2025

Decrease the gap between icon and text in the Share button for visual consistency with the Playground button.

image

* fix chat image sent

* 🐛 (chat-input.tsx): fix issue where files were not being cleared immediately after sending a message
📝 (chat-input.tsx): refactor code to improve readability and maintainability by extracting filesToSend logic into a separate variable

* Delete diff_output_ts.txt

* ♻️ (chat-input.tsx): refactor code to store and restore files when sending a message to prevent losing files if an error occurs during sending.

* ✅ (fileUploadComponent.spec.ts): update timeout values for better test reliability and performance

* ✅ (fileUploadComponent.spec.ts): update test assertion to check for the correct attribute value to ensure accurate testing

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 7, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update modifies file upload handling and asynchronous control flow in the chat input and related UI components. It also adjusts a CSS utility class for button spacing and increases timeouts in a file upload test. No changes were made to exported or public entity declarations except for one interface method signature.

Changes

File(s) Change Summary
src/frontend/src/components/ui/button.tsx Reduced the gap between inline-flex children in the buttonVariants CSS class from gap-2 to gap-1.
src/frontend/src/modals/IOModal/components/chatView/chatInput/chat-input.tsx Improved file state handling in the send function: files are now cleared before sending and restored on error only.
src/frontend/src/modals/IOModal/components/chatView/chatInput/components/no-input.tsx Updated sendMessage in NoInputViewProps to be async, and updated the button handler to await it.
src/frontend/src/modals/IOModal/playground-modal.tsx Changed the onSubmit prop to an async function that awaits sendMessage.
src/frontend/tests/core/unit/fileUploadComponent.spec.ts Increased timeouts for certain assertions and removed two UI click lines in the file upload test.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChatInput
    participant FileState
    participant sendMessage

    User->>ChatInput: Trigger send
    ChatInput->>FileState: Store current files
    ChatInput->>FileState: Clear files state
    ChatInput->>sendMessage: Send message with filesToSend
    alt sendMessage fails
        ChatInput->>FileState: Restore files state
    end
Loading
sequenceDiagram
    participant User
    participant NoInputView
    participant sendMessage

    User->>NoInputView: Click "Run Flow" button
    NoInputView->>sendMessage: Await sendMessage({ repeat: 1 })
Loading

Possibly related PRs

Suggested labels

bug, size:S, lgtm

Suggested reviewers

  • mfortman11
  • Cristhianzl
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/button-gap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 7, 2025
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 10, 2025

const buttonVariants = cva(
"noflow nopan nodelete nodrag inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-70 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
"noflow nopan nodelete nodrag inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-70 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it safe to change this for all buttons?

Comment on lines -326 to -335
await page
.getByTestId("handle-file-shownode-raw content-right")
.first()
.click();

await page
.getByTestId("handle-chatoutput-noshownode-inputs-target")
.first()
.click();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why change this?

@ogabrielluiz ogabrielluiz added the community Pull Request from an external contributor label Jul 14, 2025
@SonicDMG SonicDMG temporarily deployed to fix/button-gap - langflow-manual-install PR #8896 July 29, 2025 17:51 — with Render Destroyed
@SonicDMG SonicDMG temporarily deployed to fix/button-gap - langflow-manual-install PR #8896 July 29, 2025 17:51 — with Render Destroyed
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Request from an external contributor size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants