Handle interactive add menu commands

This commit is contained in:
Joe Tretter
2026-05-18 20:39:06 -05:00
parent 3c437c980a
commit eb24866a7a
5 changed files with 150 additions and 17 deletions

View File

@@ -21,7 +21,14 @@ val RepoStateSaver = listSaver<RepoState, Any>(
state.submodules.flatMap { listOf(it.key, it.value) },
state.maintenanceActions.toList(),
state.fetchHeadCount,
state.interactiveAddSession?.let { listOf(it.target.orEmpty(), it.awaitingUpdateSelection.toString()) }.orEmpty(),
state.interactiveAddSession?.let {
listOf(
it.target.orEmpty(),
it.awaitingUpdateSelection.toString(),
it.selectionPrompt,
it.selectionAction,
)
}.orEmpty(),
)
},
restore = { saved ->
@@ -70,6 +77,8 @@ val RepoStateSaver = listSaver<RepoState, Any>(
InteractiveAddSession(
target = (it[0] as String).ifBlank { null },
awaitingUpdateSelection = (it[1] as String).toBoolean(),
selectionPrompt = it.getOrNull(2) as? String ?: "Update>>",
selectionAction = it.getOrNull(3) as? String ?: "update",
)
},
)