diff --git a/src/webviews/apps/plus/composer/components/app.ts b/src/webviews/apps/plus/composer/components/app.ts index 26dd71ed431f8..b126f2a600bae 100644 --- a/src/webviews/apps/plus/composer/components/app.ts +++ b/src/webviews/apps/plus/composer/components/app.ts @@ -402,7 +402,6 @@ export class ComposerApp extends LitElement { @state() private onboardingStepNumber: number = 0; - private commitsSortable?: Sortable; private hunksSortable?: Sortable; private isDragging = false; private lastMouseEvent?: MouseEvent; @@ -460,7 +459,6 @@ export class ComposerApp extends LitElement { override disconnectedCallback() { super.disconnectedCallback?.(); - this.commitsSortable?.destroy(); this.hunksSortable?.destroy(); if (this.commitMessageDebounceTimer) { clearTimeout(this.commitMessageDebounceTimer); @@ -470,33 +468,6 @@ export class ComposerApp extends LitElement { } private initializeSortable() { - // Initialize commits sortable - const commitsContainer = this.shadowRoot?.querySelector('.commits-list'); - if (commitsContainer) { - this.commitsSortable = Sortable.create(commitsContainer as HTMLElement, { - animation: 150, - ghostClass: 'sortable-ghost', - chosenClass: 'sortable-chosen', - dragClass: 'sortable-drag', - handle: '.drag-handle', // Only allow dragging by the handle - filter: '.new-commit-drop-zone', - onMove: evt => { - // Only allow moving within the commits list, not into drop zones - const target = evt.related; - return ( - target.tagName.toLowerCase() === 'gl-commit-item' && - !target.closest('.drop-zone') && - !target.closest('.new-commit-drop-zone') - ); - }, - onEnd: evt => { - if (evt.oldIndex !== undefined && evt.newIndex !== undefined && evt.oldIndex !== evt.newIndex) { - this.reorderCommits(evt.oldIndex, evt.newIndex); - } - }, - }); - } - // Initialize hunks sortable (will be re-initialized when commit is selected) this.initializeHunksSortable(); @@ -742,8 +713,6 @@ export class ComposerApp extends LitElement { } private reorderCommits(oldIndex: number, newIndex: number) { - if (!this.canReorderCommits) return; - this.saveToHistory(); const newCommits = [...this.state.commits]; @@ -1214,10 +1183,6 @@ export class ComposerApp extends LitElement { return this.state?.mode === 'preview'; } - private get canReorderCommits(): boolean { - return !this.isPreviewMode; - } - private get canCombineCommits(): boolean { return !this.isPreviewMode; } @@ -1624,7 +1589,6 @@ export class ComposerApp extends LitElement { .committing=${this.state.committing} .aiEnabled=${this.aiEnabled} .aiDisabledReason=${this.aiDisabledReason} - .canReorderCommits=${this.canReorderCommits} .canCombineCommits=${this.canCombineCommits} .canMoveHunks=${this.canMoveHunks} .canGenerateCommitsWithAI=${this.canGenerateCommitsWithAI} diff --git a/src/webviews/apps/plus/composer/components/commits-panel.ts b/src/webviews/apps/plus/composer/components/commits-panel.ts index 3adc1ea07dce8..9fb2c55c6a942 100644 --- a/src/webviews/apps/plus/composer/components/commits-panel.ts +++ b/src/webviews/apps/plus/composer/components/commits-panel.ts @@ -426,11 +426,6 @@ export class CommitsPanel extends LitElement { } private initializeSortable() { - // Don't initialize sortable in AI preview mode - if (this.isPreviewMode) { - return; - } - const commitsContainer = this.shadowRoot?.querySelector('.commits-only'); if (commitsContainer) { this.commitsSortable = Sortable.create(commitsContainer as HTMLElement, {