INTERFACES SKIP TASK implemented more intuitive 'skip task' in each interface

This commit is contained in:
Ine Maria Nilssen Aanonsen
2026-03-19 11:49:08 +01:00
parent d16bd5a302
commit a7fd271928
3 changed files with 28 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ func (m TaskModel) View() tea.View {
b.WriteString("\n")
helpText := "Press " + m.keys.Start.Help().Key + " to start • " + m.keys.Quit.Help().Key + " to quit • " + m.keys.About.Help().Key + " " + m.keys.About.Help().Desc
helpText := "Press " + m.keys.Start.Help().Key + " to start • " + m.getQuitHelpText() + " • " + m.keys.About.Help().Key + " " + m.keys.About.Help().Desc
b.WriteString(style.HelpStyle.Render(helpText))
final := lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, b.String())
@@ -119,6 +119,19 @@ func (m TaskModel) View() tea.View {
return v
}
func (m TaskModel) getQuitHelpText() string {
switch m.InterfaceType {
case models.InterfaceTypeWeb:
return "Press esc/q in the terminal to skip the task"
case models.InterfaceTypeTUI:
return "Press 'q' to skip task during the survey"
case models.InterfaceTypeCLI, models.InterfaceTypeREPL:
return "Write 'exit' to skip task during the survey"
default:
return m.keys.Quit.Help().Key + " to quit"
}
}
func (m *TaskModel) SetSize(width, height int) {
m.width, m.height = width, height
}