@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimveyn/aimux-config",
3
- "version": "0.10.2",
3
+ "version": "0.10.5",
4
4
  "description": "TypeScript configuration API for aimux — keymaps, themes, and backends with a fluent builder.",
5
5
  "keywords": [
6
6
  "aimux",
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
- export const cancelNewTabModal: KeyResult = r([{ type: 'cancel-command-edit' }])
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
- * An empty prompt is not a workspace: it names nothing, branches nothing and
248
- * gives the assistant nothing to do, so Enter is simply inert until it is typed.
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: ActionFn = (ctx: ModeContext) => {
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: ActionFn = (ctx: ModeContext) => {
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
- // `h`/`l` always mean "change column", never "change value": a number row
163
- // would otherwise make them ambiguous. Values move on <Space>/<CR> (toggle,
164
- // next option) and on -/+ (step a number).
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('h', actions.focusSettingsPane('nav'), 'Sections')
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('+', actions.adjustSettingsRow(1), 'Increase', { repeatable: true })
183
- .map('-', actions.adjustSettingsRow(-1), 'Decrease', { repeatable: true })
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-select-section'; sectionId: string }
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 }