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

Position of context and project tags should be respected in file #370

Closed
thewholelifetolearn opened this issue Apr 20, 2022 · 17 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@thewholelifetolearn
Copy link

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:

  1. Create a new task with context and project tags in the text
  2. Valid the form
  3. Open the todo file in a text editor (for example Notepad++)
  4. 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
Entering task
Display in Sleek
Content of file

Desktop (please complete the following information):

  • OS: Windows 10
  • Version of sleek : 1.1.9
  • Source: Github
@thewholelifetolearn thewholelifetolearn added the bug Something isn't working label Apr 20, 2022
@ransome1
Copy link
Owner

@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: #68

@thewholelifetolearn
Copy link
Author

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.

@aubreyz
Copy link

aubreyz commented Apr 21, 2022

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

@aurisnoctis
Copy link

aurisnoctis commented Jun 27, 2022

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.

@ransome1
Copy link
Owner

I'll take another look into what we can do about it and put it on the backlog.

@ransome1 ransome1 reopened this Jun 30, 2022
@ransome1
Copy link
Owner

ransome1 commented Jul 1, 2022

@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: jmhobbs/jsTodoTxt#5

@aurisnoctis
Copy link

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.

Selection_20220702_21:21:37

"Bert" line as shown in sleek
Selection_20220702_21:48:04

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.

@ransome1
Copy link
Owner

ransome1 commented Jul 3, 2022

@aurisnoctis in order for the rest to work, we need to wait until jsTodoTxt has been enhanced unfortunately.

@aurisnoctis
Copy link

Ok, for the moment I am back to https://github.com/QTodoTxt/ but will keep an 👁️ on you every now and then. Thanks again for your quick response!

@harshad1
Copy link

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.

@ransome1
Copy link
Owner

@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.

@harshad1
Copy link

harshad1 commented Sep 16, 2022 via email

@ransome1
Copy link
Owner

@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.

@aurisnoctis
Copy link

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.

@aisbergde
Copy link

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!

@ransome1
Copy link
Owner

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.

@ransome1
Copy link
Owner

ransome1 commented Oct 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants