Skip to content

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

fix(plan): default all phases to expanded (#19921)

boojackbc483c78f845
diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vue
index 21e08f2db7..febda2fad3 100644
--- a/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vue
+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vue
@@ -11,7 +11,7 @@
:label="$t('plan.navigator.changes')"
:status="phases[0].status"
:expanded="isExpanded('changes')"
- :collapsible="currentPhase !== 'changes'"
+ collapsible
:badge="phases[0].badge"
:line-class="phases[0].lineClass"
@toggle="togglePhase('changes')"
@@ -33,7 +33,7 @@
:label="$t('plan.navigator.review')"
:status="phases[1].status"
:expanded="isExpanded('review')"
- :collapsible="currentPhase !== 'review'"
+ collapsible
:badge="phases[1].badge"
:line-class="phases[1].lineClass"
@toggle="togglePhase('review')"
@@ -60,7 +60,7 @@
:label="$t('plan.navigator.deploy')"
:status="phases[2].status"
:expanded="isExpanded('deploy')"
- :collapsible="currentPhase !== 'deploy'"
+ collapsible
:badge="phases[2].badge"
:is-last="true"
@toggle="togglePhase('deploy')"
@@ -191,13 +191,8 @@ const {
desktopSidebarWidth,
mobileSidebarOpen,
} = useSidebarContext();
-const {
- currentPhase,
- isExpanded,
- togglePhase,
- expandPhase,
- syncExpandedPhases,
-} = useActivePhase(issue, rollout);
+const { isExpanded, togglePhase, expandPhase, syncExpandedPhases } =
+ useActivePhase();
const routeDrivenExpandedPhases = computed<PhaseType[]>(() => {
if (
@@ -218,7 +213,7 @@ const routeDrivenExpandedPhases = computed<PhaseType[]>(() => {
});
watch(
- [routeDrivenExpandedPhases, currentPhase] as const,
+ [routeDrivenExpandedPhases] as const,
([phases]) => {
syncExpandedPhases(phases);
},
diff --git a/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.ts b/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.ts
index c6427dca0f..e884e0aa2e 100644
--- a/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.ts
+++ b/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.ts
@@ -1,37 +1,16 @@
-import { computed, type Ref, ref, watch } from "vue";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import type { Rollout } from "@/types/proto-es/v1/rollout_service_pb";
+import { ref } from "vue";
export type PhaseType = "changes" | "review" | "deploy";
-export const useActivePhase = (
- issue: Ref<Issue | undefined>,
- rollout: Ref<Rollout | undefined>
-) => {
- // The lifecycle-determined phase (always expanded by default)
- const currentPhase = computed<PhaseType>(() => {
- if (rollout.value) return "deploy";
- if (issue.value) return "review";
- return "changes";
- });
-
- // Set of expanded phases. The current lifecycle phase is always included.
- const manualExpanded = ref(new Set<PhaseType>());
-
- // When lifecycle transitions, reset manual expansions
- watch(currentPhase, () => {
- manualExpanded.value = new Set<PhaseType>();
- });
+const DEFAULT_EXPANDED_PHASES: PhaseType[] = ["changes", "review", "deploy"];
+export const useActivePhase = () => {
+ const manualExpanded = ref(new Set<PhaseType>(DEFAULT_EXPANDED_PHASES));
const isExpanded = (phase: PhaseType): boolean => {
- if (phase === currentPhase.value) return true;
return manualExpanded.value.has(phase);
};
const togglePhase = (phase: PhaseType) => {
- // The current lifecycle phase cannot be collapsed
- if (phase === currentPhase.value) return;
-
const next = new Set(manualExpanded.value);
if (next.has(phase)) {
next.delete(phase);
@@ -43,20 +22,22 @@ export const useActivePhase = (
// For programmatic expansion (e.g., route query ?section=deploy)
const expandPhase = (phase: PhaseType) => {
- if (phase === currentPhase.value) return;
const next = new Set(manualExpanded.value);
next.add(phase);
manualExpanded.value = next;
};
const syncExpandedPhases = (phases: PhaseType[]) => {
- manualExpanded.value = new Set(
- phases.filter((phase) => phase !== currentPhase.value)
- );
+ if (phases.length === 0) return;
+
+ const next = new Set(manualExpanded.value);
+ for (const phase of phases) {
+ next.add(phase);
+ }
+ manualExpanded.value = next;
};
return {
- currentPhase,
isExpanded,
togglePhase,
expandPhase,