Enhance command structure and user feedback in task management
- Added SprintCmd to issues command group - taskLoop hide survey related commands when in repl - Updated coding task instructions for clarity - Removed redundant SprintCmd registration - Improved REPL command handling for better user experience avoiding a chash if users type pm - Enhanced task UI to display additional information
This commit is contained in:
@@ -73,6 +73,7 @@ func init() {
|
||||
issues.CloseCmd.GroupID = "issues"
|
||||
issues.DeleteCmd.GroupID = "issues"
|
||||
issues.DepCmd.GroupID = "issues"
|
||||
issues.SprintCmd.GroupID = "issues"
|
||||
|
||||
RootCmd.AddCommand(issues.CreateCmd)
|
||||
RootCmd.AddCommand(issues.GetCmd)
|
||||
@@ -81,6 +82,7 @@ func init() {
|
||||
RootCmd.AddCommand(issues.CloseCmd)
|
||||
RootCmd.AddCommand(issues.DeleteCmd)
|
||||
RootCmd.AddCommand(issues.DepCmd)
|
||||
RootCmd.AddCommand(issues.SprintCmd)
|
||||
|
||||
RootCmd.AddGroup(&cobra.Group{ID: "comment", Title: "Comment Management"})
|
||||
issues.CommentCmd.GroupID = "comment"
|
||||
|
||||
@@ -158,7 +158,12 @@ func runStartCmd(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func taskLoop(ctx context.Context, application *task.App, surveyTasks map[string]task.Tasker, interfaces map[string]task.Interface) error {
|
||||
func taskLoop(
|
||||
ctx context.Context,
|
||||
application *task.App,
|
||||
surveyTasks map[string]task.Tasker,
|
||||
interfaces map[string]task.Interface,
|
||||
) error {
|
||||
var iNames []string
|
||||
for name := range interfaces {
|
||||
iNames = append(iNames, name)
|
||||
@@ -196,6 +201,15 @@ func taskLoop(ctx context.Context, application *task.App, surveyTasks map[string
|
||||
return fmt.Errorf("failed to write task details: %w", err)
|
||||
}
|
||||
|
||||
if tasks.InterfaceToType(selected) == tasks.InterfaceTypeREPL {
|
||||
survey.StartCmd.Hidden = true
|
||||
survey.StatusCmd.Hidden = true
|
||||
survey.SubmitCmd.Hidden = true
|
||||
replCmd.Hidden = true
|
||||
tuiCmd.Hidden = true
|
||||
webCmd.Hidden = true
|
||||
}
|
||||
|
||||
fmt.Println("\033[H\033[2J")
|
||||
if err := runner.Run(ctx, t, selected, tasks.InterfaceToType(selected)); err != nil {
|
||||
return err
|
||||
|
||||
@@ -15,6 +15,7 @@ const codingDescription = `You are tasked with fixing a logical error in the cod
|
||||
|
||||
Your task:
|
||||
1. A text file will appear in this directory(your desktop):
|
||||
- Name: code.txt
|
||||
- Open it and follow the instructions inside.
|
||||
- Save the file after you are done.
|
||||
2. Change status of the Issue "Fix major error" to Closed.`
|
||||
@@ -165,7 +166,7 @@ func (t *CodingTask) Validate(ctx context.Context) ValidationFeedback {
|
||||
return expect.ValidationFeedback
|
||||
}
|
||||
|
||||
code, ok := strings.CutPrefix(string(fileContent), codingDescription+textFileDescription+"\n")
|
||||
code, ok := strings.CutPrefix(string(fileContent), textFileDescription+"\n")
|
||||
if !ok {
|
||||
expect.Fail("The content of code.txt does not match the expected format.")
|
||||
return expect.ValidationFeedback
|
||||
|
||||
Reference in New Issue
Block a user