@brimveyn/aimux-config 0.4.1 → 0.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimveyn/aimux-config",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
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
@@ -457,6 +457,14 @@ export const toggleGitFileListMode: ActionFn = (ctx: ModeContext) => {
457
457
  )
458
458
  }
459
459
 
460
+ export const toggleTreeCompaction: ActionFn = (ctx: ModeContext) => {
461
+ const enabled = !ctx.state.gitPane.treeCompaction
462
+ return r(
463
+ [{ type: 'git-mode-toggle-tree-compaction' }],
464
+ [{ enabled, type: 'persist-git-tree-compaction' }]
465
+ )
466
+ }
467
+
460
468
  export function scrollGitDiff(delta: number): KeyResult {
461
469
  return r([], [{ delta, type: 'scroll-git-diff' }])
462
470
  }
package/src/defaults.ts CHANGED
@@ -88,6 +88,7 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
88
88
  .map('p', actions.gitPush, 'Push')
89
89
  .map('v', actions.toggleGitDiffView, 'Toggle split/stacked')
90
90
  .map('t', actions.toggleGitFileListMode, 'Toggle flat/tree')
91
+ .map('T', actions.toggleTreeCompaction, 'Toggle tree compaction')
91
92
  .map(']', actions.shiftGitHeadOffset(1), 'Older commit')
92
93
  .map('[', actions.shiftGitHeadOffset(-1), 'Newer commit')
93
94
  .map('?', actions.helpModal('git-mode'), 'Help')
package/src/types.ts CHANGED
@@ -165,8 +165,10 @@ export interface GitPaneState {
165
165
  ratio: number
166
166
  diffModeRatio: number
167
167
  fileListMode: GitFileListMode
168
+ treeCompaction: boolean
168
169
  path: GitPanePathConfig
169
170
  diffCount: GitPaneDiffCountConfig
171
+ prefetchRadius: number
170
172
  }
171
173
 
172
174
  export type GitFileStatus = 'M' | 'A' | 'D' | 'R' | 'C' | 'U' | '?'
@@ -215,6 +217,10 @@ export interface GitModeState {
215
217
  selectedEntryKey: string | null
216
218
  collapsedFolders: Record<string, true>
217
219
  diffs: Record<string, DiffData>
220
+ /** Parsed diff cache (internal); detailed shape lives in src/state/types. */
221
+ parsedFiles: Record<string, { hash: string; file: unknown }>
222
+ /** Syntax-highlight cache (internal). */
223
+ highlights: Record<string, { hash: string; themeId: string; add: unknown; del: unknown }>
218
224
  loading: Record<string, boolean>
219
225
  pendingDeletePath: string | null
220
226
  actionMessage: string | null
@@ -464,7 +470,8 @@ export type GitModeAction =
464
470
  | { type: 'git-mode-collapse-selection' }
465
471
  | { type: 'git-mode-expand-selection' }
466
472
  | { type: 'git-mode-toggle-file-list-mode' }
467
- | { type: 'git-mode-set-diff'; key: string; diff: DiffData }
473
+ | { type: 'git-mode-toggle-tree-compaction' }
474
+ | { type: 'git-mode-set-diff'; key: string; diff: DiffData; hash: string }
468
475
  | { type: 'git-mode-set-loading'; key: string; loading: boolean }
469
476
  | { type: 'git-mode-set-pending-delete'; path: string | null }
470
477
  | { type: 'git-mode-clear-diff-cache'; path: string }
@@ -529,6 +536,7 @@ export type SideEffect =
529
536
  | { type: 'scroll-git-diff'; delta: number }
530
537
  | { type: 'persist-git-diff-mode-ratio'; ratio: number }
531
538
  | { type: 'persist-git-file-list-mode'; mode: GitFileListMode }
539
+ | { type: 'persist-git-tree-compaction'; enabled: boolean }
532
540
  | { type: 'git-stage'; path: string }
533
541
  | { type: 'git-unstage'; path: string }
534
542
  | { type: 'git-restore'; path: string }
@@ -787,8 +795,11 @@ interface GitPaneBaseConfig {
787
795
  ratio?: number
788
796
  diffModeRatio?: number
789
797
  fileListMode?: GitFileListMode
798
+ treeCompaction?: boolean
790
799
  path?: GitPanePathConfig
791
800
  diffCount?: GitPaneDiffCountConfig
801
+ /** Prefetch N neighbouring diffs around the cursor; 0 disables. */
802
+ prefetchRadius?: number
792
803
  }
793
804
 
794
805
  export interface GitPaneEmbeddedConfig extends GitPaneBaseConfig {