ccmanager 2.4.0 → 2.5.0
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/dist/components/App.js +1 -7
- package/dist/components/NewWorktree.js +50 -27
- package/package.json +1 -1
package/dist/components/App.js
CHANGED
|
@@ -10,7 +10,6 @@ import Configuration from './Configuration.js';
|
|
|
10
10
|
import PresetSelector from './PresetSelector.js';
|
|
11
11
|
import { globalSessionOrchestrator } from '../services/globalSessionOrchestrator.js';
|
|
12
12
|
import { WorktreeService } from '../services/worktreeService.js';
|
|
13
|
-
import { shortcutManager } from '../services/shortcutManager.js';
|
|
14
13
|
import { configurationManager } from '../services/configurationManager.js';
|
|
15
14
|
import { ENV_VARS } from '../constants/env.js';
|
|
16
15
|
import { MULTI_PROJECT_ERRORS } from '../constants/error.js';
|
|
@@ -264,12 +263,7 @@ const App = ({ devcontainerConfig, multiProject }) => {
|
|
|
264
263
|
}
|
|
265
264
|
if (view === 'session' && activeSession) {
|
|
266
265
|
return (React.createElement(Box, { flexDirection: "column" },
|
|
267
|
-
React.createElement(Session, { key: activeSession.id, session: activeSession, sessionManager: sessionManager, onReturnToMenu: handleReturnToMenu })
|
|
268
|
-
React.createElement(Box, { marginTop: 1 },
|
|
269
|
-
React.createElement(Text, { dimColor: true },
|
|
270
|
-
"Press ",
|
|
271
|
-
shortcutManager.getShortcutDisplay('returnToMenu'),
|
|
272
|
-
" to return to menu"))));
|
|
266
|
+
React.createElement(Session, { key: activeSession.id, session: activeSession, sessionManager: sessionManager, onReturnToMenu: handleReturnToMenu })));
|
|
273
267
|
}
|
|
274
268
|
if (view === 'new-worktree') {
|
|
275
269
|
return (React.createElement(Box, { flexDirection: "column" },
|
|
@@ -12,7 +12,7 @@ const NewWorktree = ({ projectPath, onComplete, onCancel, }) => {
|
|
|
12
12
|
const isAutoDirectory = worktreeConfig.autoDirectory;
|
|
13
13
|
const limit = 10;
|
|
14
14
|
// Adjust initial step based on auto directory mode
|
|
15
|
-
const [step, setStep] = useState(isAutoDirectory ? 'branch' : 'path');
|
|
15
|
+
const [step, setStep] = useState(isAutoDirectory ? 'base-branch' : 'path');
|
|
16
16
|
const [path, setPath] = useState('');
|
|
17
17
|
const [branch, setBranch] = useState('');
|
|
18
18
|
const [baseBranch, setBaseBranch] = useState('');
|
|
@@ -59,18 +59,30 @@ const NewWorktree = ({ projectPath, onComplete, onCancel, }) => {
|
|
|
59
59
|
const handlePathSubmit = (value) => {
|
|
60
60
|
if (value.trim()) {
|
|
61
61
|
setPath(value.trim());
|
|
62
|
-
setStep('branch');
|
|
62
|
+
setStep('base-branch');
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
const handleBranchSubmit = (value) => {
|
|
66
66
|
if (value.trim()) {
|
|
67
67
|
setBranch(value.trim());
|
|
68
|
-
setStep('
|
|
68
|
+
setStep('copy-settings');
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
const handleBaseBranchSelect = (item) => {
|
|
72
72
|
setBaseBranch(item.value);
|
|
73
|
-
setStep('
|
|
73
|
+
setStep('branch-strategy');
|
|
74
|
+
};
|
|
75
|
+
const handleBranchStrategySelect = (item) => {
|
|
76
|
+
const useExisting = item.value === 'existing';
|
|
77
|
+
if (useExisting) {
|
|
78
|
+
// Use the base branch as the branch name for existing branch
|
|
79
|
+
setBranch(baseBranch);
|
|
80
|
+
setStep('copy-settings');
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// Need to input new branch name
|
|
84
|
+
setStep('branch');
|
|
85
|
+
}
|
|
74
86
|
};
|
|
75
87
|
const handleCopySettingsSelect = (item) => {
|
|
76
88
|
setCopyClaudeDirectory(item.value);
|
|
@@ -107,31 +119,10 @@ const NewWorktree = ({ projectPath, onComplete, onCancel, }) => {
|
|
|
107
119
|
React.createElement(Text, null, "Enter worktree path (relative to repository root):")),
|
|
108
120
|
React.createElement(Box, null,
|
|
109
121
|
React.createElement(Text, { color: "cyan" }, '> '),
|
|
110
|
-
React.createElement(TextInputWrapper, { value: path, onChange: setPath, onSubmit: handlePathSubmit, placeholder: "e.g., ../myproject-feature" })))) :
|
|
111
|
-
React.createElement(Box, { marginBottom: 1 },
|
|
112
|
-
React.createElement(Text, null,
|
|
113
|
-
"Enter branch name for worktree at ",
|
|
114
|
-
React.createElement(Text, { color: "cyan" }, path),
|
|
115
|
-
":")),
|
|
116
|
-
React.createElement(Box, null,
|
|
117
|
-
React.createElement(Text, { color: "cyan" }, '> '),
|
|
118
|
-
React.createElement(TextInputWrapper, { value: branch, onChange: setBranch, onSubmit: handleBranchSubmit, placeholder: "e.g., feature/new-feature" })))) : step === 'branch' ? (React.createElement(Box, { flexDirection: "column" },
|
|
119
|
-
React.createElement(Box, { marginBottom: 1 },
|
|
120
|
-
React.createElement(Text, null, "Enter branch name (directory will be auto-generated):")),
|
|
121
|
-
React.createElement(Box, null,
|
|
122
|
-
React.createElement(Text, { color: "cyan" }, '> '),
|
|
123
|
-
React.createElement(TextInputWrapper, { value: branch, onChange: setBranch, onSubmit: handleBranchSubmit, placeholder: "e.g., feature/new-feature" })),
|
|
124
|
-
generatedPath && (React.createElement(Box, { marginTop: 1 },
|
|
125
|
-
React.createElement(Text, { dimColor: true },
|
|
126
|
-
"Worktree will be created at:",
|
|
127
|
-
' ',
|
|
128
|
-
React.createElement(Text, { color: "green" }, generatedPath)))))) : null,
|
|
122
|
+
React.createElement(TextInputWrapper, { value: path, onChange: setPath, onSubmit: handlePathSubmit, placeholder: "e.g., ../myproject-feature" })))) : null,
|
|
129
123
|
step === 'base-branch' && (React.createElement(Box, { flexDirection: "column" },
|
|
130
124
|
React.createElement(Box, { marginBottom: 1 },
|
|
131
|
-
React.createElement(Text, null,
|
|
132
|
-
"Select base branch for ",
|
|
133
|
-
React.createElement(Text, { color: "cyan" }, branch),
|
|
134
|
-
":")),
|
|
125
|
+
React.createElement(Text, null, "Select base branch for the worktree:")),
|
|
135
126
|
isSearchMode && (React.createElement(Box, { marginBottom: 1 },
|
|
136
127
|
React.createElement(Text, null, "Search: "),
|
|
137
128
|
React.createElement(TextInputWrapper, { value: searchQuery, onChange: setSearchQuery, focus: true, placeholder: "Type to filter branches..." }))),
|
|
@@ -143,6 +134,38 @@ const NewWorktree = ({ projectPath, onComplete, onCancel, }) => {
|
|
|
143
134
|
item.label))))) : (React.createElement(SelectInput, { items: branchItems, onSelect: handleBaseBranchSelect, initialIndex: selectedIndex, limit: limit, isFocused: !isSearchMode })),
|
|
144
135
|
!isSearchMode && (React.createElement(Box, { marginTop: 1 },
|
|
145
136
|
React.createElement(Text, { dimColor: true }, "Press / to search"))))),
|
|
137
|
+
step === 'branch-strategy' && (React.createElement(Box, { flexDirection: "column" },
|
|
138
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
139
|
+
React.createElement(Text, null,
|
|
140
|
+
"Base branch: ",
|
|
141
|
+
React.createElement(Text, { color: "cyan" }, baseBranch))),
|
|
142
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
143
|
+
React.createElement(Text, null, "Choose branch creation strategy:")),
|
|
144
|
+
React.createElement(SelectInput, { items: [
|
|
145
|
+
{
|
|
146
|
+
label: 'Create new branch from base branch',
|
|
147
|
+
value: 'new',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: 'Use existing base branch',
|
|
151
|
+
value: 'existing',
|
|
152
|
+
},
|
|
153
|
+
], onSelect: handleBranchStrategySelect, initialIndex: 0 }))),
|
|
154
|
+
step === 'branch' && (React.createElement(Box, { flexDirection: "column" },
|
|
155
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
156
|
+
React.createElement(Text, null,
|
|
157
|
+
"Enter new branch name (will be created from",
|
|
158
|
+
' ',
|
|
159
|
+
React.createElement(Text, { color: "cyan" }, baseBranch),
|
|
160
|
+
"):")),
|
|
161
|
+
React.createElement(Box, null,
|
|
162
|
+
React.createElement(Text, { color: "cyan" }, '> '),
|
|
163
|
+
React.createElement(TextInputWrapper, { value: branch, onChange: setBranch, onSubmit: handleBranchSubmit, placeholder: "e.g., feature/new-feature" })),
|
|
164
|
+
isAutoDirectory && generatedPath && (React.createElement(Box, { marginTop: 1 },
|
|
165
|
+
React.createElement(Text, { dimColor: true },
|
|
166
|
+
"Worktree will be created at:",
|
|
167
|
+
' ',
|
|
168
|
+
React.createElement(Text, { color: "green" }, generatedPath)))))),
|
|
146
169
|
step === 'copy-settings' && (React.createElement(Box, { flexDirection: "column" },
|
|
147
170
|
React.createElement(Box, { marginBottom: 1 },
|
|
148
171
|
React.createElement(Text, null,
|