Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to duplicate tasks #2931

Open
Tracked by #3111
KatrinIhler opened this issue Dec 20, 2023 · 14 comments
Open
Tracked by #3111

Ability to duplicate tasks #2931

KatrinIhler opened this issue Dec 20, 2023 · 14 comments

Comments

@KatrinIhler
Copy link

I've thought a couple of times that it would be neat if we were able to do right-click -> "Duplicate Task" on an existing task to create a new task with all the same properties (project association, tags, description and so on).

This might be useful if the new task is very similar to the old one (e.g. same task for a different project, different day, ...), because you can just duplicate and then amend the new one slightly. And yes, I'm lazy. :D

Copy link

Thank you very much for opening up this issue! I am currently a bit overwhelmed by the many requests that arrive each week, so please forgive me, if I fail to respond personally. I am still very likely to at least skim read your request and I'll probably try to fix all (real) bugs if possible and I will likely review every single PR being made (please, give me a heads up if you intent to do so) and I will try to work on popular requests (please upvote via thumbs up on the original issue) whenever possible, but trying to respond to every single issue over the last years has been kind of draining and I need to adjust my approach for this project to remain fun for me and to make any progress with actually coding new stuff. Thanks for your understanding!

Copy link

Hello there KatrinIhler! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀

For more open ended discussions and/or specific questions, please visit the discussions page. 💖

@johannesjo
Copy link
Owner

Just for reference: #2184 #1579

@KatrinIhler
Copy link
Author

Just for reference: #2184 #1579

Ah dammit, overlooked that closed issue...

Copy link

This issue has not received any updates in 90 days. Please comment, if this still relevant!

@github-actions github-actions bot added the Stale label Apr 20, 2024
@KatrinIhler
Copy link
Author

Still relevant!

@github-actions github-actions bot removed the Stale label Apr 23, 2024
@wammar
Copy link

wammar commented Jun 17, 2024

Just +1ing this because it's much needed.

@TeguSolutions
Copy link

+1

@RomanMIzulin
Copy link

+1, especially when working in schedule mode

@MikeTheSapien
Copy link

MikeTheSapien commented Oct 4, 2024

Ahmmm there seems to be a recurring need for this?

The main contributor has his hands already full, is there someone who can point me on some documentation on the relevant codes to be updated if this feature, task duplication, is to be implemented?

Perhaps, I may be able to contribute code for this feature.

I looked at the current PRs and didn't see anything related to this feature.

PS. Trying to maximize my single post.
If someone is more aware of the code base of this project, how accurate/inaccurate are the following statements when a feature to duplicate a task would be implemented?

  1. The code for showing some popup of options when a task is "right clicked" needs to be updated
  2. The code for key bindings on Ctrl + C (or CMD + C in MacOS perhaps) needs to be updated, and copying of a task only excludes its unique ID (I assume it has a unique ID) as such should be generated each time a task is duplicated, or when Ctrl + V is pressed
  3. on (1) and (2), there should be some controller, to which will be called, that then calls the API for creating a new task on the backend, but the controller should generate a new ID for the task to be duplicated.

For context, I mainly code backend stuff and mostly using strongly typed languages and a limited experience on vanilla JavaScript (for utterly rudimentary tasks). I might ask stupid questions on frontend stuff and TypeScript and JavaScript related stuff.

@johannesjo
Copy link
Owner

Thank you @MikeTheSapien !!!

Most of the relevant code should be here:
https://github.com/johannesjo/super-productivity/tree/master/src/app/features/tasks
Having a look at addTask and other ngrx actions will probably help to understand the current code.

From the technical side I would start with listing the edge cases that need to be considered and possibly excluded (e.g. repeating task or issue task instances). Next step would be to add an ngrx action (and maybe add unit tests :)). For the list stuff you need to consider the project and tag reducers.

To wire up saving the data you would need to add the action to task-db.effects.ts.

As duplicating tasks potentially touches a lot of areas we need to test this very carefully :)

@MikeTheSapien
Copy link

Thanks for the response @johannesjo. And sorry for the late response on my part.
Happy to tackle this!

Alright, I'll follow your direction, it's way better than my initial thought, "duh" moment for me. No problem with creating unit tests, I agree it's important.

  1. Should the edge cases to be considered be listed in this thread? Or some place else? Perhaps in Discussions thread?
  2. What do you mean by tag reducers?

For those following on this thread and it's their first time as well to see ngrx, I'm confident it's this NgRx: Reactive State for Angular - Actions, please simply correct me if I'm wrong.

@johannesjo
Copy link
Owner

2. What do you mean by tag reducers?

tag.reducer.ts and project.reducer.ts

  1. Should the edge cases to be considered be listed in this thread? Or some place else? Perhaps in Discussions thread?

If you think there is something we should discuss, then here in this thread is the right place I think. Alternatively, if it is more technical, we can also discuss stuff in your upcoming PR. Apart from that it is not necessary to document everything. Thank you for asking! That's very considerate!

@MikeTheSapien
Copy link

MikeTheSapien commented Oct 30, 2024

I'll look up *.reducer.ts on the code base.

Sorry, I'm new to this open source thing. I want to contribute to projects I like but lack the experience (especially working in a non-software development industry for at least a decade) and lack money (a 3rd worlder so can't contribute to Patreons 😅). So please let me know if I'm doing something wrong.

Terms

this/the operation/feat/feature - the feature to duplicate task, not considering how yet (programmatically through an API which other clients might call, if that's important)
tasks/todo - as what is implied on this project

Edge cases (and things to consider?):

  • Limit the feature per constant period of time? Say 500ms?
    • My concern is someone's device might lag a bit then they keep pressing Ctrl+v? Which creates more threads (I'm assuming as of this writing that the app is multi-threaded) which then adds unnecessary load to the already struggling machine, then suddenly, n duplicates were created.
  • How does undo or Ctrl+z affect this operation? Should it be deleted when undo operation is executed?
  • Is it possible to highlight multiple tasks/todo then duplicate those highlighted tasks?
  • Should this feat be limited to particular OS platform? (googled this project and this is available on MacOS and Android, I'm using this on Windows 11)
    • If not, how do we test or narrow down the effects of the feature to each platform? (Or could it be the project is relying on some framework that simply translates into native language the specific and detailed implementation for this feature?)
    • Should there be a limit to OS platforms to which this feature is available? (Assumed to limit rather than not, being conservative to mitigate potential concerning vulnerabilities)
  • What information shall be placed in the logs when this feature is executed by the user?
  • What gets copied to the machine's clipboard when a task is clicked then the interface to duplicated is selected (interface could be pressing Ctrl+c or right click then a pop-up option for duplicate will show, or maybe tap and hold on mobile and tablets?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants