@brimveyn/aimux-config 0.10.2 → 0.10.5
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 +17 -16
- package/src/defaults.ts +18 -10
- package/src/types.ts +1 -4
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -105,7 +105,13 @@ export const closeModal: KeyResult = r([{ type: 'close-modal' }], [], 'navigatio
|
|
|
105
105
|
|
|
106
106
|
export const closeOverlayModal: KeyResult = r([{ type: 'close-modal' }])
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
/**
|
|
109
|
+
* The picker has no separate filter mode to fall back to, so `cancel-command-edit`
|
|
110
|
+
* would only drop focus to `modal` — a focusMode the new-tab modal has no handler
|
|
111
|
+
* for, leaving it on screen and deaf to every key. Esc closes it, like every other
|
|
112
|
+
* picker. (Esc while editing a custom command is `cancelEditCustomCommand`.)
|
|
113
|
+
*/
|
|
114
|
+
export const cancelNewTabModal: KeyResult = closeModal
|
|
109
115
|
|
|
110
116
|
// ---------------------------------------------------------------------------
|
|
111
117
|
// Dynamic actions (need ctx at runtime — ActionFn)
|
|
@@ -244,14 +250,11 @@ export const createWorkspaceModal: KeyResult = r(
|
|
|
244
250
|
export const switchCreateWorkspaceField: KeyResult = r([{ type: 'switch-create-workspace-field' }])
|
|
245
251
|
|
|
246
252
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
253
|
+
* The prompt is optional: left empty, the workspace still gets cut and the
|
|
254
|
+
* assistant still launches — it is simply handed nothing, and the workspace
|
|
255
|
+
* keeps its `wt-<project>` placeholder name.
|
|
249
256
|
*/
|
|
250
|
-
export const confirmCreateWorkspace:
|
|
251
|
-
const { modal } = ctx.state
|
|
252
|
-
if (modal.type === 'create-workspace' && modal.prompt.trim() === '') return r([])
|
|
253
|
-
return r([], [{ type: 'create-workspace' }])
|
|
254
|
-
}
|
|
257
|
+
export const confirmCreateWorkspace: KeyResult = r([], [{ type: 'create-workspace' }])
|
|
255
258
|
|
|
256
259
|
/**
|
|
257
260
|
* `Enter` creates, so the prompt needs another way to break a line. Inverted
|
|
@@ -970,23 +973,21 @@ export function scrollStats(delta: number): KeyResult {
|
|
|
970
973
|
return r([{ delta, type: 'stats-scroll' }])
|
|
971
974
|
}
|
|
972
975
|
|
|
973
|
-
export function focusSettingsPane(pane: 'nav' | 'rows'): KeyResult {
|
|
974
|
-
return r([{ pane, type: 'settings-focus-pane' }])
|
|
975
|
-
}
|
|
976
|
-
|
|
977
976
|
export function moveSettingsSelection(delta: -1 | 1): KeyResult {
|
|
978
977
|
return r([{ delta, type: 'settings-move-selection' }])
|
|
979
978
|
}
|
|
980
979
|
|
|
980
|
+
/** To the first row of the next section, the way `}` moves by paragraph. */
|
|
981
|
+
export function jumpSettingsSection(delta: -1 | 1): KeyResult {
|
|
982
|
+
return r([{ delta, type: 'settings-jump-section' }])
|
|
983
|
+
}
|
|
984
|
+
|
|
981
985
|
/**
|
|
982
986
|
* One key for every kind of row: it toggles a checkbox, advances an enum, or runs
|
|
983
987
|
* whatever the row does. Which one is the row's business, not the keymap's — so
|
|
984
988
|
* there is no per-kind binding to keep in sync with the schema.
|
|
985
989
|
*/
|
|
986
|
-
export const activateSettingsRow:
|
|
987
|
-
if (ctx.state.settings.pane !== 'rows') return r([{ pane: 'rows', type: 'settings-focus-pane' }])
|
|
988
|
-
return r([], [{ type: 'activate-settings-row' }])
|
|
989
|
-
}
|
|
990
|
+
export const activateSettingsRow: KeyResult = r([], [{ type: 'activate-settings-row' }])
|
|
990
991
|
|
|
991
992
|
export function adjustSettingsRow(delta: 1 | -1): KeyResult {
|
|
992
993
|
return r([], [{ delta, type: 'adjust-settings-row' }])
|
package/src/defaults.ts
CHANGED
|
@@ -159,19 +159,21 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
159
159
|
// -----------------------------------------------------------------------
|
|
160
160
|
// Settings screen
|
|
161
161
|
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
162
|
+
// One list, sections included, so every key here moves a single cursor:
|
|
163
|
+
// `j`/`k` a row, `}`/`{` a section, `/` searches the same list from a
|
|
164
|
+
// picker.
|
|
165
|
+
//
|
|
166
|
+
// The two axes are the whole grammar: across a row changes its value —
|
|
167
|
+
// `h`/`l`, the arrows and -/+ all drag the gauge, step the enum, set the
|
|
168
|
+
// checkbox — and <CR> hands over to a field for the value you would rather
|
|
169
|
+
// type than aim at. Nothing here is a column any more, which is what freed
|
|
170
|
+
// `h`/`l` to mean what they read like.
|
|
165
171
|
// -----------------------------------------------------------------------
|
|
166
172
|
.mode('settings', (m) =>
|
|
167
173
|
m
|
|
168
174
|
.map('<Esc>', actions.exitSettings, 'Close settings')
|
|
169
175
|
.map('<Leader>,', actions.exitSettings, 'Close settings')
|
|
170
|
-
.map('
|
|
171
|
-
.map('<Left>', actions.focusSettingsPane('nav'))
|
|
172
|
-
.map('l', actions.activateSettingsRow, 'Settings of the section')
|
|
173
|
-
.map('<Right>', actions.activateSettingsRow)
|
|
174
|
-
.map('<CR>', actions.activateSettingsRow, 'Change')
|
|
176
|
+
.map('<CR>', actions.activateSettingsRow, 'Change, or type a value')
|
|
175
177
|
.map('<Space>', actions.activateSettingsRow, 'Change')
|
|
176
178
|
.map('j', actions.moveSettingsSelection(1), 'Next', { repeatable: true })
|
|
177
179
|
.map('k', actions.moveSettingsSelection(-1), 'Prev', { repeatable: true })
|
|
@@ -179,8 +181,14 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
179
181
|
.map('<Up>', actions.moveSettingsSelection(-1), undefined, { repeatable: true })
|
|
180
182
|
.map('<C-n>', actions.moveSettingsSelection(1))
|
|
181
183
|
.map('<C-p>', actions.moveSettingsSelection(-1))
|
|
182
|
-
.map('
|
|
183
|
-
.map('
|
|
184
|
+
.map('}', actions.jumpSettingsSection(1), 'Next section', { repeatable: true })
|
|
185
|
+
.map('{', actions.jumpSettingsSection(-1), 'Prev section', { repeatable: true })
|
|
186
|
+
.map('l', actions.adjustSettingsRow(1), 'Increase', { repeatable: true })
|
|
187
|
+
.map('<Right>', actions.adjustSettingsRow(1), undefined, { repeatable: true })
|
|
188
|
+
.map('+', actions.adjustSettingsRow(1), undefined, { repeatable: true })
|
|
189
|
+
.map('h', actions.adjustSettingsRow(-1), 'Decrease', { repeatable: true })
|
|
190
|
+
.map('<Left>', actions.adjustSettingsRow(-1), undefined, { repeatable: true })
|
|
191
|
+
.map('-', actions.adjustSettingsRow(-1), undefined, { repeatable: true })
|
|
184
192
|
.map('r', actions.resetSettingsRow, 'Reset to default')
|
|
185
193
|
.map('/', actions.openSettingsSearch, 'Search settings')
|
|
186
194
|
.map('?', actions.helpModal('settings'), 'Help')
|
package/src/types.ts
CHANGED
|
@@ -582,8 +582,6 @@ export interface MultiRepoState {
|
|
|
582
582
|
|
|
583
583
|
/** Where the cursor is in the settings screen — the cursor only, not the values. */
|
|
584
584
|
export interface SettingsUIState {
|
|
585
|
-
sectionId: string
|
|
586
|
-
pane: 'nav' | 'rows'
|
|
587
585
|
rowIndex: number
|
|
588
586
|
}
|
|
589
587
|
|
|
@@ -785,9 +783,8 @@ export type UIAction =
|
|
|
785
783
|
export type SettingsAction =
|
|
786
784
|
| { type: 'enter-settings' }
|
|
787
785
|
| { type: 'exit-settings' }
|
|
788
|
-
| { type: 'settings-focus-pane'; pane: 'nav' | 'rows' }
|
|
789
786
|
| { type: 'settings-move-selection'; delta: -1 | 1 }
|
|
790
|
-
| { type: 'settings-
|
|
787
|
+
| { type: 'settings-jump-section'; delta: -1 | 1 }
|
|
791
788
|
| { type: 'settings-select-row'; rowIndex: number }
|
|
792
789
|
| { type: 'open-settings-search' }
|
|
793
790
|
| { type: 'open-setting-text-modal'; settingId: string; label: string; value: string }
|