Add pin rows to Profile Memory table - #9832
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to pin classes to the top of the Profile Memory table in DevTools. The implementation involves updating the AdaptedProfile and ProfileRecord models to track pinning status, adding pinning logic and serialization to the ProfilePaneController, and creating a new _PinColumn for the UI. Review feedback identifies a logical issue where the pinned classes listener is not updated during initialization, suggests improving the stateful widget's resilience to controller changes, and highlights performance concerns regarding redundant builders and inefficient key generation for the table.
…file_pane_controller.dart Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…file_view.dart Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hey @khanak0509 thanks for contributing! Apologies it looks like this fell through the review cracks. Would you like to still work on this change? |
srawlins
left a comment
There was a problem hiding this comment.
Code looks good. I want to pull it down and play with it.
|
Hey @srawlins, just checking in, plz let me know if any changes are needed. Thanks! |
|
So sorry for the delay! I've played with this locally now and its very cool. I would like two changes however:
Thanks much and sorry for the delay! |
| : super( | ||
| 'Pin', | ||
| titleTooltip: 'Pin class to the top of the table', | ||
| fixedWidthPx: 40.0, |
There was a problem hiding this comment.
Something is funny here. When I view this live, and when I look at your screenshots, this column is way bigger than 40. 40 should esentially look like a bit of padding around the 32px icon, but it's clearly something more like 100 or 120px.
I think 40px is a perfect size... if we can actually get it to render at 40px.
There was a problem hiding this comment.
There was a problem hiding this comment.
I think I prefer 10! Haha does that look good to you?
There was a problem hiding this comment.
I think so too! 10 looks good to me...



Fixes #8898
Trace Instances already keeps traced classes at the top (via the checkbox), but Profile Memory didn’t have anything similar
This PR adds a Pin column to Profile Memory. Tap the pin icon on a row and that class stays in the pinned section at the top (under All Classes), with a divider between pinned and the rest of the table, same general idea as Trace Instances, but without turning on allocation tracing
before
after
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.