@brimveyn/aimux-config 0.10.2 → 0.10.3
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 +6 -8
- package/src/defaults.ts +18 -10
- package/src/types.ts +1 -4
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -970,23 +970,21 @@ export function scrollStats(delta: number): KeyResult {
|
|
|
970
970
|
return r([{ delta, type: 'stats-scroll' }])
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
-
export function focusSettingsPane(pane: 'nav' | 'rows'): KeyResult {
|
|
974
|
-
return r([{ pane, type: 'settings-focus-pane' }])
|
|
975
|
-
}
|
|
976
|
-
|
|
977
973
|
export function moveSettingsSelection(delta: -1 | 1): KeyResult {
|
|
978
974
|
return r([{ delta, type: 'settings-move-selection' }])
|
|
979
975
|
}
|
|
980
976
|
|
|
977
|
+
/** To the first row of the next section, the way `}` moves by paragraph. */
|
|
978
|
+
export function jumpSettingsSection(delta: -1 | 1): KeyResult {
|
|
979
|
+
return r([{ delta, type: 'settings-jump-section' }])
|
|
980
|
+
}
|
|
981
|
+
|
|
981
982
|
/**
|
|
982
983
|
* One key for every kind of row: it toggles a checkbox, advances an enum, or runs
|
|
983
984
|
* whatever the row does. Which one is the row's business, not the keymap's — so
|
|
984
985
|
* there is no per-kind binding to keep in sync with the schema.
|
|
985
986
|
*/
|
|
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
|
-
}
|
|
987
|
+
export const activateSettingsRow: KeyResult = r([], [{ type: 'activate-settings-row' }])
|
|
990
988
|
|
|
991
989
|
export function adjustSettingsRow(delta: 1 | -1): KeyResult {
|
|
992
990
|
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 }
|