mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix: Prevent flicker during paginated workflow navigation (#13348)
This commit is contained in:
parent
8ff7ba9b82
commit
d277e0ba0e
|
@ -551,7 +551,7 @@ const loadPaginationFromQueryString = async () => {
|
||||||
|
|
||||||
<slot name="preamble" />
|
<slot name="preamble" />
|
||||||
|
|
||||||
<div v-if="resourcesRefreshing" class="resource-list-loading">
|
<div v-if="resourcesRefreshing" class="resource-list-loading resource-list-loading-instant">
|
||||||
<n8n-loading :rows="rowsPerPage" :shrink-last="false" />
|
<n8n-loading :rows="rowsPerPage" :shrink-last="false" />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -736,6 +736,9 @@ const loadPaginationFromQueryString = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.resource-list-loading-instant {
|
||||||
|
animation: 0.01s linear 0s forwards changeVisibility;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes changeVisibility {
|
@keyframes changeVisibility {
|
||||||
from {
|
from {
|
||||||
|
|
|
@ -40,6 +40,7 @@ import ProjectHeader from '@/components/Projects/ProjectHeader.vue';
|
||||||
import { getEasyAiWorkflowJson } from '@/utils/easyAiWorkflowUtils';
|
import { getEasyAiWorkflowJson } from '@/utils/easyAiWorkflowUtils';
|
||||||
import { useDebounce } from '@/composables/useDebounce';
|
import { useDebounce } from '@/composables/useDebounce';
|
||||||
import { createEventBus } from 'n8n-design-system/utils';
|
import { createEventBus } from 'n8n-design-system/utils';
|
||||||
|
import { debounce } from 'lodash-es';
|
||||||
|
|
||||||
interface Filters extends BaseFilters {
|
interface Filters extends BaseFilters {
|
||||||
status: string | boolean;
|
status: string | boolean;
|
||||||
|
@ -237,7 +238,11 @@ const setPageSize = async (size: number) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchWorkflows = async () => {
|
const fetchWorkflows = async () => {
|
||||||
|
// We debounce here so that fast enough fetches don't trigger
|
||||||
|
// the placeholder graphics for a few milliseconds, which would cause a flicker
|
||||||
|
const delayedLoading = debounce(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
}, 300);
|
||||||
const routeProjectId = route.params?.projectId as string | undefined;
|
const routeProjectId = route.params?.projectId as string | undefined;
|
||||||
const homeProjectFilter = filters.value.homeProject || undefined;
|
const homeProjectFilter = filters.value.homeProject || undefined;
|
||||||
|
|
||||||
|
@ -252,6 +257,7 @@ const fetchWorkflows = async () => {
|
||||||
tags: filters.value.tags.map((tagId) => tagsStore.tagsById[tagId]?.name),
|
tags: filters.value.tags.map((tagId) => tagsStore.tagsById[tagId]?.name),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
delayedLoading.cancel();
|
||||||
workflows.value = fetchedWorkflows;
|
workflows.value = fetchedWorkflows;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return fetchedWorkflows;
|
return fetchedWorkflows;
|
||||||
|
|
Loading…
Reference in a new issue