Skip to content

Auto-select first file for DiffView, whenever context is set or changed #1019

Closed
@goran-w

Description

@goran-w

There is an unnecessary click whenever the "Select file to view changes" (DiffView) panel is/becomes visible and/or the selected context is changed.

It would be much preferable to always auto-select the first file (diff) from the list (whenever there is no active selection already), both on entering/activating the diff panel and when changing its selected context. (NOTE: This means the Text.Diff.Welcome string should be changed from "Select file to view changes" to "No changes available" or similar, since it would only be shown if the file list is empty.)

This sort of auto-selection is what we're used to from other tools (Plastic SCM, GitHub Desktop, Fork, Git Extensions, Tower, Sourcetree etc).

All the 5 DiffView instances would benefit from auto-selection:

  • On the CHANGES tab-link-page in HISTORY view.
  • On the RevisionCompare page in HISTORY view (i.e when exactly 2 commits are multi-selected).
  • In the LOCAL CHANGES view - auto-select from non-empty list of UNSTAGED or STAGED (in whatever order would make more sense).
  • In the STASHES view, when changing the selected stash. (NOTE: Should also auto-select the first stash when entering!)
  • In the "Branch Compare" window.

Related:
When going back from multi-selection to single-selection in HISTORY view, the previously active tab-link-page (INFORMATION / CHANGES / FILES) should be preserved, instead of reverting to the first tab-link-page (INFORMATION) !

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions