Replace loading text with spinner in RunDetails page#12873
Replace loading text with spinner in RunDetails page#12873RATNAPRADEEP wants to merge 3 commits intokubeflow:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🎉 Welcome to the Kubeflow Pipelines repo! 🎉 Thanks for opening your first PR! We're excited to have you onboard 🚀 Next steps:
Feel free to ask questions in the comments. |
|
Hi @RATNAPRADEEP. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Pull request overview
This PR updates the RunDetails page loading experience by replacing the plain loading text with a centered Material-UI CircularProgress spinner and keeping a loading message beneath it.
Changes:
- Replace the
isLoadingrender branch with a centered spinner + “Currently loading run information...” text. - Includes a number of formatting-only indentation changes elsewhere in
RunDetails.tsx(no functional behavior changes observed).
frontend/src/pages/RunDetails.tsx
Outdated
| ? [runIdFromParams] | ||
| : [], | ||
| ? [runIdFromParams] | ||
| : [], |
There was a problem hiding this comment.
The nested ternary blocks here (and other places in this PR) appear to be re-indented without changing behavior. Since this PR’s stated goal is only the loading spinner UI, consider reverting unrelated formatting-only changes to keep the diff focused and reduce future merge conflicts.
| public render(): JSX.Element { | ||
| if (this.props.isLoading) { | ||
| return <div>Currently loading run information</div>; | ||
| return ( | ||
| <div style={{ padding: 40, textAlign: 'center' }}> | ||
| <CircularProgress size={40} /> | ||
| <div style={{ marginTop: 16 }}> | ||
| Currently loading run information... | ||
| </div> | ||
| </div> | ||
| ); |
There was a problem hiding this comment.
The loading-state rendering has changed (spinner + updated message), but there doesn’t appear to be a unit test covering the isLoading path for this page. Since this file already has extensive tests, add a small test asserting the loading UI (e.g., presence of a progressbar and the loading text) to prevent regressions.
51b4b17 to
fc73c5f
Compare
|
/ok-to-test |
Signed-off-by: Ratnapradeep <prpr23091999@gmail.com>
fc73c5f to
fbd80e5
Compare
jeffspahr
left a comment
There was a problem hiding this comment.
Code Review: Replace loading text with spinner in RunDetails
Critical Bug: isLoading state is never set to false
This PR will break the RunDetails page. The new isLoading state is initialized to true but is never set to false anywhere in the diff. The component will be permanently stuck on the loading spinner.
The original code used this.props.isLoading, which was driven by the parent RunDetailsRouter (RunDetailsRouter.tsx:73):
return <EnhancedRunDetails {...props} isLoading={runIsFetching || templateStrIsFetching} />;That prop correctly transitions from true to false when data fetching completes. The new state-based approach has no corresponding setState({ isLoading: false }) call — none of the setStateSafe calls in the component include isLoading: false.
Additional Issues
-
Dead prop: The
isLoadingprop onRunDetailsInternalProps(line 104) is now unused but not removed. The parent still passes it, but it's ignored. This is misleading. -
Inline styles: The PR uses inline styles (
style={{ textAlign: 'center', paddingTop: '40px' }}). The file already usestypestylefor CSS (thecssobject). The new styles should use the same pattern for consistency. -
No test changes: The
RunDetailsInternalPropsinterface exportsisLoadingfor testing. If the behavior changes from prop-driven to state-driven, tests should be updated to reflect this.
Recommendations
-
Don't move to state at all. The prop-driven approach is correct — the parent already manages loading state via React Query's
isFetching. Just update the JSX to use the spinner while keepingthis.props.isLoading:if (this.props.isLoading) { return ( <div style={{ textAlign: 'center', paddingTop: '40px' }}> <CircularProgress /> <div>Currently loading run information.</div> </div> ); }
-
If state-based loading is truly desired, add
isLoading: falseto thesetStateSafecall at the end of theload()method and in the catch block. -
Move inline styles to the existing
cssstylesheet object. -
Clean up the unused
isLoadingprop fromRunDetailsInternalPropsif switching to state.
Signed-off-by: Ratnapradeep <prpr23091999@gmail.com>
f95059f to
6ce15a3
Compare
Signed-off-by: Ratnapradeep <prpr23091999@gmail.com>
a2a4a18 to
c8c02b6
Compare
Description
Replaces the plain loading text in the RunDetails page with a Material-UI CircularProgress spinner to improve user experience while data is loading.
Type of Change
Notes