tui: permission prompt diff has no keyboard scrolling

Ouverte Adaptée aux débutants
#67,490 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
83/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
rust

Piste de recherche

Commence dans packages/cli-rs/crates/tui/src/routes/session/permission.rs, en lisant question_layer pour les raccourcis clavier de l’invite et edit_body pour la ScrollBox du diff ; compare-les aux commandes de défilement existantes de la vue /diff. Ajoute des commandes clavier réassignables pour défiler d’une ligne, d’une page, jusqu’au début et jusqu’à la fin avec les valeurs par défaut suggérées, puis vérifie que le long diff de permissions peut être lu à l’aide de ces touches.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area/tui platform/macos type/feature version/v2

Summary

The permission prompt in the Rust TUI has no keyboard scrolling. Its diff body only scrolls with the mouse wheel, so a change that is taller than the visible area cannot be fully read from the keyboard before approving it.

Environment

  • opencode version: 2.4.3
  • Client: TUI
  • Model and provider: Not relevant
  • OS: Darwin 27.0.0 (darwin arm64)
  • Terminal: tmux 3.8, TERM=tmux-256color, COLORTERM=truecolor
  • Shell: /bin/zsh
  • Install/channel: Homebrew, latest
  • Active plugins: none

Reproduction

  1. Set edits to ask ("session": { "permissions": "prompt" } in cli.json).
  2. Ask the agent for an edit whose diff is taller than the prompt area.
  3. Press ctrl+f (permission.prompt.fullscreen) to expand the prompt.
  4. Press j, k, up, down, pageup, pagedown, ctrl+d or ctrl+u.
  5. Nothing moves. Only the mouse wheel scrolls the diff.

Reproduces consistently.

Expected Behavior

Keyboard scrolling works in the permission prompt the same way it does in the /diff viewer, which already binds diff.up to k,up and diff.down to j,down. The commands should also be remappable in cli.json, like every other TUI command.

Suggested command IDs, following the existing permission.prompt.fullscreen:

  • permission.prompt.line.up / permission.prompt.line.down — default k,up and j,down
  • permission.prompt.page.up / permission.prompt.page.down — default pageup,ctrl+u and pagedown,ctrl+d
  • permission.prompt.first / permission.prompt.last — default gg,home and shift+g,end

Actual Behavior

The prompt keymap layer registers only these commands:

  • app.exit and permission.prompt.fullscreen
  • left,h and right,l to move between options, added when there is more than one option
  • return to select, escape to reject

The diff body is a ScrollBox with no keyboard bindings on it. See packages/cli-rs/crates/tui/src/routes/session/permission.rs, question_layer for the bindings and edit_body for the scroll box.

Additional Context

This is the only place to read a change before it is applied, so no keyboard scroll means approving after reading only the visible part, or reaching for the mouse.

Related, all closed or unrelated to the current code:

  • #50903, closed as NOT_PLANNED because it was reported on opencode 1.18.32 (v1). The behaviour is the same on the current V2 Rust TUI, confirmed above on 2.4.3.
  • #7961, closed as NOT_PLANNED.
  • PR #58671, feat(tui): scroll permission diff with pageup and pagedown, closed without merge. It targeted the old TypeScript TUI.
  • #28191 asks for a configurable default expanded state and height for the same prompt.
Langage dominant
TypeScript
Étoiles
230k
Forks
31.3k
Merge moyen
5 h 59 min
PR mergées (30 j)
473

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de anomalyco/opencode

Toutes les issues de anomalyco/opencode

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.