Skip to content

Allow switching between legacy and new Inspector #8342

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

Merged
merged 31 commits into from
Sep 30, 2024

Conversation

elliette
Copy link
Member

@elliette elliette commented Sep 24, 2024

Fixes #8269

Allow users to switch between the legacy inspector and the new inspector.

Previously the feature flag inspectorV2 determined whether to show the legacy InspectorScreen or the new InspectorScreen.

Now, the same InspectorScreen (inspector_shared/inspector_screen.dart) is always shown, and the user preference enableInspectorV2 determines whether it builds the legacy InspectorScreenBody or the new InspectorScreenBody.

Note: The InspectorSettingsDialog which had two implementations in the legacy inspector/ directory and the new inspector_v2/ directory now have been combined and also live in inspector_shared/.

revert_to_legacy

@elliette elliette marked this pull request as ready for review September 25, 2024 17:19
@elliette elliette requested a review from a team as a code owner September 25, 2024 17:19
@elliette elliette requested review from bkonyi and removed request for a team September 25, 2024 17:19
@elliette elliette changed the title [DRAFT] Allow switching between legacy and V2 Inspector Allow switching between legacy and V2 Inspector Sep 25, 2024
@kenzieschmoll
Copy link
Member

DBC: if we want to increase our chances of users using the V2 inspector to gather early feedback, wdyt about pulling the setting out into the top level row of actions as a Switch "Try the new Inspector!"?

Copy link
Member

Choose a reason for hiding this comment

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

super-nit: can we take a screenshot without the debug label in the upper left? most users will experience this in the embedded view anyway so perhaps add the embedMode=single query param and then take a screenshot?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes! Will update the screenshots in the release notes as a last step once everything else in the PR looks good

Comment on lines +54 to +62
if (controller != null) ...[
const SizedBox(width: defaultSpacing),
ShowImplementationWidgetsButton(controller: controller!),
],
const Spacer(),
// TODO(https://github.com/flutter/devtools/issues/7860): Clean-up after
// Inspector V2 has been released.
if (FeatureFlags.inspectorV2) ...[
const SizedBox(width: defaultSpacing),
Copy link
Member

Choose a reason for hiding this comment

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

could this all be in the same spread?

if (controller != null && FeatureFlags.inspectorV2) ...[
  const SizedBox(width: defaultSpacing),
  ShowImplementationWidgetsButton(controller: controller!),
  const Spacer(),
  const SizedBox(width: defaultSpacing),
  SwitchSetting(...),
] else 
  const Spacer(),

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately it can't! The existence of controller means we are on new Inspector, but even for the legacy Inspector we need to show the SwitchSetting (so that users can enable the new Inspector)

@elliette elliette changed the title Allow switching between legacy and V2 Inspector Allow switching between legacy and new Inspector Sep 30, 2024
@elliette elliette merged commit fd529c5 into flutter:master Sep 30, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inspector 2.0 is exposed via a setting
3 participants