ransome1 / sleek

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

Edits in the freetext field when writing a todo should update the select/input fields below #533

Closed swantzter closed 7 months ago

swantzter commented 11 months ago

Feature Request

Description: When creating a task you have two sections available in the dialog, a top freeform text field where you can enter the task in todo.txt format (red) and a bottom section where you can configure some of sleek's supported tags etc. (blue)

image

When you make a change to something in the bottom half (blue), such as updating the priority or setting the due date the main input (red) gets updated. For example, setting the priority dropdown to "A" will prepend "(A) " to the main field or replace /^\([A-Z]\)\s/ with "(A) "

However, updating the main field (red), such as typing "(A) " or "due:next friday" does not update the input fields in the bottom half (blue)

image

It would be neat if the top and bottom half stayed in sync, in other word writing "(A) " in the main input would update the priority field in the bottom half, or writing "due:2023-12-31" would update the due date input in the bottom half. It would be especially helpful (but tricky) with the "Friendly/Speaking date names", I could write "due:next friday" and the input field in the bottom half would get updated with the YYYY-MM-DD representation of that showing me what date that actually is

Use Case: This is mostly a cosmetic thing, but would also make it less confusing in some scenarios. For example if you had selected a due date in the bottom half (blue) but then manually removed it from the main input (red) the due date input field will still show the due date you set making the user unsure if it will still be (re-)added when they save the task or not.

Similarly if you set the priority in the bottom half (blue) to "A" then edit it to "(B) " in the main input field it's unclear what takes precedent at first glance

Implementation Details: This is a little bit extra tricky with dates due to "Friendly/Speaking date names" because of the spaces that aren't normally allowed in tags

Additional Context:

ransome1 commented 8 months ago

@swantzter although just a small feature, it let to quite some refactoring, which I think has a positive effect. Are you currently available for testing this feature?

swantzter commented 8 months ago

@ransome1 I'll try to remember to look at it when I'm on a computer next - which might not be until Jan 8

ransome1 commented 8 months ago

@swantzter sure, no problem.

Can be tested with the latest pre-release: https://github.com/ransome1/sleek/releases/tag/v2.0.4-rc.4

swantzter commented 8 months ago

@ransome1 This seems to be working pretty well in both directions. Only thing that isn't working entirely as expected is the interaction with "Friendly/Speaking date names"

If you input (A) test due:in two days into the text field the due date select field below does automatically update. But if you then change the date in the select field below the input field will read something like (A) test due:2023-12-28 two days instead of the expected (A) test due:2023-12-28

ransome1 commented 8 months ago

@swantzter yep that's correct and it will take a significant more of work to fix this. But it should not be handled in this feature request. Since you already filed a respective bug report, we will finish it over there I'd suggest.