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

fix(core): fix flickering render of stage labels on hydration #7181

Merged
merged 1 commit into from
Jul 8, 2019
Merged

fix(core): fix flickering render of stage labels on hydration #7181

merged 1 commit into from
Jul 8, 2019

Conversation

anotherchrisberry
Copy link
Contributor

You know the annoying thing where you hover over a stage and you get a loading indicator in a tooltip, and then it just goes away, and you have to mouse out and then back over the stage to see the label? This fixes that.

@@ -165,6 +165,7 @@ export class HoverablePopover extends React.Component<IHoverablePopoverProps, IH
placement={placementOverride || placement}
target={this.targetRef.current}
container={container}
shouldUpdatePosition={true}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding this because we're actually changing the children in the popover (instead of creating an entirely new one), which means we need to recompute its position when children change.

I only 30% understand why this works.

@@ -43,17 +39,7 @@ export class ExecutionMarker extends React.Component<IExecutionMarkerProps, IExe
};
}

private hydrate = (): void => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moving this hydration down to the label itself (which already had some redundant hydration code)

@@ -12,7 +12,6 @@ Registry.pipeline.registerStage({
},
component: ConcourseStageConfig,
executionDetailsSections: [ConcourseExecutionDetails],
useCustomTooltip: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it doesn't

template = getExecutionWindowTemplate();
} else if (suspendedStageTypes.has('waitForCondition')) {
template = getWaitForConditionTemplate();
}
Copy link
Contributor Author

@anotherchrisberry anotherchrisberry Jul 3, 2019

Choose a reason for hiding this comment

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

I hate an else if, but in this case, I think it's fairly clean to read?

This render method was pretty spaghetti'd before and I feel like this refactor makes it a lot easier to grok but I'm biased.

@anotherchrisberry anotherchrisberry merged commit e26f797 into spinnaker:master Jul 8, 2019
@anotherchrisberry anotherchrisberry deleted the label-hover branch July 8, 2019 02:23
anotherchrisberry added a commit that referenced this pull request Jul 8, 2019
7d2c4e1 fix(core): fix overrideTimeout behavior on existing stages (#7190)
e26f797 fix(core): fix flickering render of stage labels on hydration (#7181)
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.

2 participants