Add ability to recompose commits from Interactive Rebase Editor using AI
Adds "Recompose Commits" action to the Interactive Rebase Editor that allows users to abort the current rebase and recompose all commits using AI via the Commit Composer.
Impact
Provides users with a seamless workflow to switch from manual interactive rebasing to AI-powered commit recomposition. Users can leverage AI capabilities to reorganize and refactor commits without manually editing the rebase todo file. This bridges the gap between traditional Git rebase workflows and modern AI-assisted commit management.
Validation
UI/UX Testing
-
Visual Appearance
- Open a repository with multiple commits on a branch
- Start an interactive rebase:
git rebase -i HEAD~5 - Verify Interactive Rebase Editor opens
- Verify "Recompose Commits" button appears with sparkle icon in footer actions
- Verify button shows tooltip: "Open Commit Composer & Recompose using AI"
- Verify button appearance is "secondary"
- When rebase is not active, verify button shows full text: "Recompose Commits..."
- When rebase is active (paused/has conflicts), verify button shows only sparkle icon
-
Confirmation Dialog
- Click "Recompose Commits" button
- Verify confirmation popover appears with:
- When rebase is inactive: Heading "Abort Rebase & Recompose", message "This will abort the rebase and open the Commit Composer to recompose all commits using AI.", icon is "warning", initial focus on "Recompose Commits" button
- When rebase is active: Heading "Abort Rebase & Recompose", confirm button text "Abort & Recompose" (danger appearance), initial focus on "Cancel" button, icon is "error"
- Verify "Cancel" button dismisses popover without action
- Verify clicking outside popover dismisses it
-
Keyboard Navigation
- Open confirmation popover
- Verify Enter or Space on focused button triggers appropriate action
- Verify Tab cycles between Cancel and Confirm buttons
- Verify initial focus is set correctly based on rebase state
Functional Testing
-
Inactive Rebase → Recompose
- Start interactive rebase:
git rebase -i HEAD~5 - Click "Recompose Commits" → Confirm
- Verify:
- Rebase is aborted (verify via
git status) - Commit Composer webview opens
- Composer is in "preview" mode
- All 5 commit SHAs are passed to composer
- Composer's
sourceis set to 'rebaseEditor' - Branch name is passed (if available)
- Repository path is correct
- Rebase is aborted (verify via
- Start interactive rebase:
-
Active Rebase with Conflicts → Recompose
- Create merge conflicts during rebase
- Pause rebase (conflicts present)
- Click "Recompose Commits" button (sparkle icon only) → Confirm "Abort & Recompose"
- Verify:
- Rebase is aborted
- Conflicts are cleared
- Commit Composer opens with all commits from rebase
- Working directory returns to clean state
-
Multiple Rebase States
- Test with rebase containing:
- Only
pickactions - Mixed actions (
pick,reword,edit,squash,fixup,drop) - Already processed commits vs. pending commits
- Only
- Verify only processed commits are passed to composer with correct SHA order
- Test with rebase containing:
-
Edge Cases
- Empty rebase (no commits): Verify graceful handling
- Single commit rebase: Verify works correctly
- Rebase with 50+ commits: Verify performance is acceptable
- Cancel confirmation dialog: Verify rebase state unchanged
- Close rebase editor before confirming: Verify no state corruption
Integration Testing
-
Composer Integration
- After recompose action, verify Commit Composer:
- Displays all commits from rebase
- Shows correct repository context
- Branch name is prefilled (if available)
- Can successfully AI-generate new commits
- Can apply changes to working directory
- After recompose action, verify Commit Composer:
-
Command Typing & Protocol
- Verify
RecomposeCommitsCommandIPC is registered - Verify command sends no parameters (undefined)
- Verify command handler in
rebaseWebviewProvider.tsprocesses correctly - Verify
ComposerWebviewShowingArgstypes are correctly passed
- Verify
-
Tooltip Behavior
- Hover over "Recompose Commits" button
- Verify tooltip appears
- Open confirmation popover
- Verify anchor button tooltip is disabled while popover is open
- Close popover
- Verify tooltip is re-enabled after popover closes
Component Testing
-
GlPopoverConfirm Component
- Verify component renders with all properties:
heading,message,confirm,confirm-appearance,initial-focus,icon,show-icon,placement
- Verify slot="anchor" renders correctly
- Verify slot="icon" can override default icon
- Verify
gl-confirmevent fires on confirm - Verify
gl-cancelevent fires on cancel - Verify
role="alertdialog"for accessibility - Verify
aria-labelledbypoints to heading element
- Verify component renders with all properties:
-
Cross-browser Compatibility
- Test in VS Code Desktop (Electron)
- Test in VS Code Web (if supported for git operations)
- Verify popover positioning with different
placementvalues
Accessibility Testing
-
Screen Reader
- Navigate to "Recompose Commits" button with screen reader
- Verify button label and tooltip are announced
- Open popover
- Verify alert dialog role is announced
- Verify heading and message are read
- Verify button labels are clear
-
Keyboard-only Navigation
- Navigate entire Interactive Rebase Editor using only keyboard
- Verify can reach and activate "Recompose Commits" button
- Verify can navigate confirmation dialog buttons
- Verify can dismiss dialog with Escape (if implemented)
Performance Testing
- Large Rebases
- Test with 100+ commits
- Verify button remains responsive
- Verify confirmation dialog opens promptly
- Verify commit SHA collection doesn't hang
- Verify Commit Composer handles large commit sets
Regression Testing
- Existing Rebase Editor Functionality
- Verify existing actions still work (Continue, Abort, Start)
- Verify commit reordering still works
- Verify search functionality (/) still works
- Verify keyboard shortcuts still work
- Verify drag-and-drop still works
- Verify action changes (pick → squash) still work
Risk
Low to Medium — Adds new optional workflow path without modifying core rebase editor functionality. Primary risk is around:
- Ensuring rebase state is properly cleaned up on abort
- Handling edge cases with malformed todo files
- Popover component interactions with existing UI
Follow Ups
- Consider adding telemetry to track usage of recompose action
- Explore adding "Recompose" option directly in rebase action menu
- Consider preserving rebase progress metadata for "resume" scenarios
- Evaluate adding undo capability after aborting rebase