summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/components
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-08-19 22:39:59 -0500
committerGitHub <[email protected]>2025-08-19 22:39:59 -0500
commit574be9febf74e9571c0400bfc6de33f5deede977 (patch)
treea5f0a538d1e54fec9d06ac50d2181074688946d3 /packages/tui/internal/components
parent5b05ede748095865d3dc3a69790b01da92f1e6dd (diff)
downloadopencode-574be9febf74e9571c0400bfc6de33f5deede977.tar.gz
opencode-574be9febf74e9571c0400bfc6de33f5deede977.zip
fix: keybind panic (#2092)
Diffstat (limited to 'packages/tui/internal/components')
-rw-r--r--packages/tui/internal/components/chat/message.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go
index 9a1531fb0..a19d15fd7 100644
--- a/packages/tui/internal/components/chat/message.go
+++ b/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: