Optional feature to reorder checked lines to the top or bottom of the checkmark list #9951
Replies: 13 comments 1 reply
-
|
Years ago, I built a function using ETAPI with python, called move_yesterday_unfinished_todo_to_today :) and set up a cron job to run it every day at 00:15. https://github.com/Nriver/trilium-py#move-yesterdays-unfinished-todo-to-today |
Beta Was this translation helpful? Give feedback.
-
|
@Nriver Thanks! I'll try this out! It's probably better to have it be a native option though, but that's up to the main dev team I guess. |
Beta Was this translation helpful? Give feedback.
-
|
@Nriver So I just tried out that command. It didn't actually do what I was expecting. What I want to do is something like this. If you have a list in a note like this:
After the script runs it should be:
|
Beta Was this translation helpful? Give feedback.
-
|
Well, the idea is quite similar. I made a new function to do that. https://github.com/Nriver/trilium-py#sort-todo Sort today's todos, put finished todos to the bottom and keep relative order ea.sort_todo()Sort for some day ea.sort_todo(date="2026-05-26")Sort and push newly finished items to the bottom ea.sort_todo(append_new_done=True) |
Beta Was this translation helpful? Give feedback.
-
I just tried this out. It doesn't work. I read more about the implementation and I think this is assuming the note I'm trying to reorder is a journal note assigned to a specific date (today by default). The type of feature I'm describing would account for any changed notes that have checkboxes. At a certain time a day, it would go through these notes, find the groups of checkboxes, then reorder the groups with the unchecked either at the top or bottom of the grouping, together. This would encompass all notes that have checkboxes in them that were changed since the last run. |
Beta Was this translation helpful? Give feedback.
-
|
@StephenArg , as an exercise, it would be interesting to try the new AI chat, ask it to create a script which would do this for you. |
Beta Was this translation helpful? Give feedback.
-
|
I made a change to the function, now it supports noteId. You can find all notes with unchecked checkbox with the search query. Backup before you do anything : ) |
Beta Was this translation helpful? Give feedback.
-
|
@eliandoran I don't have keys for those providers. Are you saying I should just make a plugin though? Edit: Just checked. I don't see an option for plugins :/ |
Beta Was this translation helpful? Give feedback.
-
@Nriver So this basically goes through every single note? That's a bit much. Would probably be more efficient if the app did this itself. Easier for it to track which notes are changed. |
Beta Was this translation helpful? Give feedback.
-
|
@StephenArg , there is not yet a concept for plugins in Trilium. But yes, I'm saying this can be implemented as a frontend or backend script (see https://docs.triliumnotes.org/user-guide/scripts). |
Beta Was this translation helpful? Give feedback.
-
|
Well, that's the best ETAPI can do. If you want more precise controls, you'll need to write a plugin then. I think you can do something with Trilium 's |
Beta Was this translation helpful? Give feedback.
-
|
@eliandoran @Nriver Ok, this solution worked well! Make a note (code note). Add these two tags (bottom right where it says "[some number] attributes"): The number for runAtHour corresponds to the hour you want to run it on 24 hour time. Then add this code to the note and you're good. |
Beta Was this translation helpful? Give feedback.
-
|
@StephenArg , glad you could set it up by yourself. As a future improvement, you might consider keeping this script as a one-off execution to process old notes, but create a frontend script which hooks to the CKEditor and automatically reorders the TODOs when they are done. This would be a bit harder to implement but it would yield a better user experience. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe feature
So a feature I've seen elsewhere on other note taking applications is for checked lines in a list of checkboxes to reorder themselves so the unchecked and checked lines are always grouped together. It can be annoying for the lines to quickly "disappear" when checked, so perhaps there can be some cleanup function to it where it reorders the list after a few minutes or hours. That way when you return to the list is orderly and what still needs to be done is grouped together.
Additional Information
Since it doesn't work like this now, it would be nice to have it added as an optional feature.
Beta Was this translation helpful? Give feedback.
All reactions