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

Limited date navigation and editing commands #54

Closed
LanHikari22 opened this issue Apr 13, 2023 · 4 comments
Closed

Limited date navigation and editing commands #54

LanHikari22 opened this issue Apr 13, 2023 · 4 comments

Comments

@LanHikari22
Copy link

Currently, you need to switch to Month view to be able to use the "g" go to certain day keybinding. And then, you are limited to go back to only a day within that month. Say I want to switch to a much later date to book an event, I have to scroll all the way to it.

I suggest the following:

  • This keybinding should work in day mode and should not require changing views.
  • It is okay to autofill the year and month, but allow the entire date to be editable for the use case of navigating to another month or year.
  • When moving events, the same problem with the non-editable month and year persists. It should be possible to move an event to another month and year.
  • Optionally, people may prefer to use their own custom date format. Some may do yyyy/mm/dd, some dd/mm/yyyy, etc. This could maybe be configurable like the date command: $(date +%d/%m/%Y). Things to watch for is that the date does need to specify year month and day and be syntactically correct, so that may need to be logged as error for the user. Another thing to consider is that with a custom date format (not %Y/%m/%d) you won't be able to fill in most of the details as nicely as you do now. One possibility is to just fit in the current day in the user format, and then just let them modify that date as it fits them. If the format is the default, you can keep the autofilling.

I could also implement that last suggested feature and open a PR if you would like.

Thank you for all the help!

@anufrievroman
Copy link
Owner

anufrievroman commented Apr 14, 2023

Thank you for the suggestions! Let's see:

This keybinding should work in day mode and should not require changing views.

Ah, I didn't realize it doesn't work in day view, I'll fix that.

It is okay to autofill the year and month, but allow the entire date to be editable for the use case of navigating to another month or year.

I agree, but this is a long-standing general problem with this app, that standard curses library in python doesn't provide good input filed, it cannot prefill, move cursor without removing characters, and other problems. I'd like to improve it, but I couldn't see an easy way to do that without switching to a completely different lib to create TUI interface. Now there are many good ones actually, but it would mean rewriting a lot of code (for a small feature).

When moving events, the same problem with the non-editable month and year persists. It should be possible to move an event to another month and year.

Yes, that's true. I guess to fix that, I could just create a free filed, but user would have to write the entire YYYY/MM/DD. It would be ideal to have a prefilled field, but again, I am not sure how to implement that.

Optionally, people may prefer to use their own custom date format. Some may do yyyy/mm/dd, some dd/mm/yyyy, etc. This could maybe be configurable like the date command: $(date +%d/%m/%Y). Things to watch for is that the date does need to specify year month and day and be syntactically correct, so that may need to be logged as error for the user. Another thing to consider is that with a custom date format (not %Y/%m/%d) you won't be able to fill in most of the details as nicely as you do now. One possibility is to just fit in the current day in the user format, and then just let them modify that date as it fits them. If the format is the default, you can keep the autofilling.

Well, I agree that it would be nice to have a custom format. But again it all boils down to the issue above, i.e. if it would be possible to have a prefilled editable field, then we can try to improve this aspect, but for now I don't see a clear way to do that. I wonder if I can keep curses library to draw the screen like I do now, but use another nicer library to create user dialogues. Any ideas?

@LanHikari22
Copy link
Author

Hmm. I will have to look into the source to see if I can find some workaround for that curses limitation, but is it possible to just add an option to toggle autofilling? That way I would be able to go to any date and not be limited to the current month.

@anufrievroman
Copy link
Owner

Well, so in the commit df1cdc9 I reworked the date change system, now it works like that:

g and m go the date and move events in free format YYYY/MM/DD
G and M do the same with year and month prefilled

This is the best solution I could find without big rewrites. This change appears in version 2.9. Let me know if that seems okay :)

@anufrievroman
Copy link
Owner

So, I'll consider this issue resolved for now. As for the custom date format, I don't see an easy way to implement it, so maybe I'll keep it as it is for now. If you have any further suggestions, feel free to open new issues. Thanks again for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants