creecros / MarkdownPlus

Improved Markdown, with check boxes, emoji shortcode, inline html, etc...
MIT License
50 stars 15 forks source link

Checkbox marker doesnt save it's state #15

Open Zacc806 opened 1 year ago

Zacc806 commented 1 year ago

When I check the box it doesnt save it's state. Is there something specific to configure? i dont have any other plugins installed.

Chaosmeister commented 1 year ago

do you use url rewrite? maybe it doesn't work with that

Zacc806 commented 1 year ago

is it turned on by default, i'm not using any other plugin, i haven't changed any parameters

Zacc806 commented 1 year ago

do you use url rewrite? maybe it doesn't work with that

I did turn off the url rewrite, It didn't help my case

Chaosmeister commented 1 year ago

interesting
do you see any kind of errormessage in your browsers console?

Zacc806 commented 1 year ago

Btw thanks for answering, this is the only message i got: DevTools failed to load source map: Could not load content for http://localhost:8084/plugins/MarkdownPlus/Assets/js/dist/jquery.textcomplete.min.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

bsats commented 1 year ago

I've got exactly the same problem

Tagirijus commented 11 months ago

On my end the checkbox state also does not get saved. Test-wise I even disabled all other plugins and I had only this plugin here enabled.

I did not even know that your plugin is supposed to save the state. I even wanted to code my own plugin doing so; but I am glad that it seems to be implemented in your plugin already. If only it would work, hehe. Maybe I will be able to find the issue.

Edit: oh and I get no error messages at all. Neither in the Kanboard dev log, nor the JS console. And I am using Kanboard v1.2.32

Chaosmeister commented 11 months ago

I need to find a way to enable the url rewriting on my testinstance so I can debug it
didn't have time to figure that out, yet

Tagirijus commented 11 months ago

So ... I am rather new to doing such pull request manually, haha. At least I got some kind of fix with a fork of your repo here ... :sweat_smile:

Edit: Ok, I guess I managed to start a pull request. Now it's up to you, I guess. :v:

creecros commented 11 months ago

good to make a new release @Chaosmeister ?

Chaosmeister commented 11 months ago

@Tagirijus

are you able to test it on your side with the current main branch?

If this goes well, I'd say we can release a new version

Tagirijus commented 11 months ago

It seems to work on my end. Only flaw (with my monkey patch it is the same flaw) is that it seems that I first have to switch to e.g. the board and back to the task to be able to switch the checkbox and it saves the state, if I created this commented on the bottom comment box, instead of the modal comment box you can bring up with c. Very weird.

Tagirijus commented 11 months ago

I noticed another issue, which is maybe somehow related to this ... in a way. In either way I did not want to start a new thread for this:

When I change the sorting order of the comments, it seems like the checkbox-state-change method cannot catch up. Besides that I have to refresh and switch pages before the state-checking takes effect (which makes it hard to test really .. so overall it feels quite a tiny bit buggy anyway), the state-checking seem to affect totally different checkboxes with an inverted comment order.

To be honest, I did not quite dig that much into the code, but I guess that the checking will work with numbering the checkboxes on the DOM, right? Maybe the checkbox needs something like a data- value with the comments id or so ... so that the backend method will be able to change the checkboxs state (it just changes the markdown and counts which nth "[ ]"/"[x]" to toggle, I guess).

Chaosmeister commented 11 months ago

aye! I can reproduce that on my side.

I've never used the inverter for the comments. Actually I didn't even know that was available...

like you already found out, the checkboxes are numbered (on the serverside with the next release) from top to bottom. Instead of adding a comment ID, I'll check the sorting and adjust the algorithm accordingly.

Thanks for the report.

you should actually start a new one for each bug you find. we'll crosslink them if necessary.

Tagirijus commented 11 months ago

Thanks for checking and the fast reply. Also thanks for fixing!

I will open a new issue for this and link this issue here. 👍

Chaosmeister commented 11 months ago

It seems to work on my end. Only flaw (with my monkey patch it is the same flaw) is that it seems that I first have to switch to e.g. the board and back to the task to be able to switch the checkbox and it saves the state, if I created this commented on the bottom comment box, instead of the modal comment box you can bring up with c. Very weird.

I don't really understand this one though. as soon as I hit save I can use the checkbox as intended

Chaosmeister commented 11 months ago

Thanks for checking and the fast reply. Also thanks for fixing!

I will open a new issue for this and link this issue here. 👍

not necessary, I already fixed it 😄

Tagirijus commented 11 months ago

not necessary, I already fixed it 😄

Oopsie, you are fast, I am not. :D Thanks!

Tagirijus commented 11 months ago

I don't really understand this one though. as soon as I hit save I can use the checkbox as intended

Sorry for being slow right now - typing on my mobile the whole time, urgs. Regarding this issue: if I save a comment and toggle a checkbox and then refresh (or revisit the task), the toggled state will not be saved. I somehow have to refresh multiple times or so. I also do not get any console infos. /-: ... I have to dig deeper to see how I can reproduce it, or what exactly makes it work suddenly ...

Chaosmeister commented 11 months ago

that is very weird behaviour

I can't imagine anything that may cause this.

Please notify me if you can reproduce it somehow.

Chaosmeister commented 10 months ago

I just release a new version, where the original issue should be fixed.

@Zacc806 please verify, once https://github.com/kanboard/website/pull/490 is pulled

Tagirijus commented 10 months ago

Seems to work for me now! At least I can create a new task, use the checkbox in the description and it saves the state, without the need to refresh multiple times now. Same in comments. This was odd before, but seems totally like expected to me now.

Thank you so much! (=

Chaosmeister commented 10 months ago

Awesome! Thanks for the info!