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

Option to run all Tasks with only one Trigger + option to run a group of tasks starting with a specific character #183

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nabemono
Copy link

@nabemono nabemono commented Nov 17, 2023

I would like to contribute also the following commits to the fantastic Round-Sync:

  • First commit: Option to run all (active) Tasks with only one Trigger (the Tasks will run one by one in alphabetical order).
  • Second commit: Tasks are automatically grouped by their titles' first character in Triggers' Task-dropdown to provide an option to run all Tasks starting with the specific character. (The first character can be any unicode character.) This allows simply grouping Tasks in order to be executed with only one Trigger.

Some information for first commit:
The new dropdown entry "All tasks" gets a Task Id which is negative (I used -1000L) and therefore can easily be recognized as not belonging to any task (as they always have positive Long values). When the SyncManager's queue() finds this Id, all Tasks are fetched from the Database, sorted by title, and enqueued to run one after one. (If one Task finishes with an error, the next Task will still be executed.)

Some information for second commit:
The grouping is realized with (again) negative Task Ids which is used to store the unicode character as a Long value.

Have a nice weekend.

Best regards
Fabian

Screenshot for "Run all tasks":
image

Screenshot for "Run all tasks starting with character ..." (automatically grouped first characters):
image2

…with only one Trigger. The Tasks will run one by one in alphabetical order.
…s' Task-dropdown to provide an option to run all Tasks starting with the specific character. (First character can be any unicode character.)

This allows simply grouping Tasks in order to be executed with only one Trigger.
@nabemono nabemono changed the title Option to run all Tasks with only one Trigger Option to run all Tasks with only one Trigger + option to run a group of tasks starting with a specific character Nov 18, 2023
@newhinton
Copy link
Owner

I didnt have time to look at your PR's in depth yet, sorry for that.

From a quick glance i can see two things:

  1. Multi-Tasks per Trigger
  2. Fine-Control of Task per Trigger

I like 1. I dont really like 2.
My reason for this is that i see a better way to present this ability. Instead of running everything "after X", i think it would be better to allow really-fine-grained-control, where the user can specifically select tasks, independend of their names.

Would you be willing to furter refine this?

I imagine instead of a dropdown, we need a dialog where each task gets a checkbox. For that to work, the Trigger-Object would need a list of tasks instead of a single field, (and a migration for the database, aswell as the exporter and importer)

That way we dont get problems when users add new tasks that are now suddenly run because their name starts with the wrong letter.

Thank you very much for your work! If you need help at any point, with any part, just ask, im glad to help!

@nvllz
Copy link

nvllz commented Jan 22, 2024

I love it! I just tested (after a lot of struggle thanks to my lack of general knowledge, hahah), got a debug build, and can say that this works really well. But I agree with newhinton, instead of having multiple "starting with a letter" entries, it would be more convenient to have a checkable list of tasks like this:
https://www.geeksforgeeks.org/how-to-implement-multiselect-dropdown-in-android/

Are you willing, @nabemono, to try to make it that way? It'd be a massive upgrade to the triggers module, and you seem to understand this piece of code better.

@nabemono
Copy link
Author

Thank you for your feedback and sorry for the late reply. I must have missed the notification a while ago.

A checklist is a good idea. But it may be that my skills will not be sufficient to implement this. I will check.
Have a nice day!

@newhinton
Copy link
Owner

Thank you for your feedback and sorry for the late reply. I must have missed the notification a while ago.

A checklist is a good idea. But it may be that my skills will not be sufficient to implement this. I will check. Have a nice day!

If you need any help, let me know!
(Please also let me know if it doesn't fit in your free time. Then i can take over and get it merged!)

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

Successfully merging this pull request may close these issues.

None yet

3 participants