nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Feature] Audit and Improve Keyboard Interaction

Open akramcodez opened this issue 3 months ago • 2 comments

Description

Audit Nanocoder's keyboard interaction and ensure that important actions have predictable and consistent behavior.

Terminal applications should be fully usable from the keyboard without requiring mouse interaction.

This issue should first identify the actual keyboard interaction gaps before implementing changes.

Use Case

Users should be able to perform common Nanocoder interactions using predictable keyboard controls.

Important interactions include:

  • Enter.
  • Shift+Enter.
  • Escape.
  • Ctrl+C.
  • Ctrl+V.
  • Ctrl+Shift+V.
  • Arrow keys.
  • Home.
  • End.
  • History navigation.
  • Multiline editing.
  • Command selection.
  • Contextual suggestion navigation.

Proposed Solution

First perform a keyboard interaction audit.

Document:

  1. Current behavior.
  2. Expected behavior.
  3. Missing/inconsistent behavior.
  4. Platform/terminal-specific problems.
  5. Proposed fixes.

The audit should cover:

Composer

  • Single-line input.
  • Multiline input.
  • Cursor movement.
  • Home/End.
  • Arrow navigation.
  • History navigation.

Submission

  • Enter behavior.
  • Shift+Enter behavior.
  • Multiline submission.

Cancellation

  • Escape.
  • Ctrl+C.
  • Processing-state cancellation where applicable.

Clipboard

  • Ctrl+V.
  • Ctrl+Shift+V.
  • Multiline paste.
  • Large paste.

Contextual UI

  • Navigating /, !, and @ suggestions.
  • Selecting suggestions.
  • Dismissing suggestions.

The implementation should follow the audit rather than assuming that every listed key currently needs a change.

Alternatives Considered

  • Implement behavior for every listed key without auditing the existing implementation.
  • Depend on mouse interaction.
  • Rely entirely on terminal-native behavior.
  • Document the existing behavior without making improvements.

The preferred approach is to first identify actual gaps and then fix the relevant ones.

Additional Context

Matt specifically requested clarification around what keyboard behavior is currently missing.

Therefore, this issue is intentionally open-ended during the investigation phase.

Contributors should report concrete problems rather than changing keyboard behavior unnecessarily.

Implementation Notes

This issue may overlap with the fullscreen TUI work because fullscreen terminal ownership can change how stdin and keyboard events are handled. https://github.com/Nano-Collective/nanocoder/issues/947

If fullscreen TUI work is not yet complete, the audit can still document current behavior and identify what will need to be revisited.

Contribution / PR Workflow

PRs should target: feature/new-ui

Do not merge directly into main.

Alternative keyboard interaction models and terminal-specific considerations are welcome.

akramcodez avatar Aug 25 '26 09:08 akramcodez

hey @akramcodez can you assign me this issue ?

tusharui avatar Aug 27 '26 06:08 tusharui

Sure @tusharui, but could you do some research on the codebase and let me know what you think? It would be great to have a proper implementation plan since this is a high-priority issue.

akramcodez avatar Aug 27 '26 09:08 akramcodez