MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / initModifyStep

Method initModifyStep

tui/modify.go:244–271  ·  view source on GitHub ↗

initModifyStep sets up step-specific state when arriving at a visible step.

()

Source from the content-addressed store, hash-verified

242
243// initModifyStep sets up step-specific state when arriving at a visible step.
244func (m *modifyModel) initModifyStep() {
245 m.cursor = 0
246 switch m.step {
247 case modifyStepGPU:
248 m.cursor = m.getCurrentGPUCursorPosition()
249 case modifyStepCompute:
250 if m.needsGPUCountPhase() && m.config.NumGPUs == 0 {
251 m.gpuCountPhase = true
252 m.cursor = m.getCurrentGPUCountCursorPosition()
253 } else if !m.needsGPUCountPhase() {
254 gpuCounts := m.specs.GPUCounts(m.config.GPUType)
255 if len(gpuCounts) > 0 {
256 m.config.NumGPUs = gpuCounts[0]
257 } else {
258 m.config.NumGPUs = 1
259 }
260 m.gpuCountPhase = false
261 m.cursor = m.getCurrentComputeCursorPosition()
262 } else {
263 m.cursor = m.getCurrentComputeCursorPosition()
264 }
265 case modifyStepDiskSize:
266 m.diskInput.Focus()
267 m.diskInputTouched = false
268 default:
269 m.diskInput.Blur()
270 }
271}
272
273func (m *modifyModel) resetComputeSelection() {
274 m.config.NumGPUs = 0

Callers 1

trySkipCurrentStepMethod · 0.95

Tested by

no test coverage detected