johannesjo / super-productivity

Super Productivity is an advanced todo list app with integrated Timeboxing and time tracking capabilities. It also comes with integrations for Jira, Gitlab, GitHub and Open Project.
http://super-productivity.com
MIT License
12.05k stars 934 forks source link

Add task in order / put at the end of task list #1221

Closed nicola-lunghi closed 3 years ago

nicola-lunghi commented 3 years ago

When I add a bunch of task, I want them to be put at the bottom of the task list

for example if I have a project I will add the tasks in the order of execution not in reverse...

Can an option be added for this?

johannesjo commented 3 years ago

Yes I am open for this. Would you prefer add this as a project level option or as a global option?

gotjoshua commented 3 years ago

I like the idea and could be a good first pr for me...

I'd go for a pull down button on the new task pop over that has "add next" and "add to end" as options... And remembers the previous choice... Like a very flexible/transient global option rather than project only.

What do you think?

johannesjo commented 3 years ago

Hey @gotjoshua that sounds like a good solution to me! By task pop over you mean the AddTaskBarComponent right?

gotjoshua commented 3 years ago

By task pop over you mean the AddTaskBarComponent right? yeah, this thing: Screen Shot 2021-07-08 at 17 05 51

you have the quick switch on the left side for backlog vs task, it could be a similar toggle button on the right. and maybe alt+enter could do a quick inversion of the currently selected default.

I still need to clone and setup the toolchain (versed in react and vue, will be my first dive into angular)...

johannesjo commented 3 years ago

The UI concept looks good to me. A list of available icons can be found here: https://fonts.google.com/icons vertical_align_top good be a candidate.

Please let me know if I can help you somehow and also if you find something is missing form the setup instructions!

gotjoshua commented 3 years ago

<> ng serve An unhandled exception occurred: Cannot find module 'unique-filename' ..... https://github.com/johannesjo/super-productivity/discussions/1376

I did try the obvious to install unique-filename with yarn, but that did not help.

do you have a discord server or telegram, signal etc that we could have a chat session to get me up and coding? could be quicker than continuing in this thread...

also i found that the button i want to mimic and adapt is bound to "isAddToBacklog" and I started to create a new var "isAddAtEnd" but then discovered that "isAddToBottom" already exists... trying to decifer if i should use that var as is and add ui or to continue with my first impulse to create and use isAddAtEnd.

johannesjo commented 3 years ago

I totally forgot about this setting. It's used to change the behavior in the different places the add task bar can appear, which are:

  1. Globally via button or keyboard shortcut => false
  2. The work view (task list) page in planning mode => true (so the user can see the tasks they add right below the bar)
  3. The daily summary planning section => true (so the user can see the tasks they add right below the bar)

One option could be to just show the isAddToBottom button just for the global bar. The other to remove the different behavior for the three and just always use the isAddToBottom button. What do you think?

gotjoshua commented 3 years ago

I think removing the over ride and always showing the button feels best to me. Main risk is that the UI starts to feel cluttered. Bummer that my Toolchain install creates delays...I started in full on... And already had the button added before yarn was done... But never got it to build. I'll get it building tomorrow morning... Somehow

On Friday, July 9, 2021, Johannes Millan @.***> wrote:

I totally forgot about this setting. It's used to change the behavior in the different places the add task bar can appear, which are:

  1. Globally via button or keyboard shortcut => false
  2. The work view (task list) page in planning mode => true (so the user can see the tasks they add right below the bar)
  3. The daily summary planning section => true (so the user can see the tasks they add right below the bar)

One option could be to just show the isAddToBottom button just for the global bar. The other to remove the different behavior for the three and just always use the isAddToBottom button. What do you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/johannesjo/super-productivity/issues/1221#issuecomment-877428960, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCIW5UZBOC4NSHGB7C2YJDTW5JMXANCNFSM45GYRUTA .

-- ~ .:.joshua

“Our lives are not our own. We are bound to others, past and present, and by each crime and every kindness, we birth our future.” ― David Mitchell https://www.goodreads.com/author/show/6538289.David_Mitchell, Cloud Atlas https://www.goodreads.com/work/quotes/1871423

"Avoid the pursuit of happiness. Seek to define your mission and pursue that." ― John Perry Barlow https://www.goodreads.com/author/show/273206.John_Perry_Barlow

"Life is a series of gestures, into which we embed meaning..." ― Joshua Gottdenker

gotjoshua commented 3 years ago

so i got it building in gitpod, still not sure whats up with my mac ng setup...

https://github.com/johannesjo/super-productivity/pull/1378 the button is in, i removed the x close button to avoid clutter (and as there is no submit button but we rely on return key, i propose that its fine to rely on click away or escape key to close - open for discussion)

soooo, the isAddToBottom flag behaves differently on different pages

any hints why the behavior is reversed on different pages? some redux stuff?

stkofler commented 3 years ago

I hope you don't mind me trying to help out. Looks pretty good so far and sorry I couldn't help with your build issues. Rather than redux, I'd say it depends on Angular and its @ Input() directive. Have a close look at this: @Input() and then in work-view.compontent.html: isAddToBottom. This, I think, "causes" your unexpected behavior.

gotjoshua commented 3 years ago

all good @stkofler ! thanks for your efforts. gitpod is good enough for now...

i removed all the defaults for isAddToBottom and reversed one ternary in the project reducer and now it works as expected (but not fully as desired)...

I think that if a task is running the toggle should choose between just after the current task (not the top) and the bottom. agreed?

gotjoshua commented 3 years ago

should choose between just after the current task (not the top) and the bottom.

I have a placeholder for this now on my 1221 branch

I am not sure how to get access to a different part of the state tree from inside the project reducer (which is where the taskId ordering happens)

any help?

johannesjo commented 3 years ago

@stkofler not at all! This is very welcome! Thank you :)

@gotjoshua what other state do you need to access and why? Not sure if that helps, but you can use one action within several different reducers. Just a general hint: The changes you make to the project reducer also need to be reflected on the tag.reducer.

gotjoshua commented 3 years ago

@gotjoshua https://github.com/gotjoshua what other state do you need to access and why?

I need to know the current active task (the one with the timer on it)

And as far as I could tell it only lives in the task section of the state... Either I need a ref to task service in the reducer or access to that prop... Or maybe I could make a util FX somewhere to insert new task ID after the current running one and return the sorted array.

What do you think?

-- ~ .:.joshua

“Our lives are not our own. We are bound to others, past and present, and by each crime and every kindness, we birth our future.” ― David Mitchell https://www.goodreads.com/author/show/6538289.David_Mitchell, Cloud Atlas https://www.goodreads.com/work/quotes/1871423

"Avoid the pursuit of happiness. Seek to define your mission and pursue that." ― John Perry Barlow https://www.goodreads.com/author/show/273206.John_Perry_Barlow

"Life is a series of gestures, into which we embed meaning..." ― Joshua Gottdenker

johannesjo commented 3 years ago

Ah ok. I missed that part:

I think that if a task is running the toggle should choose between just after the current task (not the top) and the bottom. agreed?

This is a bit complicated. We either need to add the currentTaskId to the addTask action and provide it as a parameter or to create a combined reducer. Given that and the complexity it introduces I think it's best to start out just with the add to bottom or top thing and then see how that feels?

gotjoshua commented 3 years ago

also need to be reflected on the tag.reducer.

the code in tag.reducer is already working, so changing it would only be for style reasons.
I prefer the style that i used in project.reducer as it avoids the ternaries, and avoids some code running when not needed.