Skip to content

Extract Engine::handle_context_menu_key(key) from backend key handlers #379

Description

@JDonaghy

Problem

Both backends implement context menu keyboard navigation (j/k/Up/Down/Escape/Return) by directly mutating cm.selected with wrapping arithmetic:

  • GTK: mod.rs:5428-5483, ~55 lines
  • TUI: similar in key dispatch, ~40 lines

Proposed fix

Add Engine::handle_context_menu_key(key: &str) -> bool that handles selection movement, confirm, and dismiss. Backends call it instead of reimplementing navigation.

Context

Identified in Session 370 backend dedup audit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions