TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.04k stars 1.19k forks source link

[IDEA] There should be a possibility to sync the whole TW state to other clients connected. #5857

Open pmario opened 3 years ago

pmario commented 3 years ago

Let's assume ServerSentEvents are active.

For demonstration purposes it would be nice to have a button, that can toggle a "Broadcast" mode. This will allow a "presentor" to demonstrate the wiki functions, without the need of a video-conferencing tool.

IMO this will be much more bandwidth efficient. ...

If SSE is active, there should be 2 new buttons:

The goal should be that the full state of the presentors wiki will be synced to all "viewers" which are connected.

joshuafontany commented 3 years ago

I have been experimenting with a "live multiplayer" feature with a branch of the Bob server. I think we have previously been considering the StoryList related server-client relationship incorrectly.

I think the primary StoryList, i.e. $:/StoryList should be the SHARED viewport on the wiki. All "Writers" should be able to update that shared list, while "Readers" lists are not pushed to the server. Then, the Logged-In Users (could be readers or writers, or even (anon) users) can have their own $:/StoryList/{{$:/status/LoggedInUsername}} story-list.

We should then have UI to switch views, and/or remember the active view for authenticated users.

That's the approach I am going for once I have the syncing websocket logic layer done.

pmario commented 3 years ago

I want to sync the whole wiki state. So if I type in the search input all viewers will see the search-temp tiddler and the popup. If I select an element with cursor down, viewers will see that. If I select a tab in the right sidebar, users will see that ...

joshuafontany commented 3 years ago

That should be possible by changing the SyncFilter config... the problem you run into with the stock TW server is that sync polling takes time. I am having a lot of success this week with the real-time "multiplayer" feature in my Bob2.0 experiment & it's really neat:

https://drive.google.com/file/d/14l1OHpT8bfOwY_U92eiM_Vs530ZcZzSn/view?usp=sharing

pmario commented 3 years ago

That should be possible by changing the SyncFilter config... the problem you run into with the stock TW server is that sync polling takes time.

I did test SSE and it worked well enough. ... The only problem I did find, was that it needs to be possible to send a "Draft of" tiddler back to bottom line, without closing or saving it, if someone else opened it. ... But that's just a bit of UI improvements.

joshuafontany commented 3 years ago

@pmario I also noticed that little UI bug. The Close Draft button should not delete the draft tiddler.

dubiouscript commented 3 years ago

sync the whole TW state to other clients connected.

reminded me of https://github.com/Jermolene/TiddlyWiki5/issues/436#issuecomment-501797600 - Local revision history support

because ...i guess tracking state precludes doing any thing else with it