@brimveyn/aimux-config 0.6.11 → 0.8.1
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 +25 -0
- package/src/defaults.ts +21 -0
- package/src/types.ts +39 -0
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -45,6 +45,12 @@ export function helpModal(scope?: ModeId): KeyResult {
|
|
|
45
45
|
return r([{ scope, type: 'open-help-modal' }])
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export const openFlashJump: KeyResult = r(
|
|
49
|
+
[{ type: 'open-flash-jump-modal' }],
|
|
50
|
+
[],
|
|
51
|
+
'modal.flash-jump'
|
|
52
|
+
)
|
|
53
|
+
|
|
48
54
|
export const toggleSidebar: KeyResult = r([{ type: 'toggle-sidebar' }])
|
|
49
55
|
export const toggleGitPane: KeyResult = r([{ type: 'toggle-git-pane' }])
|
|
50
56
|
export const toggleSessionBar: KeyResult = r([{ type: 'toggle-session-bar' }])
|
|
@@ -525,6 +531,25 @@ export const confirmRenameTab: ActionFn = (ctx: ModeContext) => {
|
|
|
525
531
|
return r(actions, [], 'navigation')
|
|
526
532
|
}
|
|
527
533
|
|
|
534
|
+
// Rename worktree modal
|
|
535
|
+
export const confirmRenameWorktree: ActionFn = (ctx: ModeContext) => {
|
|
536
|
+
const { modal } = ctx.state
|
|
537
|
+
const trimmed = (modal.editBuffer ?? '').trim()
|
|
538
|
+
const worktreeId = modal.sessionTargetId
|
|
539
|
+
const sessionId = modal.type === 'rename-worktree' ? modal.worktreeSessionId : null
|
|
540
|
+
const actions: KeyResult['actions'] = []
|
|
541
|
+
if (trimmed && worktreeId != null && worktreeId !== '' && sessionId != null && sessionId !== '') {
|
|
542
|
+
actions.push({
|
|
543
|
+
patch: { name: trimmed },
|
|
544
|
+
sessionId,
|
|
545
|
+
type: 'update-worktree-record',
|
|
546
|
+
worktreeId,
|
|
547
|
+
})
|
|
548
|
+
}
|
|
549
|
+
actions.push({ type: 'close-modal' })
|
|
550
|
+
return r(actions, [], 'navigation')
|
|
551
|
+
}
|
|
552
|
+
|
|
528
553
|
// Create session modal
|
|
529
554
|
export const confirmCreateSession: ActionFn = (ctx: ModeContext) => {
|
|
530
555
|
const modal = ctx.state.modal as {
|
package/src/defaults.ts
CHANGED
|
@@ -55,6 +55,7 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
55
55
|
.map('K', actions.reorderSession(-1), 'Move workspace up')
|
|
56
56
|
.map('r', actions.renameTab, 'Rename tab')
|
|
57
57
|
.map('i', actions.enterInsert, 'Focus terminal')
|
|
58
|
+
.map('S', actions.openFlashJump, 'Flash jump')
|
|
58
59
|
.map('?', actions.helpModal(), 'Help')
|
|
59
60
|
)
|
|
60
61
|
|
|
@@ -226,6 +227,16 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
226
227
|
.map('y', actions.confirmWorktreeDeleteModal, 'Delete worktree')
|
|
227
228
|
)
|
|
228
229
|
|
|
230
|
+
// -----------------------------------------------------------------------
|
|
231
|
+
// Modal: flash-jump (flash.nvim-style label jump)
|
|
232
|
+
// -----------------------------------------------------------------------
|
|
233
|
+
.mode('modal.flash-jump', (m) =>
|
|
234
|
+
m
|
|
235
|
+
.map('<Esc>', actions.closeModal, 'Cancel')
|
|
236
|
+
.map('<Space>', actions.closeModal, 'Cancel')
|
|
237
|
+
.passthrough()
|
|
238
|
+
)
|
|
239
|
+
|
|
229
240
|
// -----------------------------------------------------------------------
|
|
230
241
|
// Modal: rename-tab
|
|
231
242
|
// -----------------------------------------------------------------------
|
|
@@ -236,6 +247,16 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
236
247
|
.passthrough()
|
|
237
248
|
)
|
|
238
249
|
|
|
250
|
+
// -----------------------------------------------------------------------
|
|
251
|
+
// Modal: rename-worktree
|
|
252
|
+
// -----------------------------------------------------------------------
|
|
253
|
+
.mode('modal.rename-worktree', (m) =>
|
|
254
|
+
m
|
|
255
|
+
.map('<Esc>', actions.closeModal, 'Cancel')
|
|
256
|
+
.map('<CR>', actions.confirmRenameWorktree, 'Confirm')
|
|
257
|
+
.passthrough()
|
|
258
|
+
)
|
|
259
|
+
|
|
239
260
|
// -----------------------------------------------------------------------
|
|
240
261
|
// Modal: new-tab (always in filter mode via Picker)
|
|
241
262
|
// -----------------------------------------------------------------------
|
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'
|
|
@@ -32,6 +33,7 @@ export type ModeId =
|
|
|
32
33
|
| 'modal.worktree-move'
|
|
33
34
|
| 'modal.worktree-move-confirm'
|
|
34
35
|
| 'modal.ai-usage'
|
|
36
|
+
| 'modal.flash-jump'
|
|
35
37
|
|
|
36
38
|
// ─── Primitive app types ──────────────────────────────────────────────────────
|
|
37
39
|
|
|
@@ -325,6 +327,10 @@ export interface ModalSessionName extends ModalBase {
|
|
|
325
327
|
export interface ModalRenameTab extends ModalBase {
|
|
326
328
|
type: 'rename-tab'
|
|
327
329
|
}
|
|
330
|
+
export interface ModalRenameWorktree extends ModalBase {
|
|
331
|
+
type: 'rename-worktree'
|
|
332
|
+
worktreeSessionId: string
|
|
333
|
+
}
|
|
328
334
|
export interface ModalSnippetPicker extends ModalBase {
|
|
329
335
|
type: 'snippet-picker'
|
|
330
336
|
actionMessage?: string | null
|
|
@@ -417,12 +423,36 @@ export interface ModalWorktreeDeleteConfirm extends ModalBase {
|
|
|
417
423
|
force: boolean
|
|
418
424
|
}
|
|
419
425
|
|
|
426
|
+
export type FlashJumpTargetKind = 'workspace' | 'worktree' | 'tab'
|
|
427
|
+
|
|
428
|
+
export interface FlashJumpTarget {
|
|
429
|
+
kind: FlashJumpTargetKind
|
|
430
|
+
sessionIndex: number
|
|
431
|
+
sessionId: string
|
|
432
|
+
worktreeId?: string
|
|
433
|
+
tabId?: string
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface FlashLabel {
|
|
437
|
+
key: string
|
|
438
|
+
label: string
|
|
439
|
+
target: FlashJumpTarget
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface ModalFlashJump extends ModalBase {
|
|
443
|
+
type: 'flash-jump'
|
|
444
|
+
labels: FlashLabel[]
|
|
445
|
+
buffer: string
|
|
446
|
+
pendingJump: FlashJumpTarget | null
|
|
447
|
+
}
|
|
448
|
+
|
|
420
449
|
export type ModalState =
|
|
421
450
|
| ModalClosed
|
|
422
451
|
| ModalNewTab
|
|
423
452
|
| ModalSessionPicker
|
|
424
453
|
| ModalSessionName
|
|
425
454
|
| ModalRenameTab
|
|
455
|
+
| ModalRenameWorktree
|
|
426
456
|
| ModalSnippetPicker
|
|
427
457
|
| ModalThemePicker
|
|
428
458
|
| ModalHelp
|
|
@@ -435,6 +465,7 @@ export type ModalState =
|
|
|
435
465
|
| ModalWorktreeMove
|
|
436
466
|
| ModalWorktreeMoveConfirm
|
|
437
467
|
| ModalWorktreeDeleteConfirm
|
|
468
|
+
| ModalFlashJump
|
|
438
469
|
|
|
439
470
|
export interface LayoutState {
|
|
440
471
|
terminalCols: number
|
|
@@ -537,6 +568,12 @@ export type ModalAction =
|
|
|
537
568
|
| { type: 'switch-create-session-field' }
|
|
538
569
|
| { type: 'select-directory' }
|
|
539
570
|
| { type: 'open-rename-tab-modal' }
|
|
571
|
+
| {
|
|
572
|
+
type: 'open-rename-worktree-modal'
|
|
573
|
+
sessionId: string
|
|
574
|
+
worktreeId: string
|
|
575
|
+
initialName: string
|
|
576
|
+
}
|
|
540
577
|
| { type: 'open-snippet-picker' }
|
|
541
578
|
| { type: 'open-snippet-editor'; snippetId?: string }
|
|
542
579
|
| { type: 'set-help-entry-count'; count: number }
|
|
@@ -569,6 +606,8 @@ export type ModalAction =
|
|
|
569
606
|
closeTabs: boolean
|
|
570
607
|
force: boolean
|
|
571
608
|
}
|
|
609
|
+
| { type: 'open-flash-jump-modal' }
|
|
610
|
+
| { type: 'clear-flash-jump-pending' }
|
|
572
611
|
|
|
573
612
|
export type SessionAction =
|
|
574
613
|
| { type: 'load-session'; sessionId: string; workspaceSnapshot?: WorkspaceSnapshotV1 }
|