Giter VIP home page Giter VIP logo

Comments (6)

lindapaiste avatar lindapaiste commented on August 12, 2024

I'm not opposed but let's think this through.

The current behavior:

  • When the focus is in the editor, pressing Delete removes the next character in front of the cursor (vs. Backspace, which removes the character behind the cursor.
  • When the focus is on the filename in the sidebar, pressing Delete does not do anything.
  • If I click somewhere in the sidebar, I can delete the currently-opened file through keyboard controls by Tabbing to the dropdown menu for that file and selecting the "Delete" item.
  • If I want to delete a file which is not currently open that's lot bit trickier. I Tab to that file name and hit Enter -- this opens the file and moves the focus to the text of the file in the editor. Which is good, but once the focus is in the editor I cannot figure out how to get the focus out of the editor using the keyboard alone. I have to click in the sidebar and then use the previous steps.

also we can update the shortcut instruction.

I wouldn't put it there because those are global shortcuts, but this is only if the file is selected.

from p5.js-web-editor.

praveen-rikhari avatar praveen-rikhari commented on August 12, 2024

@Swarnendu0123 @lindapaiste any update on this or should i start working on this?

from p5.js-web-editor.

Swarnendu0123 avatar Swarnendu0123 commented on August 12, 2024

Well @praveen-rikhari,

When the focus is in the editor, pressing Delete removes the next character in front of the cursor (vs. Backspace, which removes the character behind the cursor.
When the focus is on the filename in the sidebar, pressing Delete does not do anything.
If I click somewhere in the sidebar, I can delete the currently-opened file through keyboard controls by Tabbing to the dropdown menu for that file and selecting the "Delete" item

We have already figured out this part.

If I want to delete a file which is not currently open that's lot bit trickier. I Tab to that file name and hit Enter -- this opens the file and moves the focus to the text of the file in the editor. Which is good, but once the focus is in the editor I cannot figure out how to get the focus out of the editor using the keyboard alone. I have to click in the sidebar and then use the previous steps.

But, in this part I feel we need a clear approach. Can you please share, how you are going to implement that, maybe we could come up with a better solution. Though, I have one approach for this:
https://youtu.be/3ucnmBSp1xQ?si=whXQURv2e4uva46J

from p5.js-web-editor.

praveen-rikhari avatar praveen-rikhari commented on August 12, 2024

@Swarnendu0123 Yes, I have come up with an idea which looks like this :

  • We nee to detect when the user presses the delete key which can be done by adding an event listener for the keydown event.
  • But before triggering the delete action, we will need to check if a file is currently selected in the sidebar.
  • Then we can add a alert box for confirmation.
  • If the user confirms the deletion, we can proceed with the deletion action.
    I think this approach will work. So what's your take on this?

from p5.js-web-editor.

Swarnendu0123 avatar Swarnendu0123 commented on August 12, 2024

Yes @praveen-rikhari! I have also came up with a similar solution, and already created the PR.

from p5.js-web-editor.

praveen-rikhari avatar praveen-rikhari commented on August 12, 2024

Awesome @Swarnendu0123 thanks i will take a look at the code

from p5.js-web-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.