Skip to content

Review: a keyboard path to comment on a diff line #697

Open

Description

@SSFSKIM

What is missing

In Review, a comment on a diff line can be started only with the pointer: the diff library's add button is drawn on hover, acts on mousedown only, and is named "+". A keyboard cannot reach it, and Enter or Space on it does nothing. This is so on master today (.diff-add-widget in src/renderer/src/tools/code/code.css) and the UX wave's stacked Review (board 590) does not change it: that landing's review rated it Important and it was deferred here on purpose, because the obvious repair is the wrong one.

Why not a focusable button per line

A tab stop on every line of every file in the stack makes Review slower for the keyboard it is meant to serve: a change of a few hundred lines would put a few hundred stops between the toolbar and the next file.

What done looks like (a proposal to check at design)

  • One tab stop per file's body. Inside it, the arrow keys move a row cursor that is drawn (a focus ring on the line), Home and End go to the file's first and last line, and the hunk keys the toolbar already has move it by hunk.
  • A key on the row under the cursor opens the comment card under that line (Enter, with the same act the pointer's add button makes); the card is already fully keyboard-operable and Escape returns to the row.
  • The row's accessible name says the line and the side ("line 42", "line 17, before the change"), and the act is announced.
  • In Split, Left and Right move between the two sides.
  • Words and the look of the row cursor go to the owner on a drawn example before the build.

Notes

  • Spawned by board 590; the files are src/renderer/src/tools/code/review/ (the stack, LineComments.tsx, comment-place.ts).
  • The desk's web app draws the same Review and follows.
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

    enhancementpriority:P2status:ready-for-architect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions