Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

fix(opencode): disable session navigation commands when no parent session#15762

Merged
nexxeln merged 4 commits intoanomalyco:devfrom
jerome-benoit:fix/disable-session-nav-without-parent
Mar 3, 2026
Merged

fix(opencode): disable session navigation commands when no parent session#15762
nexxeln merged 4 commits intoanomalyco:devfrom
jerome-benoit:fix/disable-session-nav-without-parent

Conversation

@jerome-benoit
Copy link
Contributor

@jerome-benoit jerome-benoit commented Mar 2, 2026

Issue for this PR

Closes #15761

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Disables session_parent, session_child_cycle, and session_child_cycle_reverse commands when the current session has no parent. Without this, the bare up/down keybinds (introduced in #14814) intercept arrow keys in the prompt textarea via useKeyboard in the command dialog, silently swallowing the event before it reaches the history navigation handler.

Adds enabled: !!session()?.parentID to the three commands in session/index.tsx.

How did you verify your code works?

Built the TUI locally, verified Up/Down arrow keys navigate prompt history in a root session, and confirmed child session navigation still works when a parent session exists.

Screenshots / recordings

N/A — keyboard input behavior, no visual change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…sion

Session navigation commands (session_parent, session_child_cycle,
session_child_cycle_reverse) are now disabled when there is no parent
session. This prevents them from intercepting Up/Down/Left/Right arrow
keys via the command dialog's useKeyboard handler, which was blocking
prompt history navigation and other textarea key events.

Closes anomalyco#15761
Copilot AI review requested due to automatic review settings March 2, 2026 21:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables session navigation keybind commands that are no-ops in a root session, preventing them from intercepting raw arrow keys (Up/Down/Left/Right) and swallowing prompt-history navigation events.

Changes:

  • Add enabled: !!session()?.parentID gating for session_parent, session_child_cycle, and session_child_cycle_reverse.
  • Ensures these commands don’t match in the global useKeyboard command handler when there is no parent session.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jerome-benoit added a commit to jerome-benoit/dotfiles that referenced this pull request Mar 2, 2026
…nt session

Cherry-pick anomalyco/opencode#15762: disable session_parent,
session_child_cycle, and session_child_cycle_reverse commands when
no parent session exists, preventing Up/Down arrow keys from being
swallowed in the prompt textarea.
Copy link
Member

@nexxeln nexxeln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fix works for #15761, but it doesn’t address #10444 fully because session_child_cycle/session_child_cycle_reverse are still blocked when there’s no parent (enabled: !!session()?.parentID + childSessionHandler early return).
please update this pr to fully address #10444, or remove that from the description

@jerome-benoit
Copy link
Contributor Author

@nexxeln You're right — session_child_cycle/session_child_cycle_reverse are still blocked in root sessions by both the enabled guard and the childSessionHandler early return. Removed the #10444 reference from the description. This PR now only addresses #15761.

Copy link
Member

@nexxeln nexxeln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

@nexxeln nexxeln merged commit 18850c4 into anomalyco:dev Mar 3, 2026
9 checks passed
Grappeggia pushed a commit to teamslop/slopcode that referenced this pull request Mar 4, 2026
…sion (anomalyco#15762)

Co-authored-by: Test User <test@test.com>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
PrakharMNNIT pushed a commit to PrakharMNNIT/opencode that referenced this pull request Mar 5, 2026
…sion (anomalyco#15762)

Co-authored-by: Test User <test@test.com>
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Up/Down arrow keys no longer navigate prompt history

3 participants