cryptee / web-client

Cryptee's web client source code for all platforms.
https://crypt.ee
Other
444 stars 22 forks source link

[Feature Request] Insert newline in table cell #128

Closed Parasrah closed 3 years ago

Parasrah commented 3 years ago

Is your feature request related to a problem? Please describe.

I often use tables in my notes for d&d for character summaries, which basically ends up being key-value pairs. In some cases I'd like to add multiple values to the same key, such as multiple notes about appearance, but there doesn't seem to be any way that I could determine to add a newline in a table cell.

Describe the solution you'd like

Would be nice if one could use to insert a newline instead of jumping to the next cell / jumping out of the table

Additional context

This would just be a nice to have, if it would complicate or take away from how tables currently work I'd rather keep the current implementation. Also keep up the good work, I love cryptee, and find myself coming up with excuses to write just to use it.

johnozbay commented 3 years ago

Hi there,

Thanks a lot for filing this!

This is on our list of things to-do, however it will take us a while to make this happen. Basically, the way tables work on the web, are quite inefficient if you want to also make the tables editable / copy paste-able / selectable / row-deletable / column-deletable etc.

This gets even more complicated when you start adding in factors like what happens if you copy paste a table from Cryptee into other apps, or export Cryptee tables to markdown etc. (or vice versa, paste from another app to Cryptee etc etc)

So we have our own implementation, which essentially works like a looooong bullet-list, but one that is spread across columns and rows logically. This simplifies the editor logic by a factor of 1000x, and removes complexity greatly.

But this also means, each new line acts sort of like a new item in a bullet list. (for the lack of a better term, I'm overly simplifying this description right now) So basically, a new line in our tables = new cell in tables right now.

In order to make this happen, we'll need to build not only an entirely new tables-implementation, but one that can as-easily scale to thousands of columns/rows etc. So it's going to take us some time.

We've considered using things like special unicode characters etc for 'table cells', and reserving new-lines for new lines, but this sacrifices imports / pastes etc, (and vice versa, using special characters for new lines, but this sacrifices exports / copy-operations etc)

So if you have any ideas on how we can do this without impacting the way our tables work right now – we'd be very open to trying things out.

But in the interest of setting the right expectations here, I'll have to say it may take us a long while to bring this feature to life. The amount of testing involved alone can be blinding. We had to test every permutation / combination of all editor features with tables while building it. (i.e. what happens if you have a bullet list in a table? now what happens if there's a bold text that's also half-italic, half-underlined, and the rest of the rest is H1, and there's a divider afterwards - would copy paste / import / export work all as expected or break the tables etc etc)

Hoping this makes sense! Best, J

Parasrah commented 3 years ago

That makes total sense, thank you for the detailed description! I'm personally happy that you are being so thoughtful about adding features, I wouldn't want to see the current functionality impacted as it is quite clean!