sleek
sleek copied to clipboard
Position of context and project tags should be respected in file
Describe the bug When project tags and/or context tags are used in the task, they appear in Sleek at the end of the line but also in the saved file
To Reproduce Steps to reproduce the behavior:
- Create a new task with context and project tags in the text
- Valid the form
- Open the todo file in a text editor (for example Notepad++)
- The input isn't respected in the file. The tags are at the end.
Expected behavior At least the file should respect what the user entered in the form. The tags should be placed as written by the user.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
- Version of sleek : 1.1.9
- Source: Github
@thewholelifetolearn thanks for pointing it out. Unfortunately there is nothing we can do at this moment, as the parsing is done by a library, which doesn't respect the arrangements in the file. There is an issue here and also in the respective library: https://github.com/ransome1/sleek/issues/68
There is indeed already an issue in Sleek regarding the position in the display. My issue is about the position in the file. Sleek is a tool mostly to display the content of the file. It should not alter the content. In this case, the content of the file is not what I have submitted. That means that even if I use an other tool on the same or other platform, the display will stay incorrect. In my opinion, Sleek can alter the display of the content to highlight informations but it should not alter the content.
Seems identical to other issue referred to. However I agree that sleek actually changing entries to shift text would be a disaster. It would turn natural text entries from other software or text editor to gobbledegook. Ask @george about @peter gift Is destroyed in meaning
Complete disaster. Opened my todo.txt once with sleek and all entries scrambled already. Quite a lot turned from readable into a riddle.
Edit for clarity: I agree that sleek just showing it that way would not be a problem, but it rewrote my whole todo.txt.
I'll take another look into what we can do about it and put it on the backlog.
@aubreyz @aurisnoctis @thewholelifetolearn We can approach this step by step.
First we should limit the file writing in order to just edit single lines and not the whole file. But as long as we're using the jsTodoTxt library for parsing, newly added todos or todos, that are edited, will continue being rearranged.
I did some minor changes to the file handling in sleek and created a pre-release. This release should not alter your todos, unless you edit a single one of them. In this case the todo will be rearranged and written to file. The same goes for new todos. Please feel free and help me give it some proper testing, you can download the release here: https://github.com/ransome1/sleek/releases/tag/v1.2.2-rc.2
Be aware that there is still work to be done on the archiving function. Archiving still does alter the whole todo.txt file according to jsTodoTxt specs.
Second, I'm still hoping there will be some work on this anytime soon at jsTodoTxt. Here is the corresponding issue in case you want to be in the loop: https://github.com/jmhobbs/jsTodoTxt/issues/5
Hi @ransome1 and thanks for the quick test version.
Indeed, the order of words and symbols in the existing lines in the todo.txt are now preserved. New tasks created in sleek are still scrambled directly after saving them to the todo.txt file.
The upper "anna" line was created in the new version of sleek, the lower line was typed with an editor directly into the todo.txt file. The rearrangement to the end of the line seems to leave too many blanks behind.
"Bert" line as shown in sleek
In the todo.txt, the lines not created with sleek remain in the correct order so far, also after a new start and also after starting to edit a line, but cancelling the process.
@aurisnoctis in order for the rest to work, we need to wait until jsTodoTxt has been enhanced unfortunately.
Ok, for the moment I am back to https://github.com/QTodoTxt/ but will keep an :eye: on you every now and then. Thanks again for your quick response!
I haven't yet dug through the code and understood how the parser is used in sleek, but in Markor, we just keep the todo item string intact through parsing. Would it be possible to do this in sleek too? i.e. for each line, parse using the js library to extract the contexts, due date etc etc while keeping a copy of the full task string. It isn't a full fix - changing the task will still result in it being re-written with the contexts and projects in the end, but tasks which are not modified will be unaffected.
@harshad1 yes this is possible and actually one of the solutions I've been looking into already. As I'm afk at the moment I can only continue working on this from October on. So please stay tuned.
Awesome. I can try to help, but I have basically zero JS experience, so I'm not sure how useful I'll be.
Sep. 16, 2022 07:39:48 ransome @.***>:
@harshad1[https://github.com/harshad1] yes this is possible and actually one of the solutions I've been looking into already. As I'm afk at the moment I can only continue working on this from October on. So please stay tuned.
— Reply to this email directly, view it on GitHub[https://github.com/ransome1/sleek/issues/370#issuecomment-1249454365], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAOZ3TELL3TEWRBNZZXCYY3V6SBDHANCNFSM5T4PZEZA]. You are receiving this because you were mentioned.[Tracking image][https://github.com/notifications/beacon/AAOZ3TGHQQDDXVQCEBIMWJLV6SBDHA5CNFSM5T4PZEZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJJ4SSHI.gif]
@thewholelifetolearn @harshad1 @aurisnoctis @aubreyz
I looked into it a bit further and applied some changes. The issue has not been fully solved, though.
In this pre release sleek will not rearrange todos anymore if you just open and rewrite them using the interface. The only times todos will be put into the todo.txt parser (this is the part where todos are being altered, unfortunately) is when you
- use the date pickers and the priority picker
- mark todos as complete or incomplete
- archive completed todos
- rename or delete filters (in the filter drawer)
As you see there is still work to do, but the most critical issues have been solved – theoretically.
I could need some help of you guys on the testing. It would mean a lot to me, if you could download the latest pre-release (https://github.com/ransome1/sleek/releases/tag/v1.2.2-rc.4), backup your data and start testing the changes.
Hi @ransome1 ! Thanks for working on the issue. I am back on https://github.com/QTodoTxt (QTodoTxt2, the re-write of it), contributed some code there and that satisfies my needs completely at the moment.
First impression is very good! Word order keeps fine. And of course it would be great, if sometimes in the future even the display keeps the order :-) Thank you!
First impression is very good! Word order keeps fine. And of course it would be great, if sometimes in the future even the display keeps the order :-) Thank you!
I agree, but there is so much else to do before I could take care of that. But stay tuned.
At least the file should respect what the user entered in the form. The tags should be placed as written by the user.
This should now be happening in 1.2.2.
I'm closing here. If you find any issues, let's discuss them here and reopen if necessary.