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 ability to enable and disable an extension from the extension screen #6140

Merged

Conversation

kenzieschmoll
Copy link
Member

@kenzieschmoll kenzieschmoll commented Aug 2, 2023

When an extension is loaded for the first time and there is no entry in devtools_options.yaml for this extension, an enable prompt will be shown in place of the extension iFrame:
Screenshot 2023-08-01 at 5 11 18 PM

The user's answer will be recorded to the devtools_options.yaml file by proxy of the devtools server.

Once an extension has been enabled, there will be an option to disable the extension from the extension tool header:
Screenshot 2023-08-01 at 4 59 59 PM

When clicked, the user will be asked if they really want to disable the extension. This is preferred because an accidental click here could destroy any state in the extension tool. This also makes the experience less jarring when the screen is removed and the user is navigated back to the DevTools home screen.
Screenshot 2023-08-01 at 5 00 08 PM

This PR also ensures that tabs for extensions are automatically added / removed based on the enabled state for each extension.

Work towards #1632

@kenzieschmoll kenzieschmoll marked this pull request as ready for review August 2, 2023 18:59
@kenzieschmoll kenzieschmoll requested a review from a team as a code owner August 2, 2023 18:59
@kenzieschmoll kenzieschmoll requested review from CoderDake and removed request for a team August 2, 2023 18:59
@@ -112,50 +124,6 @@ class ExtensionView extends StatelessWidget {
}
}

// TODO(kenz): add button to deactivate extension once activate / deactivate
Copy link
Member Author

Choose a reason for hiding this comment

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

moved to extension_screen_controls.dart

@polina-c
Copy link
Contributor

polina-c commented Aug 2, 2023

Do we want to be transparent to the user that we will record the answer in the file, so that they know they could save this file in source control?
Where the file is located?

@kenzieschmoll
Copy link
Member Author

Do we want to be transparent to the user that we will record the answer in the file, so that they know they could save this file in source control?
Where the file is located?

If the user does not already have a devtools_options.yaml file, one will be created, and if they do already have one, it will be modified. So they should see this come up in their git diff automatically, and from there they can choose to .gitignore it or check it in. I don't know if we should add this sort of information into DevTools itself, but we can certainly add this in documentation. For example, we don't notify users that we persist settings in a ~/.flutter-devtools/.devtools, we just save them there.

@kenzieschmoll kenzieschmoll merged commit 2d36a29 into flutter:master Aug 2, 2023
15 checks passed
@kenzieschmoll kenzieschmoll deleted the extension-enable-from-screen branch August 2, 2023 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants