Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions app/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,25 @@ func (m *model) generateContent() string {
cmdBuf.WriteString(cmdStr)

// Border the commands with a title (plain header, with spinner while running or a tick when finished)
headerTitle := titleStyle.Render("60-second Linux analysis")
var header string
if m.execSeconds == 0 {
header = fmt.Sprintf("%s %s", m.spin.View(), headerTitle)
title := ""
if m.toolbox != nil && m.toolbox.Playbook != nil && strings.TrimSpace(m.toolbox.Playbook.Name) != "" {
title = m.toolbox.Playbook.Name
}
if title != "" {
headerTitle := titleStyle.Render(title)
if m.execSeconds == 0 {
header = fmt.Sprintf("%s %s", m.spin.View(), headerTitle)
} else {
header = fmt.Sprintf("%s %s %s", successStyle.Render(iconSuccess), headerTitle, descStyle.Render(fmt.Sprintf("(finished in %.1f seconds)", m.execSeconds)))
}
}
var commandsBox string
if header != "" {
commandsBox = header + "\n\n" + cmdBuf.String()
} else {
header = fmt.Sprintf("%s %s %s", successStyle.Render(iconSuccess), headerTitle, descStyle.Render(fmt.Sprintf("(finished in %.1f seconds)", m.execSeconds)))
commandsBox = cmdBuf.String()
}
commandsBox := header + "\n\n" + cmdBuf.String()

// Assemble full UI
var b strings.Builder
Expand Down
1 change: 1 addition & 0 deletions playbook/60-second-darwin.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: 60-second-darwin
name: 60-second macOS analysis
system_prompt: |
### 60-second macOS analysis
Expand Down
1 change: 1 addition & 0 deletions playbook/60-second-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: 60-second-linux
name: 60-second Linux analysis
nixpkgs:
version: "380be19fbd2d9079f677978361792cb25e8a3635" # nixos-22.05 branch
packages:
Expand Down
1 change: 1 addition & 0 deletions playbook/playbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package playbook

type PlaybookConfig struct {
ID string `yaml:"id"`
Name string `yaml:"name,omitempty"`
Nixpkgs struct {
Version string `yaml:"version"`
Packages []string `yaml:"packages"`
Expand Down