Skip to content

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

chore: improve plan UI layout and navigation consistency (#17114)

boojack6e081f049aa3
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index 1f4cd9a867..f305daadc7 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -327,7 +327,7 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *connect.Request[v
}
if storePlanConfigHasRelease(oldPlan.Config) && slices.Contains(req.UpdateMask.Paths, "specs") {
- return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("disallowed to update the plan steps because the plan is created from a release"))
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("disallowed to update the plan specs because the plan is created from a release"))
}
ok, err = func() (bool, error) {
diff --git a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue
index 3db71eafcc..74784e2a10 100644
--- a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue
+++ b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue
@@ -2,7 +2,7 @@
<div
class="flex-1 flex flex-col hide-scrollbar gap-3 divide-y overflow-x-hidden"
>
- <div class="w-full flex flex-col px-4 gap-2">
+ <div class="w-full flex flex-col">
<SpecListSection v-if="isCreating || plan.specs.length > 1" />
<TargetListSection />
</div>
diff --git a/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue b/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue
index 83269e5a12..01151f9042 100644
--- a/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue
+++ b/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue
@@ -1,10 +1,11 @@
<template>
- <div class="flex items-center gap-2">
+ <div class="flex items-center">
<NTabs
- :value="selectedSpec?.id"
- type="bar"
+ :value="selectedSpec.id"
+ type="line"
size="small"
class="flex-1"
+ tab-class="first:ml-4"
@update:value="handleTabChange"
>
<NTab v-for="(spec, index) in plan.specs" :key="spec.id" :name="spec.id">
@@ -22,17 +23,19 @@
</NTab>
<template #suffix>
- <NButton
- v-if="isCreating"
- type="default"
- size="small"
- @click="showAddSpecDrawer = true"
- >
- <template #icon>
- <PlusIcon class="w-4 h-4" />
- </template>
- {{ $t("plan.add-spec") }}
- </NButton>
+ <div class="pr-4">
+ <NButton
+ v-if="isCreating"
+ type="default"
+ size="small"
+ @click="showAddSpecDrawer = true"
+ >
+ <template #icon>
+ <PlusIcon class="w-4 h-4" />
+ </template>
+ {{ $t("plan.add-spec") }}
+ </NButton>
+ </div>
</template>
</NTabs>
</div>
diff --git a/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue b/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue
index ba35d06bb8..0ddf6a6a37 100644
--- a/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue
+++ b/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex flex-col gap-y-2">
+ <div class="flex flex-col gap-y-2 pt-2 px-4">
<div class="flex items-center justify-between gap-2">
<div class="flex items-center gap-1">
<h3 class="text-base font-medium">{{ $t("plan.targets.title") }}</h3>
diff --git a/frontend/src/views/project/CICDLayout.vue b/frontend/src/views/project/CICDLayout.vue
index 506e47ec70..e611f48350 100644
--- a/frontend/src/views/project/CICDLayout.vue
+++ b/frontend/src/views/project/CICDLayout.vue
@@ -22,6 +22,7 @@
<HeaderSection />
<NTabs
+ v-if="shouldShowNavigation"
type="line"
:value="tabKey"
tab-class="first:ml-4"
@@ -39,7 +40,7 @@
<!-- Suffix slot -->
<template #suffix>
<div class="pr-3 flex flex-row justify-end items-center gap-4">
- <RefreshIndicator v-if="!isCreating" />
+ <RefreshIndicator />
</div>
</template>
</NTabs>
@@ -134,6 +135,10 @@ const ready = computed(() => {
return !isInitializing.value && !!plan.value && !isLoading.value;
});
+const shouldShowNavigation = computed(() => {
+ return !isCreating.value && (plan.value.issue || plan.value.rollout);
+});
+
const route = useRoute();
const router = useRouter();
@@ -206,13 +211,11 @@ const tabKey = computed(() => {
const availableTabs = computed<TabKey[]>(() => {
const tabs: TabKey[] = [TabKey.Plan];
- if (!isCreating.value) {
- if (plan.value.issue && enabledNewLayout.value) {
- tabs.unshift(TabKey.Issue);
- }
- if (plan.value.rollout) {
- tabs.push(TabKey.Rollout);
- }
+ if (plan.value.issue && enabledNewLayout.value) {
+ tabs.unshift(TabKey.Issue);
+ }
+ if (plan.value.rollout) {
+ tabs.push(TabKey.Rollout);
}
return tabs;
});