Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/webviews/apps/plus/composer/components/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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();

Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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}
Expand Down
5 changes: 0 additions & 5 deletions src/webviews/apps/plus/composer/components/commits-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down