@brimveyn/aimux-config 0.11.5 → 0.11.7

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.11.5",
3
+ "version": "0.11.7",
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
@@ -664,6 +664,27 @@ function selectedGitFile(ctx: ModeContext) {
664
664
 
665
665
  export const exitGitMode: KeyResult = r([{ type: 'exit-git-mode' }], [], 'navigation')
666
666
 
667
+ /**
668
+ * Esc in git mode peels one layer at a time: an applied file filter goes
669
+ * first, so the full list is one key away, and the next Esc leaves.
670
+ */
671
+ export const escapeGitMode: ActionFn = (ctx: ModeContext) =>
672
+ ctx.state.gitMode.fileFilter === '' ? exitGitMode : r([{ type: 'clear-git-file-filter' }])
673
+
674
+ export const openGitFileFilter: KeyResult = r(
675
+ [{ type: 'open-git-file-filter' }],
676
+ [],
677
+ 'modal.git-file-filter'
678
+ )
679
+
680
+ export const commitGitFileFilter: KeyResult = r(
681
+ [{ type: 'commit-git-file-filter' }],
682
+ [],
683
+ 'git-mode'
684
+ )
685
+
686
+ export const cancelGitFileFilter: KeyResult = r([{ type: 'close-modal' }], [], 'git-mode')
687
+
667
688
  export function selectGitFile(delta: -1 | 1): ActionFn {
668
689
  return (ctx: ModeContext) => {
669
690
  if (ctx.state.gitPanel.files.length === 0) return r([])
package/src/app-types.ts CHANGED
@@ -102,6 +102,7 @@ export type ModalType =
102
102
  | 'setting-text'
103
103
  | 'setting-keybind'
104
104
  | 'settings-search'
105
+ | 'git-file-filter'
105
106
  /**
106
107
  * Every plugin modal, the way `plugin-view` covers every plugin view. Which
107
108
  * one is on `ModalPlugin.modalId`, so adding a modal is a registration
@@ -462,6 +463,12 @@ export interface GitModeState {
462
463
  headOffset: number
463
464
  /** When true, diff the active workspace's working tree against its fork point. */
464
465
  reviewBase: boolean
466
+ /**
467
+ * The applied file filter: a case-insensitive substring of the path. Empty
468
+ * shows every file. While the filter bar is open, the draft in its modal's
469
+ * `editBuffer` is what the sidebar shows instead.
470
+ */
471
+ fileFilter: string
465
472
  }
466
473
 
467
474
  interface ModalBase {
@@ -534,6 +541,13 @@ export interface ModalRenameTab extends ModalBase {
534
541
  export interface ModalSettingsSearch extends ModalBase {
535
542
  type: 'settings-search'
536
543
  }
544
+ /**
545
+ * The diff sidebar's file filter being typed. An overlay: focus stays on git
546
+ * mode, and the bar is drawn in the sidebar rather than floating over it.
547
+ */
548
+ export interface ModalGitFileFilter extends ModalBase {
549
+ type: 'git-file-filter'
550
+ }
537
551
  export interface ModalSettingText extends ModalBase {
538
552
  type: 'setting-text'
539
553
  settingId: string
@@ -761,6 +775,7 @@ export type ModalState =
761
775
  | ModalSettingText
762
776
  | ModalSettingKeybind
763
777
  | ModalSettingsSearch
778
+ | ModalGitFileFilter
764
779
  | ModalPlugin
765
780
 
766
781
  export interface LayoutState {
@@ -969,6 +984,7 @@ export type BuiltinModeId =
969
984
  | 'modal.update-available'
970
985
  | 'modal.workspace-move'
971
986
  | 'modal.workspace-move-confirm'
987
+ | 'modal.git-file-filter'
972
988
  | 'modal.flash-jump'
973
989
  | 'modal.quotas'
974
990
  | 'settings'
@@ -1385,6 +1401,9 @@ export type AutoCommitAction =
1385
1401
  export type GitModeAction =
1386
1402
  | { type: 'enter-git-mode' }
1387
1403
  | { type: 'exit-git-mode' }
1404
+ | { type: 'open-git-file-filter' }
1405
+ | { type: 'commit-git-file-filter' }
1406
+ | { type: 'clear-git-file-filter' }
1388
1407
  | { type: 'git-mode-move-selection'; delta: -1 | 1 }
1389
1408
  | { type: 'git-mode-move-file-selection'; delta: -1 | 1 }
1390
1409
  | { type: 'git-mode-select-entry-by-key'; key: string }
package/src/defaults.ts CHANGED
@@ -139,7 +139,8 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
139
139
  .map(']', actions.shiftGitHeadOffset(-1), 'Newer commit')
140
140
  .map('[', actions.shiftGitHeadOffset(1), 'Older commit')
141
141
  .map('?', actions.helpModal('git-mode'), 'Help')
142
- .map('<Esc>', actions.exitGitMode, 'Exit git')
142
+ .map('/', actions.openGitFileFilter, 'Search files')
143
+ .map('<Esc>', actions.escapeGitMode, 'Clear filter, then exit git')
143
144
  .map('j', actions.selectGitFile(1), 'Next entry')
144
145
  .map('k', actions.selectGitFile(-1), 'Prev entry')
145
146
  .map('<C-n>', actions.selectGitFileOnly(1), 'Next file')
@@ -157,6 +158,21 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
157
158
  .map('<Up>', actions.scrollGitDiff(-1), 'Scroll up')
158
159
  )
159
160
 
161
+ // -----------------------------------------------------------------------
162
+ // Git mode: the sidebar's file filter, typed in place. The list narrows as
163
+ // you type; <CR> keeps the filter, <Esc> puts back the one you had.
164
+ // -----------------------------------------------------------------------
165
+ .mode('modal.git-file-filter', (m) =>
166
+ m
167
+ .map('<Esc>', actions.cancelGitFileFilter, 'Cancel')
168
+ .map('<CR>', actions.commitGitFileFilter, 'Apply filter')
169
+ .map('<C-n>', actions.selectGitFileOnly(1), 'Next file')
170
+ .map('<C-p>', actions.selectGitFileOnly(-1), 'Prev file')
171
+ .map('<Down>', actions.selectGitFileOnly(1))
172
+ .map('<Up>', actions.selectGitFileOnly(-1))
173
+ .passthrough()
174
+ )
175
+
160
176
  // -----------------------------------------------------------------------
161
177
  // Settings screen
162
178
  //
package/src/types.ts CHANGED
@@ -293,6 +293,13 @@ export interface AutoRenameConfig {
293
293
  * confirmations and ignored (they do not consume an attempt).
294
294
  */
295
295
  minPromptWords: number
296
+ /**
297
+ * Extra rules for the branch name generated when a workspace is created from
298
+ * a prompt, appended to the naming prompt (e.g. `"Prefix with the Jira ticket:
299
+ * ABC-123/short-subject"`). They override the built-in `<type>/<subject>`
300
+ * convention; the result is then only checked for being a valid git ref.
301
+ */
302
+ branchInstructions?: string
296
303
  }
297
304
 
298
305
  export interface MultiRepoConfig {