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

[megathread] Deleting profiles is often confusing #9997

Open
7 of 13 tasks
zadjii-msft opened this issue Apr 29, 2021 · 0 comments
Open
7 of 13 tasks

[megathread] Deleting profiles is often confusing #9997

zadjii-msft opened this issue Apr 29, 2021 · 0 comments
Labels
Area-Settings UI Anything specific to the SUI Area-Settings Issues related to settings and customizability, for console or terminal Issue-Scenario Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented Apr 29, 2021

Deleting profiles is often confusing. There are builtin, dynamic, and user profiles. Profiles can be hidden or deleted (as of #10910)

  • If WSL fails to respond (it does this from time to time), but you customized WSL, then the SUI won't have the profile in its list of profiles, and saving the SUI won't write out the WSL profile. That's bad.
    • We should still write it out to the settings file
    • We should indicate that it's a dynamic profile where we couldn't find the source
  • Dynamic profiles should be able to be deleted in the SUI, and have them removed from the settings file. The tombstone in state.json will let us know "the user does not want to see this".
  • Built-in profiles cannot be deleted, but maybe we should have a "hidden" toggle more prominent on the "General" page
  • The Extensions page (Add an Extensions page to the SUI #10436) should allow users to recreate profiles that have been deleted for dynamic profiles.
    • i.e. The user deletes "Debian" from their settings.json. the Debian profile doesn't show up in the SUI. However, on the extensions page, where it lists WSL generator, there's a little button to recreate the profile in the settings
  • Dynamic profiles are just a little different than normal profiles. They should be clearly identified with a link back to the extension page that generated them. (Can the Settings UI indicate when a profile is dynamic  #10707)

relevant discussions:

Relevant discussions on "WSL slow to start":

@zadjii-msft zadjii-msft added the ⛺ Reserved For future use label Apr 29, 2021
@zadjii-msft zadjii-msft changed the title <reserved> [megathread] Deleting profiles is often confusing Aug 16, 2021
@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Area-Settings UI Anything specific to the SUI Issue-Scenario Product-Terminal The new Windows Terminal. and removed ⛺ Reserved For future use labels Aug 16, 2021
@zadjii-msft zadjii-msft added this to the Terminal v1.12 milestone Aug 16, 2021
zadjii-msft added a commit that referenced this issue Aug 17, 2021
  fixes #6160

  [3:12 PM] Dustin Howett
    > we're gonna have to reason about what happens when we start keeping disconnected leaves (for user settings purposes)
    >
    > like, they will exist and they can be the default profile but we need a sane fallback
    >
    > and that will help us detect that there was a source but no generata

  So I'm stashing this until later after the elements of #9997 merge
ghost pushed a commit that referenced this issue Aug 23, 2021
Re-enables the delete button for generated profiles in the settings UI.
Additionally fixes "Startup Profiles" to only list active profiles.

Profiles are considered deleted if they're absent from settings.json, but their
GUID has been encountered before. Or in other words, from a user's perspective:
Generated profiles are added to the settings.json automatically only once.
Thus if the user chooses to delete the profile (e.g. using the delete button)
they aren't re-added automatically and thus appear to have been deleted.

Meanwhile those generated profiles are actually only marked as "hidden"
as well as "deleted", but still exist in internal profile lists.
The "hidden" attribute hides them from all existing menus. The "deleted" one
hides them from the settings UI and prevents them from being written to disk.

It would've been preferrable of course to just not generate and
add deleted profile to internal profile lists in the first place.
But this would've required far more wide-reaching changes.
The settings UI for instance requires a list of _all_ profiles in order to
allow a user to re-create previously deleted profiles. Such an approach was
attempted but discarded because of it's current complexity overhead.

## References

* Part of #9997
* A sequel to 5d36e5d

## PR Checklist

* [x] Closes #10960
* [x] I work here
* [x] Tests added/passed

## Validation Steps Performed

* "Startup Profiles" doesn't list deleted profiles ✔️
* Manually removing an item from settings.json removes the profile ✔️
* Removing cmd.exe and saving doesn't create empty objects (#10960) ✔️
* "Add a new profile" lists deleted profiles ✔️
* "Duplicate" recreates previously deleted profiles ✔️
* Profiles are always created with GUIDs ✔️
DHowett pushed a commit that referenced this issue Aug 25, 2021
Re-enables the delete button for generated profiles in the settings UI.
Additionally fixes "Startup Profiles" to only list active profiles.

Profiles are considered deleted if they're absent from settings.json, but their
GUID has been encountered before. Or in other words, from a user's perspective:
Generated profiles are added to the settings.json automatically only once.
Thus if the user chooses to delete the profile (e.g. using the delete button)
they aren't re-added automatically and thus appear to have been deleted.

Meanwhile those generated profiles are actually only marked as "hidden"
as well as "deleted", but still exist in internal profile lists.
The "hidden" attribute hides them from all existing menus. The "deleted" one
hides them from the settings UI and prevents them from being written to disk.

It would've been preferrable of course to just not generate and
add deleted profile to internal profile lists in the first place.
But this would've required far more wide-reaching changes.
The settings UI for instance requires a list of _all_ profiles in order to
allow a user to re-create previously deleted profiles. Such an approach was
attempted but discarded because of it's current complexity overhead.

* Part of #9997
* A sequel to 5d36e5d

* [x] Closes #10960
* [x] I work here
* [x] Tests added/passed

* "Startup Profiles" doesn't list deleted profiles ✔️
* Manually removing an item from settings.json removes the profile ✔️
* Removing cmd.exe and saving doesn't create empty objects (#10960) ✔️
* "Add a new profile" lists deleted profiles ✔️
* "Duplicate" recreates previously deleted profiles ✔️
* Profiles are always created with GUIDs ✔️
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, 22H2 Jan 4, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H2, Megathreads Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI Area-Settings Issues related to settings and customizability, for console or terminal Issue-Scenario Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

1 participant