Skip to content

feat(ui): filter freight/stages by current warehouse filters#6161

Merged
jessesuen merged 1 commit intoakuity:mainfrom
jessesuen:fix/warehouse-filter-ui
Apr 24, 2026
Merged

feat(ui): filter freight/stages by current warehouse filters#6161
jessesuen merged 1 commit intoakuity:mainfrom
jessesuen:fix/warehouse-filter-ui

Conversation

@jessesuen
Copy link
Copy Markdown
Member

@jessesuen jessesuen commented Apr 24, 2026

Companion PR to #6153

This improves UI performance by sending the currently selected warehouse filters to the backend, reducing the response payload so the UI does not have to handle as many objects.

@rpelczar, please feel free to discard this or take it over; it was entirely vibecoded, and I just created it to prove that #6153 would help with the UI performance.

What changed:

The UI's queryFreight and listStages calls now pass the active warehouse filter (origins / freightOrigins) as query parameters, so the server-side filter applies to the initial data fetch — not just the display.

The stage/freight watchers are also updated to respect the active filter:

  • Watcher.watchStages now accepts an optional warehouses array and passes it as freightOrigins to the watch stream, so live stage updates are scoped to the filtered warehouses. The ListStagesRequest input used for cache key lookups is constructed once with the filter and reused.
  • useEventsWatcher (used by both graph and list views) accepts and forwards the warehouses filter to watchStages, and includes the warehouse list in its useEffect dependency array so the watcher restarts when the filter changes.
  • useWatchFreight fixes a bug where deleting Freight while a warehouse filter was active didn't update the UI: DELETED events now use setQueriesData with exact: false to remove the freight from all queryFreight cache entries (both unfiltered and warehouse-filtered), rather than only the unfiltered one.
  • In pipelines.tsx, the preferredFilter store is read before the queries are declared so the filter values are available to pass into both queryFreight and listStages.

@jessesuen jessesuen requested a review from a team as a code owner April 24, 2026 06:00
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit aa0c950
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/69eb286ad42873000882f851
😎 Deploy Preview https://deploy-preview-6161.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.69%. Comparing base (596be3d) to head (ed5d870).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6161   +/-   ##
=======================================
  Coverage   57.69%   57.69%           
=======================================
  Files         474      474           
  Lines       40499    40499           
=======================================
  Hits        23365    23365           
  Misses      15739    15739           
  Partials     1395     1395           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jessesuen jessesuen changed the title feat: UI makes use of backend warehouse filters feat(ui): filter freight/stages by current warehouse filters Apr 24, 2026
Signed-off-by: Jesse Suen <jesse@akuity.io>
@jessesuen jessesuen force-pushed the fix/warehouse-filter-ui branch from ed5d870 to aa0c950 Compare April 24, 2026 08:23
@jessesuen jessesuen requested a review from rpelczar April 24, 2026 10:46
@jessesuen jessesuen added this pull request to the merge queue Apr 24, 2026
Merged via the queue into akuity:main with commit fbbea55 Apr 24, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants