MisterJames / CollidR

An open source project leveraging SignalR to make real time forms easy.
Apache License 2.0
22 stars 5 forks source link

Add a "Shadow user" Feature #39

Open MisterJames opened 11 years ago

MisterJames commented 11 years ago

When user "A" starts editing a record, give the option to other users to shadow changes for user "A".

Example: 1) User "A" joins. 2) User "B" joins. 3) User "B" edits the text field. 4) User "A" sees message in alerts area, prompting to shadow user "B". 5) User "A" chooses to shadow, all user "B" edits are sent through the hub to other users

dpaquette commented 11 years ago

Was thinking about this, and I'm not sure if this is what you were thinking: http://jsfiddle.net/8SkE6/1/ (chrome only)

If so, I think it could work. Just need a way to send the values through the hub, which should be fairly easy I think.

MisterJames commented 11 years ago

I'm having some trouble figuring out which way to go here. I like this, but it may not work if someone has a specific layout or other design constraint.

I was thinking about just replacing the values, but then what do you do when the other user is typing in the same field as you? I'm wondering if we should just lock the field (or the whole form?) when someone else starts editing? Prompt the viewing users and lock the form?

MisterJames commented 11 years ago

Whatever route we go here, we'll need to push the values out to the other clients, so I'll start there with #40.

MisterJames commented 11 years ago

Okay, #41 includes the change to the modify event that includes the new field value.

If you wanted implement this per your fiddle I think that should be fine - even if down the road we come up with multiple formatter options (passed into the initialization of the CollidR).

MisterJames commented 11 years ago

I created the shadow-user branch for this feature. I'm not doing anything in there, but we can collaborate on that branch to work this stuff out.

dpaquette commented 11 years ago

Okay, I will try to get that part done this weekend.

dpaquette commented 11 years ago

Preliminary results are promising: image

Although this opens up a big can of worms. For example, if I start shadowing someone after they already made a few changes, I will only see changes that happen after I start shadowing them. This means I get an incorrect picture of the other user's form.

dpaquette commented 11 years ago

Changed the wording on the warning and added option to remove the shadow: image

I also changed the behavior of the reload warning behavior as I thought it was a misleading: 1) User A joins 2) User B joins 3) User B edits a field 4) User A was presented the reload warning. This was misleading because User B had not saved the changes yet. User A had no way of reloading to see User B's changes. I changed the behavior so this warning is only displayed when User B saves their changes.

What we could do is show the "Shadow" option for User B as soon as User B makes a change to a field (by default, the icon could be hidden).

dpaquette commented 11 years ago

Some things to consider:

1) If User A is shadowing User B, we could highlight the field that User B is currently editing (instead of showing the tooltip). I think this would be a little less 'invasive' than the tooltip. 2) We may want to create a CollidR.Boostrapper.css file to encapsulate some of the styling. 3) We could highlight fields that have differences 4) We will need to solve #38 or else this approach will be very confusing for the end user. 5) On client side, how do we get the current user name? It seems silly that there is an option to shadow yourself, but I don't see how to tell who the current user is