I am editing a question and would like to preview my changes prior to saving. I can see how the page will look and can optionally hide this preview.

However, I would like to see the actual changes that I made; that is, the diff with the red struck out parts and the green newly inserted parts (as is shown when you are comparing versions). A side-by-side and side-by-side markdown preview would be helpful too.

To make sure the basic usage doesn't change, we could by default list a normal preview, like it is now. There could be buttons to change to inline differences, side-by-side differences and side-by-side markdown differences. This could look the same as it does when looking at revisions.

This would make it easier to see the changes, hence preventing an additional edit step. This also helps you write the edit summary, so that you don't forget to mention an important change you made.

I'm not sure what you mean; what are you looking for that the preview right below the edit box doesn't provide?
–
Michael MrozekMar 18 '12 at 20:24

4

I would like to see the diff - with green and red that I can see after I saved the edit
–
falseMar 18 '12 at 20:26

3

@false: Can you provide the reason you feel this is important? The diff is not what matters, the final outcome is all that does. What do you mean by "to prevent an additional edit step"?
–
Wesley MurchMar 18 '12 at 20:30

10

Ah, I guess that could be useful, to see if you've accidentally deleted something and forgotten about it
–
Michael MrozekMar 18 '12 at 20:32

4

@Madmartigan: If edits are a little bit larger though trivial (like name formatting that otherwise would make the text less readable), this feature would be very useful.
–
falseMar 18 '12 at 20:37

@Camil As you deleted a duplicate question. I suggest you that instead of deleting, you should vote/flag it to close. So that feature users may get link of this question from your question. :)
–
hims056Apr 2 '13 at 7:03

1

@Camil I agree with what hims056 said, didn't mean for you to delete your post and even upvoted it. Nothing wrong with dupes.
–
Shadow WizardApr 2 '13 at 7:22

@hims056 Sorry, but I can't find the post anymore. Shall I just post a new one?
–
Camil StapsApr 2 '13 at 8:13

@CamilStaps - Nah. Don't post duplicate question once you find the original one. Just remember it in the future. :)
–
hims056Apr 2 '13 at 8:15

1 Answer
1

I think this is a good idea. I don't have to explain what the advantages would be; the question covers that enough, I think. There are two things I'd like to do with the answer: giving an optional design and discussing the developer's pain to create this.

The design

As you can see, I added some options directly above the preview: inline, side-by-side and side-by-side markdown. This is exactly the same as when you're viewing revisions. Because I added a normal option, you won't lose any features you have now!

Now, let's see how it looks when viewing it with, for example, the side-by-side view:

The developers

I assume the revision change views are done with the pecl Text-Diff package or its newer version. That means the changes are calculated at the server. That means, there are three options (I think):

Make or get a JavaScript version of the package. There appears to be something, but I'm not sure. It might always look a bit different then the revisions, but that wouldn't be a huge problem.

Continuously use Ajax calls to the server, like every 10 or 15 seconds. I wouldn't recommend it, it would increase the server load a lot, probably.

Use an Ajax call, but on demand. So only call the server when someone actually clicks on a side-by-side button. I (and the OP) think this is your best bet, but who am I.

Conclusion

I don't have to say why this is a good idea, the arguments are explained in the question already.

Given my design ideas, the user won't lose the preview option he has now (just the new text). The design idea I gave only adds features, without really changing an existing feature.

I'm not sure how much it will take to integrate the ideas. Since the revision changes are calculated on the server and the standard preview is pure JavaScript (I think), it might get tricky.