Aiden Cline 6 месяцев назад
Родитель
Сommit
574be9febf
2 измененных файлов с 19 добавлено и 4 удалено
  1. 3 0
      packages/tui/internal/app/app.go
  2. 16 4
      packages/tui/internal/components/chat/message.go

+ 3 - 0
packages/tui/internal/app/app.go

@@ -207,6 +207,9 @@ func New(
 
 func (a *App) Keybind(commandName commands.CommandName) string {
 	command := a.Commands[commandName]
+	if len(command.Keybindings) == 0 {
+		return ""
+	}
 	kb := command.Keybindings[0]
 	key := kb.Key
 	if kb.RequiresLeader {

+ 16 - 4
packages/tui/internal/components/chat/message.go

@@ -671,10 +671,22 @@ func renderToolDetails(
 				body = strings.Join(steps, "\n")
 
 				body += "\n\n"
-				body += baseStyle(app.Keybind(commands.SessionChildCycleCommand)) +
-					mutedStyle(", ") +
-					baseStyle(app.Keybind(commands.SessionChildCycleReverseCommand)) +
-					mutedStyle(" navigate child sessions")
+
+				// Build navigation hint with proper spacing
+				cycleKeybind := app.Keybind(commands.SessionChildCycleCommand)
+				cycleReverseKeybind := app.Keybind(commands.SessionChildCycleReverseCommand)
+
+				var navParts []string
+				if cycleKeybind != "" {
+					navParts = append(navParts, baseStyle(cycleKeybind))
+				}
+				if cycleReverseKeybind != "" {
+					navParts = append(navParts, baseStyle(cycleReverseKeybind))
+				}
+
+				if len(navParts) > 0 {
+					body += strings.Join(navParts, mutedStyle(", ")) + mutedStyle(" navigate child sessions")
+				}
 			}
 			body = defaultStyle(body)
 		default: