saqimtiaz / streams

TiddlyWiki plugin for rapid data entry with a keyboard driven workflow. Divide content into smaller tiddlers as you write.
BSD 3-Clause "New" or "Revised" License
58 stars 6 forks source link

Codemirror editor and streams #11

Closed arunnbabu81 closed 3 years ago

arunnbabu81 commented 3 years ago

I would like to know whether codemirror editor can be used for editing streams tiddlers. Only when a node is opened as a seperate tiddler, codemirror editor was working. Not when I tried to edit the node within the streams tree itself.

MeneDev commented 3 years ago

I once had a working prototype for RapidTiddler, but it stopped working with newer versions of streams

https://groups.google.com/forum/embed/#!topic/tiddlywiki/wvjYv36S2YU

arunnbabu81 notifications@github.com schrieb am Mi. 30. Dez. 2020 um 23:45:

I would like to know whether codemirror editor can be used for editing streams tiddlers. Only when a node is opened as a seperate tiddler, codemirror editor was working. Not when I tried to edit the node within the streams tree itself.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/saqimtiaz/streams/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJGCW72IAUSPU5MHMOH5XTSXOURPANCNFSM4VOZJJUA .

saqimtiaz commented 3 years ago

Streams needs to extend the default editor to be able to allow some of the features users have requested, such as splitting a text at the caret when saving a node. Therefore trying to use an alternative editor would likely be problematic.

There are fairly significant updates to Streams coming in the next couple of weeks which may also help some what in this regard. I can take a look at CodeMirror integration after that but I cannot promise that this will be implemented. It will depend on how easily extensible CodeMirror is to do what is needed, which is getting the caret position in the text, the selection if any and also allowing to specify the caret start position when the editor is first rendered.

arunnbabu81 commented 3 years ago

Thanks Saq. Take your time for looking into this matter.

MeneDev, I had checked RapidTiddler before posting here. The concept looks interesting, but was buggy. May be because i am using the latest version of streams. Hope you can correct the bugs after the new streams update which may come out of beta soon. Best wishes.

MeneDev commented 3 years ago

Yes, RapidTiddler is just a POC at the moment, my plan is to look into it again once streams' interface becomes more stable

arunnbabu81 notifications@github.com schrieb am Do. 31. Dez. 2020 um 09:43:

Thanks Saq. Take your time for looking into this matter.

MeneDev, I had checked RapidTiddler before posting here. The concept looks interesting, but was buggy. May be because i am using the latest version of streams. Hope you can correct the bugs after the new streams update which may come out of beta soon. Best wishes.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/saqimtiaz/streams/issues/11#issuecomment-752891404, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJGCW5LF5PK46364COUIKLSXQ2TRANCNFSM4VOZJJUA .

saqimtiaz commented 3 years ago

There is an attempt at CodeMirror integration in the updated preview for Streams 0.2: https://saqimtiaz.github.io/sq-tw/temp/streams-0.2-preview.html

When the CodeMirror plugin is installed, you can choose the editor in the Streams settings. Testing and feedback is needed to make sure this works as expected, both using codemirror as the editor and using the default editor.

The areas most likely to be affected are:

saqimtiaz commented 3 years ago

@MeneDev the requirements for a new editor to work with Streams are:

If the CodeMirror integration works as expected, your RapidTiddler should be able to make use of it as long as it doesn't change anything related to the two above requirements.

arunnbabu81 commented 3 years ago

@saqimtiaz Thanks for the CodeMirror integration with Streams. i was asking for this because, l use streams for making nodes with multiline contents also. In such cases, i liked Codemirror editor's UI better than the default editor (i use codemirror plus by adithya). I have started used Codemirror recently only. So far i am liking it. In case you dont plan to implement Codemirror in main streams plug in, please give it as an supplemental plug in so that users who need it can use it.

I tried the new streams beta in my personal wiki in my windows laptop and iphone 7 with Codemirror editor selected. It worked fine except that in iphone 7 I had to long press in the editor area for the keyboard to appear. Splitting a node by hitting Enter with the text cursor/caret in the middle of some text, hitting Enter with the cursor at the beginning of some text and hitting backspace with the cursor at the beginning of a text - all worked fine in laptop and in iphone.

When i was comparing the default editor and CodeMirror editor, i found some something strange. With "exit editing on saving an empty node" not selected and default editor is selected instead of codemirror editor, suppose i create 3 to 4 empty nodes at the end of a streams tiddler, i was unable to delete the empty nodes except for the last empty node. I found this behaviour in the old versions of streams also. I noticed this only in my iphone. Not in my windows laptop or in the android phone which i used to test this. This was also not seen when CodeMirror editor was selected.

saqimtiaz commented 3 years ago

I'm not really convinced as to the value that using CodeMirror in Streams brings.

I suspect codemirror is an attractive editor for the normal tiddler interface due to things like indenting and support for the tab key, as well as Vim keyboard shortcuts, all of which will clash with Streams.

As for iOS specific issues, moving forwards I think my policy for iOS is going to be that if certain features don't work then so be it, and I'll only debug issues that make the plugin entirely unusable. iOS is far too limited and restricted a platform for me to dedicate the time and effort to, especially considering that I do consider Streams and in fact TiddlyWiki to be of limited utility on mobile.

arunnbabu81 commented 3 years ago

In streams also, I liked the better color coding given by CodeMirror plus plug in by adithya. This is useful when i am writing multiline contents within a single node especially if i use formatting . Since i haven't used the entire keyboard shortcuts of CodeMirror, i am not aware of all the clashes with streams. However because the keyboard shortcuts of streams are customizable, i guess clashes could be avoided. I am not sure though.

If you think it wont work out, don't implement it in the main streams plug in. Consider whether it could be given as add on. In the mean time, I will use this beta more in my TW and report if its useable without clashes.

Another thing which i forgot to mention in the above post - if i unselect "Double click in editor to exit editing", it is working only when default editor is used. When CodeMirror editor is selected, i was still able to double click in editor to exit editing. I am ok with it if that behavior is not modifiable.

Regarding the iOS related issues, it not a big thing actually. I just reported it to you since it was not seen in other systems.

An iOS related bug which i had reported in reddit is not seen with the beta released today. when editing the Child node 1, the margins of the Child node 1 which is in edit mode is partly overlapping the subnode 1

arunnbabu81 commented 3 years ago

These are my suggestions after using streams beta with codemirror for a few days

  1. In the documentation you may suggest to those people who use codemirror editor and editor autolist plug in along with streams to change the conflicting keyboard shortcuts. I think such conflicts can be overcomed since everything is customizable.
  2. Codemirror editor add much value when I am dealing with multi line content in child nodes because of keyboard shortcuts. This holds true in desktops and laptops.
  3. I think codemirror should be disabled in mobile by default since selecting text doesn’t work when codemirror editor is active in mobile. Also because codemirror shortcuts won’t work in mobile. I came across a code by buggyj for automatic disabling of codemirror in mobile. But this doesn’t disable codemirror editor in streams nodes in the mobile mode. Can that code be modified to disable codemirror in mobile for nodes in the streams tree also.
  4. When the wiki is opened in mobile and the code mirror editor is selected, currently there is no option to disable double click to exit editing. But since I recommend not using codemirror in mobile, it doesn’t matter. But in desktop or laptop it would be a greater addition if the option to double click to exit editing is given while using codemirror editor also.
  5. For a node with long mutli line text content, when codemirror is selected as editor and we double click to edit the node, the focus of the node in edit mode will shift to the end of that node with caret position also at end of node. But if the default editor is selected, focus of the node in edit mode will remain at the top of the node with the caret position still at the end of the node. I am not saying that I routinely use such long multi line text in a single node of streams tree, but sometimes when I am preparing notes I will first paste the relevant text into a single node before splitting it into separate nodes. This behavior while using codemirror editor is not a big problem bcos I can just use keyboard shortcut to return to the top.
arunnbabu81 commented 3 years ago

I was wrong about the point number 4. When codemirror editor is active in streams in mobile, double click to exit editing is not enabled by default or is not working. But since text selection won’t work in codemirror editor in mobile, it’s better to let codemirror editor be disabled by default in mobile.

But in desktop or laptop with codemirror editor active for streams, double click to exit editing functions even if its disabled in the streams setting. I am not much bothered about this because if someone is using codemirror, there is always a keyboard shortcut to select text easily. So I won’t complain if it’s difficult to disable double click to exit editing when using codemirror editor in desktop or laptop.

saqimtiaz commented 3 years ago

Closing this as Streams 0.21 has experimental support for CodeMirror.