Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add spec for #1620 #2650

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
93 changes: 93 additions & 0 deletions doc/specs/#1620 - Installer selector on multiple matches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
author: Darshan Rander @SirusCodes
created on: 2022-10-29
last updated: 2022-10-29
issue id: 1620
---

# Spec Title

For [#1620](https://github.com/microsoft/winget-cli/issues/1620)"
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

## Abstract

The winget.exe client simply lists all the matches and if the user wants to install the app they need to re-run the command with Id.

The UX can be improved here by giving users an option to select the package instead of asking them to re-run the command with Id.

## Inspiration

It is not a good experience to copy Id and then run the command again.
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

## Solution Design

If we find multiple packages then the user should get a selector.

winget should ask for user input, for example -

```pwsh
> winget install Powershell
Multiple packages found matching.
No. Name Id Source
-------------------------------------------
1 PowerShell 9MZ1SNWT0N5D msstore
2 PowerShell Microsoft.PowerShell winget

Please select the packages (eg. 2): <user-input>

Installing <user-input>...
```

> `<user-input>` - is the input by user

After the user will give the input the installation should start.

## UI/UX Design

The idea is explained in [Solution Design](#solution-design).
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

## Capabilities

### Accessibility

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New text in the menu (e.g Please select the packages) will need to be localized. There may need to be considerations made for if the indices used for selecting packages also need to be localized

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do windows localize numerical forms automatically?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but it would need to be a consideration that needs to be made as to whether they will or won't be

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will verify it and add in the spec

It should not have any direct impact on screen readers.

### Security

It should not have any security issues.

### Reliability

This will help the users to have a better experience and would decrease the chance of human error while copy-pasting the Id.
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

### Compatibility

It will not break anything.
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

### Performance, Power, and Efficiency

## Potential Issues

SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved
The user might not be negatively impacted by this, as it is geared towards simplifying the installation process in case of multiple matches.

## Future considerations

As far as I know currently (v1.3.2691) widget doesn't support installing multiple packages in a single command.
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

For Example -

```pswh
winget install Powershell Git
```

The above command will not install anything.

If will ever support this then we might consider having _multiple_, _range_ and _not_ selectors.
SirusCodes marked this conversation as resolved.
Show resolved Hide resolved

- multiple selector (1 3): A **space** separated number should install packages of that number.
- range selector (1-3): A **hyphen** separated number should install all the packages including the start and end numbers.
- not selector (^2): A number with a **carat** symbol should install all packages except the number marked with a carat symbol.

## Resources

- [winget#301 (comment)](https://github.com/microsoft/winget-cli/issues/301#issuecomment-940172239) a snapshot from the [yay](https://github.com/Jguer/yay).