mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat(tui): fuse all started results of a run from the run list
This commit is contained in:
1 parent
588bf7b12e
commit
f67a48b728
4 files changed
+19
-8
No files matched your search
@@ -281,6 +281,11 @@ function MultiRunsDialog(props: MultiRunsDialogProps & { context: Context }) {
|
||||
if ((name === 'return' || name === 'right') && current) {
|
||||
event.preventDefault()
|
||||
setPane('details')
|
||||
return
|
||||
}
|
||||
if (name === 'f') {
|
||||
event.preventDefault()
|
||||
startFusion()
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -326,7 +331,7 @@ function MultiRunsDialog(props: MultiRunsDialogProps & { context: Context }) {
|
||||
|
||||
const hints = createMemo(() => {
|
||||
if (pane() === 'fuse') return [['tab', 'next field'], ['enter', 'pick model'], ['ctrl+s', 'fuse'], ['ctrl+b', 'back']] as const
|
||||
if (pane() === 'runs') return [['↑↓', 'select run'], ['enter', 'open run'], ['n', 'new multi-run'], ['r', 'refresh']] as const
|
||||
if (pane() === 'runs') return [['↑↓', 'select run'], ['enter', 'open run'], ['f', 'fuse results'], ['n', 'new multi-run'], ['r', 'refresh']] as const
|
||||
return [
|
||||
['↑↓', 'move'],
|
||||
['enter', 'open session'],
|
||||
|
||||
@@ -141,12 +141,12 @@ export function canDiscard(entry: MultiRunEntry): boolean {
|
||||
return entry.status === 'started' || entry.status === 'failed'
|
||||
}
|
||||
|
||||
/** Toggles an entry in the fusion selection, ignoring non-source entries and selections past the model limit. */
|
||||
/** Toggles an entry in the fusion selection, keeping run order and ignoring non-sources and selections past the model limit. */
|
||||
export function toggleFusionSource(run: MultiRun, selected: readonly number[], entryId: number): number[] {
|
||||
if (selected.includes(entryId)) return selected.filter((id) => id !== entryId)
|
||||
if (!startedEntries(run).some((entry) => entry.id === entryId)) return [...selected]
|
||||
if (selected.length >= MULTI_RUN_MAX_MODELS) return [...selected]
|
||||
return [...selected, entryId]
|
||||
const sourceIds = startedEntries(run).map((entry) => entry.id)
|
||||
if (selected.includes(entryId)) return sourceIds.filter((id) => id !== entryId && selected.includes(id))
|
||||
if (!sourceIds.includes(entryId) || selected.length >= MULTI_RUN_MAX_MODELS) return sourceIds.filter((id) => selected.includes(id))
|
||||
return sourceIds.filter((id) => id === entryId || selected.includes(id))
|
||||
}
|
||||
|
||||
export function parseLaunchForm(form: LaunchFormInput, repoId: number): ActionResult<LaunchMultiRunRequest> {
|
||||
|
||||
Reference in new issue
Block a user