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

Address bar UI bug & Save button indicator #2844

Open
2 tasks done
menjilx opened this issue Aug 15, 2024 · 3 comments
Open
2 tasks done

Address bar UI bug & Save button indicator #2844

menjilx opened this issue Aug 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@menjilx
Copy link

menjilx commented Aug 15, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

image

I encountered this weird UI bug when I entered a long URL on my Bruno address bar, the "save" and "send/arrow" buttons will be hidden. Is it possible to hide the text if it is longer than the viewport?

Also, the "Save" button when clicked won't change to a "grey" state even if it says "Saved Successfully", I only saw this bug when I was using "Auth" but when using just "params" it won't show up.
image

Thanks!

.bru file to reproduce the bug

No response

Screenshots/Live demo link

image
@menjilx menjilx added the bug Something isn't working label Aug 15, 2024
@menjilx menjilx changed the title Address bar UI bug Address bar UI bug & Save button indicator Aug 15, 2024
@zachary-berdell-elliott
Copy link
Contributor

I think I noticed that it stays orange if you change something then enter the same thing so you are saving what is already saved. I think some logic needs to be added to check if everything is the same when saving.

@zachary-berdell-elliott
Copy link
Contributor

As for the other issue, that should be fixed in the most recent version of bruno with this pr:
#2804

@zachary-berdell-elliott
Copy link
Contributor

zachary-berdell-elliott commented Aug 18, 2024

I took a look at this. The current logic is just checking whether or not item.draft exists in the component. This causes the issue if someone changes everything back to how they had it before editing. It also impacts more than just the save button:
image

I am thinking the fix would involve a useDispatch hook and some logic like this to compare if the fields in item are equal to the fields in item.draft instead of just checking if item.draft exists:

const itemHasChanged = (item) => {
    if(!item.draft) return false;

    const draftKeys = Object.keys(item.draft).filter(
      (key) => key !== 'draft'
    );

    for(let key of draftKeys) {
      if(JSON.stringify(item[key]) !== JSON.stringify(item.draft[key])) {
        return true;
      }
    }

    return false;
  }

If anyone has a better idea then feel free to implement that or suggest it. I can pick this up when I have time unless someone else wants to pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants