@mobius-os/mobius 0.2.6 → 0.2.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 +1 -1
- package/src/components/Chat.tsx +1 -1
- package/src/components/PrepScreen.tsx +12 -18
package/package.json
CHANGED
package/src/components/Chat.tsx
CHANGED
|
@@ -131,11 +131,13 @@ export function PrepScreen({ client, onReady, onQuit }: {
|
|
|
131
131
|
setStep(next)
|
|
132
132
|
if (!next) finish(iss, p)
|
|
133
133
|
}
|
|
134
|
-
async function createIssue(name: string
|
|
134
|
+
async function createIssue(name: string) {
|
|
135
135
|
if (!project) return
|
|
136
136
|
setStatusMsg('创建任务…')
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
// git worktree is disabled by default and not offered as a choice — TUI
|
|
139
|
+
// tasks always run in the bound working tree.
|
|
140
|
+
const iss = await client.createIssue(project.id, { title: name || '命令行任务', description: '由 TUI 创建', use_worktree: false })
|
|
139
141
|
setIssues(await client.listIssues(project.id, 'active'))
|
|
140
142
|
await pickIssue(iss)
|
|
141
143
|
} catch (e: any) { setStatusMsg(`创建任务失败: ${e?.message ?? e}`) }
|
|
@@ -278,29 +280,21 @@ function ProjectPicker({ cwd, projects, statusMsg, onPick, onCreate, onQuit }: {
|
|
|
278
280
|
function IssuePicker({ issues, onPick, onCreate }: {
|
|
279
281
|
issues: Issue[]
|
|
280
282
|
onPick: (i: Issue) => void
|
|
281
|
-
onCreate: (name: string
|
|
283
|
+
onCreate: (name: string) => void
|
|
282
284
|
}) {
|
|
283
|
-
const [mode, setMode] = useState<'list' | 'create-name'
|
|
285
|
+
const [mode, setMode] = useState<'list' | 'create-name'>('list')
|
|
284
286
|
const [name, setName] = useState('')
|
|
285
287
|
|
|
286
288
|
if (mode === 'create-name') {
|
|
289
|
+
// git worktree is disabled by default and the option is intentionally not
|
|
290
|
+
// offered — TUI-created tasks always run in the bound working tree.
|
|
287
291
|
return (
|
|
288
292
|
<Box flexDirection="column" paddingX={2}>
|
|
289
|
-
<Text bold color="cyan"
|
|
293
|
+
<Text bold color="cyan">创建新任务</Text>
|
|
294
|
+
<Text color="gray">输入任务名称(不使用 git worktree)</Text>
|
|
290
295
|
<TextInput value={name} onChange={setName} focused placeholder="命令行任务"
|
|
291
|
-
onSubmit={() =>
|
|
292
|
-
<Text color="gray"
|
|
293
|
-
</Box>
|
|
294
|
-
)
|
|
295
|
-
}
|
|
296
|
-
if (mode === 'create-wt') {
|
|
297
|
-
return (
|
|
298
|
-
<Box flexDirection="column" paddingX={2}>
|
|
299
|
-
<Text bold color="cyan">创建新任务 · 第 2 步:是否使用 git worktree?</Text>
|
|
300
|
-
<Select
|
|
301
|
-
items={[{ label: '否(默认)', value: 'no' }, { label: '是', value: 'yes' }]}
|
|
302
|
-
onSelect={v => onCreate(name, v === 'yes')} />
|
|
303
|
-
<Text color="gray">回车确认 · Esc 返回</Text>
|
|
296
|
+
onSubmit={() => onCreate(name)} />
|
|
297
|
+
<Text color="gray">回车创建 · Esc 返回</Text>
|
|
304
298
|
</Box>
|
|
305
299
|
)
|
|
306
300
|
}
|