diff --git a/cmd/msg/main.go b/cmd/msg/main.go index 46095f1..37fd036 100644 --- a/cmd/msg/main.go +++ b/cmd/msg/main.go @@ -42,7 +42,7 @@ func (MsgExecutor) Execute(_ context.Context, in executor.ExecuteInput) (executo if len(commandParts) > 2 && commandParts[1] == "selects" { switch commandParts[2] { case "first": - // User selected the first option, now show both selects side by side + // User selected the first option, now show both selects sequentially return showBothSelects(), nil case "second": // User selected the second option, respond accordingly @@ -62,7 +62,7 @@ func (MsgExecutor) Execute(_ context.Context, in executor.ExecuteInput) (executo }, nil } -// initialMessages shows only the first select option. +// initialMessages shows only the first dropdown. func initialMessages() executor.ExecuteOutput { cmdPrefix := func(cmd string) string { return fmt.Sprintf("%s %s %s", api.MessageBotNamePlaceholder, pluginName, cmd) @@ -102,7 +102,7 @@ func initialMessages() executor.ExecuteOutput { } } -// showBothSelects displays the second select option after the first one is selected. +// showBothSelects displays the second dropdown after the first one is selected. func showBothSelects() executor.ExecuteOutput { cmdPrefix := func(cmd string) string { return fmt.Sprintf("%s %s %s", api.MessageBotNamePlaceholder, pluginName, cmd) @@ -115,50 +115,46 @@ func showBothSelects() executor.ExecuteOutput { }, Sections: []api.Section{ { - Columns: []api.Column{ // Use columns to layout dropdowns side by side - { - Selects: api.Selects{ - ID: "select-id-1", - Items: []api.Select{ + Selects: api.Selects{ + ID: "select-id-1", + Items: []api.Select{ + { + Name: "first", + Command: cmdPrefix("selects first"), + OptionGroups: []api.OptionGroup{ { - Name: "first", - Command: cmdPrefix("selects first"), - OptionGroups: []api.OptionGroup{ - { - Name: "Group 1", - Options: []api.OptionItem{ - {Name: "BAR", Value: "BAR"}, - {Name: "BAZ", Value: "BAZ"}, - {Name: "XYZ", Value: "XYZ"}, - }, - }, + Name: "Group 1", + Options: []api.OptionItem{ + {Name: "BAR", Value: "BAR"}, + {Name: "BAZ", Value: "BAZ"}, + {Name: "XYZ", Value: "XYZ"}, }, }, }, }, }, - { - Selects: api.Selects{ - ID: "select-id-2", - Items: []api.Select{ + }, + }, + { + Selects: api.Selects{ + ID: "select-id-2", + Items: []api.Select{ + { + Name: "second", + Command: cmdPrefix("selects second"), + OptionGroups: []api.OptionGroup{ { - Name: "second", - Command: cmdPrefix("selects second"), - OptionGroups: []api.OptionGroup{ - { - Name: "Second Group", - Options: []api.OptionItem{ - {Name: "Option A", Value: "Option A"}, - {Name: "Option B", Value: "Option B"}, - }, - }, - }, - InitialOption: &api.OptionItem{ - Name: "Option A", - Value: "Option A", + Name: "Second Group", + Options: []api.OptionItem{ + {Name: "Option A", Value: "Option A"}, + {Name: "Option B", Value: "Option B"}, }, }, }, + InitialOption: &api.OptionItem{ + Name: "Option A", + Value: "Option A", + }, }, }, },