ransome1 / sleek

todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)
https://github.com/ransome1/sleek/wiki
MIT License
1.45k stars 113 forks source link

WIP: When friendly dates are enabled, group elements use friendly dates #717

Closed jcarstairs-scottlogic closed 3 months ago

jcarstairs-scottlogic commented 5 months ago

This PR is a WIP. I'm putting it up so that nobody duplicates effort. And @ransome1, feel free to let me know if this the intent of this PR is not what you want, and I'll stop working on it!

TODO:


I love the 'friendly dates' feature. Right now, when you enable it in Settings, tags for due dates and threshold dates are displayed using localised, human-friendly words like 'today' and 'tomorrow' rather than ISO strings.

I would love it if this feature extended to 'group elements', ie the headings which appear above grouped todo items.

This PR does that. Now, when the user enables friendly dates in settings, those group elements use friendly dates. (If the user doesn't enable friendly dates in settings, nothing is different.)

Screenshot of group elements showing friendly dates for due dates

ransome1 commented 5 months ago

@jcarstairs-scottlogic Hey, thank you so much for the PR. I'm currently not really available but as soon as I find some time I will look into it and report back :) Very happy to see new contributions.

ransome1 commented 5 months ago

@jcarstairs-scottlogic I checked it out and it seems to work without any noticable issues :)

However I also agree, that the grouping of headlines, as done in the sidebar, might be necessary.

Only if grouped, it does really help the user to get a better overview of the tasks. But of course I also know, that this is not the easiest thing to achieve.

Screenshot 2024-06-14 at 11 49 33 AM

Anyhow I want to thank you for this first commit and hope we can fine grind this, as it is a nice addition.

joeacarstairs commented 5 months ago

@jcarstairs-scottlogic I checked it out and it seems to work without any noticable issues :)

However I also agree, that the grouping of headlines, as done in the sidebar, might be necessary.

Only if grouped, it does really help the user to get a better overview of the tasks. But of course I also know, that this is not the easiest thing to achieve.

Screenshot 2024-06-14 at 11 49 33 AM

Anyhow I want to thank you for this first commit and hope we can fine grind this, as it is a nice addition.

I see the problem -- well spotted! I've put aside some time next week for this

ransome1 commented 4 months ago

@jcarstairs-scottlogic let me know if I can help anyhow.

jcarstairs-scottlogic commented 4 months ago

Thanks, sorry for the inactivity. I think this should be a good first draft, though it still needs wants tests. For some reason when I run npm start I get an error because browser APIs like path and window are undefined, so I haven't been able to sanity-check this yet.

There's a bit of gentle refactoring and typing changes here, but the real meat is in the last two commits, 05b66ae and 7496de2. (The second of those is basically what I had done before.)

ransome1 commented 3 months ago

@jcarstairs-scottlogic thanks a bunch and sorry for being soo slow atm. I will check all commits asap.

jcarstairs-scottlogic commented 3 months ago

Woah there, thanks for looking at this, but I don't think this is ready to merge. I had realised I had made a big mistake misunderstanding how Electron works, and made a dependency across the main and renderer modules, which was causing build errors. I was in the middle of refactoring this to fix that problem yesterday. I think you might want to revert the merge for now, @ransome1?

ransome1 commented 3 months ago

Yeah, I am just trying to figure out, why I cannot start or build it. This might be the reason. I will revert the merge. Just let me know when you think youre good to go :)