@brimveyn/aimux-config 0.5.3 → 0.5.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.5.3",
3
+ "version": "0.5.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
@@ -547,6 +547,64 @@ export const gitDestructiveSelected: ActionFn = (ctx: ModeContext) => {
547
547
  return r([{ path: file.path, type: 'git-mode-set-pending-delete' }])
548
548
  }
549
549
 
550
+ export const gitToggleFoldAll: ActionFn = (ctx: ModeContext) => {
551
+ const file = selectedGitFile(ctx)
552
+ if (!file) return r([])
553
+ const key = gitFileKey(file.section, file.path)
554
+ return r([{ key, type: 'git-mode-fold-toggle-all' }])
555
+ }
556
+
557
+ export const gitStageAll: ActionFn = (ctx: ModeContext) => {
558
+ if (ctx.state.gitMode.headOffset > 0) {
559
+ return r([
560
+ {
561
+ message: 'disabled while viewing HEAD~N (press 0 or [ to return)',
562
+ type: 'git-mode-set-message',
563
+ },
564
+ ])
565
+ }
566
+ const files = ctx.state.gitPanel.files
567
+ const pending = clearPendingDelete(ctx)
568
+ if (files.length === 0) return r(pending)
569
+ const actions: AppAction[] = [...pending]
570
+ for (const f of files) {
571
+ if (f.section === 'staged') continue
572
+ actions.push({
573
+ fromSection: f.section,
574
+ path: f.path,
575
+ toSection: 'staged',
576
+ type: 'git-mode-optimistic-move',
577
+ })
578
+ }
579
+ return r(actions, [{ type: 'git-stage-all' }])
580
+ }
581
+
582
+ export const gitUnstageAll: ActionFn = (ctx: ModeContext) => {
583
+ if (ctx.state.gitMode.headOffset > 0) {
584
+ return r([
585
+ {
586
+ message: 'disabled while viewing HEAD~N (press 0 or [ to return)',
587
+ type: 'git-mode-set-message',
588
+ },
589
+ ])
590
+ }
591
+ const files = ctx.state.gitPanel.files
592
+ const pending = clearPendingDelete(ctx)
593
+ if (files.length === 0) return r(pending)
594
+ const actions: AppAction[] = [...pending]
595
+ for (const f of files) {
596
+ if (f.section !== 'staged') continue
597
+ const toSection = f.status === 'A' ? 'untracked' : 'unstaged'
598
+ actions.push({
599
+ fromSection: 'staged',
600
+ path: f.path,
601
+ toSection,
602
+ type: 'git-mode-optimistic-move',
603
+ })
604
+ }
605
+ return r(actions, [{ type: 'git-unstage-all' }])
606
+ }
607
+
550
608
  export const gitCommitOpen: ActionFn = (ctx: ModeContext) => {
551
609
  if (ctx.state.gitMode.headOffset > 0) {
552
610
  return r([
package/src/defaults.ts CHANGED
@@ -98,7 +98,10 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
98
98
  .mode('git-mode', (m) =>
99
99
  m
100
100
  .map('a', actions.gitStageSelected, 'Stage')
101
+ .map('A', actions.gitStageAll, 'Stage all')
101
102
  .map('d', actions.gitDestructiveSelected, 'Unstage/delete')
103
+ .map('D', actions.gitUnstageAll, 'Unstage all')
104
+ .map('e', actions.gitToggleFoldAll, 'Expand/collapse all folds')
102
105
  .map('c', actions.gitCommitOpen, 'Commit')
103
106
  .map('p', actions.gitPush, 'Push')
104
107
  .map('v', actions.toggleGitDiffView, 'Toggle split/stacked')
package/src/types.ts CHANGED
@@ -543,6 +543,7 @@ export type GitModeAction =
543
543
  delta: number
544
544
  }
545
545
  | { type: 'git-mode-fold-set'; key: string; foldId: string; top: number; bottom: number }
546
+ | { type: 'git-mode-fold-toggle-all'; key: string }
546
547
  | {
547
548
  type: 'git-mode-optimistic-move'
548
549
  path: string
@@ -619,6 +620,8 @@ export type SideEffect =
619
620
  | { type: 'persist-git-tree-compaction'; enabled: boolean }
620
621
  | { type: 'git-stage'; path: string }
621
622
  | { type: 'git-unstage'; path: string }
623
+ | { type: 'git-stage-all' }
624
+ | { type: 'git-unstage-all' }
622
625
  | { type: 'git-restore'; path: string }
623
626
  | { type: 'git-rm'; path: string }
624
627
  | { type: 'git-commit'; title: string; body: string }