firecamp-dev / firecamp

Developer-first OpenSource API DevTool, Postman/Insomnia alternative.
https://firecamp.dev
GNU Affero General Public License v3.0
1.92k stars 122 forks source link

[bug]: Renaming request from left menu not working properly #154

Open arp99 opened 10 months ago

arp99 commented 10 months ago

Describe the bug A clear and concise description of what the bug is. When the request is not opened in any tab, and the user tries to rename the request from the dropdown available in the 3 dot. It opens a input box, but when the user tries to click on the input box the request gets selected, instead of the cursor getting inside the input box.

To Reproduce Steps to reproduce the behavior:

  1. Go to your workspace
  2. Create a folder inside a collection
  3. Create a request inside the folder, and close any open tabs of the request
  4. Now try to rename the request by clicking on the 3 dots beside the request name
  5. It will open a input box, but now try to click inside the input box.

Expected behavior A clear and concise description of what you expected to happen.

  1. Ideally the input box should get active, without the opening the request tab
  2. and on user entering the updated name and pressing enter or the square that appear on right, should rename the request

Screenshots If applicable, add screenshots to help explain your problem.

https://github.com/firecamp-dev/firecamp/assets/47218246/f4978990-407c-442c-8143-1d090982391a

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

arp99 commented 10 months ago

Can the project admins review the issue and assign me the issue, I want to start contributing to this project

Nishchit14 commented 10 months ago

Thank you @arp99 for filing this issue. I have assigned it to you, you can start contributing it.

arp99 commented 10 months ago

@Nishchit14 This seems to be a problem with the react-complex-tree the project is using to render the collection tree, the input box is being rendered by the library itself. Correct me If I am wrong. Basically we need to get access to the synthetic event object of the click event on the input box, for this reason there is another linked issue to it. User can rename and keep blank folder or request names. Need to add a custom rename input box to handle all such situations, and remove the library dependency from that. Let me know your thoughts on this

Nishchit14 commented 10 months ago

The input box is being rendered by the library itself.

yes, that's true

Need to add a custom rename input box to handle all such situations, and remove the library dependency from that.

we're using the react-complex-tree for API collection tree UI to get rich accessibility. Here we can not remove the library deps easily. @lukasbach (creator of the lib ) is a very helpful person, you can ask on their own repo for the solution.

Nishchit14 commented 10 months ago

I think this solution would work @arp99

Try to check that the tree has a renaming state with this api treeRef.current.isRenaming at this line https://github.com/firecamp-dev/firecamp/blob/85ce70c836b764b0d7a897c705b39052b65c7d79/platform/firecamp-platform/src/components/activity-bar/explorer/Explorer.tsx#L141

treeRef.current.isRenaming

here is the API https://rct.lukasbach.com/docs/api/interfaces/TreeRef#isrenaming

Nishchit14 commented 9 months ago

@arp99 have you tried it?

arp99 commented 9 months ago

@arp99 have you tried it?

Bit busy with work, will try to resolve it by weekend