Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can undo changes made by others #1439

Open
JosefForkman opened this issue Dec 17, 2018 · 75 comments
Open

Can undo changes made by others #1439

JosefForkman opened this issue Dec 17, 2018 · 75 comments

Comments

@JosefForkman
Copy link

I think it's not right that you can regret the last thing you've done, even if it was the friend who had done it. can it be fixed or is it a function

Product and Version VSCode
OS Version Windows
Live Share Extension Version: latest
Target Platform or Language PHP

Steps to Reproduce / Scenario:

  1. Write something
  2. ask your friend to push undo
  3. What you just wrote is gone
  4. See error
@jasongin
Copy link
Member

Currently, the undo command will revert the last change in the document made by any participant.

We have experimented with making the undo command revert only the last change that you made in the document. But then we got feedback that many people actually did want to be able to undo others' changes. It's a tricky problem that we still haven't settled on how to handle in a way that meets everyones' expectations.

@jasongin jasongin changed the title can push regret for my friend! Can undo changes made by others Dec 18, 2018
@JosefForkman
Copy link
Author

can you make a request to his friend if it is going to happen. I mean to ask permission

@jasongin
Copy link
Member

I suppose that could be possible, but I think it might get annoying.

In general, we assume the participants in a Live Share session are working together toward a common goal, and that you only let people edit your code if you trust them.

We highly recommend participants also have a voice chat session at the same time, whether that is via the Live Share Audio extension or any other communication tool that you prefer. Voice chat makes it much easier to coordinate the work among multiple people. Then you could easily verbally ask someone before undoing / changing something they just typed.

@JosefForkman
Copy link
Author

ok, that may work

@jasongin
Copy link
Member

I'm going to leave this issue open as a general feature request about improving collaborative undo behavior. Hopefully if others have related questions they can find this issue and give feedback.

@V-ed
Copy link

V-ed commented Jan 2, 2019

I tried Live Share and this issue is one of the first thing we realized was happening - the undo stack is shared.

I personally find value in having my own undo stack as I know what I did and want to act on that - I do also understand how having a shared undo stack could be potentially helpful to some.

Could this be a setting of some sort? I believe there are use cases for both usage, and such setting could alleviate this problem. I'm guessing such setting would take effect on the initial share of the project, but if it's possible to change it on the fly while a sharing session is in progress, this would be even better!

@daytonellwanger
Copy link
Collaborator

I'm going to merge issue 1396 into this one.

@daytonellwanger
Copy link
Collaborator

@V-ed how would you feel about us presenting a dialog when you attempt an undo and the last change was made by a participant aside from yourself? Something to the effect of

The last change was made by another user. What change would you like to undo?
My Last Change (ctrl+z) - Their Change (ctrl+z+g) - Don't ask again

Do you think we should have some indicator to alert you that the last change was made by another participant?

Any other suggestions on how to most intuitively and helpfully surface this behavior?

@V-ed
Copy link

V-ed commented Jan 2, 2019

@daytonellwanger I've read the conversations over in that other issue and indeed liked the idea of having a local and global undo stack that could be assigned to different keybinds.

I don't think a dialog like this would be ideal - it would be quite obtrusive as undos are quite frequent.

The idea I've got (following the linked issue's points) changes up again the default undo behavior, so take it with a grain of salt :

  • By default, undo the local stack of changes.
  • Using another keybind (Ctrl+Z+G as an exemple) can undo the global stack at any time.
  • If the changes made by collaborators intersects with your own set of changes, the undo still follows the keybind used, but if it was a local undo with collaborators edits, it also shows a notification (not a prompt , hoping that VS has notifications like VSCode) that says something similar to what you proposed :
