nextcloud / text

📑 Collaborative document editing using Markdown
GNU Affero General Public License v3.0
528 stars 85 forks source link

Fix/toc without transaction #5893

Open max-nextcloud opened 2 weeks ago

max-nextcloud commented 2 weeks ago

📝 Summary

🚧 TODO

🏁 Checklist

juliushaertl commented 2 weeks ago

Very nice, unfortunately this does not seem to fix the initial update step stent for read only sessions.

juliushaertl commented 2 weeks ago

Also happens without headings for files that have not been opened by a write session before:

Screenshot 2024-06-13 at 07 25 53
juliushaertl commented 2 weeks ago

Additional backend attempt at https://github.com/nextcloud/text/pull/5895

max-nextcloud commented 2 weeks ago

Very nice, unfortunately this does not seem to fix the initial update step stent for read only sessions.

Yes... that's exactly what I wondered this morning - whether the toc transaction was really the cause.

Thanks for coming up with the backend fix. I'll take a look at it.

max-nextcloud commented 2 weeks ago

Since this does not fix the 403s fully, there's no rush to get it into todays RC anymore.

I'll fix the tests and see if it fixes https://github.com/nextcloud/collectives/issues/1114 .

max-nextcloud commented 2 weeks ago

I fixed quite a few of the cypress tests and the failing ones are also failing for me locally.

One major issue remains though. When typing at the beginning of the heading nothing happens. I suspect this is due to the slightly different markup: previously: grafik now: grafik (or without the span when the renderHTML function is left untouched.)

It's fairly hard to bring back the anchor in front of the span inside the heading tag.

max-nextcloud commented 1 week ago

One major issue remains though. When typing at the beginning of the heading nothing happens. I suspect this is due to the slightly different markup:

I figured it out. By default decorations are put behind the cursor in the given position. Adding a { side: -1 } fixed that and now the cursor is between the anchor and the first letter of the heading and typing works just fine.