ccmanager 0.1.11 → 0.1.12

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.
@@ -66,6 +66,6 @@ const Configuration = ({ onComplete }) => {
66
66
  React.createElement(Text, { bold: true, color: "green" }, "Configuration")),
67
67
  React.createElement(Box, { marginBottom: 1 },
68
68
  React.createElement(Text, { dimColor: true }, "Select a configuration option:")),
69
- React.createElement(SelectInput, { items: menuItems, onSelect: handleSelect, isFocused: true })));
69
+ React.createElement(SelectInput, { items: menuItems, onSelect: handleSelect, isFocused: true, limit: 10 })));
70
70
  };
71
71
  export default Configuration;
@@ -126,7 +126,7 @@ const ConfigureHooks = ({ onComplete }) => {
126
126
  React.createElement(Text, { bold: true, color: "green" }, "Configure Status Change Hooks")),
127
127
  React.createElement(Box, { marginBottom: 1 },
128
128
  React.createElement(Text, { dimColor: true }, "Set commands to run when Claude Code session status changes:")),
129
- React.createElement(SelectInput, { items: getMenuItems(), onSelect: handleMenuSelect, isFocused: true }),
129
+ React.createElement(SelectInput, { items: getMenuItems(), onSelect: handleMenuSelect, isFocused: true, limit: 10 }),
130
130
  React.createElement(Box, { marginTop: 1 },
131
131
  React.createElement(Text, { dimColor: true }, "Press Esc to go back"))));
132
132
  };
@@ -132,7 +132,7 @@ const ConfigureShortcuts = ({ onComplete, }) => {
132
132
  error))),
133
133
  React.createElement(Box, { marginBottom: 1 },
134
134
  React.createElement(Text, { dimColor: true }, "Select a shortcut to change:")),
135
- React.createElement(SelectInput, { items: shortcutItems, onSelect: handleSelect, isFocused: true }),
135
+ React.createElement(SelectInput, { items: shortcutItems, onSelect: handleSelect, isFocused: true, limit: 10 }),
136
136
  React.createElement(Box, { marginTop: 1 },
137
137
  React.createElement(Text, { dimColor: true }, "Press Esc to exit without saving"))));
138
138
  };
@@ -8,6 +8,7 @@ const DeleteWorktree = ({ onComplete, onCancel, }) => {
8
8
  const [selectedIndices, setSelectedIndices] = useState(new Set());
9
9
  const [focusedIndex, setFocusedIndex] = useState(0);
10
10
  const [confirmMode, setConfirmMode] = useState(false);
11
+ const VIEWPORT_SIZE = 10; // Maximum number of items to display at once
11
12
  useEffect(() => {
12
13
  const worktreeService = new WorktreeService();
13
14
  const allWorktrees = worktreeService.getWorktrees();
@@ -73,13 +74,28 @@ const DeleteWorktree = ({ onComplete, onCancel, }) => {
73
74
  React.createElement(Text, { bold: true, color: "red" }, "\u26A0\uFE0F Delete Confirmation"),
74
75
  React.createElement(Box, { marginTop: 1, marginBottom: 1, flexDirection: "column" },
75
76
  React.createElement(Text, null, "You are about to delete the following worktrees:"),
76
- selectedWorktrees.map(wt => (React.createElement(Text, { key: wt.path, color: "red" },
77
- "\u2022 ",
77
+ selectedWorktrees.length <= 10 ? (selectedWorktrees.map(wt => (React.createElement(Text, { key: wt.path, color: "red" },
78
+ "\u2022",
79
+ ' ',
78
80
  wt.branch ? wt.branch.replace('refs/heads/', '') : 'detached',
79
81
  ' ',
80
82
  "(",
81
83
  wt.path,
82
- ")")))),
84
+ ")")))) : (React.createElement(React.Fragment, null,
85
+ selectedWorktrees.slice(0, 8).map(wt => (React.createElement(Text, { key: wt.path, color: "red" },
86
+ "\u2022",
87
+ ' ',
88
+ wt.branch
89
+ ? wt.branch.replace('refs/heads/', '')
90
+ : 'detached',
91
+ ' ',
92
+ "(",
93
+ wt.path,
94
+ ")"))),
95
+ React.createElement(Text, { color: "red", dimColor: true },
96
+ "... and ",
97
+ selectedWorktrees.length - 8,
98
+ " more worktrees")))),
83
99
  React.createElement(Text, { bold: true }, "This will also delete their branches. Are you sure?")));
84
100
  return (React.createElement(Confirmation, { message: confirmMessage, onConfirm: handleConfirm, onCancel: handleCancel }));
85
101
  }
@@ -88,21 +104,37 @@ const DeleteWorktree = ({ onComplete, onCancel, }) => {
88
104
  React.createElement(Text, { bold: true, color: "red" }, "Delete Worktrees")),
89
105
  React.createElement(Box, { marginBottom: 1 },
90
106
  React.createElement(Text, { dimColor: true }, "Select worktrees to delete (Space to select, Enter to confirm):")),
91
- worktrees.map((worktree, index) => {
92
- const isSelected = selectedIndices.has(index);
93
- const isFocused = index === focusedIndex;
94
- const branchName = worktree.branch
95
- ? worktree.branch.replace('refs/heads/', '')
96
- : 'detached';
97
- return (React.createElement(Box, { key: worktree.path },
98
- React.createElement(Text, { color: isFocused ? 'green' : undefined, inverse: isFocused, dimColor: !isFocused && !isSelected },
99
- isSelected ? '[✓]' : '[ ]',
100
- " ",
101
- branchName,
102
- " (",
103
- worktree.path,
104
- ")")));
105
- }),
107
+ (() => {
108
+ // Calculate viewport window
109
+ const viewportStart = Math.max(0, Math.min(focusedIndex - Math.floor(VIEWPORT_SIZE / 2), worktrees.length - VIEWPORT_SIZE));
110
+ const viewportEnd = Math.min(viewportStart + VIEWPORT_SIZE, worktrees.length);
111
+ const visibleWorktrees = worktrees.slice(viewportStart, viewportEnd);
112
+ return (React.createElement(React.Fragment, null,
113
+ viewportStart > 0 && (React.createElement(Text, { dimColor: true },
114
+ "\u2191 ",
115
+ viewportStart,
116
+ " more...")),
117
+ visibleWorktrees.map((worktree, relativeIndex) => {
118
+ const actualIndex = viewportStart + relativeIndex;
119
+ const isSelected = selectedIndices.has(actualIndex);
120
+ const isFocused = actualIndex === focusedIndex;
121
+ const branchName = worktree.branch
122
+ ? worktree.branch.replace('refs/heads/', '')
123
+ : 'detached';
124
+ return (React.createElement(Box, { key: worktree.path },
125
+ React.createElement(Text, { color: isFocused ? 'green' : undefined, inverse: isFocused, dimColor: !isFocused && !isSelected },
126
+ isSelected ? '[✓]' : '[ ]',
127
+ " ",
128
+ branchName,
129
+ " (",
130
+ worktree.path,
131
+ ")")));
132
+ }),
133
+ viewportEnd < worktrees.length && (React.createElement(Text, { dimColor: true },
134
+ "\u2193 ",
135
+ worktrees.length - viewportEnd,
136
+ " more..."))));
137
+ })(),
106
138
  React.createElement(Box, { marginTop: 1, flexDirection: "column" },
107
139
  React.createElement(Text, { dimColor: true },
108
140
  "Controls: \u2191\u2193 Navigate, Space Select, Enter Confirm,",
@@ -55,7 +55,7 @@ const MergeWorktree = ({ onComplete, onCancel, }) => {
55
55
  React.createElement(Text, { bold: true, color: "green" }, "Merge Worktree")),
56
56
  React.createElement(Box, { marginBottom: 1 },
57
57
  React.createElement(Text, null, "Select the source branch to merge:")),
58
- React.createElement(SelectInput, { items: branchItems, onSelect: handleSelectSource, isFocused: true }),
58
+ React.createElement(SelectInput, { items: branchItems, onSelect: handleSelectSource, isFocused: true, limit: 10 }),
59
59
  React.createElement(Box, { marginTop: 1 },
60
60
  React.createElement(Text, { dimColor: true },
61
61
  "Press ",
@@ -72,7 +72,7 @@ const MergeWorktree = ({ onComplete, onCancel, }) => {
72
72
  React.createElement(Text, { color: "yellow" }, sourceBranch))),
73
73
  React.createElement(Box, { marginBottom: 1 },
74
74
  React.createElement(Text, null, "Select the target branch to merge into:")),
75
- React.createElement(SelectInput, { items: branchItems, onSelect: handleSelectTarget, isFocused: true }),
75
+ React.createElement(SelectInput, { items: branchItems, onSelect: handleSelectTarget, isFocused: true, limit: 10 }),
76
76
  React.createElement(Box, { marginTop: 1 },
77
77
  React.createElement(Text, { dimColor: true },
78
78
  "Press ",
@@ -96,7 +96,7 @@ const NewWorktree = ({ onComplete, onCancel }) => {
96
96
  "Select base branch for ",
97
97
  React.createElement(Text, { color: "cyan" }, branch),
98
98
  ":")),
99
- React.createElement(SelectInput, { items: branchItems, onSelect: handleBaseBranchSelect, initialIndex: 0 }))),
99
+ React.createElement(SelectInput, { items: branchItems, onSelect: handleBaseBranchSelect, initialIndex: 0, limit: 10 }))),
100
100
  React.createElement(Box, { marginTop: 1 },
101
101
  React.createElement(Text, { dimColor: true },
102
102
  "Press ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "TUI application for managing multiple Claude Code sessions across Git worktrees",
5
5
  "license": "MIT",
6
6
  "author": "Kodai Kabasawa",