cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Make undo (ctrl+z) work in the Editor component

Open Praneeth2k opened this issue 1 year ago • 3 comments

Is your proposal related to a problem?

It would be great if the user can use the undo option while typing something. This option is missing in the Editor (@calcom\ui\components\editor) component. The editor component is used for writing the description or agenda for a new meeting and in the About section of the user's profile

  • https://app.cal.com/event-types?dialog=new&event
  • https://app.cal.com/settings/my-account/profile

Current behavior:

https://user-images.githubusercontent.com/47350983/235458247-2250b14c-339a-4dab-aa06-f74c3870c1b4.mp4

Describe the solution you'd like

The lexical react package comes with a History Plugin which enables the undo/redo option.

Expected behavior (with the History plugin added):

https://user-images.githubusercontent.com/47350983/235457839-709f43d1-540e-4237-b74f-417593ccd93d.mp4

Praneeth2k avatar May 01 '23 13:05 Praneeth2k

Can I work on this?

Sheikh-JamirAlam avatar May 01 '23 14:05 Sheikh-JamirAlam

@Praneeth2k I would like to help!

ameeetgaikwad avatar May 01 '23 14:05 ameeetgaikwad

@ameeetgaikwad I wanted to work on this, have the PR up. Sorry, but here's something I learnt that might be useful to you for your future PRs. There are ESLint errors in the PR you raised. This can be fixed by running: npx eslint <path-to-file> --fix to fix the file you've edited or npx eslint . --fix to fix all the files. The issue is that your editor might change LF to CRLF and this doesn't show up in in git diff.

Praneeth2k avatar May 01 '23 17:05 Praneeth2k

@Praneeth2k sorry. Didn't see that you made a PR too.

ameeetgaikwad avatar May 01 '23 18:05 ameeetgaikwad

@Praneeth2k i tried the eslint thing, but gave me error. Trying to do the same thing in a different branch let's see if it works or not

ameeetgaikwad avatar May 01 '23 18:05 ameeetgaikwad