Skip to content

Rename Inspector V2 --> Inspector#9796

Open
elliette wants to merge 12 commits intoflutter:masterfrom
elliette:legacy-inspector-removal-followup
Open

Rename Inspector V2 --> Inspector#9796
elliette wants to merge 12 commits intoflutter:masterfrom
elliette:legacy-inspector-removal-followup

Conversation

@elliette
Copy link
Copy Markdown
Member

@elliette elliette commented Apr 21, 2026

Closes #7860
Work towards #9563

Follow up to #9782

This PR:

  • Renames all files from inspector_v2 -> inspector
  • Updates any inspector V2 variable names to simply inspector

Note: The only exception is our analytics. I kept the inspector V2 analytics dimension, which is true for any inspector usage

@elliette elliette changed the title [Draft] Rename Inspector V2 --> Inspector Rename Inspector V2 --> Inspector Apr 22, 2026
@elliette elliette marked this pull request as ready for review April 22, 2026 20:22
@elliette elliette requested review from a team, kenzieschmoll and srawlins as code owners April 22, 2026 20:22
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request promotes the "Inspector V2" to the default inspector by renaming directories, updating imports, and removing the inspectorV2 feature flag across the codebase. It also cleans up related analytics metrics, documentation imports, and integration test goldens. Feedback focuses on the DiagnosticsNodeDescription widget, where the new logic for preserving font sizes during style merges is flagged as redundant and potentially incorrect. It is recommended to simplify these merges by using copyWith(fontSize: null) on the incoming styles to prevent them from overwriting the existing font size.

Comment on lines +305 to +309
textStyle = textStyle.merge(theme.subtleTextStyle);
final fontSize = textStyle.fontSize;
if (fontSize != null) {
textStyle = textStyle.copyWith(fontSize: fontSize);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

[CONCERN] The logic to preserve the font size is redundant and incorrect here. fontSize is captured after the merge operation (line 306), meaning it will capture the font size from theme.subtleTextStyle if it exists, and then re-apply it. This differs from the implementation at line 405 where it is captured before the merge. A cleaner and more robust approach to ensure the font size is not overwritten by subtleTextStyle is to use copyWith(fontSize: null) on the style being merged.

        textStyle = textStyle.merge(
          theme.subtleTextStyle.copyWith(fontSize: null),
        );

Comment on lines +405 to +409
final fontSize = textStyle.fontSize;
textStyle = textStyle.merge(theme.subtleTextStyle);
if (fontSize != null) {
textStyle = textStyle.copyWith(fontSize: fontSize);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

[CONCERN] This logic can be simplified by using copyWith(fontSize: null) on the style being merged. This prevents subtleTextStyle from overwriting the current font size during the merge, which is more concise than capturing and re-applying the font size manually.

        textStyle = textStyle.merge(
          theme.subtleTextStyle.copyWith(fontSize: null),
        );

Copy link
Copy Markdown
Contributor

@srawlins srawlins left a comment

Choose a reason for hiding this comment

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

🎉

@@ -201,7 +201,7 @@ class DevToolsAnalyticsEvent {
: null,
// [InspectorScreenMetrics]
isV2Inspector: screenMetrics is InspectorScreenMetrics
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm does something need to be done here? Removing isV2Inspector?

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.

Inspector V2 feature flag cleanup

2 participants