Skip to content

chore/fix: show refresh loading state in jobs and pod on refresh button#256

Open
gautamsidhwani29 wants to merge 1 commit into
volcano-sh:mainfrom
gautamsidhwani29:chore/refresh-button-loading-state
Open

chore/fix: show refresh loading state in jobs and pod on refresh button#256
gautamsidhwani29 wants to merge 1 commit into
volcano-sh:mainfrom
gautamsidhwani29:chore/refresh-button-loading-state

Conversation

@gautamsidhwani29
Copy link
Copy Markdown

Summary

The refresh button had isRefreshing={false} hardcoded, so the loading spinner and "Refreshing..." text never appeared during data fetches.

Closes #255

Changes

  • Exposed the loading state in:
    • Jobs.jsx
    • Pods.jsx

Signed-off-by: gautamsidhwani29 <gautamsidhwani405@gmail.com>
@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jessestutler for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Jobs and Pods components to utilize the loading state for the isRefreshing prop in the search bar, replacing hardcoded false values. The review feedback highlights that the loading state is currently overloaded in both components, as it tracks both the overall list fetching and individual item YAML fetching. This results in the refresh button displaying a loading state even when a user is only viewing details. It is recommended to split these into dedicated state variables to provide more accurate UI feedback.

handleRefresh={fetchJobs}
fetchData={fetchJobs}
isRefreshing={false} // Update if needed
isRefreshing={loading}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loading state is currently overloaded, as it tracks both the overall job list fetching (via fetchJobs) and the individual job YAML fetching (via handleJobClick). This causes the refresh button in the search bar to display "Refreshing..." and spin even when a user is only viewing job details. Consider using a dedicated state variable for list refreshing to provide more accurate UI feedback.

handleRefresh={handleRefresh}
fetchData={fetchPods}
isRefreshing={false} // Update if needed
isRefreshing={loading}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loading state is overloaded here as well, tracking both the pod list fetch and the YAML fetch in handlePodClick. This results in the refresh button showing a loading state during detail views. Splitting this into separate state variables for list loading and detail loading would improve the user experience and prevent misleading UI states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: wire up loading state to refresh button in Jobs and pods

2 participants