UIP-1802 CSS Transition Timeout/Warning#55
Conversation
UIP-2052 Release over_react 1.7.0
RavenNumber of Findings: 0 |
Codecov Report
@@ Coverage Diff @@
## release_1.7.0 #55 +/- ##
=================================================
+ Coverage 97.71% 97.72% +0.01%
=================================================
Files 28 28
Lines 1352 1356 +4
=================================================
+ Hits 1321 1325 +4
Misses 31 31Continue to review full report at Codecov.
|
jacehensley-wf
left a comment
There was a problem hiding this comment.
Just a few pieces of feedback
| bool get hasTransition => true; | ||
|
|
||
| /// The duration that can elapse before a transition timeout occurs. | ||
| Duration get transitionTimeout => const Duration(seconds: 15); |
There was a problem hiding this comment.
We should have a discussion around the default value for this.
@aaronlademann-wf @greglittlefield-wf @clairesarsam-wf @joelleibow-wf
There was a problem hiding this comment.
I'd say make this a prop so that it's configurable, and default it to something much smaller, like 1s, so that consumers see the warning right away.
There was a problem hiding this comment.
I feel like a getter is better for this, similar to hasTransition. That way consumers have the ability to either proxy it with a prop or have a custom implementation.
1s sounds good to me tho.
There was a problem hiding this comment.
Yeah, the only reason I said prop is that it would be easier to override. Good point, I'm fine leaving it as a getter.
| } | ||
|
|
||
| var timer = new Timer(transitionTimeout, () { | ||
| assert(ValidationUtil.warn("A transition timeout has occurred.")); |
There was a problem hiding this comment.
#nit Should use single quotes ' vs "
| } | ||
|
|
||
| var timer = new Timer(transitionTimeout, () { | ||
| assert(ValidationUtil.warn("A transition timeout has occurred.")); |
There was a problem hiding this comment.
This should be a more informative message. Something like: 'The amount of transitions expected to complete have not completed. Something is most likely wrong.' The wording isn't great but something that get across the point that we are expecting some amount of transitions and they have not fired.
|
|
||
| TransitionerComponent transitioner = getDartComponent(renderedInstance); | ||
|
|
||
| transitioner.hide(); |
There was a problem hiding this comment.
You should add a expect before and after this that verifies that the state.transtionPhase is TransitionPhase.SHOWN.
| var timer = new Timer(transitionTimeout, () { | ||
| assert(ValidationUtil.warn( | ||
| 'The number of transitions expected to complete have not completed. Something is most likely wrong.' | ||
| )); |
There was a problem hiding this comment.
Something else that I was thinking about. Should we still call complete if the timer completes? I could go either way, was just wondering what the desired behavior is.
There was a problem hiding this comment.
Mm, yes, we should, in order to account for when the warning isn't caught by the time this is deployed
| ..addProps(super.getDefaultProps()) | ||
| ..hasTransition = true | ||
| ..initiallyShown = true | ||
| ..transitionTimeout = const Duration(seconds: 15) |
There was a problem hiding this comment.
This should be updated to match the default in AbstractTransitionComponent
|
+1 |
Merging.+10 |
|
RM +1 verified dependencies |
…assist Remove prop navigation assist
Ultimate problem:
When creating components that utilize the
AbstractTransitionComponent, it's possible to set transition to a value that something like anOverlayTriggerdoesn't know about, which causes the cleanup of the component to hang.How it was fixed:
transitionTimeoutgetter toAbstractTransitionComponentthat can be overridden to adjust the desired timeout duration.Timerand display a warning after a timeout has occurred.Testing suggestions:
Potential areas of regression: