add a interface descripton to each task

This commit is contained in:
Robin Olsen
2026-03-11 19:39:03 +01:00
parent 102f718726
commit 5919333fd3
16 changed files with 92 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import (
type Tasker interface {
Config() Config
Details() TaskDetails
Details(InterfaceType) TaskDetails
Setup(context.Context) error
Questions(InterfaceType) Questions
Validate(context.Context) ValidationFeedback
@@ -32,10 +32,12 @@ type ValidatedInterface interface {
}
type TaskDetails struct {
Title string
Description string
TimeToComplete string
Difficulty string
Title string
Description string
TimeToComplete string
Difficulty string
InterfaceType InterfaceType
InterfaceDescription string
}
func (td TaskDetails) WithTitle(title string) TaskDetails {
@@ -58,6 +60,16 @@ func (td TaskDetails) WithDifficulty(difficulty string) TaskDetails {
return td
}
func (td TaskDetails) WithInterfaceType(interfaceType InterfaceType) TaskDetails {
td.InterfaceType = interfaceType
return td
}
func (td TaskDetails) WithInterfaceDescription(desc string) TaskDetails {
td.InterfaceDescription = desc
return td
}
type Questions []*huh.Group
func (q Questions) With(group *huh.Group) Questions {