Notepad icon indicating copy to clipboard operation
Notepad copied to clipboard

feat: allow user to rename files before downloading

Open subrato-pattanaik opened this issue 3 years ago • 6 comments

Hi everyone! 👋 It is the first issue that I am posting in this project. 😊🙈 Really awesome idea 🚀

Is your feature request related to a problem? Please describe.

In the native notepad, we can rename a file when saving it for the first time. Here, I am not able to rename the file before downloading it because of that in my download directory all the files which I download from you are ending with Untitled.txt (n) ( n = no. of the same file downloaded - 1 ). That got me annoyed 😛.

Describe the solution you'd like

This request is to introduce a feature in your project that allows users (like me) to be able to edit the name of the file which can be triggered either by shortcut key or In-place input.

  • With In-place input, we can edit the file name at the place where it has been rendered i.e on the top. I found this library react-inline-input-edit useful to implement this feature.

  • ctrl + r shortcut can be used to rename a file and when pressed we will focus the in-place input to edit.

Addition context

We also need to think of save as functionality in our project. Just a random idea for save as, we could open a Model with input to edit the filename and two buttons save and cancel. On saving button clicked, we will download the file and on cancel, we'll close the modal.

Thank you!! 😊

subrato-pattanaik avatar Jan 26 '22 13:01 subrato-pattanaik

Cool request @subrato-pattanaik! It will be nice if we add rename feature.

My suggestions on this:-

  • Make the filename title (on the left top) content editable. So users can name the file from there! As like the GIF down below:-

rename-feat-notepad

Muhammed-Rahif avatar Jan 26 '22 13:01 Muhammed-Rahif

Yes, the design is so neat. I was looking for that feature in this project.

I am also wondering about the keyboard shortcut to rename the filename title. How do we handle the keystroke event for this feature?

I am thinking about ctrl + r, when it is pressed, we will make the input focusable along with the blinking cursor and selection of the existing filename.

What do you suggest about this? Or could we discuss this later once this feature is ready for users?

subrato-pattanaik avatar Jan 26 '22 14:01 subrato-pattanaik

Adding rename feature on ctrl + r shortcut wouldn't be a best practice, because ctrl + r used to reload the browser tab in default. Preventing that will create a bad user experience, I think. We can implement this feature on F2, I think that will be better, IMO.

Muhammed-Rahif avatar Jan 26 '22 14:01 Muhammed-Rahif

Yes, you're absolutely right. My bad 😅. F2 will be better.

Do we need to rely on external npm lib for Inline input?

I am interested to work on this feature. This would be my first contribution. 🙈

subrato-pattanaik avatar Jan 26 '22 15:01 subrato-pattanaik

@subrato-pattanaik I don't think we need to rely on a module, because we can do this by adding attribute contenteditable="true" for that title. And when the user press on 'save' button we will grab that value from that title put that value as the filename and download the file. Any other better ideas are welcome!

And all the best for your first contribution 🤗..

Muhammed-Rahif avatar Jan 26 '22 15:01 Muhammed-Rahif

@subrato-pattanaik Are you working on this @Muhammed-Rahif I wanna try this.

khushbooag4 avatar May 28 '22 13:05 khushbooag4

Hi @subrato-pattanaik @khushbooag4,

I'm writing to let you know that due to unforeseen circumstances, this project has been inactive for the past few months. We apologize for any inconvenience this may have caused.

We've recently switched the technology stack of this project from ReactJS to NextJS. As a result, the issues related to the old stack are no longer applicable.

We've deployed the new version of the app to production, and you can access it at this link: https://notepad-dusky.vercel.app/

I would like to take this opportunity to encourage you to actively contribute to the project. If you have any ideas, feature requests, or bug reports, please don't hesitate to create a new issue or submit a pull request on our GitHub repository.

Therefore, I'm closing this issue. If you believe that the issue is still relevant to the current version of the project, please feel free to create a new issue and provide details on how to reproduce the problem.

Thank you, @subrato-pattanaik @khushbooag4, for your understanding and for your interest in this project! Let's work together to bring it back to life.

Best regards,
Muhammed Rahif

Muhammed-Rahif avatar Feb 23 '23 18:02 Muhammed-Rahif