@prefecthq/prefect-ui-library 3.14.3 → 3.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prefecthq/prefect-ui-library",
3
- "version": "3.14.3",
3
+ "version": "3.14.4",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,7 +52,7 @@
52
52
  <script lang="ts" setup>
53
53
  import { useDebouncedRef, useLocalStorage } from '@prefecthq/vue-compositions'
54
54
  import merge from 'lodash.merge'
55
- import { computed, ref } from 'vue'
55
+ import { computed, ref, watch } from 'vue'
56
56
  import {
57
57
  ResultsCount,
58
58
  StateNameSelect,
@@ -88,6 +88,19 @@
88
88
  limit,
89
89
  }), props.prefix)
90
90
 
91
+ // Reset pagination to page 1 whenever the flow run state filter changes.
92
+ // This prevents showing an empty or incorrect page when the result set changes.
93
+ watch(
94
+ () => filter.flowRuns?.state?.name,
95
+ (newState, oldState) => {
96
+ // Use JSON.stringify for deep comparison since the value may be an array.
97
+ if (JSON.stringify(newState) !== JSON.stringify(oldState)) {
98
+ filter.page = 1
99
+ }
100
+ },
101
+ { deep: true }
102
+ )
103
+
91
104
  const { flowRuns, count, pages, subscription, errored, error } = usePaginatedFlowRuns(filter, {
92
105
  interval: 30000,
93
106
  })