PR #145 accidentally reverted all source control enhancements from PR #138. This cherry-picks those changes back: discard changes functionality, commit detail view, commit file diffs, diff truncation, and UI improvements.