-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Labels
area-rebase-editorIssues or features related to the Interactive Rebase EditorIssues or features related to the Interactive Rebase Editorhas-testplanIssue that has a test planIssue that has a test planneeds-verificationRequest for verificationRequest for verificationpending-releaseResolved but not yet released to the stable editionResolved but not yet released to the stable edition
Milestone
Description
Summary
Delivers a complete overhaul of the Interactive Rebase Editor with modern Lit-based architecture, advanced Git rebase features, optimized performance, and comprehensive user experience improvements.
Impact
Transforms the rebase editor from a basic todo file editor into a powerful, feature-rich interactive tool that:
- Supports modern Git rebase features (
update-ref,mergecommands) - Provides instant visual feedback through optimistic UI updates
- Enables efficient multi-select operations with keyboard and mouse shortcuts
- Offers drag-and-drop with auto-scrolling for intuitive commit reordering
- Detects and surfaces conflicts before execution
- Scales to large rebase operations through virtualization
- Improves accessibility with ARIA roles and keyboard navigation
- Integrates seamlessly with Commit Composer for AI-powered recomposition
Key Features Delivered
Multi-Select Operations
- Mouse selection:
- Click → select single commit
- Ctrl/Cmd+Click → toggle commit in/out of selection
- Shift+Click → range selection (visual or topological)
- Keyboard selection:
- Arrow Up/Down → move focus/selection
- Ctrl/Cmd+Arrow Up/Down → topological navigation
- Alt+Arrow Up/Down → jump to merge/fork points
- Alt+Page Up/Down → jump between refs
- Home/End → first/last commit
- Shift+arrows → extend selection
- Ctrl/Cmd+A → select all entries
- Bulk actions: Change actions for multiple commits simultaneously (pick → squash, etc.)
- Multi-select drag-and-drop: Reorder multiple selected commits together
Drag-and-Drop Enhancements
- Auto-scrolling when dragging near viewport edges
- Visual feedback for drop zones
- Multi-select support (drag entire selection)
- Topological awareness to prevent invalid reordering
Advanced Git Command Support
update-ref: Support for updating branch references during rebasemerge: Support for--rebase-mergescommand- Proper handling of onto targets and base commits
- Validation of command sequences
Performance Optimizations
- Virtualization: Efficiently handles large rebase lists (100+ commits)
- Lazy loading: Batch enrichment of commit metadata and avatars on-demand
- Optimistic UI: Instant visual feedback without waiting for backend confirmation
Conflict Detection
- Pre-execution conflict analysis
- Visual indicators for conflicting commits
- Updated action buttons when conflicts detected
- Reflection of conflict state from paused rebases
User Experience Improvements
- Optimistic updates: Actions reflect immediately in UI
- Keyboard shortcuts: Full keyboard navigation support
- Accessibility: ARIA roles, labels, and focus management
- Visual polish: Modern Lit-based components with responsive design
- Auto-open on pause:
gitlens.rebaseEditor.openOnPausedRebasesetting - Smart window placement: Opens beside existing tabs when available
Integration with Commit Composer
- "Recompose Commits" action to abort rebase and manage commits in Commit Composer with AI
- Seamless handoff of commit SHAs and branch context
- Confirmation dialog for abort-and-recompose workflow
Testing & Quality
- Comprehensive E2E test suite (627 lines in
rebase.test.ts) - Test coverage for: abort, action changes, multi-select, drag-and-drop, execute rebase, rebase-merges
- GitFixture helper for consistent test setup
- Standardized setup/teardown procedures
Validation
Multi-Select
- Open rebase editor with 10+ commits
- Verify mouse selection (Click, Ctrl+Click, Shift+Click)
- Verify keyboard selection (Arrow keys, Shift+Arrow, Ctrl+Arrow, Home/End)
- Verify Ctrl+A selects all entries
- Select 3 commits → change action to "squash" → verify all 3 update
- Select 5 commits via Shift+Click → drag to new position → verify all move together
Drag-and-Drop
- Drag commit to top/bottom edge → verify auto-scrolling
- Drag commit over invalid drop zone → verify visual feedback prevents drop
- Multi-select 4 commits → drag → verify all move as a unit
Advanced Git Commands
- Rebase with
--rebase-merges→ verifymergecommands appear - Rebase with
--update-refs→ verifyupdate-refcommands appear - Verify onto targets display correctly
- Execute rebase with
merge/update-refcommands → verify Git applies correctly
Conflict Detection
- Start rebase known to have conflicts
- Verify conflict indicators appear in UI
- Verify "Continue" button changes to reflect conflict state
- Pause rebase with conflicts → reopen editor → verify conflict state persists
Performance
- Open rebase editor with 100+ commits
- Verify smooth scrolling and responsive interactions
- Verify commit metadata loads progressively (lazy loading)
- Change action on commit → verify optimistic UI update (< 50ms)
Keyboard Navigation
- Use only keyboard to:
- Navigate through all commits (Arrow keys, Page Up/Down, Home/End)
- Select ranges (Shift+Arrow)
- Change actions (Tab to action dropdown, Enter to select)
- Execute operations (Tab to Continue, Enter)
- Verify focus indicators are always visible
Accessibility
- Use screen reader to navigate rebase editor
- Verify ARIA labels announce commit info, actions, and state
- Verify role="grid" or appropriate ARIA structure
- Test with keyboard-only navigation (no mouse)
Integration with Commit Composer
- Start rebase → Click "Recompose Commits" → Verify confirmation dialog
- Confirm → Verify rebase aborts and Commit Composer opens with correct commits
- Test both inactive and active (paused) rebase scenarios
Auto-Open on Pause
- Set
gitlens.rebaseEditor.openOnPausedRebaseto true - Start rebase → introduce conflict → verify editor opens automatically when paused
- Set to false → verify editor doesn't auto-open
Edge Cases
- Empty rebase (no commits) → verify graceful handling
- Single commit rebase → verify works correctly
- Rebase only with
noop→ verify treated as empty - Close editor while rebase active → verify state preserved
- Delete rebase todo file externally → verify editor closes automatically
- Abort from Home view → verify editor closes automatically
Technical Details
Architecture
- Framework: Lit Elements for reactive webview UI
- Provider:
RebaseWebviewProvidermanages lifecycle and IPC - Protocol: Typed IPC messages (commands, requests, notifications)
- Virtualization: Handles large commit lists efficiently
- State Management: Context providers with reactive signals
Key Files
src/webviews/apps/rebase/- Webview app implementationsrc/webviews/rebase/- Provider and backend logicsrc/webviews/protocol.ts- IPC protocol definitionstests/e2e/specs/rebase.test.ts- E2E test suite (627 lines)
IPC Protocol
- RecomposeCommitsCommand: Abort rebase and open Commit Composer
- ChangeActionCommand: Change action for selected commits
- MoveCommand: Reorder commits via drag-and-drop
- SelectCommand: Update selection state
- ExecuteCommand: Continue/abort rebase
- DidChangeNotification: Backend state updates
Risk
Medium — Comprehensive rewrite of rebase editor with many moving parts:
- Multiple new features increase complexity
- Git command handling requires careful validation
- Multi-select logic has many edge cases
- Performance optimization (virtualization) adds complexity
- Extensive E2E tests mitigate risk
Potential regressions:
- Rebase execution with complex command sequences
- State synchronization between UI and Git
- Drag-and-drop in edge cases (topological constraints)
- Conflict detection accuracy
Follow Ups
- Add undo/redo capability for action changes
- Implement "preview" mode showing expected commit tree
- Add visual diff preview for squash/fixup operations
- Explore saving rebase templates for common workflows
- Consider adding AI-suggested action changes
- Add telemetry to track feature usage (multi-select, drag-drop, etc.)
- Investigate performance with extremely large rebases (500+ commits)
- Add keyboard shortcuts reference (? key)
Related Issues: #4405, #4383, #4160, #4148, #4032, #3897, #3866, #3815, #3393, #3337, #3310, #4796, #4775
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-rebase-editorIssues or features related to the Interactive Rebase EditorIssues or features related to the Interactive Rebase Editorhas-testplanIssue that has a test planIssue that has a test planneeds-verificationRequest for verificationRequest for verificationpending-releaseResolved but not yet released to the stable editionResolved but not yet released to the stable edition