markor icon indicating copy to clipboard operation
markor copied to clipboard

Create launcher widget for todo/textediting, closes #1997

Open wshoy opened this issue 1 year ago • 11 comments

Introduces a Todo widget.

Todo:

  • [x] widget color scheme
  • [x] place cursor on the clicked line
  • [x] add widget preview image
screenshot

wshoy avatar Jul 30 '24 18:07 wshoy

Thanks, let me know when you want a check

as you mentioned "widget color scheme settings": please don't make separate colors for that. You can use the same foreground (text) and background color like at the normal editor ("" basic color scheme""). There are getters for that in AppSettings.java

gsantner avatar Jul 30 '24 18:07 gsantner

Suggestion: reuse our existing widget but replace the provider with one which supplies lines from a todo.txt file.

You'll get 70% of the widget for free with good code reuse.

harshad1 avatar Jul 31 '24 04:07 harshad1

In these commits:

  • used the editor color scheme
  • used Document and TodoTxtTask classes
  • parse the task text (removed patterns such as creation dates (allows the widgets to be smaller))
  • made a temporary workaround for placing the cursor on the clicked line

Suggestion: reuse our existing widget but replace the provider with one which supplies lines from a todo.txt file.

Which parts can be reused?

wshoy avatar Aug 01 '24 11:08 wshoy

Which parts can be reused?

Our current widget displays a list of files. Clicking on a file opens it.

What you want is a list of todo text lines where clicking on a line opens the todo file at the appropriate line.

We can achieve this by:

  1. Changing the provider to provide lines
  2. Changing the intent to open the file at the correct line

For 2 we just need to add an EXTRA_FILE with the file and EXTRA_FILE_LINE_NUMBER with the correct line number to each intent.

Both can be done by creating a new factory and reusing the rest of the widget. You will need to modify the other parts of the widget to use the correct factory though.

I may be missing something here, but I don't think so

harshad1 avatar Aug 01 '24 16:08 harshad1

@wshoy What do you think about that, possibly also in a later PR?:
To show a file selection dialog when making the widget, to select the file to create the widget for.
In AppSettings we can store what files are currently widget-used (to trigger the widget update)

At the end the most important part is that users don't lose data..so the file management part. Years of changes of Markor told..it's very difficult to get that somewhat 99% reliable working for most users.

I fear that another compound of the big calculations is then widgets and their currently loaded content. Hope it not makes too much issues.

gsantner avatar Aug 01 '24 20:08 gsantner

To show a file selection dialog when making the widget

It is a good idea. If that happens, I think, that the ToDo functionality should be prioritized in some way (maybe making it the default file or making a separate ToDo widget). I assume, that the widget would be mostly used for the ToDo file, so it should be made easy for the user to do that.

wshoy avatar Aug 01 '24 22:08 wshoy

I assume that there is a split interest of todo vs notes/normal text editing. (so basically resembling why ToDo + QuickNote have their prominent separated existance)

Just to note again - feel free to make in the PR what you have time and interest on. I can only tell what I personally think is a good way. At the end most important need is that the file handling does not spread havoc and users lose recent modifications 😄

gsantner avatar Aug 01 '24 23:08 gsantner

Is the WIP marking still the case?

gsantner avatar Aug 18 '24 21:08 gsantner

I want to track down the issues you mentioned about virtual folders not being updated and see if there are any related issues with this approach.

harshad1 avatar Aug 18 '24 22:08 harshad1

Aside from that this is done

harshad1 avatar Aug 18 '24 22:08 harshad1

Is the WIP marking still the case?

It's finished.

wshoy avatar Aug 18 '24 23:08 wshoy

has conflicts now unfortunatley

gsantner avatar Sep 16 '24 21:09 gsantner

Thanks you, I merged the widget! 😄

Also tried it: Seems currently limited to just displaying ToDo, and that readonly.

I think editing is not a all too good idea, but selecting the file for each widget would make sense.

gsantner avatar Sep 24 '24 22:09 gsantner

Awesome to see this merged! Just curious, when will this be added to a release?

ssebs avatar Sep 25 '24 00:09 ssebs

Whenever the next release will be.

gsantner avatar Sep 25 '24 01:09 gsantner

If I may be permitted an off-topic message, thank you so much for working on this feature! It'll be really helpful. I really appreciate the work everyone does!

enterprisey avatar Oct 13 '24 23:10 enterprisey