@@ -49,8 +49,11 @@ type Commands struct {
49 Close key.Binding
49 Close key.Binding
52− sessionID string // can be empty for non-session-specific commands
52+ sessionID string
53− selected CommandType
56+ selected CommandType
55 spinner spinner.Model
58 spinner spinner.Model
56 loading bool
59 loading bool
@@ -68,11 +71,14 @@ type Commands struct {
68var _ Dialog = (*Commands)(nil)
71var _ Dialog = (*Commands)(nil)
70// NewCommands creates a new commands dialog.
73// NewCommands creates a new commands dialog.
71−func NewCommands(com *common.Common, sessionID string, customCommands []commands.CustomCommand, mcpPrompts []commands.MCPPrompt) (*Commands, error) {
74+func NewCommands(com *common.Common, sessionID string, hasSession, hasTodos, hasQueue bool, customCommands []commands.CustomCommand, mcpPrompts []commands.MCPPrompt) (*Commands, error) {
72 c := &Commands{
75 c := &Commands{
74 selected: SystemCommands,
77 selected: SystemCommands,
75 sessionID: sessionID,
78 sessionID: sessionID,
79+ hasSession: hasSession,
76 customCommands: customCommands,
82 customCommands: customCommands,
77 mcpPrompts: mcpPrompts,
83 mcpPrompts: mcpPrompts,
@@ -387,7 +393,7 @@ func (c *Commands) defaultCommands() []*CommandItem {
389 // Only show compact command if there's an active session
395 // Only show compact command if there's an active session
390− if c.sessionID != "" {
396+ if c.hasSession {
391 commands = append(commands, NewCommandItem(c.com.Styles, "summarize", "Summarize Session", "", ActionSummarize{SessionID: c.sessionID}))
397 commands = append(commands, NewCommandItem(c.com.Styles, "summarize", "Summarize Session", "", ActionSummarize{SessionID: c.sessionID}))
@@ -417,10 +423,10 @@ func (c *Commands) defaultCommands() []*CommandItem {
419 // Only show toggle compact mode command if window width is larger than compact breakpoint (120)
425 // Only show toggle compact mode command if window width is larger than compact breakpoint (120)
420− if c.windowWidth >= sidebarCompactModeBreakpoint && c.sessionID != "" {
426+ if c.windowWidth >= sidebarCompactModeBreakpoint && c.hasSession {
421 commands = append(commands, NewCommandItem(c.com.Styles, "toggle_sidebar", "Toggle Sidebar", "", ActionToggleCompactMode{}))
427 commands = append(commands, NewCommandItem(c.com.Styles, "toggle_sidebar", "Toggle Sidebar", "", ActionToggleCompactMode{}))
423− if c.sessionID != "" {
429+ if c.hasSession {
424 cfg := c.com.Config()
430 cfg := c.com.Config()
425 agentCfg := cfg.Agents[config.AgentCoder]
431 agentCfg := cfg.Agents[config.AgentCoder]
426 model := cfg.GetModelByType(agentCfg.Model)
432 model := cfg.GetModelByType(agentCfg.Model)
@@ -437,12 +443,27 @@ func (c *Commands) defaultCommands() []*CommandItem {
437 commands = append(commands, NewCommandItem(c.com.Styles, "open_external_editor", "Open External Editor", "ctrl+o", ActionExternalEditor{}))
443 commands = append(commands, NewCommandItem(c.com.Styles, "open_external_editor", "Open External Editor", "ctrl+o", ActionExternalEditor{}))
446+ if c.hasTodos || c.hasQueue {
449+ case c.hasTodos && c.hasQueue:
450+ label = "Toggle To-Dos/Queue"
452+ label = "Toggle Queue"
454+ label = "Toggle To-Dos"
456+ commands = append(commands, NewCommandItem(c.com.Styles, "toggle_pills", label, "ctrl+t", ActionTogglePills{}))
440− return append(commands,
459+ commands = append(commands,
441 NewCommandItem(c.com.Styles, "toggle_yolo", "Toggle Yolo Mode", "", ActionToggleYoloMode{}),
460 NewCommandItem(c.com.Styles, "toggle_yolo", "Toggle Yolo Mode", "", ActionToggleYoloMode{}),
442 NewCommandItem(c.com.Styles, "toggle_help", "Toggle Help", "ctrl+g", ActionToggleHelp{}),
461 NewCommandItem(c.com.Styles, "toggle_help", "Toggle Help", "ctrl+g", ActionToggleHelp{}),
443 NewCommandItem(c.com.Styles, "init", "Initialize Project", "", ActionInitializeProject{}),
462 NewCommandItem(c.com.Styles, "init", "Initialize Project", "", ActionInitializeProject{}),
444 NewCommandItem(c.com.Styles, "quit", "Quit", "ctrl+c", tea.QuitMsg{}),
463 NewCommandItem(c.com.Styles, "quit", "Quit", "ctrl+c", tea.QuitMsg{}),
448// SetCustomCommands sets the custom commands and refreshes the view if user commands are currently displayed.
469// SetCustomCommands sets the custom commands and refreshes the view if user commands are currently displayed.