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

Bug Fix: Fix color picker regression #6682

Merged
merged 3 commits into from Nov 14, 2023

Conversation

rileyajones
Copy link
Contributor

Motivation for features / changes

There was a regression associated with the new runs table which meant that changing the color of a run immediately closed the color picker.

Technical description of changes

Previously the runs table did not have a dependency on the metrics state. Now that it does, changing the color of a run leads to a state change which then in turn rerenders the row and thus closed the color picker.
The state dependency is important so that cannot be undone, however, we don't actually need to re render the rows when the color changes so I've update the render logic to ignore the color attribute (I know it's a little hacky).

Screenshots of UI changes (or N/A)

Before:
45503b0a-11af-4660-b168-fb54b6262a00

After - With Paint Flashing
9c5d3e86-9369-4c37-87ab-66bb74662c07

After - Without Paint Flashing
57df4fe5-536a-49f0-aeda-16028912e35b

Detailed steps to verify changes work correctly (as executed by you)

  1. Start tensorboard
  2. Open the color picker
  3. Change the color
  4. Observe the color picker does not close
  5. Check a row and observe that it is rerendered.

Alternate designs / implementations considered (or N/A)

@rileyajones rileyajones marked this pull request as ready for review November 10, 2023 23:26
@@ -127,4 +127,10 @@ export class RunsDataTable {
const input = event.target! as HTMLInputElement;
this.onRegexFilterChange.emit(input.value);
}

trackByRuns(index: number, data: TableData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you document what/why you're doing this? And can you add a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a comment explaining how trackBy guards rerenders of items within an ngFor.
This is going to be very hard to test because it involves tracking whether a non angular component is rerendered.
I can add a test ensuring this get called, but since it's a framework feature I'm not sure that is worth doing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just a test for the logic in this function. it('returns the data object without the color attribute');

@rileyajones rileyajones merged commit 200ba5e into tensorflow:master Nov 14, 2023
13 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.

None yet

3 participants