nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
616 stars 134 forks source link

"auto"-completion of text #843

Open newhinton opened 2 years ago

newhinton commented 2 years ago

I would like to propose a new feature for the markdown editor (that i am willing to implement)

When a user types any type of bracket, usually the user wants to also complete the opposite bracket. So if the user types an opening bracket, notes could insert the closing bracket after the cursor. Many IDE's have similar features.

Caveats: old-school smileys would require the user to remove the wrong closing bracket, but with a simple rule system we could limit such false positives.

Is that something we want for the notes-app? Are there other issues with that? Could we auto-apply suggestions for other elements too?

newhinton commented 2 years ago

This could also be expanded to provide suggestions. eg:

! []() The exclamationmark was typed by the user, and we suggest the codeblock. if the user confirms with an enter, we insert the text, and on any other input we discard it. Suggestions should be a different color, and not count to the history of actions

newhinton commented 2 years ago

For posteriority i found this:

https://stackoverflow.com/questions/22549505/make-css-tooltip-follow-cursor

This may help me implement something appropriate.

korelstar commented 2 years ago

I'm still unsure about this feature. There are always situations, where automatic insertions or suggestions are false positives and these can be very annoying. Therefore, personally, I tend to don't want to have such a feature. But I'm interesting in other opinions, too.

newhinton commented 2 years ago

We dont nessessarily need to "type" anything. But we could provide suggestions (that are 'ghost'-added to the editor) which then can be inserted with enter, just like IDE's do with code.

I dont think false positives are that much of a deal, but i can see where this feature may be against this app beeing 'Distraction-free' with such suggestions.

stefan-niedermann commented 2 years ago

I guess one would need to define the use cases before deciding whether to implement or not such a feature. Much "boilerplate" might be such uses cases - namely images and links. What else use cases do you have in mind? emojis should be handeled in the long term separately, so all we can save are 2-3 characters maybe, right?