@brimveyn/aimux-config 0.6.11 → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/actions.ts +19 -0
- package/src/defaults.ts +10 -0
- package/src/types.ts +12 -0
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -525,6 +525,25 @@ export const confirmRenameTab: ActionFn = (ctx: ModeContext) => {
|
|
|
525
525
|
return r(actions, [], 'navigation')
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
+
// Rename worktree modal
|
|
529
|
+
export const confirmRenameWorktree: ActionFn = (ctx: ModeContext) => {
|
|
530
|
+
const { modal } = ctx.state
|
|
531
|
+
const trimmed = (modal.editBuffer ?? '').trim()
|
|
532
|
+
const worktreeId = modal.sessionTargetId
|
|
533
|
+
const sessionId = modal.type === 'rename-worktree' ? modal.worktreeSessionId : null
|
|
534
|
+
const actions: KeyResult['actions'] = []
|
|
535
|
+
if (trimmed && worktreeId != null && worktreeId !== '' && sessionId != null && sessionId !== '') {
|
|
536
|
+
actions.push({
|
|
537
|
+
patch: { name: trimmed },
|
|
538
|
+
sessionId,
|
|
539
|
+
type: 'update-worktree-record',
|
|
540
|
+
worktreeId,
|
|
541
|
+
})
|
|
542
|
+
}
|
|
543
|
+
actions.push({ type: 'close-modal' })
|
|
544
|
+
return r(actions, [], 'navigation')
|
|
545
|
+
}
|
|
546
|
+
|
|
528
547
|
// Create session modal
|
|
529
548
|
export const confirmCreateSession: ActionFn = (ctx: ModeContext) => {
|
|
530
549
|
const modal = ctx.state.modal as {
|
package/src/defaults.ts
CHANGED
|
@@ -236,6 +236,16 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
236
236
|
.passthrough()
|
|
237
237
|
)
|
|
238
238
|
|
|
239
|
+
// -----------------------------------------------------------------------
|
|
240
|
+
// Modal: rename-worktree
|
|
241
|
+
// -----------------------------------------------------------------------
|
|
242
|
+
.mode('modal.rename-worktree', (m) =>
|
|
243
|
+
m
|
|
244
|
+
.map('<Esc>', actions.closeModal, 'Cancel')
|
|
245
|
+
.map('<CR>', actions.confirmRenameWorktree, 'Confirm')
|
|
246
|
+
.passthrough()
|
|
247
|
+
)
|
|
248
|
+
|
|
239
249
|
// -----------------------------------------------------------------------
|
|
240
250
|
// Modal: new-tab (always in filter mode via Picker)
|
|
241
251
|
// -----------------------------------------------------------------------
|
package/src/types.ts
CHANGED
|
@@ -20,6 +20,7 @@ export type ModeId =
|
|
|
20
20
|
| 'modal.session-name'
|
|
21
21
|
| 'modal.create-session'
|
|
22
22
|
| 'modal.rename-tab'
|
|
23
|
+
| 'modal.rename-worktree'
|
|
23
24
|
| 'modal.snippet-picker.filtering'
|
|
24
25
|
| 'modal.snippet-editor'
|
|
25
26
|
| 'modal.theme-picker.filtering'
|
|
@@ -325,6 +326,10 @@ export interface ModalSessionName extends ModalBase {
|
|
|
325
326
|
export interface ModalRenameTab extends ModalBase {
|
|
326
327
|
type: 'rename-tab'
|
|
327
328
|
}
|
|
329
|
+
export interface ModalRenameWorktree extends ModalBase {
|
|
330
|
+
type: 'rename-worktree'
|
|
331
|
+
worktreeSessionId: string
|
|
332
|
+
}
|
|
328
333
|
export interface ModalSnippetPicker extends ModalBase {
|
|
329
334
|
type: 'snippet-picker'
|
|
330
335
|
actionMessage?: string | null
|
|
@@ -423,6 +428,7 @@ export type ModalState =
|
|
|
423
428
|
| ModalSessionPicker
|
|
424
429
|
| ModalSessionName
|
|
425
430
|
| ModalRenameTab
|
|
431
|
+
| ModalRenameWorktree
|
|
426
432
|
| ModalSnippetPicker
|
|
427
433
|
| ModalThemePicker
|
|
428
434
|
| ModalHelp
|
|
@@ -537,6 +543,12 @@ export type ModalAction =
|
|
|
537
543
|
| { type: 'switch-create-session-field' }
|
|
538
544
|
| { type: 'select-directory' }
|
|
539
545
|
| { type: 'open-rename-tab-modal' }
|
|
546
|
+
| {
|
|
547
|
+
type: 'open-rename-worktree-modal'
|
|
548
|
+
sessionId: string
|
|
549
|
+
worktreeId: string
|
|
550
|
+
initialName: string
|
|
551
|
+
}
|
|
540
552
|
| { type: 'open-snippet-picker' }
|
|
541
553
|
| { type: 'open-snippet-editor'; snippetId?: string }
|
|
542
554
|
| { type: 'set-help-entry-count'; count: number }
|