mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 08:29:42 +02:00
Merge pull request #66 from aakhter/feat/tab-reorder-shortcuts
feat: add Ctrl+Shift+{/} to reorder session tabs
This commit is contained in:
@@ -639,6 +639,8 @@ class CodemanApp {
|
|||||||
{ key: '=', altKey: '+', ctrl: true, action: () => this.increaseFontSize() },
|
{ key: '=', altKey: '+', ctrl: true, action: () => this.increaseFontSize() },
|
||||||
{ key: '-', ctrl: true, action: () => this.decreaseFontSize() },
|
{ key: '-', ctrl: true, action: () => this.decreaseFontSize() },
|
||||||
{ key: 'V', ctrl: true, shift: true, action: () => VoiceInput.toggle() },
|
{ key: 'V', ctrl: true, shift: true, action: () => VoiceInput.toggle() },
|
||||||
|
{ key: '{', ctrl: true, shift: true, action: () => this.moveActiveTabLeft() },
|
||||||
|
{ key: '}', ctrl: true, shift: true, action: () => this.moveActiveTabRight() },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Use capture to handle before terminal
|
// Use capture to handle before terminal
|
||||||
@@ -2106,6 +2108,24 @@ class CodemanApp {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moveActiveTabLeft() {
|
||||||
|
if (!this.activeSessionId) return;
|
||||||
|
const idx = this.sessionOrder.indexOf(this.activeSessionId);
|
||||||
|
if (idx <= 0) return;
|
||||||
|
[this.sessionOrder[idx - 1], this.sessionOrder[idx]] = [this.sessionOrder[idx], this.sessionOrder[idx - 1]];
|
||||||
|
this.saveSessionOrder();
|
||||||
|
this._fullRenderSessionTabs();
|
||||||
|
}
|
||||||
|
|
||||||
|
moveActiveTabRight() {
|
||||||
|
if (!this.activeSessionId) return;
|
||||||
|
const idx = this.sessionOrder.indexOf(this.activeSessionId);
|
||||||
|
if (idx === -1 || idx >= this.sessionOrder.length - 1) return;
|
||||||
|
[this.sessionOrder[idx], this.sessionOrder[idx + 1]] = [this.sessionOrder[idx + 1], this.sessionOrder[idx]];
|
||||||
|
this.saveSessionOrder();
|
||||||
|
this._fullRenderSessionTabs();
|
||||||
|
}
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// Session Lifecycle — select, close, navigate
|
// Session Lifecycle — select, close, navigate
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
|
|||||||
Reference in New Issue
Block a user