Closed Gankra closed 12 years ago
This is pretty hawt. It's a much nicer version of what I was thinking for "forking" the code. We may want to implement whole code forking (saving the parent/child), then implement inline modification.
Gankro implemented.
I think it would be cool if the referenced region of code in a comment could be modified by that comment. It wouldn't be too hard to have a second CodeMirror instance pop up below the comment box with the selected region of code in it. The user can change it in that box and the changes will be stored with the comment.
If a user is browsing the comments and hovers over that comment, it could display the suggested code in place of the original. There could also be a checkbox next to every comment to the effect of "apply suggested change" that keeps the change inside the main comment box. Then you could piece together a brand new program just by checking off comments.
It would also be cool if, in addition to allowing you to copy this rewritten code, you could press a button to "resubmit" it as a new submission so people can start commenting on this "new" version. If the pages kept track of "parent" and "child" code snippets, we could even have a "history" chart at the bottom (or top) that lets people explore the changes that have been applied. Possibly on the old code any comments whose changes were used would have a check mark or something next to them.
Obviously overlapping changes are an issue, but there's no getting around that.