feat(task): cancel editing task title with escape #2730

Merged
konrad merged 3 commits from DanielPantle/vikunja:main into main 2024-10-02 07:32:34 +00:00
Contributor

Hello,

I am not very experienced with vue and this is my first PR, so please be kind ;)

Summary

With this change, it is possible to cancel editing the task title with pressing the escape key

Problem

Before it was not possible to cancel editing the task title. Pressing outside the title saves the changes that have already been done (which is intended I think). But when e.g. pasting something with a wrong format, I was not able to revert the change without saving and editing it again

Example: after accidentially pasting something with multiple lines it is not possible to escape, the only way to revert this is to save and edit again manually:
grafik.png

Solution

This PR implements a listener for the escape key that sets the title back to its original value and blurs the focus of the title

Additional notes

  • I checked this in the "page" view of the task and the "popup" view and it worked in both. For me, the popup does not close with the escape key (as it often does on other sites), therefore there is no collision with this function. But I think it would be good to check this again to make sure it does not break anything like this
  • I don't know anything about testing in this repository, if it is possible/necessary to implement a test for this feature please leave a comment :)
Hello, I am not very experienced with vue and this is my first PR, so please be kind ;) # Summary With this change, it is possible to cancel editing the task title with pressing the escape key # Problem Before it was not possible to cancel editing the task title. Pressing outside the title saves the changes that have already been done (which is intended I think). But when e.g. pasting something with a wrong format, I was not able to revert the change without saving and editing it again Example: after accidentially pasting something with multiple lines it is not possible to escape, the only way to revert this is to save and edit again manually: ![grafik.png](/attachments/11d3559a-3111-458f-9a9c-4107292054fa) # Solution This PR implements a listener for the escape key that sets the title back to its original value and blurs the focus of the title # Additional notes - I checked this in the "page" view of the task and the "popup" view and it worked in both. For me, the popup does not close with the escape key (as it often does on other sites), therefore there is no collision with this function. But I think it would be good to check this again to make sure it does not break anything like this - I don't know anything about testing in this repository, if it is possible/necessary to implement a test for this feature please leave a comment :)
DanielPantle added 2 commits 2024-10-01 05:30:01 +00:00
Member

Hi DanielPantle!

Thank you for creating a PR!

I've deployed the frontend changes of this PR on a preview environment under this URL: https://2730-main--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.

This preview does not contain any changes made to the api, only the frontend.

Have a nice day!

Beep boop, I'm a bot.

Hi DanielPantle! Thank you for creating a PR! I've deployed the frontend changes of this PR on a preview environment under this URL: https://2730-main--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/. This preview does not contain any changes made to the api, only the frontend. Have a nice day! > Beep boop, I'm a bot.
konrad reviewed 2024-10-01 11:07:51 +00:00
@ -30,6 +30,7 @@
:spellcheck="false"
@blur="save(($event.target as HTMLInputElement).textContent as string)"
@keydown.enter.prevent.stop="($event.target as HTMLInputElement).blur()"
@keydown.esc.prevent.stop="($event.target as HTMLInputElement).textContent = task.title; ($event.target as HTMLInputElement).blur()"

Can you move this into its own function?

Can you move this into its own function?
Author
Contributor

Yes, sure. Done

Yes, sure. Done
konrad marked this conversation as resolved
Owner

Welcome!

The closing via esc is something that should work eventually, but we'll deal with the restore functionality when we have that.

Welcome! The closing via esc is something that should work eventually, but we'll deal with the restore functionality when we have that.
DanielPantle added 1 commit 2024-10-01 14:15:25 +00:00
refactor: move editor cancelling into function
All checks were successful
continuous-integration/drone/pr Build is passing
fc967884d5
Owner

Looks good! The ci failure is probably related to today being the first of October, will re run it tomorrow.

Looks good! The ci failure is probably related to today being the first of October, will re run it tomorrow.
konrad changed title from feat(frontend): cancel editing task title with escape to feat(task): cancel editing task title with escape 2024-10-02 07:31:24 +00:00
konrad merged commit faff1040dc into main 2024-10-02 07:32:34 +00:00
Owner

Thanks again!

Thanks again!
This repo is archived. You cannot comment on pull requests.
No description provided.