Skip to content

[Feature] Support auto-select flags on upgrade-interactive command #6832

Open
@jnoordsij

Description

@jnoordsij
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

When updating dependencies for my projects, I regularly use the very neat upgrade-interactive command to check for all available dependencies and pick any updates I like. This interface comes with some great concepts, showing the Current, Range and Latest columns to compare and pick from, which allows for a very convenient and quick overview of possibilities.

In practice in my update workflow, I tend to pick the version from Range most often, as usually this should be non-disruptive to my projects and require no changes. Occasionally, I may include some major updates from the Latest column if I expect them to be compatible, but other times I'll opt to tackle those in separate commits/PRs/etc.

However, even when working with simple projects, one will quickly gather quite a few dependencies and thus the list of dependencies with potential updates will easily get quite long. In practice, this means that after opening this interface, I have to manually adjust quite a lot of buttons to move from Current to Range value. Although this is quite easily doable in a fast manner with arrow keys, it would be very neat to have some CLI flag or some hotkey in the interface that will automatically move all selected values to Range as this is my preferred option.

Describe the solution you'd like

My ideal solution would be some flag to the CLI command that will allow one to pick a default selected value; e.g.

yarn upgrade-interactive --auto=range

This would result in the UI opening with the Range value selected by default, rather than Current. This could then also allow one to pick --auto=latest, where it would have this selected by default whenever applicable.

Alternatively, this could also be done through some hotkey in the UI itself, to prevent the addition of flags.

Describe the drawbacks of your solution

Generally I think this should cause no major problems as auto-selecting options seems reasonable and easy-to-determine behavior. However, it does tie in to the current UI implementation, which would require additional care if the UI would be overhauled to show other columns and/or use different column names.

Adding additional hotkeys to the UI would require additional UI context and space, potentially wasting space on smaller screens to list available options.

Describe alternatives you've considered

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions