func()

in internal/engine/interactive/interactive.go [542:591]


func (model InteractiveModeModel) View() string {
	// When running in the portal, we only want to show the Azure CLI viewport
	// which mimics a command line interface during execution.
	if model.environment == "azure" {
		return model.components.azureCLIViewport.View()
	}

	scenarioTitle := ui.ScenarioTitleStyle.Width(model.width).
		Align(lipgloss.Center).
		Render(model.scenarioTitle)

	border := lipgloss.NewStyle().
		Width(model.components.stepViewport.Width - 2).
		Border(lipgloss.NormalBorder())

	stepTitle := ui.StepTitleStyle.Render(
		fmt.Sprintf(
			"Step %d - %s",
			model.currentCodeBlock+1,
			model.codeBlockState[model.currentCodeBlock].StepName,
		),
	)
	stepView := border.Render(model.components.stepViewport.View())
	stepSection := fmt.Sprintf("%s\n%s\n\n", stepTitle, stepView)

	outputTitle := ui.StepTitleStyle.Render("Output")
	outputView := border.Render(model.components.outputViewport.View())
	outputSection := fmt.Sprintf("%s\n%s\n\n", outputTitle, outputView)

	paginator := lipgloss.NewStyle().
		Width(model.width).
		Align(lipgloss.Center).
		Render(model.components.paginator.View())

	var executing string

	if model.executingCommand {
		executing = "Executing command..."
	} else {
		executing = ""
	}

	// TODO(vmarcella): Format this to be more readable.
	return ((scenarioTitle + "\n") +
		(paginator + "\n\n") +
		(stepSection) +
		(outputSection) +
		(model.helpView())) +
		("\n" + executing)
}