Skip to content

feat: add loading state for app filters and update getRows logic#3082

Merged
AbhishekA1509 merged 2 commits into
mainfrom
fix/app-list-cluster-filter
Mar 27, 2026
Merged

feat: add loading state for app filters and update getRows logic#3082
AbhishekA1509 merged 2 commits into
mainfrom
fix/app-list-cluster-filter

Conversation

@AbhishekA1509

@AbhishekA1509 AbhishekA1509 commented Mar 27, 2026

Copy link
Copy Markdown
Member

Description

This pull request enhances the DevtronAppListContainer component to better handle loading states when application filters are being fetched. The main improvement is ensuring that the app list table does not attempt to load or display data while filter responses are still loading, which helps prevent inconsistent or empty data from being shown to users.

Loading state management improvements:

  • The getRows function now checks the appFiltersResponseLoading flag and returns an empty result with zero rows if filters are still loading, preventing unnecessary data fetches and UI flicker.
  • The dependency array for the getRows callback was updated to include appFiltersResponseLoading, ensuring the effect is recalculated when the loading state changes.
  • The Table component now receives the appFiltersResponseLoading flag as its loading prop, so the table displays a loading state while filters are being fetched.

Prop handling:

  • The DevtronAppList component now accepts the appFiltersResponseLoading prop, allowing it to respond to the filter loading state.

Fixes https://github.com/devtron-labs/sprint-tasks/issues/2865

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@AbhishekA1509 AbhishekA1509 self-assigned this Mar 27, 2026
Copilot AI review requested due to automatic review settings March 27, 2026 09:22
@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions github-actions Bot added PR:Issue-verification-failed PR:Issue-verification-failed and removed PR:Issue-verification-failed PR:Issue-verification-failed labels Mar 27, 2026
@github-actions github-actions Bot added the PR:Ready-to-Review PR:Ready-to-Review label Mar 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the Devtron app list table behavior while app-filter data (environments/namespaces) is still loading, preventing premature/undesired app-list fetching and showing a table-level loading state during filter fetch.

Changes:

  • Gate getRows to return an empty result while appFiltersResponseLoading is true.
  • Update getRows hook dependencies to include appFiltersResponseLoading.
  • Pass appFiltersResponseLoading to the Table component via its loading prop.
Comments suppressed due to low confidence (1)

src/components/app/list/DevtronAppListContainer.tsx:167

  • updateDataSyncing(false) won’t run if getAppList(...) rejects (network error) or is aborted via the passed signal, which can leave the parent isDataSyncing state stuck. Wrap the request in try/finally (and optionally handle abort separately) so syncing is always reset, even on errors/cancellation.
            updateDataSyncing(true)
            const data = await getAppList(getDevtronAppListPayload(filterConfig, environmentList, namespaceList), {
                signal,
            })
            updateDataSyncing(false)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

arunjaindev
arunjaindev previously approved these changes Mar 27, 2026
vivek-devtron
vivek-devtron previously approved these changes Mar 27, 2026
@AbhishekA1509 AbhishekA1509 dismissed stale reviews from vivek-devtron and arunjaindev via 48fe6f7 March 27, 2026 10:11
@sonarqubecloud

Copy link
Copy Markdown

@AbhishekA1509 AbhishekA1509 merged commit a83dfaa into main Mar 27, 2026
10 checks passed
@AbhishekA1509 AbhishekA1509 deleted the fix/app-list-cluster-filter branch March 27, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:Ready-to-Review PR:Ready-to-Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants