Rapid Diffs for the commits (`/-/commits/<SHA>`) page
### Release notes
We're introducing Rapid Diffs to commit detail pages (`/-/commits/<SHA>`) - extending our modernized diff rendering approach to repository commits with a major breakthrough: full discussions support. This implementation brings fast, server-side rendered diffs to commit pages while enabling inline commenting and collaboration on historical code changes for the first time in the Rapid Diffs architecture. Users will experience dramatically improved performance when viewing commits with many files, plus a new file tree browser for easier navigation through large commits.
### Problem to solve
As a developer reviewing commit changes in GitLab repositories, I want to see commit diffs load quickly and completely, navigate easily through files, and discuss historical changes with my team so I can understand code evolution, provide feedback, and collaborate effectively on commit-level reviews.
Current Pain Points:
- **Slow perceived performance**: Commit pages with many files load slowly and may hit file display limits
- **Limited navigation**: No file tree browser makes it difficult to navigate through large commits
- **Missing discussions in Rapid Diffs**: Current Rapid Diffs implementations lack discussion support, preventing inline collaboration on server-rendered diffs
### User experience goal
The user should be able to navigate to any commit detail page and immediately see diff content appearing on screen, browse files using an intuitive file tree, and engage in meaningful discussions directly on commit diff lines, providing a fast and complete commit viewing experience that works consistently across all commit sizes.
### Proposal
Implement Rapid Diffs architecture for commit detail pages (`/-/commits/<SHA>`), building upon the existing server-side rendering foundation while introducing discussions support and enhanced navigation features.
### User Journey
1. **Immediate Content**: User navigates to commit page and sees first diffs rendering immediately
2. **Progressive Loading**: Additional diffs stream in and appear without user action
3. **File Tree Navigation**: User can browse and jump between files using the new file tree browser
4. **Discussion Collaboration**: User can comment on diff lines, create threaded discussions, and save drafts
5. **Enhanced Experience**: More files displayed per commit without pagination limitations
### Further details
**Key Capabilities:**
- **Discussions Integration**: First implementation of inline commenting, threading, and draft functionality within Rapid Diffs architecture
- **File Tree Browser**: Enhanced navigation for commits with multiple files
- **Increased File Limits**: Display more files per commit page without pagination
- **Server-Side Rendering**: Immediate diff content with progressive enhancement
- **Feature Parity**: All existing commit page functionality preserved
**Technical Implementation:**
- Builds upon existing Rapid Diffs server-side rendering foundation
- Introduces discussions data layer and UI components to Rapid Diffs architecture
- Implements commit-specific file tree navigation component
- Maintains backward compatibility with existing commit page functionality
### Feature Usage Metrics
**Performance Monitoring:**
- **Time to First Diff (TTFD)**: Measure time from navigation to first diff appearance
- **Complete Load Time**: Track full page rendering completion
- **Error Rates**: Track client-side errors and failed requests
**Usage Analytics:**
- **Discussion Creation Rate**: Track adoption of inline commenting on commit diffs
- **File Tree Usage**: Monitor navigation patterns and clicks within file browser
- **Large Commit Engagement**: Measure interaction with commits containing 20+ files
- **Session Duration**: Time spent on commit pages with enhanced experience
**Feedback Collection:**
- **User Surveys**: Periodic feedback collection on performance and usability
- **Feedback Issues**: Dedicated issue template for commit page feedback
### What does success look like, and how can we measure that?
**User Experience Success:**
- **Sub-1.5-second Time to First Diff** for diffs with 1000 lines or less. **Sub-2-second Time to First Diff*** for diffs above 1000 lines.
- **25-40% Improvement on Fully Loaded Diff** See [detailed formula in the Architecture blueprint](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/rapid_diffs/#fully-loaded-improvement-formula).
- **Positive user feedback** indicating improved perceived performance
- **Feature parity maintained** with no loss of existing functionality
**Technical Success:**
- **Stable performance**: No increase in error rates or support tickets
- **Successful streaming**: HTML streaming working reliably across environments
- **Discussions functionality**: Reliable commenting, threading, and draft features
**Feature Success:**
- **Discussion Functionality**: Reliable commenting, threading, and draft features working consistently
- **File Tree Integration**: Seamless navigation between files in commits with multiple changes
- **Accessibility Compliance**: Meeting WCAG 2.2 AA standards for all new functionality
epic