Skip to content

FIX: Sync URL Input when pasting a cURL command#7344

Open
gitKashish wants to merge 1 commit intousebruno:mainfrom
gitKashish:bugfix/sync-editor-on-curl-paste
Open

FIX: Sync URL Input when pasting a cURL command#7344
gitKashish wants to merge 1 commit intousebruno:mainfrom
gitKashish:bugfix/sync-editor-on-curl-paste

Conversation

@gitKashish
Copy link

@gitKashish gitKashish commented Mar 2, 2026

Description

After the recent update when I tried pasting in the a cURL command in the URL text input. The cURL was parsed properly and it was updated in the app state as well. But the URL input did not reflect the API URL.

20260302-1715-17 5834206

I think it was due to the event.PreventDefault() on the paste operation that was causing the issue and causing the single line editor to not reflect changes, since its paste event was interrupted.

So I explicitly set the URL once the cURL command is parsed. I hope this seems like a valid approach. I made the changes for both handleGraphqlPaste() and handleHttpPaste() functions.

Thanks.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where URL changes from pasting curl or GraphQL code were not immediately reflected in the editor UI, ensuring real-time synchronization.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Walkthrough

The QueryUrl component now synchronizes the editor UI after dispatching URL updates from paste handlers. When curl or GraphQL content is pasted, the code immediately updates the editor display to reflect the new URL alongside existing state updates.

Changes

Cohort / File(s) Summary
Editor UI Synchronization
packages/bruno-app/src/components/RequestPane/QueryUrl/index.js
Added editor.setValue(request.url) calls after URL state updates in both GraphQL and HTTP paste handlers to ensure the editor UI reflects new URL values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

size/XS

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

📝 A paste, a dispatch, a URL takes flight,
Editor syncs up—now the view's just right,
Ten lines of grace, no logic to fight,
UI and state dance in perfect alignment tonight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: syncing the URL input field when pasting a cURL command, which directly addresses the issue described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gitKashish
Copy link
Author

Fixes #7345

@chirag-bruno
Copy link
Collaborator

Hey @gitKashish, thanks for taking the time to work on this. We’ll review your changes over the next day or two and get back to you with an update.

@gitKashish
Copy link
Author

Hi @chirag-bruno, thanks for responding. Is there some update on this?

@naman-bruno naman-bruno self-requested a review March 11, 2026 12:12
@cyb3rd0g-cell
Copy link

Any update on this bug fix?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants