Skip to content

Delete unused icons from DevTools - #10101

Open
Abhilash-Puthukkudi wants to merge 1 commit into
flutter:masterfrom
Abhilash-Puthukkudi:remove-unused-icons
Open

Abhilash-Puthukkudi wants to merge 1 commit into
flutter:masterfrom
Abhilash-Puthukkudi:remove-unused-icons

Conversation

@Abhilash-Puthukkudi

Copy link
Copy Markdown

Fixes #2072

This deletes 254 icon files (about 705 KB) under packages/devtools_app/icons/ that nothing in the repository references. Most are left over from porting the Inspector from IntelliJ, as described in the issue's September 2024 comment that re-scoped it to this cleanup.

How the files were chosen:

  1. For each file under icons/, I searched every tracked text file in the repo (Dart, YAML, HTML, JS, Markdown, golden .txt files) for its path relative to packages/devtools_app/.
  2. For files with no path match, I also searched for the bare file name and checked each hit by hand. All of them were false positives, such as golden image names, app-size test data, or a same-named file in a different folder.
  3. I looked for icon paths built at runtime. I found one: the Property Editor loads icons/inspector/widget_icons/${refactor.label.toLowerCase()}.png.

Kept on purpose, to stay conservative:

  • All of icons/inspector/widget_icons/, because of the runtime lookup above.
  • icons/material_symbols/LICENSE.
  • Every variant (@2x, _dark, .svg) of an icon that is still referenced. For example, phone.png stays because phone@2x.png is used. Moving to Flutter's 2.0x/ resolution-aware layout, the original ask in this issue, can be a follow-up.

pubspec.yaml: icons/actions/, icons/gutter/ and icons/memory/ are now empty, so I removed them from flutter.assets. icons/preview/ (45 files) was never listed in pubspec.yaml, so it was never bundled.

Verification:

  • Every icons/... path referenced in Dart or YAML still exists after the change. The only unmatched string is in a code comment in logging_controller.dart and never existed.
  • flutter analyze reports no new issues.
  • Tests under test/shared, test/screens/{performance,memory,debugger,logging} and test/framework pass. These bundle the app's assets and render many of the remaining icons.

No tests were added because this change only deletes unused assets.

Pre-launch Checklist

General checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • [] I updated/added relevant documentation (doc comments with ///).

Issues checklist

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the AI contributions guidelines and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

build.yaml badge

If you need help, consider asking for help on Discord.

Remove 254 icon files under packages/devtools_app/icons/ that are not
referenced anywhere in the repository, most of them left over from the
port of the Inspector from IntelliJ. The `icons/preview/` directory was
never listed in pubspec.yaml, so it was never bundled.

To stay conservative, this keeps:
- all of `icons/inspector/widget_icons/`, since the Property Editor
  builds paths into it at runtime from refactor labels;
- `icons/material_symbols/LICENSE`;
- every resolution or theme variant of an icon that is still referenced.

`icons/actions/`, `icons/gutter/` and `icons/memory/` are now empty, so
they are removed from the `flutter.assets` list.

Fixes flutter#2072

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

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.

Code Review

This pull request removes several unused SVG icon files from the repository and updates packages/devtools_app/pubspec.yaml to remove references to the deleted asset directories (icons/actions/, icons/gutter/, and icons/memory/). There are no review comments to evaluate, and the changes are straightforward, so I have no feedback to provide.

@Abhilash-Puthukkudi

Copy link
Copy Markdown
Author

This PR doesn't change the DevTools UI or behavior. Could a maintainer please add the release-notes-not-required label? Thanks!

This branch has not been deployed

No deployments
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.

Delete unused icons from DevTools

1 participant