A collaborator also made changes at the undo location. To undo their changes as well, you can use [Ctrl+Z+G].
{Use global undo instead} - {Don't ask again}

My wording isn't ideal (in my notification text example) and there are some flaws in that approach (such as using the global stack only on intersections might not actually undo the change in the intersection), but I'm not too sure how to handle such situation otherwise. This is heavy sided into the perspective of the local undo first and foremost, so I don't really know the best way to please everyone in this scenario. I'll keep thinking about it and bring more feedback here if I find some more ideas!

I'm heavily against dialogs that takes focus away from the project though, notifications are fine.

@lukepighetti
Copy link

lukepighetti commented Feb 19, 2019

Shared undo but specific to the document is the way to go imho. (I think that's the way it is today?)

@daytonellwanger
Copy link
Collaborator

@lukepighetti this is the current behavior in VS Code, but not Visual Studio. Visual Studio implements "local" undo, meaning only your changes are undone (which is significantly more difficult to implement). Based on your comments on 1659 it sounds like you feel that global undo is always the correct behavior? Do you have any thoughts on the hybrid designs proposed in this thread? We're still really not sure about the best way to address this tricky problem.

@lukepighetti
Copy link

Perhaps this can be a global setting that will defer to the host's settings?

@daytonellwanger
Copy link
Collaborator

We're currently refocusing on how to address this issue. It'd be super helpful if you all could provide scenarios where you think you would want/need global undo (that is, undo the last change regardless of who made it, not just your last change).

@lkilcher
Copy link

I can't imagine a scenario where I want shared undo. When I'm using live-mode, I'm not tracking what my partner is doing closely enough to know be able to manage a shared undo. Often we are editing the same file, at different places, and talking about it. Shared undo just creates problems for us in that scenario.

@dudeofawesome
Copy link

dudeofawesome commented May 16, 2019

@daytonellwanger
A few friends and I were using Live Share today to work on some small programming challenges together, where the code is often all in one file, but there are multiple methods that might be divided up among us. We frequently found that we'd try to undo something, but nothing would apparently change, and then another person would get very confused as to why the code they just wrote disappeared.

I think that at least having a setting for whether to control the global or local stack would be very useful.

@Kethet
Copy link

Kethet commented May 16, 2019

Personally, I haven't had the need for a shared undo.
A setting for undo behaviour would be greatly appreciated.

@daytonellwanger
Copy link
Collaborator

Yes, I think we've decided that the default behavior should be that undo undoes your last change. This is what an overwhelming percentage of users would want in an overwhelming amount of scenarios. This is the behavior in VS and we're working on making this the behavior in VS Code (it's technically a difficult problem to solve if there were edits made by other participants after your last edit).

@boardfish
Copy link

Very glad to hear that – I've just picked up the extension and this was the first thing my collaborators and I noticed. Whether there was a case for shared undo history at all is probably pretty questionable, but I'm happy to see this going forward.

@skorokithakis
Copy link

The times where I want global undo is when I'm pairing with a friend and showing them something, but want to take over after they're done typing and undo their change so I can fix it. I agree that local undo is overwhelmingly the desired thing to do, but it would be nice if there were a different hotkey for global undo.

@GeraldNDA
Copy link

Has there been any progress on this?

I think this is the most annoying "feature" for me. It makes co-editing code in the same file very sticky. It'd be nice if there were multiple hotkeys (with the setting to choose the default) or at least a setting to disable this. At least for me, Pressing ctrl+z is a habitual thing if I realize I made a mistake (instead of selecting and deleting it). So if I and someone else are editing at the same time, it's pretty likely that I'll start undoing things that they are writing as they write them.

@artidoro
Copy link

artidoro commented Mar 6, 2020

Undo is a central part of the development process which involves trying and reverting if needed. Having a global undo makes it very difficult for two people to work on separate parts of the same file, which, to me, is an important scenario for using live-share.

@daytonellwanger
Copy link
Collaborator

Thanks all for continuing to share your feedback. This helps greatly in our prioritization.

I think it's safe to say we've reached the agreement that undo should undo your changes by default (and we surface global undo via a separate command/shortcut).

The only reason that's not the behavior today is that it's a very technically challenging thing to implement and we haven't found cycles to tackle it yet. But it's on our radar and we really hope to get to it soon.

Thanks again for all the input on this thread!

@fubaduba
Copy link
Contributor

Thank you for your patience as we think through how best to implement undo stack changes to Live Share. We will be adding this to our next quarter goal to explore and improve.

@fubaduba fubaduba added this to the Jan-Mar 2023 (uncommitted) milestone Oct 26, 2022
@lursyy
Copy link
Contributor

lursyy commented Oct 27, 2022

Taking some inspiration from CodeTogether, how about adding a layer of separation in the form of sub-sessions, aka "rooms": If participants want to edit the same code together (i.e. real pair programming), they can move to the same room. If they want to edit the same file independently but see each other's cursors for occasional support/feedback, they can stay in separate rooms. This all happens within one session.

Besides addressing the undo/redo problem, I believe this could also be applied to other areas (e.g. cursor following).

@ml-lubich
Copy link

ml-lubich commented Nov 28, 2022

Please leave switching to shared undos as an option in the UI (appropriately in the live share panel). I completely understand and respect the need for undoing the changes of others in a pair programming environment. But there are times (probably more times) when we want to only undo our own changes in collaborations.

It seems Google Docs (or anything part of that suite) got collaboration right with having per-user undos available. This is the gold standard and the expected functionality of any collaborative product today.

Please make this the default (and allow users to switch to shared undos just like we expect in other leading products.

Thank you, waiting for the fix!

@icefisher225
Copy link

A friend and I are working on an Advent of Code challenge tonight and are constantly having each others' code disappear. Please implement a toggle (or individual undo only)!

@jordibruin
Copy link

Any updates on this? Constantly run into this.

@SimonAlling
Copy link

While I don't have the slightest doubt that this is indeed technically challenging (and I don't envy whoever has to implement it), it does surprise me somewhat that this has been known to Microsoft to be a serious pain point for at least four years without being prioritized over "other issues with Live Share". This really is the issue that makes it difficult to actually use Live Share.

@daytonellwanger, do you perhaps have any examples of other issues that have been prioritized over this one? Such examples could make it easier for the community to understand why this hasn't been fixed yet.

@alecdotdev
Copy link

Bump, hoping this gets addressed in this milestone

@derekbekoe derekbekoe removed this from the Jan-Mar 2023 (uncommitted) milestone Mar 28, 2023
@mrmachine
Copy link

This bug reduces "live share" sessions to basic "screen share" sessions where only one dev can "drive" and the other takes a back seat to watch and comment.

@lkilcher
Copy link

lkilcher commented Jun 1, 2023

Yes, this is still on the roadmap. The delay is due to prioritizing other reliability issues. We appreciate that this is crucial to making Live Share work well for many developers.

Hahaha! At least it's been entertaining to watch the complaints pile up here over the years.

Everything's broken and no one cares. 🤷‍♂️

@Crackvignoule
Copy link

Come one Microsoft FIX IT PLS no issue is more important than this one

@derekbekoe
Copy link
Collaborator

Hi - Just to provide some clarity and set expectations here, we’re not able to prioritize this issue over the other higher-impact issues we receive every week along with other priorities for the team. However, rest assured that we value your input. We will keep this issue open to ensure we can continue to gather feedback. Thanks.

@lursyy
Copy link
Contributor

lursyy commented Jun 2, 2023

Judging from the comments in #1396 as well as @jasongin 's comment above

We have experimented with making the undo command revert only the last change that you made in the document.

it reads like there was an implementation of this at some point. To me, that contradicts the statement that this is a "very technically challenging thing to implement"?

Like others, this was also an instant deal breaker for our team. I'd appreciate if you could elaborate on what is being prioritized over this issue.
(EDIT: just checked again - this is the second most upvoted issue in this repo currently...)

@mrmachine
Copy link

Not sure how there can be 5 years worth of non-stop higher priority issues for live share than remote pairing on a single file being effectively unusable and inferior to simple screen sharing with voice chat where only a single dev has the keyboard?

@Elakse
Copy link

Elakse commented Jun 14, 2023

I came here looking for a simple solution for what I thought would be a toggle setting... Apparently Microsoft can't solve the most simple issue that people have been complaining about for over 4 years. Global undo should be a thing but I can't use Live Share if I can't undo my changes without deleting my co-workers code.

@shellwhale
Copy link

Strong bump.

@jonardlolz
Copy link

Bump, still having trouble with this. Are there any other alternatives that allieviates this problem?

@atzemis13
Copy link

atzemis13 commented Sep 26, 2023

Really need an option to disable this, makes it impossible to reliably use Undo if two people are working on a file at the same time. Very annoying to have your code unwritten when your partner makes a mistake and hits Undo.

@RomainLaf
Copy link

We all agree that this is a major problem when using this plugin...

Please...hear our cries of despair !

please

@V-ed
Copy link

V-ed commented Oct 5, 2023

(Sorry issue watchers for this very spammy comment)

Please y'all yes this issue is very old and I wish for it to be dealt with (I've been waiting for more than 4 years myself), but the amount of people writing "Any update on this?" are not doing anyone a favor : You are simply spamming everyone interested in getting this closed. Instead, simply vote for this issue using a 👍 on the main issue body, this will show that this issue is popular to get fixed faster (hint: it already is).
image

Please, if you have written any message asking for news on this issue, especially if you can't even type correctly because you've written your message so fast you didn't realize you've made typos, please, I urge you to read this : https://ben.balter.com/2014/11/06/rules-of-communicating-at-github/#5-be-mindful-of-noise (I linked to a specific section, but you might as well read the entire thing).

Thank you. I wish Github could introduce a soft comment lock where you could still be able to vote on the issue / its comments and not being able to comment on it, but ah well, that one's on the platform level.

@lord-ne
Copy link

lord-ne commented Jan 29, 2024

While we wait for Microsoft to fix this, does anyone know of any workarounds? A fork of the extension that supports local undos? A separate extension that tracks your changes and provides a separate hotkey for undoing specifically your changes? Anything?

@shakefu
Copy link

shakefu commented Mar 5, 2024

@microsoftopensource This keeps losing us work when the Undo ordering is not clear from simultaneous changes... please please please fix it! It makes LiveShare unusable to not be able to Undo and know what is going to get reverted.

@rhylkiio
Copy link

Hello, has this ever been fixed?

@atilag
Copy link

atilag commented Sep 19, 2024

I'm just here to encourage this change to happen. Undoing other's is being one of the major pains to adopting pair-programming. I guess by making it optional would solve everyone's concern.
Implement this, please.

@Splizard
Copy link

For reference, there are other open source editors such as Zed that have implemented this. I no longer use VS Code for this reason.

@shakefu
Copy link

shakefu commented Oct 9, 2024

For reference, there are other open source editors such as Zed that have implemented this. I no longer use VS Code for this reason.

Yeah I've had to explore other editors as well because this makes pairing with Live Share basically unuseable.

@devintyler
Copy link

+1 on the separate keyboard shortcuts, it's preventing me from wanting to use Live Share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests