Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: fix current spec section display (#16371)

boojackcc0d82018abf
diff --git a/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue b/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue
index 6bc6de686b..c97ab68a03 100644
--- a/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue
+++ b/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue
@@ -157,10 +157,12 @@ const shouldShowTaskFilter = computed(() => {
});
const shouldShowCurrentTaskView = computed(() => {
+ if (stageState.value.index === 0) {
+ return false;
+ }
// Only show the current task view when the selected task is not in the filtered task list.
- return !filteredTaskList.value.some(
- (task) => task.name === selectedTask.value.name
- );
+ const visibleTasks = filteredTaskList.value.slice(0, stageState.value.index);
+ return !visibleTasks.some((task) => task.name === selectedTask.value.name);
});
const loadMore = useDebounceFn(async () => {
diff --git a/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue b/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue
index e93c43d87b..41f858bba1 100644
--- a/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue
+++ b/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue
@@ -58,10 +58,7 @@ import { NButton } from "naive-ui";
import { computed, reactive, ref, watch } from "vue";
import { BBSpin } from "@/bbkit";
import { useVerticalScrollState } from "@/composables/useScrollState";
-import {
- batchGetOrFetchDatabases,
- useDBGroupStore,
-} from "@/store";
+import { batchGetOrFetchDatabases, useDBGroupStore } from "@/store";
import { DEBOUNCE_SEARCH_DELAY, isValidDatabaseName } from "@/types";
import type { Advice_Status } from "@/types/proto/v1/sql_service";
import { isDev } from "@/utils";
@@ -131,6 +128,9 @@ const shouldShowSpecFilter = computed(() => {
});
const shouldShowCurrentSpecView = computed(() => {
+ if (state.index === 0) {
+ return false;
+ }
// Only show the current spec view when the selected spec is not in the filtered list.
const visibleSpecs = filteredSpecList.value.slice(0, state.index);
return !visibleSpecs.some((spec) => spec.id === selectedSpec.value.id);
@@ -149,7 +149,7 @@ const loadMore = useDebounceFn(async () => {
const targets = targetsForSpec(spec);
targets.forEach((target) => dbGroupNames.add(target));
}
-
+
await Promise.all(
Array.from(dbGroupNames).map((name) =>
dbGroupStore.getOrFetchDBGroupByName(name)
@@ -158,19 +158,17 @@ const loadMore = useDebounceFn(async () => {
} else {
const fromIndex = state.index;
const toIndex = fromIndex + SPEC_PER_PAGE;
-
+
// Collect all database names from all targets in the visible specs
const databaseNames = new Set<string>();
- filteredSpecList.value
- .slice(fromIndex, toIndex)
- .forEach((spec) => {
- const targets = targetsForSpec(spec);
- targets.forEach((target) => {
- if (isValidDatabaseName(target)) {
- databaseNames.add(target);
- }
- });
+ filteredSpecList.value.slice(fromIndex, toIndex).forEach((spec) => {
+ const targets = targetsForSpec(spec);
+ targets.forEach((target) => {
+ if (isValidDatabaseName(target)) {
+ databaseNames.add(target);
+ }
});
+ });
state.isRequesting = true;
try {