-
Notifications
You must be signed in to change notification settings - Fork 254
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
Comments
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. |
can you make a request to his friend if it is going to happen. I mean to ask permission |
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. |
ok, that may work |
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. |
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! |
I'm going to merge issue 1396 into this one. |
@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
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? |
@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 :
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. |
Shared undo but specific to the document is the way to go imho. (I think that's the way it is today?) |
@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. |
Perhaps this can be a global setting that will defer to the host's settings? |
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). |
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. |
@daytonellwanger I think that at least having a setting for whether to control the global or local stack would be very useful. |
Personally, I haven't had the need for a shared undo. |
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). |
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. |
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. |
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. |
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. |
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! |
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. |
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). |
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! |
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)! |
Any updates on this? Constantly run into this. |
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. |
Bump, hoping this gets addressed in this milestone |
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. |
Hahaha! At least it's been entertaining to watch the complaints pile up here over the years. Everything's broken and no one cares. 🤷♂️ |
Come one Microsoft FIX IT PLS no issue is more important than this one |
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. |
Judging from the comments in #1396 as well as @jasongin 's comment above
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. |
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? |
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. |
Strong bump. |
Bump, still having trouble with this. Are there any other alternatives that allieviates this problem? |
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. |
(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). 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. |
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? |
@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. |
Hello, has this ever been fixed? |
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. |
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. |
+1 on the separate keyboard shortcuts, it's preventing me from wanting to use Live Share. |
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:
The text was updated successfully, but these errors were encountered: