@brimveyn/aimux-config 0.10.0 → 0.10.2
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 +23 -4
- package/src/defaults.ts +25 -4
- package/src/types.ts +26 -5
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -61,11 +61,15 @@ export function toggleWidget(widgetId: string): KeyResult {
|
|
|
61
61
|
}
|
|
62
62
|
export const toggleGitPane: KeyResult = toggleWidget('git')
|
|
63
63
|
export const toggleProjectBar: KeyResult = r([{ type: 'toggle-project-bar' }])
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
/**
|
|
65
|
+
* The stats screen, which replaced the AI-usage popover: the quota windows it
|
|
66
|
+
* showed are now its first page.
|
|
67
|
+
*/
|
|
68
|
+
export const toggleStats: ActionFn = (ctx: ModeContext) => {
|
|
69
|
+
if (ctx.state.focusMode === 'stats') {
|
|
70
|
+
return r([{ type: 'exit-stats' }], [], 'navigation')
|
|
67
71
|
}
|
|
68
|
-
return r([{ type: '
|
|
72
|
+
return r([{ type: 'enter-stats' }], [], 'stats')
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
export const enterGitMode: KeyResult = r([{ type: 'enter-git-mode' }], [], 'git-mode')
|
|
@@ -951,6 +955,21 @@ export const gitCommitReturnKey: ActionFn = (ctx: ModeContext) => {
|
|
|
951
955
|
export const enterSettings: KeyResult = r([{ type: 'enter-settings' }], [], 'settings')
|
|
952
956
|
export const exitSettings: KeyResult = r([{ type: 'exit-settings' }], [], 'navigation')
|
|
953
957
|
|
|
958
|
+
// ---------------------------------------------------------------------------
|
|
959
|
+
// Stats screen
|
|
960
|
+
// ---------------------------------------------------------------------------
|
|
961
|
+
|
|
962
|
+
export const enterStats: KeyResult = r([{ type: 'enter-stats' }], [], 'stats')
|
|
963
|
+
export const exitStats: KeyResult = r([{ type: 'exit-stats' }], [], 'navigation')
|
|
964
|
+
|
|
965
|
+
export function moveStatsPage(delta: -1 | 1): KeyResult {
|
|
966
|
+
return r([{ delta, type: 'stats-move-page' }])
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
export function scrollStats(delta: number): KeyResult {
|
|
970
|
+
return r([{ delta, type: 'stats-scroll' }])
|
|
971
|
+
}
|
|
972
|
+
|
|
954
973
|
export function focusSettingsPane(pane: 'nav' | 'rows'): KeyResult {
|
|
955
974
|
return r([{ pane, type: 'settings-focus-pane' }])
|
|
956
975
|
}
|
package/src/defaults.ts
CHANGED
|
@@ -104,7 +104,7 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
104
104
|
m
|
|
105
105
|
.map('<Leader>b', actions.toggleProjectBar, 'Toggle project bar')
|
|
106
106
|
.map('<Leader>B', actions.toggleBar('right'), 'Toggle right bar')
|
|
107
|
-
.map('<Leader>u', actions.
|
|
107
|
+
.map('<Leader>u', actions.toggleStats, 'Stats')
|
|
108
108
|
.map('<Leader>,', actions.enterSettings, 'Settings')
|
|
109
109
|
.map('<Leader>1', actions.switchTabByIndex(1), 'Tab 1')
|
|
110
110
|
.map('<Leader>2', actions.switchTabByIndex(2), 'Tab 2')
|
|
@@ -216,12 +216,33 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
216
216
|
)
|
|
217
217
|
|
|
218
218
|
// -----------------------------------------------------------------------
|
|
219
|
-
//
|
|
219
|
+
// Stats screen (read-only)
|
|
220
|
+
//
|
|
221
|
+
// `h`/`l` change page and `j`/`k` scroll it — the same split the settings
|
|
222
|
+
// screen uses, where the horizontal pair never touches content.
|
|
220
223
|
// -----------------------------------------------------------------------
|
|
221
|
-
.mode('
|
|
222
|
-
m
|
|
224
|
+
.mode('stats', (m) =>
|
|
225
|
+
m
|
|
226
|
+
.map('<Esc>', actions.exitStats, 'Close stats')
|
|
227
|
+
.map('<Leader>u', actions.exitStats, 'Close stats')
|
|
228
|
+
.map('l', actions.moveStatsPage(1), 'Next page')
|
|
229
|
+
.map('h', actions.moveStatsPage(-1), 'Prev page')
|
|
230
|
+
.map('<Right>', actions.moveStatsPage(1))
|
|
231
|
+
.map('<Left>', actions.moveStatsPage(-1))
|
|
232
|
+
.map('j', actions.scrollStats(1), 'Scroll down', { repeatable: true })
|
|
233
|
+
.map('k', actions.scrollStats(-1), 'Scroll up', { repeatable: true })
|
|
234
|
+
.map('<Down>', actions.scrollStats(1), undefined, { repeatable: true })
|
|
235
|
+
.map('<Up>', actions.scrollStats(-1), undefined, { repeatable: true })
|
|
236
|
+
.map('<C-d>', actions.scrollStats(10), 'Page down')
|
|
237
|
+
.map('<C-u>', actions.scrollStats(-10), 'Page up')
|
|
238
|
+
.map('?', actions.helpModal('stats'), 'Help')
|
|
223
239
|
)
|
|
224
240
|
|
|
241
|
+
// -----------------------------------------------------------------------
|
|
242
|
+
// Modal: quotas (read-only — the status bar indicator, expanded)
|
|
243
|
+
// -----------------------------------------------------------------------
|
|
244
|
+
.mode('modal.quotas', (m) => m.map('<Esc>', actions.closeModal, 'Close'))
|
|
245
|
+
|
|
225
246
|
// -----------------------------------------------------------------------
|
|
226
247
|
// Modal: update-available
|
|
227
248
|
// -----------------------------------------------------------------------
|
package/src/types.ts
CHANGED
|
@@ -34,9 +34,10 @@ export type ModeId =
|
|
|
34
34
|
| 'modal.update-available'
|
|
35
35
|
| 'modal.workspace-move'
|
|
36
36
|
| 'modal.workspace-move-confirm'
|
|
37
|
-
| 'modal.ai-usage'
|
|
38
37
|
| 'modal.flash-jump'
|
|
38
|
+
| 'modal.quotas'
|
|
39
39
|
| 'settings'
|
|
40
|
+
| 'stats'
|
|
40
41
|
|
|
41
42
|
// ─── Primitive app types ──────────────────────────────────────────────────────
|
|
42
43
|
|
|
@@ -73,6 +74,7 @@ export type FocusMode =
|
|
|
73
74
|
| 'command-edit'
|
|
74
75
|
| 'git'
|
|
75
76
|
| 'settings'
|
|
77
|
+
| 'stats'
|
|
76
78
|
export type SplitDirection = 'horizontal' | 'vertical'
|
|
77
79
|
|
|
78
80
|
// ─── Terminal data shapes ─────────────────────────────────────────────────────
|
|
@@ -441,8 +443,9 @@ export interface ModalUpdateAvailable extends ModalBase {
|
|
|
441
443
|
latestVersion: string
|
|
442
444
|
}
|
|
443
445
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
+
/** The status bar's usage indicator, expanded. Carries nothing: it is a readout. */
|
|
447
|
+
export interface ModalQuotas extends ModalBase {
|
|
448
|
+
type: 'quotas'
|
|
446
449
|
}
|
|
447
450
|
|
|
448
451
|
export interface ModalWorkspaceMove extends ModalBase {
|
|
@@ -527,7 +530,7 @@ export type ModalState =
|
|
|
527
530
|
| ModalSnippetEditor
|
|
528
531
|
| ModalGitCommit
|
|
529
532
|
| ModalUpdateAvailable
|
|
530
|
-
|
|
|
533
|
+
| ModalQuotas
|
|
531
534
|
| ModalWorkspaceMove
|
|
532
535
|
| ModalWorkspaceMoveConfirm
|
|
533
536
|
| ModalWorkspaceDeleteConfirm
|
|
@@ -584,6 +587,12 @@ export interface SettingsUIState {
|
|
|
584
587
|
rowIndex: number
|
|
585
588
|
}
|
|
586
589
|
|
|
590
|
+
/** Mirror of the CLI's `StatsUIState`. */
|
|
591
|
+
export interface StatsUIState {
|
|
592
|
+
pageIndex: number
|
|
593
|
+
scrollTop: number
|
|
594
|
+
}
|
|
595
|
+
|
|
587
596
|
export interface AppState {
|
|
588
597
|
tabs: TabSession[]
|
|
589
598
|
activeTabId: string | null
|
|
@@ -605,6 +614,7 @@ export interface AppState {
|
|
|
605
614
|
autoCommit: AutoCommitState
|
|
606
615
|
multiRepo: MultiRepoState
|
|
607
616
|
settings: SettingsUIState
|
|
617
|
+
stats: StatsUIState
|
|
608
618
|
workspaceDivergence: Record<string, BranchDivergence>
|
|
609
619
|
workspaceActivity: Record<string, WorkspaceActivity>
|
|
610
620
|
lastActiveTabByWorkspace: Record<string, string>
|
|
@@ -653,8 +663,8 @@ export type ModalAction =
|
|
|
653
663
|
| { type: 'set-theme-entry-count'; count: number }
|
|
654
664
|
| { type: 'open-theme-picker'; returnTo?: FocusMode }
|
|
655
665
|
| { type: 'open-update-available-modal'; currentVersion: string; latestVersion: string }
|
|
666
|
+
| { type: 'open-quotas-modal' }
|
|
656
667
|
| { type: 'set-modal-selection-index'; index: number }
|
|
657
|
-
| { type: 'open-ai-usage-modal' }
|
|
658
668
|
| { type: 'open-edit-custom-command'; assistantId: AssistantId }
|
|
659
669
|
| { type: 'open-workspace-move-modal'; sourceWorkspaceId: string }
|
|
660
670
|
| { type: 'toggle-workspace-move-delete' }
|
|
@@ -782,6 +792,16 @@ export type SettingsAction =
|
|
|
782
792
|
| { type: 'open-settings-search' }
|
|
783
793
|
| { type: 'open-setting-text-modal'; settingId: string; label: string; value: string }
|
|
784
794
|
|
|
795
|
+
export type StatsAction =
|
|
796
|
+
| { type: 'enter-stats' }
|
|
797
|
+
| { type: 'exit-stats' }
|
|
798
|
+
| { type: 'stats-move-page'; delta: -1 | 1 }
|
|
799
|
+
| { type: 'stats-select-page'; pageIndex: number }
|
|
800
|
+
/** Rows, not pixels: the view holds a scroll offset the page applies to its box. */
|
|
801
|
+
| { type: 'stats-scroll'; delta: number }
|
|
802
|
+
/** The offset the scrollbox actually accepted, sent back so the state cannot run past the page. */
|
|
803
|
+
| { type: 'stats-scroll-settled'; scrollTop: number }
|
|
804
|
+
|
|
785
805
|
export interface GitRefreshPayload {
|
|
786
806
|
branch: string | null
|
|
787
807
|
ahead: number
|
|
@@ -878,6 +898,7 @@ export type AppAction =
|
|
|
878
898
|
| LayoutAction
|
|
879
899
|
| UIAction
|
|
880
900
|
| SettingsAction
|
|
901
|
+
| StatsAction
|
|
881
902
|
| DataAction
|
|
882
903
|
| GitPanelAction
|
|
883
904
|
| GitModeAction
|