Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor(plan): unify rollout flows under the plan detail page (#19783)
boojacka729c96593fc
diff --git a/frontend/src/components/IssueV1/components/Sidebar/IssueLabels.vue b/frontend/src/components/IssueV1/components/Sidebar/IssueLabels.vueindex 977e23b446..8f5a64ba20 100644--- a/frontend/src/components/IssueV1/components/Sidebar/IssueLabels.vue+++ b/frontend/src/components/IssueV1/components/Sidebar/IssueLabels.vue@@ -1,6 +1,6 @@<template><div class="flex flex-col gap-y-1">- <div class="flex items-center gap-x-1 textlabel">+ <div class="flex items-center gap-x-1 textinfolabel"><span>{{ $t("issue.labels") }}</span><RequiredStar v-if="project.forceIssueLabels" /></div>diff --git a/frontend/src/components/Plan/components/Configuration/Configuration.vue b/frontend/src/components/Plan/components/Configuration/Configuration.vueindex c87e6618c0..1cd492dda2 100644--- a/frontend/src/components/Plan/components/Configuration/Configuration.vue+++ b/frontend/src/components/Plan/components/Configuration/Configuration.vue@@ -1,12 +1,12 @@<template>- <div class="flex flex-col gap-y-3 py-3">- <h3 class="text-base">{{ $t("plan.options.self") }}</h3>- <div v-if="shouldShow" class="flex flex-col gap-y-3">- <InstanceRoleSection v-if="shouldShowInstanceRoleSection" />+ <div class="flex flex-col gap-y-2">+ <h3 class="textlabel uppercase">{{ $t("plan.options.self") }}</h3>+ <div v-if="shouldShow" class="flex flex-wrap gap-x-6 gap-y-2"><TransactionModeSection v-if="shouldShowTransactionModeSection" />- <IsolationLevelSection v-if="shouldShowIsolationLevelSection" />- <GhostSection v-if="shouldShowGhostSection" /><PreBackupSection v-if="shouldShowPreBackupSection" />+ <GhostSection v-if="shouldShowGhostSection" />+ <IsolationLevelSection v-if="shouldShowIsolationLevelSection" />+ <InstanceRoleSection v-if="shouldShowInstanceRoleSection" /></div><div v-else class="text-sm text-control-light">{{ $t("plan.options.no-options-available") }}diff --git a/frontend/src/components/Plan/components/Configuration/OptionRow.vue b/frontend/src/components/Plan/components/Configuration/OptionRow.vueindex a9f666be78..0114be0792 100644--- a/frontend/src/components/Plan/components/Configuration/OptionRow.vue+++ b/frontend/src/components/Plan/components/Configuration/OptionRow.vue@@ -1,14 +1,14 @@<template>- <div class="flex items-center justify-between gap-3">- <!-- Left: Label + Tooltip -->+ <div class="flex items-center gap-2">+ <!-- Label + Tooltip --><div class="flex items-center gap-1">- <label class="text-sm text-main whitespace-nowrap">+ <label class="text-sm text-control-placeholder whitespace-nowrap"><slot name="label" /></label><NTooltip v-if="$slots.tooltip"><template #trigger><heroicons:information-circle- class="w-4 h-4 text-control-light cursor-help"+ class="w-3.5 h-3.5 text-control-light cursor-help"/></template><template #default>@@ -19,7 +19,7 @@</NTooltip><slot name="suffix" /></div>- <!-- Right: Value (switch/selector) -->+ <!-- Value --><slot /></div></template>diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vueindex 5f4cdc97f3..1eec791a3a 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue@@ -51,13 +51,6 @@@confirm="handleRolloutActionConfirm"/>- <!-- Rollout Create Panel -->- <RolloutCreatePanel- :show="showRolloutCreatePanel"- :context="context"- @close="showRolloutCreatePanel = false"- @confirm="showRolloutCreatePanel = false"- /></div></template>@@ -74,7 +67,7 @@ import {issueServiceClientConnect,rolloutServiceClientConnect,} from "@/connect";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";+import { buildPlanDeployRouteFromRolloutName } from "@/router/dashboard/projectV1RouteHelpers";import { pushNotification, useCurrentProjectV1 } from "@/store";import { usePlanStore } from "@/store/modules/v1/plan";import { State } from "@/types/proto-es/v1/common_pb";@@ -87,11 +80,7 @@ import {BatchRunTasksRequestSchema,CreateRolloutRequestSchema,} from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,-} from "@/utils";-import { CreateButton, CreateIssueButton, RolloutCreatePanel } from "./create";+import { CreateButton, CreateIssueButton } from "./create";import { ExportArchiveDownloadAction } from "./export";import RolloutReadyLink from "./RolloutReadyLink.vue";import {@@ -138,8 +127,6 @@ const globalDisabledReason = computed(() => {// Panel visibility stateconst pendingRolloutAction = ref<RolloutAction | undefined>(undefined);-const showRolloutCreatePanel = ref(false);-// Get the first stage for database creation/export rollouts// (the panel handles all stages internally for these task types)const rolloutStage = computed(() => rollout.value?.stages[0]);@@ -156,9 +143,6 @@ const handlePerformAction = async (action: UnifiedAction) => {case "PLAN_REOPEN":await handlePlanStateChange("PLAN_REOPEN");break;- case "ROLLOUT_CREATE":- showRolloutCreatePanel.value = true;- break;case "ROLLOUT_START":// For deferred rollout plans without rollout, create and run all tasksif (context.value.hasDeferredRollout && !rollout.value) {@@ -281,13 +265,7 @@ const handleCreateRollout = async (options?: { runAllTasks?: boolean }) => {style: "SUCCESS",title: t("common.created"),});- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: {- projectId: extractProjectResourceName(project.value.name),- planId: extractPlanUIDFromRolloutName(createdRollout.name),- },- });+ router.push(buildPlanDeployRouteFromRolloutName(createdRollout.name));}} catch (error) {pushNotification({diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vueindex f071200857..4f7472cc6d 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue@@ -1,9 +1,8 @@<template>- <RouterLink :to="rolloutRoute">+ <RouterLink :to="planRoute"><NButton icon-placement="right" secondary strong>- <TaskStatus :status="rolloutStatus" size="small" />- <span class="ml-2 mr-1">{{ $t("common.rollout") }}</span>- <span>#{{ planID }}</span>+ <span class="mr-1">#{{ planID }}</span>+ <span>{{ $t("common.plan") }}</span><template #icon><ArrowUpRightIcon class="opacity-60" /></template>@@ -16,29 +15,25 @@ import { ArrowUpRightIcon } from "lucide-vue-next";import { NButton } from "naive-ui";import { computed } from "vue";import { usePlanContext } from "@/components/Plan/logic";-import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";-import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUID,- extractProjectResourceName,- getRolloutStatus,-} from "@/utils";+import { PROJECT_V1_ROUTE_PLAN_DETAIL } from "@/router/dashboard/projectV1";+import { buildPlanDeployRouteFromPlanName } from "@/router/dashboard/projectV1RouteHelpers";+import { extractPlanUID, extractProjectResourceName } from "@/utils";-const { plan, rollout } = usePlanContext();--const rolloutStatus = computed(() => {- if (!rollout.value) return Task_Status.NOT_STARTED;- return getRolloutStatus(rollout.value);-});+const { plan } = usePlanContext();const planID = computed(() => extractPlanUID(plan.value.name));-const rolloutRoute = computed(() => ({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: {- projectId: extractProjectResourceName(plan.value.name),- planId: planID.value,- },-}));+const planRoute = computed(() => {+ if (plan.value.hasRollout) {+ return buildPlanDeployRouteFromPlanName(plan.value.name);+ }++ return {+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,+ params: {+ projectId: extractProjectResourceName(plan.value.name),+ planId: planID.value,+ },+ };+});</script>diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateIssueButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateIssueButton.vueindex 39ac412b32..89aafd5465 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateIssueButton.vue+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateIssueButton.vue@@ -95,7 +95,10 @@ import {import { usePlanCheckStatus, usePlanContext } from "@/components/Plan/logic";import RequiredStar from "@/components/RequiredStar.vue";import { issueServiceClientConnect } from "@/connect";-import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";+import {+ PROJECT_V1_ROUTE_ISSUE_DETAIL,+ PROJECT_V1_ROUTE_PLAN_DETAIL,+} from "@/router/dashboard/projectV1";import {pushNotification,useCurrentProjectV1,@@ -250,15 +253,23 @@ const doCreateIssue = async () => {resetDraft();showPopover.value = false;- nextTick(() => {- router.push({- name: PROJECT_V1_ROUTE_ISSUE_DETAIL,- params: {- projectId: extractProjectResourceName(plan.value.name),- issueId: extractIssueUID(createdIssue.name),- },+ // On Plan Detail Page, stay in-place — the Review section will auto-expand.+ // On other pages, navigate to the issue (backward compat).+ const currentRoute = router.currentRoute.value;+ const isPlanDetailPage =+ typeof currentRoute.name === "string" &&+ currentRoute.name.startsWith(PROJECT_V1_ROUTE_PLAN_DETAIL);+ if (!isPlanDetailPage) {+ nextTick(() => {+ router.push({+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL,+ params: {+ projectId: extractProjectResourceName(plan.value.name),+ issueId: extractIssueUID(createdIssue.name),+ },+ });});- });+ }} catch (error) {pushNotification({module: "bytebase",diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vueindex fc8f468844..c38edd4f5d 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue@@ -78,21 +78,10 @@ import { ApprovalFlowSection } from "@/components/Plan/components/IssueReviewVieimport PlanCheckStatusCount from "@/components/Plan/components/PlanCheckStatusCount.vue";import { usePlanCheckStatus, usePlanContext } from "@/components/Plan/logic";import CommonDrawer from "@/components/RolloutV1/components/Rollout/CommonDrawer.vue";-import {- issueServiceClientConnect,- rolloutServiceClientConnect,-} from "@/connect";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";+import { rolloutServiceClientConnect } from "@/connect";+import { buildPlanDeployRouteFromRolloutName } from "@/router/dashboard/projectV1RouteHelpers";import { pushNotification } from "@/store";-import {- BatchUpdateIssuesStatusRequestSchema,- IssueStatus,-} from "@/types/proto-es/v1/issue_service_pb";import { CreateRolloutRequestSchema } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,-} from "@/utils";import type { ActionContext } from "../registry/types";const props = defineProps<{@@ -120,6 +109,13 @@ const bypassWarnings = ref(false);// Errors: require_*=true and condition not met (blocking)const errorMessages = computed(() => {const msgs: string[] = [];+ if (!props.context.permissions.createRollout) {+ msgs.push(+ t("common.missing-required-permission", {+ permissions: "bb.rollouts.create",+ })+ );+ }if (project.value.requireIssueApproval && !props.context.issueApproved) {msgs.push(t("project.settings.issue-related.require-issue-approval.description")@@ -174,17 +170,6 @@ const handleConfirm = async () => {create(CreateRolloutRequestSchema, { parent: plan.value.name }));- // Mark issue as done after rollout created.- if (issue.value) {- await issueServiceClientConnect.batchUpdateIssuesStatus(- create(BatchUpdateIssuesStatusRequestSchema, {- parent: project.value.name,- issues: [issue.value.name],- status: IssueStatus.DONE,- })- );- }-pushNotification({module: "bytebase",style: "SUCCESS",@@ -194,13 +179,7 @@ const handleConfirm = async () => {events.emit("status-changed", { eager: true });emit("confirm");- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: {- projectId: extractProjectResourceName(project.value.name),- planId: extractPlanUIDFromRolloutName(createdRollout.name),- },- });+ router.push(buildPlanDeployRouteFromRolloutName(createdRollout.name));} catch (error) {pushNotification({module: "bytebase",diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/actions/rollout.ts b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/actions/rollout.tsindex 90b0034d56..7cef8a93e8 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/actions/rollout.ts+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/actions/rollout.ts@@ -1,40 +1,6 @@import { t } from "@/plugins/i18n";-import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";import type { ActionDefinition } from "../types";-export const ROLLOUT_CREATE: ActionDefinition = {- id: "ROLLOUT_CREATE",- label: () => t("issue.create-rollout"),- buttonType: "default",- category: (ctx) => (ctx.issueApproved ? "primary" : "secondary"),- priority: 55,-- isVisible: (ctx) => {- // Deferred rollout plans use ROLLOUT_START to create rollout and run tasks together- if (ctx.hasDeferredRollout) return false;- if (ctx.isIssueOnly) return false;- if (ctx.plan.hasRollout) return false;- if (!ctx.issue) return false;- // Don't show create rollout when issue is closed- if (ctx.issueStatus === IssueStatus.CANCELED) return false;-- // Project setting validations are handled in RolloutCreatePanel- return true;- },-- isDisabled: (ctx) => !ctx.permissions.createRollout,- disabledReason: (ctx) => {- if (!ctx.permissions.createRollout) {- return t("common.missing-required-permission", {- permissions: "bb.rollouts.create",- });- }- return undefined;- },-- executeType: "immediate",-};-export const ROLLOUT_START: ActionDefinition = {id: "ROLLOUT_START",label: (ctx) => (ctx.isExportPlan ? t("common.export") : t("common.rollout")),@@ -43,19 +9,12 @@ export const ROLLOUT_START: ActionDefinition = {priority: 60,isVisible: (ctx) => {- // Deferred rollout plans: rollout is created on-demand when user clicks action button- if (ctx.hasDeferredRollout) {- if (!ctx.issue || !ctx.issueApproved) return false;- // Show if no rollout yet (will create it) or has startable tasks- if (!ctx.rollout) return true;- return ctx.hasStartableTasks;- }- // Regular plans: rollout must already exist- if (!ctx.rollout) return false;- if (!ctx.issueApproved) return false;- if (!ctx.hasDatabaseCreateOrExportTasks) return false;- if (!ctx.hasStartableTasks) return false;- return true;+ // Only for deferred rollout plans (export/create DB) — rollout created on-demand+ // Change database plans: rollout managed in Plan Detail Page's Deploy section+ if (!ctx.hasDeferredRollout) return false;+ if (!ctx.issue || !ctx.issueApproved) return false;+ if (!ctx.rollout) return true;+ return ctx.hasStartableTasks;},isDisabled: (ctx) => !ctx.permissions.runTasks,@@ -80,6 +39,8 @@ export const ROLLOUT_CANCEL: ActionDefinition = {priority: 80,isVisible: (ctx) => {+ // Only for deferred rollout plans — change database rollouts managed on Plan Detail Page+ if (!ctx.hasDeferredRollout) return false;if (!ctx.rollout) return false;if (!ctx.issueApproved) return false;if (!ctx.hasRunningTasks) return false;@@ -116,7 +77,6 @@ export const EXPORT_DOWNLOAD: ActionDefinition = {};export const rolloutActions: ActionDefinition[] = [- ROLLOUT_CREATE,ROLLOUT_START,ROLLOUT_CANCEL,EXPORT_DOWNLOAD,diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/components/IssueReviewButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/components/IssueReviewButton.vueindex 5be5576746..27a889ffe0 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/components/IssueReviewButton.vue+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/components/IssueReviewButton.vue@@ -101,10 +101,8 @@ import { usePlanContext } from "@/components/Plan/logic";import { useSidebarContext } from "@/components/Plan/logic/sidebar";import { Drawer, DrawerContent } from "@/components/v2";import { issueServiceClientConnect } from "@/connect";-import {- PROJECT_V1_ROUTE_ISSUE_DETAIL,- PROJECT_V1_ROUTE_PLAN_ROLLOUT,-} from "@/router/dashboard/projectV1";+import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";+import { buildPlanDeployRouteFromPlanName } from "@/router/dashboard/projectV1RouteHelpers";import {pushNotification,useCurrentProjectV1,@@ -115,13 +113,7 @@ import {RejectIssueRequestSchema,} from "@/types/proto-es/v1/issue_service_pb";import { PlanCheckRun_Status } from "@/types/proto-es/v1/plan_service_pb";-import { Task_Type } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractIssueUID,- extractPlanUIDFromRolloutName,- extractProjectResourceName,- flattenTaskV1List,-} from "@/utils";+import { extractIssueUID, extractProjectResourceName } from "@/utils";import IssueReviewForm, { type ReviewAction } from "./IssueReviewForm.vue";const props = defineProps<{@@ -134,7 +126,7 @@ const props = defineProps<{const { t } = useI18n();const router = useRouter();const { project } = useCurrentProjectV1();-const { issue, rollout, planCheckRuns, events } = usePlanContext();+const { plan, issue, planCheckRuns, events } = usePlanContext();const issueCommentStore = useIssueCommentStore();const { mode: sidebarMode } = useSidebarContext();@@ -232,16 +224,12 @@ const handlePostActionNavigation = (issueValue: NonNullable<typeof issue.value>) => {if (action === "COMMENT") return;-- const rolloutValue = rollout?.value;- if (!rolloutValue) return;-- const hasSpecialTasks = flattenTaskV1List(rolloutValue).some(- (task) =>- task.type === Task_Type.DATABASE_CREATE ||- task.type === Task_Type.DATABASE_EXPORT+ const hasDeferredRollout = plan.value.specs.some(+ (spec) =>+ spec.config.case === "createDatabaseConfig" ||+ spec.config.case === "exportDataConfig");- if (hasSpecialTasks) return;+ if (hasDeferredRollout) return;if (action === "APPROVE") {const { approvalTemplate, approvers } = issueValue;@@ -256,14 +244,10 @@ const handlePostActionNavigation = (title: t("issue.approval.approved-and-waiting-for-rollout"),});+ if (!plan.value.hasRollout) return;+nextTick(() => {- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: {- projectId: extractProjectResourceName(issueValue.name),- planId: extractPlanUIDFromRolloutName(rolloutValue.name),- },- });+ router.push(buildPlanDeployRouteFromPlanName(plan.value.name));});return;}diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/context.ts b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/context.tsindex a60f03880e..e4a86eaf7b 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/context.ts+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/context.ts@@ -205,7 +205,6 @@ export function buildActionContext(input: ContextBuilderInput): ActionContext {hasProjectPermissionV2(project, "bb.plans.update"),createIssue: hasProjectPermissionV2(project, "bb.issues.create"),updateIssue: hasProjectPermissionV2(project, "bb.issues.update"),- // For data export issues, creators use ROLLOUT_START which checks runTasks instead.createRollout: hasProjectPermissionV2(project, "bb.rollouts.create"),runTasks:issue?.type === Issue_Type.DATABASE_EXPORT@@ -281,7 +280,6 @@ export function buildActionContext(input: ContextBuilderInput): ActionContext {hasDatabaseCreateOrExportTasks,hasStartableTasks,hasRunningTasks,-permissions,validation,};diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/types.ts b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/types.tsindex 3253dee635..9f631656ba 100644--- a/frontend/src/components/Plan/components/HeaderSection/Actions/registry/types.ts+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/registry/types.ts@@ -21,10 +21,7 @@ export type IssueAction =export type PlanAction = "PLAN_CLOSE" | "PLAN_REOPEN";-export type RolloutAction =- | "ROLLOUT_CREATE"- | "ROLLOUT_START"- | "ROLLOUT_CANCEL";+export type RolloutAction = "ROLLOUT_START" | "ROLLOUT_CANCEL";export type ExportAction = "EXPORT_DOWNLOAD";@@ -82,7 +79,6 @@ export interface ActionContext {hasDatabaseCreateOrExportTasks: boolean;hasStartableTasks: boolean;hasRunningTasks: boolean;-// Groupedpermissions: ActionPermissions;validation: ActionValidation;diff --git a/frontend/src/components/Plan/components/HeaderSection/DescriptionSection.vue b/frontend/src/components/Plan/components/HeaderSection/DescriptionSection.vueindex f7f075e6d6..9c43ba1722 100644--- a/frontend/src/components/Plan/components/HeaderSection/DescriptionSection.vue+++ b/frontend/src/components/Plan/components/HeaderSection/DescriptionSection.vue@@ -13,17 +13,34 @@</template>{{ $t("plan.description.placeholder") }}</NButton>- <div- v-else- class="mt-1 cursor-pointer px-2 py-1 rounded-md border border-transparent hover:border-gray-200 transition-all duration-200"- @click="handleExpand($event)"- >- <MarkdownEditor- mode="preview"- class="pointer-events-none"- :content="state.description"- :project="project"- />+ <div v-else class="mt-1">+ <div+ class="relative px-2 py-1 rounded-md border border-transparent transition-all duration-200"+ :class="[+ allowEdit ? 'cursor-pointer hover:border-gray-200' : '',+ !state.showFullDescription ? 'max-h-[4.5rem] overflow-hidden' : '',+ ]"+ @click="allowEdit && handleExpand($event)"+ >+ <MarkdownEditor+ mode="preview"+ class="pointer-events-none"+ :content="state.description"+ :project="project"+ />+ <!-- Fade overlay when truncated -->+ <div+ v-if="!state.showFullDescription && isDescriptionLong"+ class="absolute bottom-0 left-0 right-0 h-6 bg-gradient-to-t from-white to-transparent pointer-events-none"+ />+ </div>+ <button+ v-if="isDescriptionLong"+ class="text-xs text-control-placeholder hover:text-control mt-1 px-2"+ @click.stop="state.showFullDescription = !state.showFullDescription"+ >+ {{ state.showFullDescription ? $t("common.show-less") : $t("common.show-more") }}+ </button></div></template><div v-else class="py-2">@@ -99,6 +116,15 @@ const state = reactive({isExpanded: false,shouldAutoFocus: false,justExpanded: false,+ showFullDescription: false,+});++// Description longer than ~3 lines of text+const isDescriptionLong = computed(() => {+ return (+ (state.description?.length ?? 0) > 150 ||+ (state.description?.split("\n").length ?? 0) > 3+ );});const allowEdit = computed(() => {diff --git a/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue b/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vueindex b4f7fd762f..3035c57c6f 100644--- a/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue+++ b/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue@@ -50,6 +50,7 @@ import { computed } from "vue";import { useRoute } from "vue-router";import {PROJECT_V1_ROUTE_ISSUE_DETAIL,+ PROJECT_V1_ROUTE_PLAN_DETAIL,PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,} from "@/router/dashboard/projectV1";@@ -67,6 +68,7 @@ const { isCreating, plan, issue } = usePlanContext();const isPlanDetailPage = computed(() => {return (+ route.name === PROJECT_V1_ROUTE_PLAN_DETAIL ||route.name === PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS ||route.name === PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL);@@ -120,9 +122,10 @@ const showDoneTag = computed(() => {});const showDescriptionSection = computed(() => {- // Only show when there's no issue yet (draft plan)- return (- (isValidPlanName(plan.value.name) || isCreating.value) && !plan.value.issue- );+ if (isCreating.value) return true;+ // On Plan Detail Page: always show description+ if (isPlanDetailPage.value) return isValidPlanName(plan.value.name);+ // On Issue page: description is managed by the Issue page itself+ return false;});</script>diff --git a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/IssueCommentView/StageName.vue b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/IssueCommentView/StageName.vueindex 70524cf495..307fac4607 100644--- a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/IssueCommentView/StageName.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/IssueCommentView/StageName.vue@@ -14,14 +14,9 @@<script lang="ts" setup>import { computed } from "vue";import { EnvironmentV1Name } from "@/components/v2";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE } from "@/router/dashboard/projectV1";+import { buildStageRoute } from "@/router/dashboard/projectV1RouteHelpers";import { useEnvironmentV1Store } from "@/store";import type { Stage } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- extractStageUID,-} from "@/utils";const props = defineProps<{stage: Stage;@@ -30,15 +25,6 @@ const props = defineProps<{const environmentStore = useEnvironmentV1Store();const link = computed(() => {- const { stage } = props;-- return {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: extractProjectResourceName(stage.name),- planId: extractPlanUIDFromRolloutName(stage.name),- stageId: extractStageUID(stage.name),- },- };+ return buildStageRoute(props.stage.name);});</script>diff --git a/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/DatabaseChangeView.vue b/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/DatabaseChangeView.vueindex 91eb5353fd..328ca08946 100644--- a/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/DatabaseChangeView.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/DatabaseChangeView.vue@@ -1,6 +1,6 @@<template><div class="w-full flex flex-col">- <!-- Spec Tabs with integrated content -->+ <!-- Spec Tabs with content (read-only on Issue page) --><SpecTabs v-model:selected-spec-id="selectedSpecId"><div v-if="selectedSpec" class="flex flex-col gap-2"><TargetListSection />@@ -10,13 +10,17 @@<OptionsSection /></div></SpecTabs>+</div></template><script setup lang="ts">-import { computed, ref, watch } from "vue";+import { computed, provide, ref, watch } from "vue";import { usePlanContext } from "../../../logic";-import { provideSelectedSpec } from "../../SpecDetailView/context";+import {+ FORCE_READONLY_KEY,+ provideSelectedSpec,+} from "../../SpecDetailView/context";import TargetListSection from "../../SpecDetailView/TargetListSection.vue";import StatementSection from "../../StatementSection/StatementSection.vue";import OptionsSection from "./OptionsSection.vue";@@ -24,15 +28,16 @@ import SpecTabs from "./SpecTabs.vue";const { plan } = usePlanContext();+// Issue page shows changes read-only — editing happens on Plan Detail Page+provide(FORCE_READONLY_KEY, true);+// Local state for selected spec (not route-based)const selectedSpecId = ref<string>(plan.value.specs[0]?.id ?? "");-// Computed selected specconst selectedSpec = computed(() => {return plan.value.specs.find((spec) => spec.id === selectedSpecId.value);});-// Provide selected spec for child componentsprovideSelectedSpec(computed(() => {const spec = selectedSpec.value;@@ -43,7 +48,6 @@ provideSelectedSpec(}));-// Update selected spec when specs changewatch(() => plan.value.specs,(specs) => {diff --git a/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/OptionsSection.vue b/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/OptionsSection.vueindex 0ce87bb050..1bd48a9793 100644--- a/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/OptionsSection.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/OptionsSection.vue@@ -46,15 +46,19 @@ import { providePreBackupSettingContext } from "../../Configuration/PreBackupSecimport PreBackupSwitch from "../../Configuration/PreBackupSection/PreBackupSwitch.vue";import { provideTransactionModeSettingContext } from "../../Configuration/TransactionModeSection/context";import TransactionModeSwitch from "../../Configuration/TransactionModeSection/TransactionModeSwitch.vue";-import { useSelectedSpec } from "../../SpecDetailView/context";+import {+ useForceReadonly,+ useSelectedSpec,+} from "../../SpecDetailView/context";const { isCreating, plan, events, issue, readonly, allowEdit, project } =usePlanContext();const { selectedSpec } = useSelectedSpec();+const forceReadonly = useForceReadonly();+const allowChange = computed(() => {- // If readonly mode, disallow changes- if (readonly?.value) {+ if (forceReadonly || readonly?.value) {return false;}diff --git a/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/SpecTabs.vue b/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/SpecTabs.vueindex 8fd8c0d93e..ba65ff1306 100644--- a/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/SpecTabs.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/DatabaseChangeView/SpecTabs.vue@@ -39,8 +39,15 @@</button></div>+ <RouterLink+ v-if="forceReadonly"+ :to="planRoute"+ class="text-sm text-accent hover:underline px-3"+ >+ {{ $t("plan.go-to-plan-page") }} →+ </RouterLink><NButton- v-if="canModifySpecs"+ v-else-if="canModifySpecs"type="default"size="small"@click="showAddSpecDrawer = true"@@ -65,7 +72,10 @@ import type { DropdownOption } from "naive-ui";import { NButton, NDropdown, NTooltip, useDialog } from "naive-ui";import { computed, h, ref } from "vue";import { useI18n } from "vue-i18n";+import { RouterLink } from "vue-router";import { planServiceClientConnect } from "@/connect";+import { PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS } from "@/router/dashboard/projectV1";+import { buildPlanDeployRouteFromPlanName } from "@/router/dashboard/projectV1RouteHelpers";import {pushNotification,useCurrentProjectV1,@@ -74,11 +84,16 @@ import {import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";import type { Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";import { UpdatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";-import { extractSheetUID } from "@/utils";+import {+ extractPlanUID,+ extractProjectResourceName,+ extractSheetUID,+} from "@/utils";import { getLocalSheetByName, usePlanContext } from "../../../logic";import { getSpecTitle } from "../../../logic/utils";import AddSpecDrawer from "../../AddSpecDrawer.vue";import { useSpecsValidation } from "../../common";+import { useForceReadonly } from "../../SpecDetailView/context";const props = defineProps<{ selectedSpecId: string }>();const emit = defineEmits<{ "update:selectedSpecId": [specId: string] }>();@@ -89,11 +104,26 @@ const { plan, issue, isCreating } = usePlanContext();const sheetStore = useSheetV1Store();const { project } = useCurrentProjectV1();+const forceReadonly = useForceReadonly();+const planRoute = computed(() => {+ if (plan.value.hasRollout) {+ return buildPlanDeployRouteFromPlanName(plan.value.name);+ }++ return {+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,+ params: {+ projectId: extractProjectResourceName(project.value.name),+ planId: extractPlanUID(plan.value.name),+ },+ };+});const specs = computed(() => plan.value.specs);const { isSpecEmpty } = useSpecsValidation(specs);const showAddSpecDrawer = ref(false);const canModifySpecs = computed(() =>+ !forceReadonly &&(isCreating.value || !plan.value.hasRollout) &&issue.value?.status !== IssueStatus.CANCELED &&issue.value?.status !== IssueStatus.DONEdiff --git a/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue b/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vueindex 2747990d9d..52ffba7da2 100644--- a/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue@@ -70,14 +70,10 @@ import { ref } from "vue";import { useRouter } from "vue-router";import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";import { EnvironmentV1Name } from "@/components/v2";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE } from "@/router/dashboard/projectV1";-import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";+import { buildStageRoute } from "@/router/dashboard/projectV1RouteHelpers";+import { useEnvironmentV1Store } from "@/store";import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- getStageStatus,-} from "@/utils";+import { getStageStatus } from "@/utils";import { usePlanCheckStatus, usePlanContext } from "../../logic";import ChecksDrawer from "../ChecksView/ChecksDrawer.vue";import PlanCheckStatusCount from "../PlanCheckStatusCount.vue";@@ -85,7 +81,6 @@ import PlanCheckStatusCount from "../PlanCheckStatusCount.vue";const { plan, rollout } = usePlanContext();const environmentStore = useEnvironmentV1Store();const router = useRouter();-const { project } = useCurrentProjectV1();const { hasAnyStatus: hasAnyChecks } = usePlanCheckStatus(plan);const selectedResultStatus = ref<Advice_Level | undefined>(undefined);@@ -95,20 +90,6 @@ const getEnvironmentEntity = (environmentName: string) => {};const navigateToStage = (stageName: string) => {- if (!rollout?.value) return;-- const planId = extractPlanUIDFromRolloutName(rollout.value.name);- const stageId = stageName.split("/").pop();-- if (!planId || !stageId) return;-- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: extractProjectResourceName(project.value.name),- planId,- stageId,- },- });+ router.push(buildStageRoute(stageName));};</script>diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vueindex 29fe1feba6..a1b6465de9 100644--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue@@ -1,7 +1,7 @@<template><div><div class="w-full flex flex-row items-center gap-2 flex-wrap">- <h3 class="textlabel">{{ $t("issue.approval-flow.self") }}</h3>+ <h3 class="textinfolabel">{{ $t("issue.approval-flow.self") }}</h3><FeatureBadge :feature="PlanFeature.FEATURE_APPROVAL_WORKFLOW" /><RiskLevelIcon:risk-level="issue.riskLevel"diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vueindex 89d30f35a4..5224dcce57 100644--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue@@ -1,23 +1,12 @@<template><div class="w-full flex flex-col p-4 gap-4">- <!-- 1. Stages - Progress indicator -->- <StagesSection v-if="isDatabaseChangePlan" />-- <!-- 2. Checks rollout hint -->- <NAlert v-if="showChecksBlockRolloutHint" type="error">- {{ $t("issue.checks-block-rollout-hint") }}- </NAlert>- <NAlert v-else-if="showForceRolloutHint" type="warning">- {{ $t("issue.force-rollout-hint") }}- </NAlert>-- <!-- 3. Checks - Health status -->+ <!-- 1. Checks - Health status --><ChecksSection v-if="isDatabaseChangePlan" />- <!-- 4. Approval Flow - Reviewers -->+ <!-- 2. Approval Flow - Reviewers --><ApprovalFlowSection :issue="issue" />- <!-- 5. Labels - Metadata -->+ <!-- 3. Labels - Metadata --><IssueLabels:project="project":value="issue.labels || []"@@ -29,32 +18,25 @@<script setup lang="ts">import { create } from "@bufbuild/protobuf";-import { NAlert } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";import IssueLabels from "@/components/IssueV1/components/Sidebar/IssueLabels.vue";import { useResourcePoller } from "@/components/Plan/logic/poller";import { issueServiceClientConnect } from "@/connect";import { pushNotification, useCurrentProjectV1 } from "@/store";-import { State } from "@/types/proto-es/v1/common_pb";import {- Issue_ApprovalStatus,IssueStatus,UpdateIssueRequestSchema,} from "@/types/proto-es/v1/issue_service_pb";import { hasProjectPermissionV2 } from "@/utils";-import { usePlanCheckStatus } from "../../../logic";import { usePlanContextWithIssue } from "../../../logic/context";import ApprovalFlowSection from "./ApprovalFlowSection/ApprovalFlowSection.vue";import ChecksSection from "./ChecksSection.vue";-import StagesSection from "./StagesSection.vue";const { t } = useI18n();const { plan, issue } = usePlanContextWithIssue();const { project } = useCurrentProjectV1();const { refreshResources } = useResourcePoller();-const { hasErrors: checksHaveErrors, hasRunning: checksRunning } =- usePlanCheckStatus(plan);const isDatabaseChangePlan = computed(() =>@@ -64,42 +46,10 @@ const isDatabaseChangePlan = computed());-const isApproved = computed(() => {- const status = issue.value.approvalStatus;- if (status === Issue_ApprovalStatus.CHECKING) return false;- const roles = issue.value.approvalTemplate?.flow?.roles ?? [];- return (- status === Issue_ApprovalStatus.APPROVED ||- status === Issue_ApprovalStatus.SKIPPED ||- roles.length === 0- );-});--const showChecksHint = computed(() => {- return (- issue.value.status === IssueStatus.OPEN &&- plan.value.state === State.ACTIVE &&- isDatabaseChangePlan.value &&- isApproved.value &&- checksHaveErrors.value &&- !checksRunning.value &&- !plan.value.hasRollout- );-});--const showChecksBlockRolloutHint = computed(() => {- return showChecksHint.value && project.value.requirePlanCheckNoError;-});--const showForceRolloutHint = computed(() => {- return showChecksHint.value && !project.value.requirePlanCheckNoError;-});-const allowChange = computed(() => {if (issue.value.status !== IssueStatus.OPEN) {return false;}-return hasProjectPermissionV2(project.value, "bb.issues.update");});diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vueindex 6eeed0d127..362312ca7f 100644--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue@@ -35,39 +35,20 @@import { useRouter } from "vue-router";import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";import { EnvironmentV1Name } from "@/components/v2";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE } from "@/router/dashboard/projectV1";-import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- getStageStatus,-} from "@/utils";+import { buildStageRoute } from "@/router/dashboard/projectV1RouteHelpers";+import { useEnvironmentV1Store } from "@/store";+import { getStageStatus } from "@/utils";import { usePlanContext } from "../../../logic";const { rollout } = usePlanContext();const environmentStore = useEnvironmentV1Store();const router = useRouter();-const { project } = useCurrentProjectV1();const getEnvironmentEntity = (environmentName: string) => {return environmentStore.getEnvironmentByName(environmentName);};const navigateToStage = (stageName: string) => {- if (!rollout?.value) return;-- const planId = extractPlanUIDFromRolloutName(rollout.value.name);- const stageId = stageName.split("/").pop();-- if (!planId || !stageId) return;-- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: extractProjectResourceName(project.value.name),- planId,- stageId,- },- });+ router.push(buildStageRoute(stageName));};</script>diff --git a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vueindex fa220d9bdc..e353247372 100644--- a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue+++ b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue@@ -1,9 +1,9 @@<template>- <div v-if="shouldShow" class="py-3 flex flex-col gap-y-2 overflow-hidden">+ <div v-if="shouldShow" class="flex flex-col gap-y-2 overflow-hidden"><!-- Row 1: Title + Run button --><div class="flex items-center justify-between gap-2"><div class="flex flex-row items-center gap-2">- <h3 class="text-base">{{ $t("plan.checks.self") }}</h3>+ <h3 class="textlabel uppercase">{{ $t("plan.checks.self") }}</h3><NTooltip v-if="isStatementOversized" style="max-width: 20rem"><template #trigger><NTag type="warning" round size="tiny">@@ -82,6 +82,8 @@ import {useCurrentProjectV1,useCurrentUserV1,} from "@/store";+import { State } from "@/types/proto-es/v1/common_pb";+import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";import { RunPlanChecksRequestSchema } from "@/types/proto-es/v1/plan_service_pb";import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";import { hasProjectPermissionV2 } from "@/utils";@@ -99,7 +101,7 @@ import { useSpecSheet } from "../StatementSection/useSpecSheet";const currentUser = useCurrentUserV1();const { project } = useCurrentProjectV1();-const { plan, planCheckRuns } = usePlanContext();+const { plan, issue, planCheckRuns } = usePlanContext();const { selectedSpec } = useSelectedSpec();const { refreshResources } = useResourcePoller();const { statusCountString } = usePlanCheckStatus(plan);@@ -114,6 +116,8 @@ const shouldShow = computed(() => {});const allowRunChecks = computed(() => {+ if (plan.value.state === State.DELETED) return false;+ if (issue.value && issue.value.status !== IssueStatus.OPEN) return false;const me = currentUser.value;if (extractUserEmail(plan.value.creator) === me.email) {return true;diff --git a/frontend/src/components/Plan/components/PlanDetailPage/DeployFutureAction.vue b/frontend/src/components/Plan/components/PlanDetailPage/DeployFutureAction.vuenew file mode 100644index 0000000000..1ffc7da7a6--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/DeployFutureAction.vue@@ -0,0 +1,44 @@+<template>+ <p v-if="showCreateRollout" class="text-sm text-control-placeholder mt-0.5">+ <i18n-t keypath="plan.phase.deploy-description-with-action" tag="span">+ <template #action>+ <span+ class="text-accent cursor-pointer hover:underline"+ @click="showRolloutCreatePanel = true"+ >{{ $t("plan.phase.create-rollout-action") }}</span>+ </template>+ </i18n-t>+ <RolloutCreatePanel+ :show="showRolloutCreatePanel"+ :context="actionContext"+ @close="showRolloutCreatePanel = false"+ @confirm="showRolloutCreatePanel = false"+ />+ </p>+ <p v-else class="text-sm text-control-placeholder mt-0.5">+ {{ $t("plan.phase.deploy-description") }}+ </p>+</template>++<script setup lang="ts">+import { computed, ref } from "vue";+import { State } from "@/types/proto-es/v1/common_pb";+import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";+import { usePlanContext } from "../../logic";+import RolloutCreatePanel from "../HeaderSection/Actions/create/RolloutCreatePanel.vue";+import { useActionRegistry } from "../HeaderSection/Actions/registry/useActionRegistry";++const { plan, issue } = usePlanContext();+const { context: actionContext } = useActionRegistry();++const showRolloutCreatePanel = ref(false);++const showCreateRollout = computed(() => {+ if (!issue.value) return false;+ if (plan.value.hasRollout) return false;+ if (plan.value.state !== State.ACTIVE) return false;+ if (issue.value.status !== IssueStatus.OPEN) return false;+ if (!actionContext.value.permissions.createRollout) return false;+ return true;+});+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailDesktopColumn.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailDesktopColumn.vuenew file mode 100644index 0000000000..3b8847c150--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailDesktopColumn.vue@@ -0,0 +1,34 @@+<template>+ <component+ :is="props.tag"+ class="min-w-0 border-l bg-white"+ :style="columnStyle"+ >+ <StickySidePanel>+ <template v-if="$slots.header" #header>+ <slot name="header" />+ </template>+ <slot />+ </StickySidePanel>+ </component>+</template>++<script setup lang="ts">+import type { CSSProperties } from "vue";+import { computed } from "vue";+import StickySidePanel from "./StickySidePanel.vue";+import { PLAN_DETAIL_CONTENT_MIN_HEIGHT_VAR } from "./usePlanDetailViewportVars";++const props = withDefaults(+ defineProps<{+ tag?: "aside" | "div";+ }>(),+ {+ tag: "div",+ }+);++const columnStyle = computed<CSSProperties>(() => ({+ minHeight: `var(${PLAN_DETAIL_CONTENT_MIN_HEIGHT_VAR})`,+}));+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailHeader.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailHeader.vuenew file mode 100644index 0000000000..62395371ef--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailHeader.vue@@ -0,0 +1,187 @@+<template>+ <div class="py-2 px-2 sm:px-4">+ <div class="flex flex-row items-center justify-between gap-2">+ <!-- Status tags (closed/done) -->+ <NTag v-if="isClosed" round type="default">+ <template #icon>+ <BanIcon class="w-4 h-4" />+ </template>+ {{ $t("common.closed") }}+ </NTag>++ <!-- Title -->+ <TitleInput />++ <!-- Actions -->+ <div class="flex items-center gap-x-2">+ <!-- Create plan (when creating) -->+ <CreateButton v-if="isCreating" />++ <!-- Submit for Review (plan exists, no issue yet) -->+ <template v-else>+ <CreateIssueButton+ v-if="showSubmitForReview"+ :disabled="submitDisabled"+ :disabled-reason="submitDisabledReason"+ />++ <!-- Close / Reopen plan (no issue, no rollout) -->+ <NButton+ v-if="showClosePlan"+ size="medium"+ @click="handleClosePlan"+ >+ {{ $t("common.close") }}+ </NButton>+ <NButton+ v-if="showReopenPlan"+ size="medium"+ @click="handleReopenPlan"+ >+ {{ $t("common.reopen") }}+ </NButton>+ </template>++ <!-- Sidebar toggle for small screens -->+ <NButton+ v-if="showSidebarToggle"+ quaternary+ size="medium"+ @click="mobileSidebarOpen = true"+ >+ <template #icon>+ <MenuIcon class="w-5 h-5" />+ </template>+ </NButton>+ </div>+ </div>+ <DescriptionSection v-if="showDescription" />+ </div>+</template>++<script setup lang="ts">+import { clone, create } from "@bufbuild/protobuf";+import { BanIcon, MenuIcon } from "lucide-vue-next";+import { NButton, NTag, useDialog } from "naive-ui";+import { computed } from "vue";+import { useI18n } from "vue-i18n";+import { planServiceClientConnect } from "@/connect";+import { pushNotification } from "@/store";+import { State } from "@/types/proto-es/v1/common_pb";+import {+ PlanSchema,+ UpdatePlanRequestSchema,+} from "@/types/proto-es/v1/plan_service_pb";+import { isValidPlanName } from "@/utils";+import { emitPlanStatusChanged, usePlanContext } from "../../logic";+import { useSidebarContext } from "../../logic/sidebar";+import { useEditorState } from "../../logic/useEditorState";+import {+ CreateButton,+ CreateIssueButton,+} from "../HeaderSection/Actions/create";+import DescriptionSection from "../HeaderSection/DescriptionSection.vue";+import TitleInput from "../HeaderSection/TitleInput.vue";++const { t } = useI18n();+const dialog = useDialog();++const { isCreating, plan, events } = usePlanContext();+const editorState = useEditorState();+const { mode: sidebarMode, mobileSidebarOpen } = useSidebarContext();++const isClosed = computed(() => {+ return plan.value.state === State.DELETED;+});++const showDescription = computed(() => {+ if (isCreating.value) return true;+ return isValidPlanName(plan.value.name);+});++const showSidebarToggle = computed(() => {+ return sidebarMode.value === "MOBILE";+});++// Submit for Review: visible when plan exists, no issue, plan is active+const showSubmitForReview = computed(() => {+ return (+ isValidPlanName(plan.value.name) &&+ !plan.value.issue &&+ plan.value.state === State.ACTIVE+ );+});++const submitDisabled = computed(() => editorState.isEditing.value);+const submitDisabledReason = computed(() =>+ submitDisabled.value+ ? t("plan.editor.save-changes-before-continuing")+ : undefined+);++// Close plan: visible when plan exists, active, no issue/rollout+const showClosePlan = computed(() => {+ return (+ isValidPlanName(plan.value.name) &&+ !plan.value.issue &&+ !plan.value.hasRollout &&+ plan.value.state === State.ACTIVE+ );+});++// Reopen plan: visible when plan is closed, no issue/rollout+const showReopenPlan = computed(() => {+ return (+ isValidPlanName(plan.value.name) &&+ !plan.value.issue &&+ !plan.value.hasRollout &&+ plan.value.state === State.DELETED+ );+});++const updatePlanState = async (state: State) => {+ try {+ const planPatch = clone(PlanSchema, plan.value);+ planPatch.state = state;+ const request = create(UpdatePlanRequestSchema, {+ plan: planPatch,+ updateMask: { paths: ["state"] },+ });+ const updated = await planServiceClientConnect.updatePlan(request);+ Object.assign(plan.value, updated);+ emitPlanStatusChanged(events);+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.updated"),+ });+ } catch (error) {+ pushNotification({+ module: "bytebase",+ style: "CRITICAL",+ title: t("common.failed"),+ description: String(error),+ });+ }+};++const handleClosePlan = () => {+ dialog.warning({+ title: t("common.close"),+ content: t("plan.state.close-confirm"),+ positiveText: t("common.confirm"),+ negativeText: t("common.cancel"),+ onPositiveClick: () => updatePlanState(State.DELETED),+ });+};++const handleReopenPlan = () => {+ dialog.info({+ title: t("common.reopen"),+ content: t("plan.state.reopen-confirm"),+ positiveText: t("common.confirm"),+ negativeText: t("common.cancel"),+ onPositiveClick: () => updatePlanState(State.ACTIVE),+ });+};+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailLayout.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailLayout.vuenew file mode 100644index 0000000000..049e3f3b07--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailLayout.vue@@ -0,0 +1,124 @@+<template>+ <div+ ref="containerRef"+ class="relative bg-gray-50 [overflow-x:clip]"+ :style="viewportVars"+ >+ <template v-if="ready">+ <PollerProvider>+ <div+ class="flex min-h-full flex-col"+ :style="{+ minHeight: `var(${PLAN_DETAIL_LAYOUT_MIN_HEIGHT_VAR})`,+ }"+ >+ <div+ ref="headerRef"+ class="shrink-0 border-b bg-white"+ >+ <PlanDetailHeader />+ </div>++ <PlanDetailPage :spec-id="props.specId" />+ </div>+ </PollerProvider>+ </template>+ <div+ v-else+ class="flex min-h-[16rem] w-full flex-col items-center justify-center"+ >+ <NSpin />+ </div>+ </div>+</template>++<script lang="ts" setup>+import { NSpin } from "naive-ui";+import { computed, ref, toRef, watch } from "vue";+import { useI18n } from "vue-i18n";+import { onBeforeRouteLeave, onBeforeRouteUpdate } from "vue-router";+import {+ providePlanContext,+ useBasePlanContext,+ useInitializePlan,+} from "@/components/Plan";+import { provideSidebarContext } from "@/components/Plan/logic/sidebar";+import { useNavigationGuard } from "@/components/Plan/logic/useNavigationGuard";+import PollerProvider from "@/components/Plan/PollerProvider.vue";+import { useProjectByName } from "@/store";+import { projectNamePrefix } from "@/store/modules/v1/common";+import { setDocumentTitle } from "@/utils";+import PlanDetailHeader from "./PlanDetailHeader.vue";+import PlanDetailPage from "./PlanDetailPage.vue";+import {+ PLAN_DETAIL_LAYOUT_MIN_HEIGHT_VAR,+ usePlanDetailViewportVars,+} from "./usePlanDetailViewportVars";++const props = defineProps<{+ projectId: string;+ planId: string;+ specId?: string;+}>();++const { t } = useI18n();+const {+ isCreating,+ plan,+ planCheckRuns,+ issue,+ rollout,+ taskRuns,+ isInitializing,+} = useInitializePlan(toRef(props, "projectId"), toRef(props, "planId"));++const planBaseContext = useBasePlanContext({ isCreating, plan, issue });+const containerRef = ref<HTMLElement>();+const headerRef = ref<HTMLElement>();+const { viewportVars } = usePlanDetailViewportVars(headerRef);++const ready = computed(() => {+ return !!plan.value && !isInitializing.value;+});++const { confirmNavigation } = useNavigationGuard();++providePlanContext({+ isCreating,+ plan,+ planCheckRuns,+ issue,+ rollout,+ taskRuns,+ ...planBaseContext,+});++provideSidebarContext(containerRef);++const projectName = computed(() => `${projectNamePrefix}${props.projectId}`);+const { project } = useProjectByName(projectName);++watch(+ [isCreating, ready, () => plan.value?.title, () => project.value.title],+ () => {+ if (isCreating.value) {+ setDocumentTitle(t("plan.new-plan"), project.value.title);+ } else if (ready.value && plan.value?.title) {+ setDocumentTitle(plan.value.title, project.value.title);+ }+ },+ { immediate: true }+);++const handleRouteNavigation = async (+ _to: unknown,+ _from: unknown,+ next: (proceed?: boolean) => void+) => {+ const canNavigate = await confirmNavigation();+ next(canNavigate);+};++onBeforeRouteLeave(handleRouteNavigation);+onBeforeRouteUpdate(handleRouteNavigation);+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vuenew file mode 100644index 0000000000..21e08f2db7--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanDetailPage.vue@@ -0,0 +1,285 @@+<template>+ <div+ class="min-h-0 bg-gray-50 flex flex-col lg:grid"+ :style="desktopLayoutStyle"+ >+ <!-- Left column: timeline phases -->+ <div class="min-w-0">+ <div class="flex min-w-0 flex-col pl-2 pr-4 pb-6 pt-4 xl:pr-8 2xl:pr-12">+ <!-- Changes -->+ <PlanPhaseItem+ :label="$t('plan.navigator.changes')"+ :status="phases[0].status"+ :expanded="isExpanded('changes')"+ :collapsible="currentPhase !== 'changes'"+ :badge="phases[0].badge"+ :line-class="phases[0].lineClass"+ @toggle="togglePhase('changes')"+ @select-phase="expandPhase('changes')"+ >+ <template #icon>+ <CodeIcon class="w-3 h-3 md:w-4 md:h-4 text-white" />+ </template>+ <template #collapsed>+ <p v-if="changesSummary" class="text-sm text-control truncate mt-0.5">+ {{ changesSummary }}+ </p>+ </template>+ <PlanSectionChanges :initial-spec-id="props.specId ?? ''" />+ </PlanPhaseItem>++ <!-- Review -->+ <PlanPhaseItem+ :label="$t('plan.navigator.review')"+ :status="phases[1].status"+ :expanded="isExpanded('review')"+ :collapsible="currentPhase !== 'review'"+ :badge="phases[1].badge"+ :line-class="phases[1].lineClass"+ @toggle="togglePhase('review')"+ @select-phase="expandPhase('review')"+ >+ <template #icon>+ <MessagesSquareIcon class="w-3 h-3 md:w-4 md:h-4 text-white" />+ </template>+ <template #future>+ <p class="text-sm text-control-placeholder mt-0.5">+ {{ $t("plan.phase.review-description") }}+ </p>+ </template>+ <template #collapsed>+ <p v-if="reviewSummary" class="text-sm text-control truncate mt-0.5">+ {{ reviewSummary }}+ </p>+ </template>+ <PlanSectionReview />+ </PlanPhaseItem>++ <!-- Deploy -->+ <PlanPhaseItem+ :label="$t('plan.navigator.deploy')"+ :status="phases[2].status"+ :expanded="isExpanded('deploy')"+ :collapsible="currentPhase !== 'deploy'"+ :badge="phases[2].badge"+ :is-last="true"+ @toggle="togglePhase('deploy')"+ @select-phase="expandPhase('deploy')"+ >+ <template #icon>+ <RocketIcon class="w-3 h-3 md:w-4 md:h-4 text-white" />+ </template>+ <template #future>+ <DeployFutureAction />+ </template>+ <template #collapsed>+ <p v-if="deploySummary" class="text-sm text-control truncate mt-0.5">+ {{ deploySummary }}+ </p>+ </template>+ <PlanSectionDeploy />+ </PlanPhaseItem>+ </div>+ </div>++ <!-- Right column: sidebar (lg+) -->+ <PlanDetailDesktopColumn v-if="showDesktopSidebar" tag="aside">+ <PlanMetadataSidebar class="p-4" />+ </PlanDetailDesktopColumn>++ <!-- Task detail panel: inline (xl+) -->+ <PlanDetailDesktopColumn v-if="showInlineDetailPanel">+ <template #header>+ <div class="flex items-center justify-between border-b px-4 py-2">+ <span class="textinfolabel">{{ $t("common.detail") }}</span>+ <NButton size="tiny" quaternary @click="closeDetailPanel">+ <template #icon>+ <XIcon class="w-4 h-4" />+ </template>+ {{ $t("common.close") }}+ </NButton>+ </div>+ </template>++ <TaskDetailPanel+ v-if="detailPanel"+ :task="detailPanel.task"+ @close="closeDetailPanel"+ />+ </PlanDetailDesktopColumn>++ <!-- Task detail panel: drawer (< xl) -->+ <NDrawer+ v-if="showTaskDrawer"+ :show="!!detailPanel"+ placement="right"+ :width="PLAN_DETAIL_TASK_DRAWER_WIDTH"+ @update:show="(val: boolean) => !val && closeDetailPanel()"+ >+ <NDrawerContent closable @close="closeDetailPanel">+ <TaskDetailPanel+ v-if="detailPanel"+ :task="detailPanel.task"+ @close="closeDetailPanel"+ />+ </NDrawerContent>+ </NDrawer>++ <!-- Sidebar drawer (< lg) -->+ <NDrawer+ v-if="showSidebarDrawer"+ :show="mobileSidebarOpen"+ placement="right"+ :width="PLAN_DETAIL_METADATA_DRAWER_WIDTH"+ @update:show="(val: boolean) => (mobileSidebarOpen = val)"+ >+ <NDrawerContent closable @close="mobileSidebarOpen = false">+ <PlanMetadataSidebar />+ </NDrawerContent>+ </NDrawer>+ </div>+</template>++<script setup lang="ts">+import {+ CodeIcon,+ MessagesSquareIcon,+ RocketIcon,+ XIcon,+} from "lucide-vue-next";+import { NButton, NDrawer, NDrawerContent } from "naive-ui";+import { computed, ref, watch } from "vue";+import { useRoute, useRouter } from "vue-router";+import {+ PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,+ PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,+} from "@/router/dashboard/projectV1";+import {+ getRouteQueryString,+ PLAN_DETAIL_PHASE_DEPLOY,+} from "@/router/dashboard/projectV1RouteHelpers";+import type { Task } from "@/types/proto-es/v1/rollout_service_pb";+import { usePlanContext } from "../../logic";+import { useSidebarContext } from "../../logic/sidebar";+import DeployFutureAction from "./DeployFutureAction.vue";+import PlanDetailDesktopColumn from "./PlanDetailDesktopColumn.vue";+import PlanMetadataSidebar from "./PlanMetadataSidebar.vue";+import PlanPhaseItem from "./PlanPhaseItem.vue";+import PlanSectionChanges from "./PlanSectionChanges.vue";+import PlanSectionDeploy from "./PlanSectionDeploy.vue";+import PlanSectionReview from "./PlanSectionReview.vue";+import TaskDetailPanel from "./TaskDetailPanel.vue";+import { type PhaseType, useActivePhase } from "./useActivePhase";+import { usePhaseState } from "./usePhaseState";+import { usePhaseSummaries } from "./usePhaseSummaries";+import {+ PLAN_DETAIL_METADATA_DRAWER_WIDTH,+ PLAN_DETAIL_TASK_DRAWER_WIDTH,+ usePlanDetailDesktopLayout,+} from "./usePlanDetailDesktopLayout";++const props = defineProps<{+ specId?: string;+}>();++const route = useRoute();+const router = useRouter();+const { isCreating, plan, issue, rollout } = usePlanContext();+const {+ mode: sidebarMode,+ containerWidth,+ desktopSidebarWidth,+ mobileSidebarOpen,+} = useSidebarContext();+const {+ currentPhase,+ isExpanded,+ togglePhase,+ expandPhase,+ syncExpandedPhases,+} = useActivePhase(issue, rollout);++const routeDrivenExpandedPhases = computed<PhaseType[]>(() => {+ if (+ route.name === PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS ||+ route.name === PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL+ ) {+ return ["changes"];+ }++ const routePhase = getRouteQueryString(route.query.phase);+ const routeStageId = getRouteQueryString(route.query.stageId);+ const routeTaskId = getRouteQueryString(route.query.taskId);+ if (routePhase === PLAN_DETAIL_PHASE_DEPLOY || routeStageId || routeTaskId) {+ return ["deploy"];+ }++ return [];+});++watch(+ [routeDrivenExpandedPhases, currentPhase] as const,+ ([phases]) => {+ syncExpandedPhases(phases);+ },+ { immediate: true }+);++const { phases } = usePhaseState(isCreating, issue, rollout);+const { changesSummary, reviewSummary, deploySummary } = usePhaseSummaries(+ plan,+ issue,+ rollout+);++// Task detail panel — driven by ?taskId query param+const detailPanel = ref<{ task: Task } | null>(null);+const hasDetailPanel = computed(() => !!detailPanel.value);+const {+ desktopLayoutStyle,+ showDesktopSidebar,+ showInlineDetailPanel,+ showTaskDrawer,+ showSidebarDrawer,+} = usePlanDetailDesktopLayout({+ sidebarMode,+ containerWidth,+ desktopSidebarWidth,+ hasDetailPanel,+});++// Reactively open/close panel based on query params+watch(+ [() => getRouteQueryString(route.query.taskId), rollout] as const,+ ([taskId, r]) => {+ if (!taskId) {+ detailPanel.value = null;+ return;+ }+ if (!taskId || !r) return;+ for (const stage of r.stages) {+ const task = stage.tasks.find((t) => t.name.endsWith(`/${taskId}`));+ if (task) {+ detailPanel.value = { task };+ return;+ }+ }+ detailPanel.value = null;+ },+ { immediate: true }+);++const closeDetailPanel = () => {+ detailPanel.value = null;+ const routePhase = getRouteQueryString(route.query.phase);+ const stageId = getRouteQueryString(route.query.stageId);+ if (route.query.taskId) {+ router.replace({+ query: {+ ...(routePhase ? { phase: routePhase } : {}),+ ...(stageId ? { stageId } : {}),+ },+ });+ }+};+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanMetadataSidebar.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanMetadataSidebar.vuenew file mode 100644index 0000000000..a0e654e3c3--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanMetadataSidebar.vue@@ -0,0 +1,223 @@+<template>+ <div class="w-full shrink-0 flex flex-col text-sm">+ <!-- Plan group: Created by + Refresh + Status + Checks -->+ <div class="flex flex-col gap-3 pb-3">+ <div v-if="!isCreating" class="flex flex-col">+ <p class="text-xs text-control-placeholder">+ {{ $t("plan.sidebar.created-by-at", { user: creatorEmail, time: createdTimeDisplay }) }}+ </p>+ </div>+ <div>+ <h4 class="textinfolabel mb-1">{{ $t("common.status") }}</h4>+ <div class="flex items-center gap-2">+ <div class="w-2.5 h-2.5 rounded-full" :class="statusInfo.dotClass" />+ <span class="text-sm font-medium text-main">{{ statusInfo.label }}</span>+ </div>+ </div>+ <div v-if="hasAnyChecks">+ <h4 class="textinfolabel mb-1">{{ $t("plan.navigator.checks") }}</h4>+ <PlanCheckStatusCount :plan="plan" />+ </div>+ </div>++ <!-- Issue group: Approval flow + link + Labels -->+ <div v-if="issue" class="flex flex-col gap-3 py-3 border-t">+ <ApprovalFlowSection :issue="issue" />+ <IssueLabels+ :project="project"+ :value="issue.labels || []"+ :disabled="!allowChangeLabels"+ @update:value="onIssueLabelsUpdate"+ />+ </div>++ <!-- Rollout group: Stages -->+ <div v-if="rollout && rollout.stages.length > 0" class="flex flex-col gap-3 py-3 border-t">+ <h4 class="textinfolabel">{{ $t("rollout.stage.self", 2) }}</h4>+ <div+ v-for="stage in rollout.stages"+ :key="stage.name"+ class="flex items-center gap-2"+ >+ <TaskStatus :status="getStageStatus(stage)" size="small" disabled />+ <EnvironmentV1Name+ :environment="environmentStore.getEnvironmentByName(stage.environment)"+ :link="false"+ />+ <span class="text-control-placeholder">+ ({{ completedTaskCount(stage) }}/{{ stage.tasks.length }})+ </span>+ </div>+ </div>++ <!-- Placeholder when no issue yet -->+ <div v-if="!issue" class="pt-3 border-t">+ <p class="text-sm text-control-placeholder">+ {{ $t("plan.sidebar.future-sections-hint") }}+ </p>+ </div>++ <div v-if="!isCreating" class="pt-1">+ <RefreshIndicator />+ </div>+ </div>+</template>++<script setup lang="ts">+import { clone, create } from "@bufbuild/protobuf";+import { computed } from "vue";+import { useI18n } from "vue-i18n";+import IssueLabels from "@/components/IssueV1/components/Sidebar/IssueLabels.vue";+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";+import { EnvironmentV1Name } from "@/components/v2";+import { issueServiceClientConnect } from "@/connect";+import {+ extractUserEmail,+ pushNotification,+ useCurrentProjectV1,+ useEnvironmentV1Store,+} from "@/store";+import { getTimeForPbTimestampProtoEs } from "@/types";+import { State } from "@/types/proto-es/v1/common_pb";+import {+ Issue_ApprovalStatus,+ IssueSchema,+ IssueStatus,+ UpdateIssueRequestSchema,+} from "@/types/proto-es/v1/issue_service_pb";+import type { Stage } from "@/types/proto-es/v1/rollout_service_pb";+import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";+import {+ getRolloutStatus,+ getStageStatus,+ hasProjectPermissionV2,+} from "@/utils";+import { humanizeTs } from "@/utils/util";+import { usePlanCheckStatus, usePlanContext } from "../../logic";+import { useResourcePoller } from "../../logic/poller";+import ApprovalFlowSection from "../IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue";+import PlanCheckStatusCount from "../PlanCheckStatusCount.vue";+import RefreshIndicator from "../RefreshIndicator.vue";++const { t } = useI18n();+const { isCreating, plan, issue, rollout } = usePlanContext();+const { project } = useCurrentProjectV1();+const { refreshResources } = useResourcePoller();+const environmentStore = useEnvironmentV1Store();+const { hasAnyStatus: hasAnyChecks } = usePlanCheckStatus(plan);++// --- Status ---++type StatusInfo = { label: string; dotClass: string };++const getReviewStatusInfo = (): StatusInfo => {+ if (!issue.value) {+ return { label: t("common.draft"), dotClass: "bg-control-placeholder" };+ }++ if (issue.value.status === IssueStatus.DONE) {+ return { label: t("common.approved"), dotClass: "bg-success" };+ }++ switch (issue.value.approvalStatus) {+ case Issue_ApprovalStatus.APPROVED:+ case Issue_ApprovalStatus.SKIPPED:+ return { label: t("common.approved"), dotClass: "bg-success" };+ case Issue_ApprovalStatus.REJECTED:+ return { label: t("common.rejected"), dotClass: "bg-warning" };+ default:+ return { label: t("common.in-review"), dotClass: "bg-accent" };+ }+};++const getRolloutStatusInfo = (): StatusInfo => {+ if (!rollout.value) {+ return getReviewStatusInfo();+ }++ switch (getRolloutStatus(rollout.value)) {+ case Task_Status.DONE:+ case Task_Status.SKIPPED:+ return { label: t("common.done"), dotClass: "bg-success" };+ case Task_Status.FAILED:+ return { label: t("common.failed"), dotClass: "bg-error" };+ case Task_Status.RUNNING:+ case Task_Status.PENDING:+ return { label: t("common.deploying"), dotClass: "bg-accent" };+ case Task_Status.CANCELED:+ return {+ label: t("common.canceled"),+ dotClass: "bg-control-placeholder",+ };+ case Task_Status.NOT_STARTED:+ default:+ return {+ label: t("common.not-started"),+ dotClass: "bg-control-placeholder",+ };+ }+};++const statusInfo = computed<StatusInfo>(() => {+ if (isCreating.value) {+ return { label: t("common.creating"), dotClass: "bg-control-placeholder" };+ }+ if (plan.value.state === State.DELETED) {+ return { label: t("common.closed"), dotClass: "bg-control-placeholder" };+ }+ if (issue.value?.status === IssueStatus.CANCELED) {+ return { label: t("common.closed"), dotClass: "bg-control-placeholder" };+ }+ if (rollout.value) {+ return getRolloutStatusInfo();+ }+ return getReviewStatusInfo();+});++// --- Creator / Created ---++const creatorEmail = computed(() => extractUserEmail(plan.value.creator));++const createdTimeDisplay = computed(() => {+ const ts = getTimeForPbTimestampProtoEs(plan.value.createTime, 0);+ if (!ts) return "";+ return humanizeTs(ts / 1000);+});++// --- Labels ---++const allowChangeLabels = computed(() => {+ if (!issue.value || issue.value.status !== IssueStatus.OPEN) return false;+ return hasProjectPermissionV2(project.value, "bb.issues.update");+});++const onIssueLabelsUpdate = async (labels: string[]) => {+ if (!issue.value) return;+ try {+ const issuePatch = clone(IssueSchema, issue.value);+ issuePatch.labels = labels;+ const request = create(UpdateIssueRequestSchema, {+ issue: issuePatch,+ updateMask: { paths: ["labels"] },+ });+ await issueServiceClientConnect.updateIssue(request);+ refreshResources(["issue"], true);+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.updated"),+ });+ } catch {+ // Ignore — label update is non-critical+ }+};++// --- Stages ---++const completedTaskCount = (stage: Stage) => {+ return stage.tasks.filter(+ (task) =>+ task.status === Task_Status.DONE || task.status === Task_Status.SKIPPED+ ).length;+};+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanPhaseItem.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanPhaseItem.vuenew file mode 100644index 0000000000..9d14bf92ca--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanPhaseItem.vue@@ -0,0 +1,115 @@+<template>+ <div class="flex">+ <!-- Timeline column: dot + connecting line -->+ <div class="flex flex-col items-center w-10 md:w-16 shrink-0">+ <div+ class="flex items-center justify-center w-5 h-5 md:w-7 md:h-7 shrink-0 cursor-pointer mt-0.5"+ @click="$emit('select-phase')"+ >+ <div class="w-5 h-5 md:w-7 md:h-7 rounded-full flex items-center justify-center" :class="dotClass">+ <template v-if="status !== 'future'">+ <slot name="icon">+ <CheckIcon v-if="status === 'completed'" class="w-3 h-3 md:w-4 md:h-4 text-white" />+ <BanIcon v-else-if="status === 'closed'" class="w-3 h-3 md:w-4 md:h-4 text-white" />+ <div v-else-if="status === 'active'" class="w-2 h-2 md:w-2.5 md:h-2.5 rounded-full bg-white" />+ </slot>+ </template>+ </div>+ </div>+ <div+ v-if="!isLast"+ class="flex-1 min-h-[16px]"+ :class="lineClass"+ />+ </div>++ <!-- Content column -->+ <div class="flex-1 min-w-0 pb-4">+ <!-- Future -->+ <div v-if="status === 'future'" class="py-0.5">+ <span class="textlabel uppercase text-control-placeholder">+ {{ label }}+ </span>+ <slot name="future" />+ </div>++ <!-- Collapsed -->+ <div+ v-else-if="!expanded"+ class="cursor-pointer py-0.5"+ @click="$emit('toggle')"+ >+ <div class="flex items-center gap-2">+ <span class="textlabel uppercase">{{ label }}</span>+ <NTag v-if="badge" size="small" round :type="badge.type">+ {{ badge.label }}+ </NTag>+ <div class="flex-1" />+ <span class="text-[11px] text-control-placeholder shrink-0">+ {{ $t("plan.phase.show-details") }}+ </span>+ </div>+ <slot name="collapsed" />+ </div>++ <!-- Expanded -->+ <div v-else class="flex flex-col">+ <div+ class="flex items-center gap-2 py-0.5"+ :class="collapsible ? 'cursor-pointer' : ''"+ @click="collapsible && $emit('toggle')"+ >+ <span class="textlabel uppercase text-accent">{{ label }}</span>+ <NTag v-if="badge" size="small" round :type="badge.type">+ {{ badge.label }}+ </NTag>+ <div class="flex-1" />+ <span+ v-if="collapsible"+ class="text-[11px] text-control-placeholder shrink-0"+ >+ {{ $t("plan.phase.hide-details") }}+ </span>+ </div>+ <div class="mt-1 bg-white rounded-lg border overflow-hidden">+ <slot />+ </div>+ </div>+ </div>+ </div>+</template>++<script setup lang="ts">+import { BanIcon, CheckIcon } from "lucide-vue-next";+import { NTag } from "naive-ui";+import { computed } from "vue";+import type { PhaseBadge } from "./usePhaseState";++const props = defineProps<{+ label: string;+ status: "completed" | "closed" | "active" | "future";+ expanded: boolean;+ collapsible?: boolean;+ badge?: PhaseBadge;+ lineClass?: string;+ isLast?: boolean;+}>();++const dotClass = computed(() => {+ switch (props.status) {+ case "completed":+ return "bg-success";+ case "closed":+ return "bg-control-placeholder";+ case "active":+ return "bg-accent ring-[3px] ring-accent/20";+ default:+ return "border-2 border-dashed border-control-border";+ }+});++defineEmits<{+ (event: "toggle"): void;+ (event: "select-phase"): void;+}>();+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionChanges.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionChanges.vuenew file mode 100644index 0000000000..e8586f5aa3--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionChanges.vue@@ -0,0 +1,66 @@+<template>+ <div class="w-full flex-1 flex flex-col">+ <SpecDetailView />+ </div>+</template>++<script setup lang="ts">+import { computed, ref, watch } from "vue";+import { usePlanContext } from "../../logic";+import { SpecDetailView } from "../index";+import { provideSelectedSpec } from "../SpecDetailView/context";++const props = withDefaults(+ defineProps<{+ initialSpecId?: string;+ }>(),+ { initialSpecId: "" }+);++const { plan } = usePlanContext();++// Injection-based spec selection+const selectedSpecId = ref<string>(props.initialSpecId);++watch(+ () => props.initialSpecId,+ (specId) => {+ if (specId) {+ selectedSpecId.value = specId;+ return;+ }+ if (!selectedSpecId.value && plan.value.specs.length > 0) {+ selectedSpecId.value = plan.value.specs[0].id;+ }+ },+ { immediate: true }+);++watch(+ () => plan.value.specs,+ (specs) => {+ if (specs.length === 0) {+ selectedSpecId.value = "";+ return;+ }++ const hasSelectedSpec = specs.some(+ (spec) => spec.id === selectedSpecId.value+ );+ if (!hasSelectedSpec) {+ selectedSpecId.value = props.initialSpecId || specs[0].id;+ }+ },+ { immediate: true }+);++const selectedSpecRef = computed(() => {+ const spec = plan.value.specs.find((s) => s.id === selectedSpecId.value);+ return spec ?? plan.value.specs[0];+});++const setSelectedSpecId = (specId: string) => {+ selectedSpecId.value = specId;+};+provideSelectedSpec(selectedSpecRef, setSelectedSpecId);+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionDeploy.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionDeploy.vuenew file mode 100644index 0000000000..907b548e21--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionDeploy.vue@@ -0,0 +1,161 @@+<template>+ <div class="flex flex-col">+ <template v-if="rollout">+ <!-- Empty state -->+ <div v-if="!hasStages" class="flex flex-col items-center justify-center py-10 gap-4">+ <p class="text-control-placeholder">{{ $t("rollout.no-tasks-created") }}</p>+ <NButton v-if="hasPendingTasks" type="primary" @click="showPreviewDrawer = true">+ {{ $t("rollout.pending-tasks-preview.action") }}+ </NButton>+ </div>++ <!-- Stages + Tasks -->+ <template v-else>+ <StageNavigationBar+ :selected-stage-id="selectedStage?.name"+ :rollout="rollout"+ :has-pending-tasks="hasPendingTasks"+ @select-stage="handleStageSelect"+ @open-preview="showPreviewDrawer = true"+ />++ <StageContentView+ :selected-stage="selectedStage"+ :rollout="rollout"+ :is-stage-created="() => true"+ @run-stage="handleRunStage"+ @create-stage="handleCreateStage"+ />+ </template>++ <PendingTasksPreviewDrawer+ :show="showPreviewDrawer"+ :plan="plan"+ :rollout="rollout"+ :project-name="project.name"+ @close="showPreviewDrawer = false"+ @created="handleTasksCreated"+ />++ <TaskRolloutActionPanel+ v-if="showStageActionPanel && stageActionTarget"+ :show="showStageActionPanel"+ :action="stageAction"+ :target="stageActionTarget"+ @close="showStageActionPanel = false"+ @confirm="handleStageActionConfirmed"+ />+ </template>+ </div>+</template>++<script setup lang="ts">+import { create } from "@bufbuild/protobuf";+import { NButton } from "naive-ui";+import { computed, type Ref, ref } from "vue";+import { useI18n } from "vue-i18n";+import { useRoute, useRouter } from "vue-router";+import StageContentView from "@/components/RolloutV1/components/Stage/StageContentView.vue";+import StageNavigationBar from "@/components/RolloutV1/components/Stage/StageNavigationBar.vue";+import { useStageSelection } from "@/components/RolloutV1/components/Stage/useStageSelection";+import PendingTasksPreviewDrawer from "@/components/RolloutV1/components/Task/PendingTasksPreviewDrawer.vue";+import type { TargetType } from "@/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue";+import TaskRolloutActionPanel from "@/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue";+import { useExpectedTaskCount } from "@/components/RolloutV1/components/Task/useExpectedTaskCount";+import { useTaskInstancePreload } from "@/components/RolloutV1/components/Task/useTaskInstancePreload";+import { rolloutServiceClientConnect } from "@/connect";+import {+ buildPlanDeployRouteFromPlanName,+ getRouteQueryString,+} from "@/router/dashboard/projectV1RouteHelpers";+import { pushNotification, useCurrentProjectV1 } from "@/store";+import type { Rollout } from "@/types/proto-es/v1/rollout_service_pb";+import {+ CreateRolloutRequestSchema,+ type Stage,+} from "@/types/proto-es/v1/rollout_service_pb";+import { extractPlanNameFromRolloutName } from "@/utils";+import { emitPlanStatusChanged, usePlanContext } from "../../logic";++const { t } = useI18n();+const route = useRoute();+const router = useRouter();+const { plan, rollout, events } = usePlanContext();+const { project } = useCurrentProjectV1();++const hasStages = computed(() => (rollout.value?.stages.length ?? 0) > 0);++const routeStageId = computed<string | undefined>(() => {+ return getRouteQueryString(route.query.stageId);+});+const { selectedStage } = useStageSelection(+ computed(() => rollout.value?.stages ?? []),+ routeStageId,+ rollout as Ref<Rollout>+);++useTaskInstancePreload(() =>+ selectedStage.value ? [selectedStage.value] : []+);++const { expectedTaskCount } = useExpectedTaskCount(plan);+const hasPendingTasks = computed(() => {+ if (!rollout.value) return false;+ const actualCount = rollout.value.stages.flatMap((s) => s.tasks).length;+ return expectedTaskCount.value > actualCount;+});++const showPreviewDrawer = ref(false);+const showStageActionPanel = ref(false);+const stageAction = ref<"RUN" | "SKIP" | "CANCEL">("RUN");+const stageActionTarget = ref<TargetType | null>(null);++const handleStageSelect = (stage: Stage) => {+ const stageId = stage.name.split("/").pop();+ router.push(+ buildPlanDeployRouteFromPlanName(plan.value.name, {+ stageId,+ })+ );+};++const handleRunStage = (stage: Stage) => {+ stageAction.value = "RUN";+ stageActionTarget.value = { type: "tasks", stage };+ showStageActionPanel.value = true;+};++const handleCreateStage = async (stage: Stage) => {+ if (!rollout.value) return;+ try {+ const request = create(CreateRolloutRequestSchema, {+ parent: extractPlanNameFromRolloutName(rollout.value.name),+ target: stage.environment,+ });+ await rolloutServiceClientConnect.createRollout(request);+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.created"),+ });+ events.emit("status-changed", { eager: true });+ } catch (error) {+ pushNotification({+ module: "bytebase",+ style: "CRITICAL",+ title: t("common.error"),+ description: String(error),+ });+ }+};++const handleStageActionConfirmed = () => {+ emitPlanStatusChanged(events, { refreshMode: "fast-follow" });+ showStageActionPanel.value = false;+ stageActionTarget.value = null;+};++const handleTasksCreated = () => {+ emitPlanStatusChanged(events);+};+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionReview.vue b/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionReview.vuenew file mode 100644index 0000000000..477931f5bc--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/PlanSectionReview.vue@@ -0,0 +1,169 @@+<template>+ <div class="flex flex-col">+ <!-- State: Checking (generating approval flow) -->+ <div+ v-if="issue.approvalStatus === Issue_ApprovalStatus.CHECKING"+ class="flex items-center gap-x-2 text-sm text-control-placeholder p-4"+ >+ <BBSpin :size="16" />+ <span>{{ $t("custom-approval.issue-review.generating-approval-flow") }}</span>+ </div>++ <!-- State: Skipped (no approval required) -->+ <div+ v-else-if="issue.approvalStatus === Issue_ApprovalStatus.SKIPPED || approvalSteps.length === 0"+ class="text-sm text-control-placeholder p-4"+ >+ {{ $t("custom-approval.approval-flow.skip") }}+ </div>++ <!-- State: Has approval flow -->+ <template v-else>+ <!-- Rejection banner -->+ <NAlert+ v-if="issue.approvalStatus === Issue_ApprovalStatus.REJECTED && lastRejection"+ type="warning"+ size="small"+ class="mx-4 mt-3"+ :title="`${$t('custom-approval.issue-review.rejected-by')} ${lastRejection.creator}`"+ >+ <span v-if="lastRejection.comment">{{ lastRejection.comment }}</span>+ </NAlert>++ <!-- Approval steps timeline -->+ <div class="px-4 py-3">+ <h3 class="textinfolabel">{{ $t("issue.approval-flow.self") }}</h3>+ <NTimeline size="large" class="pl-1 pt-3">+ <ApprovalStepItem+ v-for="(step, index) in approvalSteps"+ :key="index"+ :step="step"+ :step-index="index"+ :step-number="index + 1"+ :issue="issue"+ />+ </NTimeline>+ </div>++ <!-- Footer: rule + actions -->+ <div class="flex items-center gap-x-2 px-4 py-2.5 border-t text-sm text-control-placeholder">+ <RiskLevelIcon+ :risk-level="issue.riskLevel"+ :title="approvalTemplate?.title?.trim()"+ class="shrink-0"+ />+ <span v-if="riskLevelText">{{ riskLevelText }}</span>+ <span v-if="ruleText && riskLevelText">·</span>+ <span v-if="ruleText" class="truncate min-w-0">{{ ruleText }}</span>+ <div class="flex-1" />+ <RouterLink+ :to="issueRoute"+ class="text-accent hover:underline"+ active-class=""+ exact-active-class=""+ >+ {{ $t("common.issue") }} #{{ issueUID }} ·+ {{ $t("plan.view-discussion") }} →+ </RouterLink>+ </div>+ </template>+ </div>+</template>++<script setup lang="ts">+import { create } from "@bufbuild/protobuf";+import { NAlert, NTimeline } from "naive-ui";+import { computed, watchEffect } from "vue";+import { useI18n } from "vue-i18n";+import { RouterLink } from "vue-router";+import { BBSpin } from "@/bbkit";+import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";+import {+ getIssueCommentType,+ IssueCommentType,+ useIssueCommentStore,+} from "@/store/modules/v1/issueComment";+import { RiskLevel } from "@/types/proto-es/v1/common_pb";+import {+ Issue_ApprovalStatus,+ ListIssueCommentsRequestSchema,+} from "@/types/proto-es/v1/issue_service_pb";+import { extractIssueUID, extractProjectResourceName } from "@/utils";+import { usePlanContextWithIssue } from "../../logic/context";+import ApprovalStepItem from "../IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalStepItem.vue";+import RiskLevelIcon from "../IssueReviewView/Sidebar/ApprovalFlowSection/RiskLevelIcon.vue";++const { t } = useI18n();+const { plan, issue } = usePlanContextWithIssue();+const issueCommentStore = useIssueCommentStore();++// Approval data+const approvalTemplate = computed(() => issue.value.approvalTemplate);+const approvalSteps = computed(() => approvalTemplate.value?.flow?.roles ?? []);++const issueUID = computed(() => extractIssueUID(issue.value.name));+const issueRoute = computed(() => ({+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL,+ params: {+ projectId: extractProjectResourceName(plan.value.name),+ issueId: issueUID.value,+ },+}));++const riskLevelText = computed(() => {+ switch (issue.value.riskLevel) {+ case RiskLevel.LOW:+ return t("issue.risk-level.low");+ case RiskLevel.MODERATE:+ return t("issue.risk-level.moderate");+ case RiskLevel.HIGH:+ return t("issue.risk-level.high");+ default:+ return "";+ }+});++const ruleText = computed(() => {+ const parts: string[] = [];+ const title = approvalTemplate.value?.title?.trim();+ const desc = approvalTemplate.value?.description?.trim();+ if (title) parts.push(title);+ if (desc) parts.push(desc);+ return parts.join(" — ");+});++// Fetch comments+watchEffect(async () => {+ if (!issue.value?.name) return;+ try {+ await issueCommentStore.listIssueComments(+ create(ListIssueCommentsRequestSchema, {+ parent: issue.value.name,+ pageSize: 100,+ })+ );+ } catch {+ // Ignore — comments are non-critical+ }+});++const comments = computed(+ () => issueCommentStore.getIssueComments(issue.value.name) ?? []+);++const lastRejection = computed(() => {+ if (issue.value.approvalStatus !== Issue_ApprovalStatus.REJECTED) {+ return undefined;+ }+ for (let i = comments.value.length - 1; i >= 0; i--) {+ const comment = comments.value[i];+ if (getIssueCommentType(comment) === IssueCommentType.APPROVAL) {+ const approval = comment.event?.value;+ if (approval && "status" in approval) {+ return { creator: comment.creator, comment: comment.comment || "" };+ }+ }+ }+ return undefined;+});+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/StickySidePanel.vue b/frontend/src/components/Plan/components/PlanDetailPage/StickySidePanel.vuenew file mode 100644index 0000000000..b85cb78e87--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/StickySidePanel.vue@@ -0,0 +1,17 @@+<template>+ <div class="sticky top-0 flex flex-col bg-white" :style="panelStyle">+ <slot name="header" />+ <div class="min-h-0 flex-1 overflow-y-auto overscroll-y-contain">+ <slot />+ </div>+ </div>+</template>++<script setup lang="ts">+import { computed } from "vue";+import { PLAN_DETAIL_VIEWPORT_HEIGHT_VAR } from "./usePlanDetailViewportVars";++const panelStyle = computed(() => ({+ maxHeight: `var(${PLAN_DETAIL_VIEWPORT_HEIGHT_VAR})`,+}));+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/TaskDetailPanel.vue b/frontend/src/components/Plan/components/PlanDetailPage/TaskDetailPanel.vuenew file mode 100644index 0000000000..b3ed44a65d--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/TaskDetailPanel.vue@@ -0,0 +1,170 @@+<template>+ <div class="flex flex-col gap-y-4 p-4">+ <!-- Header: Stage + Status + Database + Scheduled time -->+ <div class="flex flex-col gap-y-3">+ <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">+ <div class="flex flex-row items-center gap-x-3 flex-wrap">+ <TaskStatus :status="task.status" />+ <NTag v-if="stageTitle" round>+ {{ stageTitle }}+ </NTag>+ <DatabaseDisplay :database="database.name" size="large" />+ <NTooltip v-if="task.runTime && task.status === Task_Status.PENDING">+ <template #trigger>+ <NTag round size="small">+ <div class="flex items-center gap-1">+ <CalendarClockIcon class="w-3.5 h-3.5 opacity-80" />+ <span class="text-xs">{{ scheduledTimeDisplay }}</span>+ </div>+ </NTag>+ </template>+ {{ $t("task.scheduled-time") }}+ </NTooltip>+ </div>++ <!-- Actions -->+ <div v-if="stage" class="flex items-center gap-x-2">+ <TaskStatusActions+ :task="task"+ :stage="stage"+ @action-confirmed="handleTaskActionConfirmed"+ />+ <TaskRollbackButton+ v-if="rollbackableTaskRun"+ :task="task"+ :task-run="rollbackableTaskRun"+ :rollout="rollout"+ />+ </div>+ </div>+ </div>++ <!-- Latest Task Run Detail -->+ <div v-if="latestTaskRun" class="flex flex-col gap-2">+ <span class="textlabel uppercase">{{ $t("task-run.latest-logs") }}</span>+ <TaskRunDetail :task-run="latestTaskRun" :database="database" />+ </div>++ <!-- Task Runs History -->+ <div v-if="taskRunsForTask.length > 0" class="flex flex-col gap-2">+ <span class="textlabel uppercase">{{ $t("task-run.history") }}</span>+ <TaskRunTable :task-runs="taskRunsForTask" />+ </div>++ <!-- SQL Statement -->+ <div v-if="statement" class="flex flex-col gap-2">+ <span class="textlabel uppercase">{{ $t("common.statement") }}</span>+ <MonacoEditor+ class="border rounded-[3px] text-sm overflow-hidden"+ :content="statement"+ :readonly="true"+ :auto-height="{ min: 200, max: 480 }"+ />+ </div>+ </div>+</template>++<script setup lang="ts">+import { last } from "lodash-es";+import { CalendarClockIcon } from "lucide-vue-next";+import { NTag, NTooltip } from "naive-ui";+import { computed, watch } from "vue";+import { MonacoEditor } from "@/components/MonacoEditor";+import DatabaseDisplay from "@/components/Plan/components/common/DatabaseDisplay.vue";+import TaskRollbackButton from "@/components/RolloutV1/components/Task/TaskRollbackButton.vue";+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";+import TaskStatusActions from "@/components/RolloutV1/components/Task/TaskStatusActions.vue";+import TaskRunDetail from "@/components/RolloutV1/components/TaskRun/TaskRunDetail.vue";+import TaskRunTable from "@/components/RolloutV1/components/TaskRun/TaskRunTable.vue";+import {+ taskRunNamePrefix,+ useCurrentProjectV1,+ useEnvironmentV1Store,+ useSheetV1Store,+} from "@/store";+import { getTimeForPbTimestampProtoEs } from "@/types";+import type { Task } from "@/types/proto-es/v1/rollout_service_pb";+import {+ Task_Status,+ TaskRun_Status,+} from "@/types/proto-es/v1/rollout_service_pb";+import { databaseForTask, getSheetStatement, sheetNameOfTaskV1 } from "@/utils";+import { humanizeTs } from "@/utils/util";+import { emitPlanStatusChanged, usePlanContextWithRollout } from "../../logic";++const props = defineProps<{+ task: Task;+}>();++defineEmits<{+ (event: "close"): void;+}>();++const { project } = useCurrentProjectV1();+const { rollout, taskRuns: allTaskRuns, events } = usePlanContextWithRollout();+const sheetStore = useSheetV1Store();+const environmentStore = useEnvironmentV1Store();++const database = computed(() => databaseForTask(project.value, props.task));++const stage = computed(() => {+ return rollout.value.stages.find((s) =>+ s.tasks.some((t) => t.name === props.task.name)+ );+});++const stageTitle = computed(() => {+ if (!stage.value?.environment) return "";+ return (+ environmentStore.getEnvironmentByName(stage.value.environment)?.title ?? ""+ );+});++const scheduledTimeDisplay = computed(() => {+ const ts = getTimeForPbTimestampProtoEs(props.task.runTime, 0);+ if (!ts) return "";+ return humanizeTs(ts / 1000);+});++const taskRunsForTask = computed(() => {+ return allTaskRuns.value.filter((run) =>+ run.name.startsWith(`${props.task.name}/${taskRunNamePrefix}`)+ );+});++const latestTaskRun = computed(() => last(taskRunsForTask.value));++const rollbackableTaskRun = computed(() => {+ if (+ latestTaskRun.value &&+ latestTaskRun.value.status === TaskRun_Status.DONE &&+ latestTaskRun.value.hasPriorBackup+ ) {+ return latestTaskRun.value;+ }+ return undefined;+});++const statement = computed(() => {+ const sheet = sheetStore.getSheetByName(sheetNameOfTaskV1(props.task));+ if (sheet) return getSheetStatement(sheet);+ return "";+});++watch(+ () => sheetNameOfTaskV1(props.task),+ async (sheetName) => {+ if (!sheetName) return;+ try {+ await sheetStore.getOrFetchSheetByName(sheetName);+ } catch {+ // Ignore — sheet fetch is non-critical for panel display+ }+ },+ { immediate: true }+);++const handleTaskActionConfirmed = () => {+ emitPlanStatusChanged(events, { refreshMode: "fast-follow" });+};+</script>diff --git a/frontend/src/components/Plan/components/PlanDetailPage/index.ts b/frontend/src/components/Plan/components/PlanDetailPage/index.tsnew file mode 100644index 0000000000..12b01a0832--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/index.ts@@ -0,0 +1 @@+export { default as PlanDetailPage } from "./PlanDetailPage.vue";diff --git a/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.ts b/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.tsnew file mode 100644index 0000000000..c6427dca0f--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/useActivePhase.ts@@ -0,0 +1,65 @@+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";++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 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);+ } else {+ next.add(phase);+ }+ manualExpanded.value = next;+ };++ // 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)+ );+ };++ return {+ currentPhase,+ isExpanded,+ togglePhase,+ expandPhase,+ syncExpandedPhases,+ };+};diff --git a/frontend/src/components/Plan/components/PlanDetailPage/usePhaseState.ts b/frontend/src/components/Plan/components/PlanDetailPage/usePhaseState.tsnew file mode 100644index 0000000000..cd7db37cbf--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/usePhaseState.ts@@ -0,0 +1,155 @@+import type { TagProps } from "naive-ui";+import { computed, type Ref } from "vue";+import { useI18n } from "vue-i18n";+import type { Issue } from "@/types/proto-es/v1/issue_service_pb";+import {+ Issue_ApprovalStatus,+ IssueStatus,+} from "@/types/proto-es/v1/issue_service_pb";+import type { Rollout } from "@/types/proto-es/v1/rollout_service_pb";+import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";+import type { PhaseType } from "./useActivePhase";++export type PhaseStatus = "completed" | "closed" | "active" | "future";++export interface PhaseBadge {+ label: string;+ type: TagProps["type"];+}++export interface PhaseConfig {+ status: PhaseStatus;+ badge?: PhaseBadge;+ lineClass: string;+}++export const usePhaseState = (+ isCreating: Ref<boolean>,+ issue: Ref<Issue | undefined>,+ rollout: Ref<Rollout | undefined>+) => {+ const { t } = useI18n();++ const statusMap = computed<Record<PhaseType, PhaseStatus>>(() => {+ const creating = isCreating.value;+ const hasIssue = !!issue.value;+ const hasRollout = !!rollout.value;+ const isIssueClosed =+ issue.value?.status === IssueStatus.CANCELED ||+ issue.value?.status === IssueStatus.DONE;+ const allTasks = rollout.value?.stages.flatMap((s) => s.tasks) ?? [];+ const allDone =+ allTasks.length > 0 &&+ allTasks.every(+ (task) =>+ task.status === Task_Status.DONE ||+ task.status === Task_Status.SKIPPED+ );++ let review: PhaseStatus = "future";+ if (hasIssue) {+ if (issue.value?.status === IssueStatus.CANCELED) {+ review = "closed";+ } else {+ review = hasRollout || isIssueClosed ? "completed" : "active";+ }+ }++ return {+ changes: creating || (!hasIssue && !hasRollout) ? "active" : "completed",+ review,+ deploy: hasRollout ? (allDone ? "completed" : "active") : "future",+ };+ });++ // Badges++ const changesBadge = computed<PhaseBadge | undefined>(() => {+ if (statusMap.value.changes !== "active") return undefined;+ if (isCreating.value) return undefined;+ return { label: t("common.draft"), type: "default" };+ });++ const reviewBadge = computed<PhaseBadge | undefined>(() => {+ if (!issue.value) return undefined;+ if (issue.value.status === IssueStatus.CANCELED) {+ return { label: t("common.closed"), type: "default" };+ }+ // Show badge for both active and completed review phases+ if (statusMap.value.review === "future") return undefined;+ const map: Partial<+ Record<Issue_ApprovalStatus, { label: string; type: TagProps["type"] }>+ > = {+ [Issue_ApprovalStatus.APPROVED]: {+ label: t("issue.table.approved"),+ type: "success",+ },+ [Issue_ApprovalStatus.SKIPPED]: {+ label: t("common.skipped"),+ type: "default",+ },+ [Issue_ApprovalStatus.REJECTED]: {+ label: t("common.rejected"),+ type: "warning",+ },+ [Issue_ApprovalStatus.PENDING]: {+ label: t("common.under-review"),+ type: "info",+ },+ };+ // If review phase is completed but approval is still pending, it was bypassed+ if (+ statusMap.value.review === "completed" &&+ issue.value.approvalStatus === Issue_ApprovalStatus.PENDING+ ) {+ return { label: t("common.bypassed"), type: "default" };+ }+ return map[issue.value.approvalStatus];+ });++ const deployBadge = computed<PhaseBadge | undefined>(() => {+ if (statusMap.value.deploy !== "active" || !rollout.value) return undefined;+ const allTasks = rollout.value.stages.flatMap((s) => s.tasks);+ if (allTasks.some((task) => task.status === Task_Status.FAILED))+ return { label: t("common.failed"), type: "error" };+ if (allTasks.some((task) => task.status === Task_Status.RUNNING))+ return { label: t("common.in-progress"), type: "info" };+ return { label: t("common.not-started"), type: "default" };+ });++ // Line colors++ const lineClass = (from: PhaseType, to: PhaseType): string => {+ const f = statusMap.value[from];+ const s = statusMap.value[to];+ if (f === "closed" || s === "closed")+ return "border-l-2 border-dashed border-control-border";+ if (f === "completed" && s === "completed")+ return "border-l-2 border-success";+ if (f === "completed" && s === "active") return "border-l-2 border-success";+ if (f === "active") return "border-l-2 border-dashed border-accent";+ return "border-l-2 border-dashed border-control-border";+ };++ // Assembled array (indexed: 0=changes, 1=review, 2=deploy)++ const phases = computed<[PhaseConfig, PhaseConfig, PhaseConfig]>(() => [+ {+ status: statusMap.value.changes,+ badge: changesBadge.value,+ lineClass: lineClass("changes", "review"),+ },+ {+ status: statusMap.value.review,+ badge: reviewBadge.value,+ lineClass: lineClass("review", "deploy"),+ },+ {+ status: statusMap.value.deploy,+ badge: deployBadge.value,+ lineClass: "",+ },+ ]);++ return { phases };+};diff --git a/frontend/src/components/Plan/components/PlanDetailPage/usePhaseSummaries.ts b/frontend/src/components/Plan/components/PlanDetailPage/usePhaseSummaries.tsnew file mode 100644index 0000000000..be1b9caa9c--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/usePhaseSummaries.ts@@ -0,0 +1,94 @@+import { uniq } from "lodash-es";+import { computed, type Ref } from "vue";+import { useI18n } from "vue-i18n";+import { extractUserEmail } from "@/store";+import { isValidDatabaseGroupName } from "@/types";+import type { Issue } from "@/types/proto-es/v1/issue_service_pb";+import type { Plan } from "@/types/proto-es/v1/plan_service_pb";+import type { Rollout } from "@/types/proto-es/v1/rollout_service_pb";+import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";+import { targetsForSpec } from "../../logic/plan";+import { usePlanCheckStatus } from "../../logic/usePlanCheckStatus";++export const usePhaseSummaries = (+ plan: Ref<Plan>,+ issue: Ref<Issue | undefined>,+ rollout: Ref<Rollout | undefined>+) => {+ const { t } = useI18n();+ const { statusSummary } = usePlanCheckStatus(plan);++ const changesSummary = computed(() => {+ const parts: string[] = [];++ const specCount = plan.value.specs.length;+ parts.push(t("plan.summary.n-changes", { n: specCount }));++ const targets = uniq(plan.value.specs.flatMap(targetsForSpec));+ if (targets.length > 0) {+ const dbGroupCount = targets.filter(isValidDatabaseGroupName).length;+ const dbCount = targets.length - dbGroupCount;+ const targetParts: string[] = [];+ if (dbCount > 0) {+ targetParts.push(t("plan.summary.n-databases", { n: dbCount }));+ }+ if (dbGroupCount > 0) {+ targetParts.push(+ t("plan.summary.n-database-groups", { n: dbGroupCount })+ );+ }+ parts.push(targetParts.join(` ${t("common.and")} `));+ }++ const checks = statusSummary.value;+ if (checks.total > 0) {+ const checkParts: string[] = [];+ if (checks.success > 0)+ checkParts.push(t("plan.summary.n-passed", { n: checks.success }));+ if (checks.warning > 0)+ checkParts.push(t("plan.summary.n-warning", { n: checks.warning }));+ if (checks.error > 0)+ checkParts.push(t("plan.summary.n-error", { n: checks.error }));+ parts.push(checkParts.join(", "));+ }++ return parts.join(" · ");+ });++ const reviewSummary = computed(() => {+ if (!issue.value) return "";+ const roles = issue.value.approvalTemplate?.flow?.roles ?? [];+ const approvers = issue.value.approvers;+ const parts: string[] = [];++ if (roles.length > 0) {+ parts.push(+ t("plan.summary.n-of-m-approved", {+ n: approvers.length,+ m: roles.length,+ })+ );+ }++ if (approvers.length > 0) {+ const last = approvers[approvers.length - 1];+ const name = extractUserEmail(last.principal).split("@")[0];+ parts.push(t("plan.summary.last-approved-by", { name }));+ }++ return parts.join(" · ");+ });++ const deploySummary = computed(() => {+ if (!rollout.value) return "";+ const allTasks = rollout.value.stages.flatMap((s) => s.tasks);+ const total = allTasks.length;+ const completed = allTasks.filter(+ (task) =>+ task.status === Task_Status.DONE || task.status === Task_Status.SKIPPED+ ).length;+ return t("plan.summary.n-of-m-tasks", { n: completed, m: total });+ });++ return { changesSummary, reviewSummary, deploySummary };+};diff --git a/frontend/src/components/Plan/components/PlanDetailPage/usePlanDetailDesktopLayout.ts b/frontend/src/components/Plan/components/PlanDetailPage/usePlanDetailDesktopLayout.tsnew file mode 100644index 0000000000..011de6c9ab--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/usePlanDetailDesktopLayout.ts@@ -0,0 +1,80 @@+import type { CSSProperties, Ref } from "vue";+import { computed } from "vue";+import { PLAN_DETAIL_CONTENT_MIN_HEIGHT_VAR } from "./usePlanDetailViewportVars";++export const PLAN_DETAIL_XL_BREAKPOINT = 1280;+export const PLAN_DETAIL_TASK_DRAWER_WIDTH = 640;+export const PLAN_DETAIL_METADATA_DRAWER_WIDTH = 320;++export const usePlanDetailDesktopLayout = ({+ sidebarMode,+ containerWidth,+ desktopSidebarWidth,+ hasDetailPanel,+}: {+ sidebarMode: Readonly<Ref<string>>;+ containerWidth: Readonly<Ref<number>>;+ desktopSidebarWidth: Readonly<Ref<number>>;+ hasDetailPanel: Readonly<Ref<boolean>>;+}) => {+ const supportsInlineDetailPanel = computed(() => {+ return (+ sidebarMode.value === "DESKTOP" &&+ containerWidth.value >= PLAN_DETAIL_XL_BREAKPOINT+ );+ });++ const showDesktopSidebar = computed(() => {+ return sidebarMode.value === "DESKTOP" && !hasDetailPanel.value;+ });++ const showInlineDetailPanel = computed(() => {+ return hasDetailPanel.value && supportsInlineDetailPanel.value;+ });++ const showTaskDrawer = computed(() => {+ return (+ hasDetailPanel.value &&+ !showInlineDetailPanel.value &&+ sidebarMode.value !== "NONE"+ );+ });++ const showSidebarDrawer = computed(() => {+ return sidebarMode.value === "MOBILE";+ });++ const desktopLayoutStyle = computed<CSSProperties>(() => {+ const baseStyle: CSSProperties = {+ minHeight: `var(${PLAN_DETAIL_CONTENT_MIN_HEIGHT_VAR})`,+ };++ if (sidebarMode.value !== "DESKTOP") {+ return baseStyle;+ }++ if (showInlineDetailPanel.value) {+ return {+ ...baseStyle,+ gridTemplateColumns: "minmax(0, 1fr) minmax(0, 50%)",+ };+ }++ if (showDesktopSidebar.value) {+ return {+ ...baseStyle,+ gridTemplateColumns: `minmax(0, 1fr) ${desktopSidebarWidth.value}px`,+ };+ }++ return baseStyle;+ });++ return {+ desktopLayoutStyle,+ showDesktopSidebar,+ showInlineDetailPanel,+ showTaskDrawer,+ showSidebarDrawer,+ };+};diff --git a/frontend/src/components/Plan/components/PlanDetailPage/usePlanDetailViewportVars.ts b/frontend/src/components/Plan/components/PlanDetailPage/usePlanDetailViewportVars.tsnew file mode 100644index 0000000000..a2d1d249b3--- /dev/null+++ b/frontend/src/components/Plan/components/PlanDetailPage/usePlanDetailViewportVars.ts@@ -0,0 +1,39 @@+import { useElementSize } from "@vueuse/core";+import { computed, type Ref } from "vue";+import { useBodyLayoutContext } from "@/layouts/common";++export const PLAN_DETAIL_VIEWPORT_HEIGHT_VAR =+ "--bb-plan-detail-viewport-height";+export const PLAN_DETAIL_LAYOUT_MIN_HEIGHT_VAR =+ "--bb-plan-detail-layout-min-height";+export const PLAN_DETAIL_CONTENT_MIN_HEIGHT_VAR =+ "--bb-plan-detail-content-min-height";++export const usePlanDetailViewportVars = (+ headerRef: Ref<HTMLElement | undefined>+) => {+ const { mainContainerRef } = useBodyLayoutContext();+ const { height: mainContainerHeight } = useElementSize(mainContainerRef);+ const { height: headerHeight } = useElementSize(headerRef);++ const viewportVars = computed(() => {+ if (!mainContainerHeight.value) {+ return undefined;+ }++ const contentMinHeight = Math.max(+ mainContainerHeight.value - headerHeight.value,+ 0+ );++ return {+ [PLAN_DETAIL_VIEWPORT_HEIGHT_VAR]: `${mainContainerHeight.value}px`,+ [PLAN_DETAIL_LAYOUT_MIN_HEIGHT_VAR]: `${mainContainerHeight.value}px`,+ [PLAN_DETAIL_CONTENT_MIN_HEIGHT_VAR]: `${contentMinHeight}px`,+ };+ });++ return {+ viewportVars,+ };+};diff --git a/frontend/src/components/Plan/components/RefreshIndicator.vue b/frontend/src/components/Plan/components/RefreshIndicator.vueindex 6087646725..96b41686ba 100644--- a/frontend/src/components/Plan/components/RefreshIndicator.vue+++ b/frontend/src/components/Plan/components/RefreshIndicator.vue@@ -11,6 +11,7 @@<span>{{ lastRefreshAbsolute }}</span></NTooltip><NButton+ class="opacity-60"size="tiny"quaternary:loading="isRefreshing"@@ -18,7 +19,7 @@@click="handleRefresh"><template #icon>- <RefreshCcwIcon class="w-4 h-4" />+ <RefreshCcwIcon class="w-3 h-3" /></template><span>{{ $t("common.refresh") }}</span></NButton>diff --git a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vueindex eb8f82d81c..599a7ee544 100644--- a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue+++ b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue@@ -1,9 +1,9 @@<template>- <div v-if="show" class="py-3 flex flex-col gap-y-2 overflow-hidden">+ <div v-if="show" class="flex flex-col gap-y-2 overflow-hidden"><!-- Row 1: Title + Run button --><div class="flex items-center justify-between gap-2"><div class="flex flex-row items-center gap-2">- <h3 class="text-base">{{ $t("plan.checks.self") }}</h3>+ <h3 class="textlabel uppercase">{{ $t("plan.checks.self") }}</h3></div><NButtonsize="tiny"diff --git a/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue b/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vueindex 47d6a0506a..a0d3174f52 100644--- a/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue+++ b/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue@@ -60,8 +60,8 @@ import TaskRunComment from "@/components/RolloutV1/components/TaskRun/TaskRunComimport TaskRunDetail from "@/components/RolloutV1/components/TaskRun/TaskRunDetail.vue";import TaskRunStatusIcon from "@/components/RolloutV1/components/TaskRun/TaskRunStatusIcon.vue";import { Drawer, DrawerContent } from "@/components/v2";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";-import { useCurrentProjectV1, useDatabaseV1Store } from "@/store";+import { buildTaskDetailRoute } from "@/router/dashboard/projectV1RouteHelpers";+import { useDatabaseV1Store } from "@/store";import { useTaskRunLogStore } from "@/store/modules/v1/taskRunLog";import { getDateForPbTimestampProtoEs } from "@/types";import {@@ -69,12 +69,7 @@ import {type TaskRun,TaskRun_Status,} from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- extractTaskUID,- flattenTaskV1List,-} from "@/utils";+import { extractTaskUID, flattenTaskV1List } from "@/utils";import { usePlanContextWithRollout } from "../../logic";import DatabaseDisplay from "../common/DatabaseDisplay.vue";import { useSelectedSpec } from "./context";@@ -83,7 +78,6 @@ const DEFAULT_TASK_RUNS_PER_PAGE = 5;const { t } = useI18n();const router = useRouter();-const { project } = useCurrentProjectV1();const { rollout, taskRuns } = usePlanContextWithRollout();const { selectedSpec } = useSelectedSpec();const databaseStore = useDatabaseV1Store();@@ -262,29 +256,6 @@ const shouldShowDetailButton = (taskRun: TaskRun) => {].includes(taskRun.status);};-// Helper function to get route params for a task run-const getTaskRouteParams = (taskRun: TaskRun) => {- const task = getTaskForTaskRun(taskRun);- if (!task) return null;-- // Extract IDs from task name (format: projects/xxx/plans/yyy/rollout/stages/zzz/tasks/aaa)-- const taskParts = task.name.split("/");-- const planId = extractPlanUIDFromRolloutName(rollout.value.name);-- const stageIndex = taskParts.indexOf("stages");-- const taskIndex = taskParts.indexOf("tasks");-- if (stageIndex === -1 || taskIndex === -1) return null;-- const stageId = taskParts[stageIndex + 1];- const taskId = taskParts[taskIndex + 1];-- return { planId, stageId, taskId };-};-// Get database for selected task runconst selectedDatabase = computed(() => {if (!taskRunDetailContext.taskRun) return undefined;@@ -295,17 +266,9 @@ const selectedDatabase = computed(() => {// Navigate to task detail pageconst navigateToTaskDetail = (taskRun: TaskRun) => {- const params = getTaskRouteParams(taskRun);- if (params) {- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- params: {- projectId: extractProjectResourceName(project.value.name),- planId: params.planId,- stageId: params.stageId || "_", // Use placeholder for empty stageId- taskId: params.taskId,- },- });+ const task = getTaskForTaskRun(taskRun);+ if (task) {+ router.push(buildTaskDetailRoute(task.name));}};diff --git a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vueindex b76080f0db..84b1a70832 100644--- a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue+++ b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue@@ -1,29 +1,20 @@<template><div class="w-full flex-1 flex flex-col">- <SpecListSection v-if="shouldShowSpecList" />- <div- class="w-full flex-1 flex flex-col lg:flex-row px-4 gap-4 overflow-hidden"- >- <!-- Left: Targets + Statement -->- <div class="flex-1 flex flex-col min-w-0 overflow-y-auto gap-y-3 py-3">- <TargetListSection />- <DataExportOptionsSection v-if="isDataExportPlan" />- <FailedTaskRunsSection v-if="!isCreating && rollout" />- <div class="flex-1 flex flex-col">- <StatementSection />- </div>- </div>- <!-- Right: Checks + Options -->- <div- v-if="shouldShowSidebar"- class="lg:w-80 shrink-0 flex flex-col divide-y lg:border-l lg:pl-4 overflow-y-auto"- >- <template v-if="!specHasRelease">- <SQLCheckV1Section v-if="isCreating" />- <PlanCheckSection v-else />- </template>- <Configuration />+ <SpecListSection />+ <div class="w-full flex-1 flex flex-col px-4 gap-y-4 py-4 overflow-y-auto">+ <TargetListSection />++ <!-- Statement -->+ <div :class="[plan.hasRollout ? 'h-[192px]' : 'h-[256px]', 'flex flex-col']">+ <StatementSection /></div>++ <!-- Checks + Configuration -->+ <template v-if="!specHasRelease">+ <SQLCheckV1Section v-if="isCreating" />+ <PlanCheckSection v-else />+ </template>+ <Configuration /></div></div></template>@@ -32,7 +23,6 @@import { computed, type Ref } from "vue";import { useCurrentProjectV1 } from "@/store";import { isValidReleaseName } from "@/types";-import { Issue_Type } from "@/types/proto-es/v1/issue_service_pb";import type { Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";import { usePlanContext } from "../../logic/context";import Configuration from "../Configuration";@@ -41,13 +31,11 @@ import { providePlanSQLCheckContext } from "../SQLCheckSection";import SQLCheckV1Section from "../SQLCheckV1Section";import StatementSection from "../StatementSection";import { useSelectedSpec } from "./context";-import DataExportOptionsSection from "./DataExportOptionsSection.vue";-import FailedTaskRunsSection from "./FailedTaskRunsSection.vue";import SpecListSection from "./SpecListSection.vue";import TargetListSection from "./TargetListSection.vue";const { project } = useCurrentProjectV1();-const { isCreating, plan, issue, rollout } = usePlanContext();+const { isCreating, plan } = usePlanContext();const { selectedSpec } = useSelectedSpec();@@ -63,35 +51,4 @@ const specHasRelease = computed(() => {isValidReleaseName(selectedSpec.value.config.value.release));});--const isDataExportPlan = computed(() => {- return plan.value.specs.every(- (spec) => spec.config.case === "exportDataConfig"- );-});--const isCreateDatabasePlan = computed(() => {- return plan.value.specs.every(- (spec) => spec.config.case === "createDatabaseConfig"- );-});--const isRoleGrantOrAccessGrantIssue = computed(() => {- return (- issue.value?.type === Issue_Type.ROLE_GRANT ||- issue.value?.type === Issue_Type.ACCESS_GRANT- );-});--const shouldShowSidebar = computed(() => {- return (- !isDataExportPlan.value &&- !isCreateDatabasePlan.value &&- !isRoleGrantOrAccessGrantIssue.value- );-});--const shouldShowSpecList = computed(() => {- return !isDataExportPlan.value;-});</script>diff --git a/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue b/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vueindex 0a50267f4b..ee9133e775 100644--- a/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue+++ b/frontend/src/components/Plan/components/SpecDetailView/SpecListSection.vue@@ -1,19 +1,16 @@<template>- <div class="flex items-center" :class="(plan.issue || plan.hasRollout) && 'mt-3'">+ <div class="flex items-center pt-3"><NTabs:key="`${plan.specs.length}-${selectedSpec.id}`":value="selectedSpec.id"- type="card"+ type="line"size="small"class="flex-1"@update:value="handleTabChange"><template #prefix>- <div class="pl-4 text-base font-medium">- {{ $t("plan.navigator.changes") }}- </div>+ <div /></template>-<NTab v-for="(spec, index) in plan.specs" :key="spec.id" :name="spec.id"><div class="flex items-center gap-1"><span v-if="plan.specs.length > 1" class="opacity-80"@@ -48,7 +45,7 @@<NButtonv-if="canModifySpecs"type="default"- size="small"+ size="tiny"@click="showAddSpecDrawer = true">{{ $t("plan.add-spec") }}@@ -70,7 +67,7 @@ import { create } from "@bufbuild/protobuf";import { MoreVerticalIcon, TrashIcon } from "lucide-vue-next";import type { DropdownOption } from "naive-ui";import { NButton, NDropdown, NTab, NTabs, NTooltip, useDialog } from "naive-ui";-import { computed, h, nextTick, ref } from "vue";+import { computed, h, inject, nextTick, ref } from "vue";import { useI18n } from "vue-i18n";import { useRouter } from "vue-router";import { planServiceClientConnect } from "@/connect";@@ -90,7 +87,10 @@ import { useEditorState } from "../../logic/useEditorState";import { getSpecTitle } from "../../logic/utils";import AddSpecDrawer from "../AddSpecDrawer.vue";import { useSpecsValidation } from "../common";-import { useSelectedSpec } from "./context";+import { SELECTED_SPEC_ID_SETTER_KEY, useSelectedSpec } from "./context";++// Check if spec selection is managed via injection (PlanDetailPage)+const specIdSetter = inject(SELECTED_SPEC_ID_SETTER_KEY, null);const router = useRouter();const dialog = useDialog();@@ -180,24 +180,35 @@ const handleSpecCreated = async (spec: Plan_Spec) => {const gotoSpec = (specId: string, enableEditing = false) => {const currentRoute = router.currentRoute.value;- router- .push({- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,- params: {- ...(currentRoute.params || {}),- specId,- },- query: currentRoute.query || {},- })- .then(() => {- // Enable editing mode if requested (for newly created specs)- if (enableEditing) {- // Use nextTick to ensure the route navigation completes first- nextTick(() => {- setEditingState(true);- });- }- });+ const nextRoute = {+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,+ params: {+ ...(currentRoute.params || {}),+ specId,+ },+ query: currentRoute.query || {},+ };++ // When spec selection is managed via injection (PlanDetailPage),+ // keep the local selection responsive while still syncing the URL.+ if (specIdSetter) {+ specIdSetter(specId);+ void router.push(nextRoute);+ if (enableEditing) {+ nextTick(() => setEditingState(true));+ }+ return;+ }++ router.push(nextRoute).then(() => {+ // Enable editing mode if requested (for newly created specs)+ if (enableEditing) {+ // Use nextTick to ensure the route navigation completes first+ nextTick(() => {+ setEditingState(true);+ });+ }+ });};const getDropdownOptions = (_spec: Plan_Spec): DropdownOption[] => {diff --git a/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue b/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vueindex 5e448ffbd5..9578658605 100644--- a/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue+++ b/frontend/src/components/Plan/components/SpecDetailView/TargetListSection.vue@@ -2,14 +2,14 @@<div class="flex flex-col gap-y-1"><div class="flex items-center justify-between"><div class="flex items-center gap-1">- <span class="text-base">{{ $t("plan.targets.title") }}</span>- <span class="text-sm text-control-light" v-if="targets.length > 1"+ <span class="textlabel uppercase">{{ $t("plan.targets.title") }}</span>+ <span class="textlabel text-control-light" v-if="targets.length > 1">({{ targets.length }})</span></div><NButtonv-if="allowEdit"- size="small"+ size="tiny"@click="showTargetsSelector = true">{{ $t("common.edit") }}@@ -29,19 +29,19 @@<div v-if="isLoadingTargets" class="flex items-center justify-center py-2"><BBSpin /></div>- <div v-else-if="targets.length > 0" class="flex flex-wrap gap-1.5">+ <div v-else-if="targets.length > 0" class="flex flex-wrap items-center gap-2"><divv-for="target in visibleTargets":key="target"- class="inline-flex items-center px-3 py-2 border rounded text-sm"+ class="inline-flex items-center gap-x-1 px-2 py-1 border rounded-lg cursor-default">- <DatabaseDisplay v-if="isValidDatabaseName(target)" :database="target" show-environment />- <DatabaseGroupTargetDisplay v-else-if="isValidDatabaseGroupName(target)" :target="target" />- <span v-else>{{ target }}</span>+ <DatabaseDisplay v-if="isValidDatabaseName(target)" :database="target" size="small" show-environment />+ <DatabaseGroupTargetDisplay v-else-if="isValidDatabaseGroupName(target)" :target="target" class="py-1" />+ <span v-else class="text-sm text-control-placeholder">{{ target }}</span></div><NButtonv-if="targets.length > DEFAULT_VISIBLE_TARGETS"- size="small"+ size="tiny"quaternary@click="showAllTargetsDrawer = true">@@ -85,7 +85,11 @@ import { extractProjectResourceName } from "@/utils";import { usePlanContext } from "../../logic/context";import DatabaseDisplay from "../common/DatabaseDisplay.vue";import AllTargetsDrawer from "./AllTargetsDrawer.vue";-import { DEFAULT_VISIBLE_TARGETS, useSelectedSpec } from "./context";+import {+ DEFAULT_VISIBLE_TARGETS,+ useForceReadonly,+ useSelectedSpec,+} from "./context";import DatabaseGroupTargetDisplay from "./DatabaseGroupTargetDisplay.vue";import TargetsSelectorDrawer from "./TargetsSelectorDrawer.vue";@@ -114,8 +118,10 @@ const project = computed(() => {// Only allow editing in creation mode or if the plan is editable and not readonly.// An empty string for `plan.value.hasRollout` indicates that the plan is in a draft or uninitialized state,// which allows edits to be made.+const forceReadonly = useForceReadonly();+const allowEdit = computed(() => {- if (readonly.value) {+ if (forceReadonly || readonly.value) {return false;}if (!hasPermission.value) {diff --git a/frontend/src/components/Plan/components/SpecDetailView/context.ts b/frontend/src/components/Plan/components/SpecDetailView/context.tsindex 7666702581..2bb748fa86 100644--- a/frontend/src/components/Plan/components/SpecDetailView/context.ts+++ b/frontend/src/components/Plan/components/SpecDetailView/context.ts@@ -9,11 +9,29 @@ import { usePlanContext } from "../../logic";export const DEFAULT_VISIBLE_TARGETS = 20;+// When provided as `true`, children should hide edit controls+export const FORCE_READONLY_KEY: InjectionKey<boolean> =+ Symbol("force-readonly");++export const useForceReadonly = (): boolean => {+ return inject(FORCE_READONLY_KEY, false);+};+export const SELECTED_SPEC_INJECTION_KEY: InjectionKey<Ref<Plan_Spec>> =Symbol("selected-spec");-export const provideSelectedSpec = (spec: Ref<Plan_Spec>) => {+export const SELECTED_SPEC_ID_SETTER_KEY: InjectionKey<+ (specId: string) => void+> = Symbol("selected-spec-id-setter");++export const provideSelectedSpec = (+ spec: Ref<Plan_Spec>,+ setSpecId?: (specId: string) => void+) => {provide(SELECTED_SPEC_INJECTION_KEY, spec);+ if (setSpecId) {+ provide(SELECTED_SPEC_ID_SETTER_KEY, setSpecId);+ }};export const useSelectedSpec = () => {diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vueindex 4c771bcd0a..06f3d2f168 100644--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue@@ -3,8 +3,8 @@<div class="flex items-center justify-between"><div class="flex items-center gap-x-1"><span- class="text-base"- :class="isEmpty(state.statement) ? 'text-red-600' : ''"+ class="textlabel uppercase"+ :class="isEmpty(state.statement) ? 'text-red-600!' : ''">{{ statementTitle }}</span>@@ -13,7 +13,7 @@<div class="flex items-center justify-end gap-x-2"><template v-if="isCreating"><SQLUploadButton- size="small"+ size="tiny":loading="state.isUploadingFile"@update:sql="handleUpdateStatement">@@ -21,7 +21,7 @@</SQLUploadButton><NButtonv-if="shouldShowSchemaEditorButton && targetDatabaseNames.length > 0"- size="small"+ size="tiny"@click="handleOpenSchemaEditor"><template #icon>@@ -39,7 +39,7 @@<template #trigger><NButtonv-if="!isSheetOversize"- size="small"+ size="tiny"tag="div":disabled="denyEditStatementReasons.length > 0"@click.prevent="beginEdit"@@ -49,7 +49,7 @@<!-- for oversized sheets, only allow to upload and overwrite the sheet --><SQLUploadButtonv-else- size="small"+ size="tiny":loading="state.isUploadingFile"@update:sql="handleUpdateStatementAndOverwrite">@@ -64,7 +64,7 @@</template><template v-else><SQLUploadButton- size="small"+ size="tiny":loading="state.isUploadingFile"@update:sql="handleUpdateStatement">@@ -72,7 +72,7 @@</SQLUploadButton><NButtonv-if="shouldShowSchemaEditorButton"- size="small"+ size="tiny"@click="handleOpenSchemaEditor"><template #icon>@@ -82,7 +82,7 @@</NButton><NButtonv-if="editorState.isEditing.value"- size="small"+ size="tiny":disabled="!allowSaveSQL"@click.prevent="saveEdit">@@ -90,7 +90,7 @@</NButton><NButtonv-if="editorState.isEditing.value"- size="small"+ size="tiny"quaternary@click.prevent="cancelEdit">@@ -107,7 +107,7 @@:description="$t('issue.statement-from-sheet-warning')"><template #action>- <DownloadSheetButton v-if="sheetName" :sheet="sheetName" size="small" />+ <DownloadSheetButton v-if="sheetName" :sheet="sheetName" size="tiny" /></template></BBAttention>@@ -130,7 +130,7 @@/><div v-if="!readonly" class="absolute bottom-1 right-4"><NButton- size="small"+ size="tiny":quaternary="true"@click="state.showEditorModal = true">@@ -228,7 +228,10 @@ import {useInstanceV1EditorLanguage,} from "@/utils";import { engineSupportsSchemaEditor } from "@/utils/schemaEditor";-import { useSelectedSpec } from "../../SpecDetailView/context";+import {+ useForceReadonly,+ useSelectedSpec,+} from "../../SpecDetailView/context";import { isGhostEnabled } from "../directiveUtils";import SchemaEditorDrawer from "../SchemaEditorDrawer.vue";import { useSpecSheet } from "../useSpecSheet";@@ -288,8 +291,10 @@ const { markers } = useSQLAdviceMarkers(* - Not in edit mode* - Disallowed to edit statement*/+const forceReadonly = useForceReadonly();+const isEditorReadonly = computed(() => {- if (readonly.value) {+ if (forceReadonly || readonly.value) {return true;}if (isCreating.value) {@@ -327,8 +332,8 @@ const denyEditStatementReasons = computed(() => {});const shouldShowEditButton = computed(() => {- // Not allowed to edit if readonly.- if (readonly.value) {+ // Not allowed to edit if readonly or forced readonly (Issue page).+ if (forceReadonly || readonly.value) {return false;}// Need not to show "Edit" while the plan is still pending create.diff --git a/frontend/src/components/Plan/logic/initialize/index.ts b/frontend/src/components/Plan/logic/initialize/index.tsindex afe75c32f4..c5fe8ebe18 100644--- a/frontend/src/components/Plan/logic/initialize/index.ts+++ b/frontend/src/components/Plan/logic/initialize/index.ts@@ -28,6 +28,10 @@ export * from "./create";export * from "./util";+const shouldLoadRolloutForPlan = (plan: Plan) => {+ return plan.hasRollout;+};+export function useInitializePlan(projectId: MaybeRef<string>,planId: MaybeRef<string | undefined>,@@ -155,7 +159,7 @@ export function useInitializePlan(// Fetch the plan using the issue's plan referenceplanResult = await planStore.fetchPlanByName(issueResult.plan);- if (planResult.hasRollout) {+ if (shouldLoadRolloutForPlan(planResult)) {try {const rolloutName = getRolloutFromPlan(planResult.name);const rolloutRequest = create(GetRolloutRequestSchema, {@@ -185,7 +189,7 @@ export function useInitializePlan(issueResult = newIssue;}- if (planResult.hasRollout) {+ if (shouldLoadRolloutForPlan(planResult)) {try {const rolloutName = getRolloutFromPlan(planResult.name);const rolloutRequest = create(GetRolloutRequestSchema, {diff --git a/frontend/src/components/Plan/logic/poller/poller.ts b/frontend/src/components/Plan/logic/poller/poller.tsindex ac4b5a0cca..a2f00e302d 100644--- a/frontend/src/components/Plan/logic/poller/poller.ts+++ b/frontend/src/components/Plan/logic/poller/poller.ts@@ -17,10 +17,8 @@ import {PROJECT_V1_ROUTE_PLAN_DETAIL,PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,- PROJECT_V1_ROUTE_PLAN_ROLLOUT,- PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,} from "@/router/dashboard/projectV1";+import { getRouteQueryString } from "@/router/dashboard/projectV1RouteHelpers";import { useCurrentProjectV1 } from "@/store";import { isValidRolloutName } from "@/types";import { IssueSchema } from "@/types/proto-es/v1/issue_service_pb";@@ -67,8 +65,12 @@ export const provideResourcePoller = () => {// Extract stage/task scope from route params for scoped taskRuns pollingconst taskRunScope = computed<TaskRunScope | undefined>(() => {- const stageId = route.params.stageId as string | undefined;- const taskId = route.params.taskId as string | undefined;+ const stageId =+ getRouteQueryString(route.query.stageId) ||+ (route.params.stageId as string | undefined);+ const taskId =+ getRouteQueryString(route.query.taskId) ||+ (route.params.taskId as string | undefined);if (!stageId) return undefined;return { stageId, taskId };});@@ -166,18 +168,19 @@ export const provideResourcePoller = () => {if (isCreating.value) return [];const routeName = route.name as string;- const planRoutes = [- PROJECT_V1_ROUTE_PLAN_DETAIL,+ const planSpecRoutes = [PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,];- const rolloutRoutes = [- PROJECT_V1_ROUTE_PLAN_ROLLOUT,- PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- ];- if (includes(planRoutes, routeName)) return ["plan"];+ // Plan Detail Page (unified view) — poll all resources+ if (routeName === PROJECT_V1_ROUTE_PLAN_DETAIL) {+ return ["plan", "planCheckRuns", "issue", "rollout", "taskRuns"];+ }+ // Plan spec routes still render the unified Plan Detail page.+ if (includes(planSpecRoutes, routeName)) {+ return ["plan", "planCheckRuns", "issue", "rollout", "taskRuns"];+ }if (includes([PROJECT_V1_ROUTE_ISSUE_DETAIL], routeName)) {if (planType.value === "CHANGE_DATABASE") {return ["plan", "issue"];@@ -186,7 +189,6 @@ export const provideResourcePoller = () => {return ["plan", "issue", "rollout", "taskRuns"];}}- if (includes(rolloutRoutes, routeName)) return ["rollout", "taskRuns"];return ["plan", "planCheckRuns", "issue", "rollout", "taskRuns"];});diff --git a/frontend/src/components/Plan/logic/sidebar.ts b/frontend/src/components/Plan/logic/sidebar.tsindex 922fcfd04e..77bd0d1cd8 100644--- a/frontend/src/components/Plan/logic/sidebar.ts+++ b/frontend/src/components/Plan/logic/sidebar.ts@@ -6,6 +6,7 @@ export type SidebarMode = "NONE" | "DESKTOP" | "MOBILE";export type SidebarContext = {mode: Ref<SidebarMode>;+ containerWidth: Ref<number>;desktopSidebarWidth: Ref<number>;mobileSidebarOpen: Ref<boolean>;};@@ -40,6 +41,7 @@ export const provideSidebarContext = (const mobileSidebarOpen = ref(false);const context: SidebarContext = {mode,+ containerWidth,desktopSidebarWidth,mobileSidebarOpen,};diff --git a/frontend/src/components/Plan/logic/useRolloutReadyLink.ts b/frontend/src/components/Plan/logic/useRolloutReadyLink.tsindex 591b496f50..b7494746ab 100644--- a/frontend/src/components/Plan/logic/useRolloutReadyLink.ts+++ b/frontend/src/components/Plan/logic/useRolloutReadyLink.ts@@ -1,34 +1,29 @@import { computed } from "vue";-import { Task_Type } from "@/types/proto-es/v1/rollout_service_pb";+import { useRoute } from "vue-router";+import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";import { usePlanContext } from "./context";+import { isDatabaseChangeSpec } from "./plan";/**- * Composable that determines whether the "Rollout" link should be shown.- * This link appears when:- * - Rollout has been fetched (rollout ref is defined)- * - Rollout does not contain database creation/export tasks+ * Composable that determines whether the "Plan" link should be shown.+ * This link appears on the Issue page when:+ * - The plan has an existing rollout+ * - All specs are database-change related*/export const useRolloutReadyLink = () => {- const { rollout } = usePlanContext();+ const route = useRoute();+ const { plan } = usePlanContext();const shouldShow = computed(() => {- if (!rollout.value) {- return false;- }+ // Only show on Issue page+ if (route.name !== PROJECT_V1_ROUTE_ISSUE_DETAIL) return false;- // Don't show for rollouts with database creation/export tasks- const hasDatabaseCreateOrExportTasks = rollout.value.stages.some((stage) =>- stage.tasks.some(- (task) =>- task.type === Task_Type.DATABASE_CREATE ||- task.type === Task_Type.DATABASE_EXPORT- )- );- if (hasDatabaseCreateOrExportTasks) {- return false;- }+ if (!plan.value.hasRollout) return false;- return true;+ return (+ plan.value.specs.length > 0 &&+ plan.value.specs.every(isDatabaseChangeSpec)+ );});return {diff --git a/frontend/src/components/Project/useProjectSidebar.ts b/frontend/src/components/Project/useProjectSidebar.tsindex 49f14adbd1..937b1b5ee3 100644--- a/frontend/src/components/Project/useProjectSidebar.ts+++ b/frontend/src/components/Project/useProjectSidebar.ts@@ -22,7 +22,6 @@ import {PROJECT_V1_ROUTE_MEMBERS,PROJECT_V1_ROUTE_PLANS,PROJECT_V1_ROUTE_RELEASES,- PROJECT_V1_ROUTE_ROLLOUTS,PROJECT_V1_ROUTE_SERVICE_ACCOUNTS,PROJECT_V1_ROUTE_SETTINGS,PROJECT_V1_ROUTE_SYNC_SCHEMA,@@ -60,11 +59,6 @@ export const useProjectSidebar = (project: MaybeRef<Project>) => {path: PROJECT_V1_ROUTE_PLANS,type: "div",},- {- title: t("rollout.rollouts"),- path: PROJECT_V1_ROUTE_ROLLOUTS,- type: "div",- },{title: t("release.releases"),path: PROJECT_V1_ROUTE_RELEASES,diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vueindex 87442cac1e..bc448839c8 100644--- a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue@@ -63,7 +63,7 @@ import {planServiceClientConnect,rolloutServiceClientConnect,} from "@/connect";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";+import { buildPlanDeployRoute } from "@/router/dashboard/projectV1RouteHelpers";import { getProjectNameReleaseId } from "@/store/modules/v1/common";import {CreatePlanRequestSchema,@@ -145,12 +145,11 @@ const handleCreate = async () => {const planId = createdPlan.name.split("/").pop();// Redirect to rollout view- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: {+ router.push(+ buildPlanDeployRoute({projectId: getProjectNameReleaseId(release.value.name)[0],- planId,- },- });+ planId: planId || "_",+ })+ );};</script>diff --git a/frontend/src/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vue b/frontend/src/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vuedeleted file mode 100644index 79c0853cce..0000000000--- a/frontend/src/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vue+++ /dev/null@@ -1,151 +0,0 @@-<template>- <nav v-if="planID" class="inline-flex items-center text-sm">- <template v-for="(item, index) in breadcrumbItems" :key="index">- <span v-if="index > 0" class="mx-2 text-gray-400 font-mono">/</span>- <RouterLink- v-if="item.clickable && item.route"- :to="item.route"- class="text-gray-500 hover:text-accent transition-colors"- >- {{ item.label }}- </RouterLink>- <span v-else class="text-gray-900">- {{ item.label }}- </span>- </template>- </nav>-</template>--<script lang="ts" setup>-import { computed } from "vue";-import { useI18n } from "vue-i18n";-import { type RouteLocationRaw, RouterLink, useRoute } from "vue-router";-import { usePlanContext } from "@/components/Plan/logic";-import {- PROJECT_V1_ROUTE_ISSUE_DETAIL,- PROJECT_V1_ROUTE_PLAN_DETAIL,- PROJECT_V1_ROUTE_PLAN_ROLLOUT,- PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,-} from "@/router/dashboard/projectV1";-import { useEnvironmentV1Store } from "@/store";-import {- extractIssueUID,- extractPlanUID,- extractPlanUIDFromRolloutName,- extractProjectResourceName,-} from "@/utils";--interface BreadcrumbItem {- label: string;- route?: RouteLocationRaw;- clickable: boolean;-}--const { t } = useI18n();-const route = useRoute();-const { plan, issue, rollout } = usePlanContext();-const environmentStore = useEnvironmentV1Store();--const projectId = computed(() => {- if (!plan.value?.name) return "";- return extractProjectResourceName(plan.value.name);-});--const planUID = computed(() => {- if (!plan.value?.name) return "";- return extractPlanUID(plan.value.name);-});--const issueUID = computed(() => {- if (!issue.value?.name) return "";- return extractIssueUID(issue.value.name);-});--const planID = computed(() => {- if (!rollout.value?.name) return "";- return extractPlanUIDFromRolloutName(rollout.value.name);-});--// Route params for stage/task views-const stageId = computed(() => route.params.stageId as string | undefined);-const taskId = computed(() => route.params.taskId as string | undefined);--// Stage info for task detail views-const selectedStage = computed(() => {- if (!stageId.value || !rollout.value) return undefined;- return rollout.value.stages.find((s) => s.name.endsWith(`/${stageId.value}`));-});--const stageTitle = computed(() => {- if (!selectedStage.value) return "";- if (selectedStage.value.environment) {- const env = environmentStore.getEnvironmentByName(- selectedStage.value.environment- );- if (env?.title) return env.title;- }- return selectedStage.value.name.split("/").pop() || "";-});--const breadcrumbItems = computed<BreadcrumbItem[]>(() => {- const items: BreadcrumbItem[] = [];- const hasTask = !!taskId.value;-- // Issue or Plan (prefer Issue if exists, but rollout must have a plan)- if (issueUID.value) {- items.push({- label: `${t("common.issue")} #${issueUID.value}`,- route: {- name: PROJECT_V1_ROUTE_ISSUE_DETAIL,- params: { projectId: projectId.value, issueId: issueUID.value },- },- clickable: true,- });- } else {- items.push({- label: `${t("common.plan")} #${planUID.value}`,- route: {- name: PROJECT_V1_ROUTE_PLAN_DETAIL,- params: { projectId: projectId.value, planId: planUID.value },- },- clickable: true,- });- }-- // Rollout - clickable when viewing task detail- items.push({- label: `${t("common.rollout")} #${planID.value}`,- route: {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: { projectId: projectId.value, planId: planID.value },- },- clickable: hasTask,- });-- // Stage (only when viewing a task)- if (hasTask && stageTitle.value) {- items.push({- label: stageTitle.value,- route: {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: projectId.value,- planId: planID.value,- stageId: stageId.value,- },- },- clickable: true,- });- }-- // Task (always last, not clickable - current page)- if (hasTask) {- items.push({- label: `${t("common.task")} #${taskId.value}`,- clickable: false,- });- }-- return items;-});-</script>diff --git a/frontend/src/components/RolloutV1/components/Rollout/RolloutDataTable.vue b/frontend/src/components/RolloutV1/components/Rollout/RolloutDataTable.vuedeleted file mode 100644index dd2c9141d0..0000000000--- a/frontend/src/components/RolloutV1/components/Rollout/RolloutDataTable.vue+++ /dev/null@@ -1,229 +0,0 @@-<template>- <div ref="tableRef">- <NDataTable- size="small"- :columns="columnList"- :data="rolloutList"- :striped="true"- :bordered="bordered"- :loading="loading"- :scroll-x="scrollX"- :row-key="(rollout) => rollout.name"- :row-props="rowProps"- />- </div>-</template>--<script lang="tsx" setup>-import { useElementSize } from "@vueuse/core";-import type { DataTableColumn } from "naive-ui";-import { NDataTable, NPerformantEllipsis, NTooltip } from "naive-ui";-import { computed, ref } from "vue";-import { useI18n } from "vue-i18n";-import { useRouter } from "vue-router";-import Timestamp from "@/components/misc/Timestamp.vue";-import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";-import { TASK_STATUS_FILTERS } from "@/components/RolloutV1/constants/task";-import { EnvironmentV1Name } from "@/components/v2";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";-import { useEnvironmentV1Store } from "@/store";-import type {- Rollout,- Stage,- Task_Status,-} from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- getStageStatus,- stringifyTaskStatus,- TailwindBreakpoints,-} from "@/utils";--withDefaults(- defineProps<{- rolloutList: Rollout[];- bordered?: boolean;- loading?: boolean;- showSelection?: boolean;- }>(),- {- loading: true,- bordered: false,- showSelection: false,- }-);--const { t } = useI18n();-const router = useRouter();-const environmentStore = useEnvironmentV1Store();-const tableRef = ref<HTMLDivElement>();-const { width: tableWidth } = useElementSize(tableRef);-const showExtendedColumns = computed(- () => tableWidth.value > TailwindBreakpoints.md-);--const getStageTaskCount = (stage: Stage, status: Task_Status) => {- return stage.tasks.filter((task) => task.status === status).length;-};--const columnList = computed(- (): (DataTableColumn<Rollout> & { hide?: boolean })[] => {- const columns: (DataTableColumn<Rollout> & { hide?: boolean })[] = [- {- key: "title",- title: t("issue.table.name"),- minWidth: 160,- resizable: true,- ellipsis: true,- render: (rollout) => {- return (- <div class={`flex items-center overflow-hidden gap-x-2`}>- <div class="whitespace-nowrap text-control opacity-60">- {extractPlanUIDFromRolloutName(rollout.name)}- </div>- {rollout.title ? (- <NPerformantEllipsis class="truncate">- {{- default: () => (- <span class="normal-nums">{rollout.title}</span>- ),- tooltip: () => (- <div class="whitespace-pre-wrap wrap-break-word break-all">- {rollout.title}- </div>- ),- }}- </NPerformantEllipsis>- ) : (- <span class="opacity-60 italic">{t("common.untitled")}</span>- )}- </div>- );- },- },- {- key: "stages",- title: t("rollout.stage.self", 2),- minWidth: 160,- resizable: true,- render: (rollout) => {- if (rollout.stages.length === 0) {- return (- <span class="text-sm text-gray-400 italic">- {t("common.no-data")}- </span>- );- }- return (- <div class="flex items-center gap-2">- {rollout.stages.map((stage, index) => {- const environment = environmentStore.getEnvironmentByName(- stage.environment- );- const stageStatus = getStageStatus(stage);- return (- <>- <NTooltip key={stage.name} placement="top">- {{- trigger: () => (- <div class="flex items-center gap-1 cursor-pointer shrink-0">- <TaskStatus- status={stageStatus}- size="small"- disabled- />- {showExtendedColumns.value && (- <EnvironmentV1Name- environment={environment}- link={false}- />- )}- </div>- ),- default: () => {- const taskCounts = TASK_STATUS_FILTERS.map(- (status) => {- const count = getStageTaskCount(stage, status);- return { status, count };- }- ).filter(({ count }) => count > 0);-- if (taskCounts.length === 0) {- return (- <span class="text-sm text-gray-400">- {t("common.no-data")}- </span>- );- }-- return (- <div class="flex flex-col gap-1">- {taskCounts.map(({ status, count }) => (- <div- key={status}- class="flex items-center gap-2"- >- <TaskStatus- status={status}- size="small"- disabled- />- <span class="text-sm">- {stringifyTaskStatus(status)}: {count}- </span>- </div>- ))}- </div>- );- },- }}- </NTooltip>- {index < rollout.stages.length - 1 && (- <span class="text-gray-400">→</span>- )}- </>- );- })}- </div>- );- },- },- {- key: "updateTime",- title: t("common.updated-at"),- minWidth: 128,- render: (rollout) => <Timestamp timestamp={rollout.updateTime} />,- },- ];- return columns.filter((column) => !column.hide);- }-);--const scrollX = computed(() => {- return columnList.value.reduce((sum, col) => {- return sum + ((col as { minWidth?: number }).minWidth ?? 100);- }, 0);-});--const rowProps = (rollout: Rollout) => {- return {- style: "cursor: pointer;",- onClick: (e: MouseEvent) => {- const routeParams = {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- params: {- projectId: extractProjectResourceName(rollout.name),- planId: extractPlanUIDFromRolloutName(rollout.name),- },- };- if (e.ctrlKey || e.metaKey) {- const routeData = router.resolve(routeParams);- window.open(routeData.href, "_blank");- } else {- router.push(routeParams);- }- },- };-};-</script>diff --git a/frontend/src/components/RolloutV1/components/Rollout/RolloutView.vue b/frontend/src/components/RolloutV1/components/Rollout/RolloutView.vuedeleted file mode 100644index c464793abc..0000000000--- a/frontend/src/components/RolloutV1/components/Rollout/RolloutView.vue+++ /dev/null@@ -1,185 +0,0 @@-<template>- <div class="rollout-view-v2 w-full min-h-screen bg-gray-50">- <!-- Empty state: no stages created yet -->- <div v-if="!hasStages" class="flex flex-col items-center justify-center py-20 gap-4">- <p class="text-gray-500">{{ $t("rollout.no-tasks-created") }}</p>- <NButton v-if="hasPendingTasks" type="primary" @click="showPreviewDrawer = true">- <template #icon>- <EyeIcon class="w-4 h-4" />- </template>- {{ $t("rollout.pending-tasks-preview.action") }}- </NButton>- </div>-- <!-- Normal view: stages exist -->- <template v-else>- <StageNavigationBar- :selected-stage-id="selectedStage?.name"- :rollout="rollout"- :has-pending-tasks="hasPendingTasks"- @select-stage="handleStageSelect"- @open-preview="showPreviewDrawer = true"- />-- <StageContentView- :selected-stage="selectedStage"- :rollout="rollout"- :is-stage-created="() => true"- @run-stage="handleRunStage"- @create-stage="handleCreateStage"- />- </template>-- <PendingTasksPreviewDrawer- :show="showPreviewDrawer"- :plan="plan"- :rollout="rollout"- :project-name="project.name"- @close="showPreviewDrawer = false"- @created="handleTasksCreated"- />-- <TaskRolloutActionPanel- v-if="showStageActionPanel && stageActionTarget"- :show="showStageActionPanel"- :action="stageAction"- :target="stageActionTarget"- @close="showStageActionPanel = false"- @confirm="handleStageActionConfirmed"- />- </div>-</template>--<script lang="ts" setup>-import { create } from "@bufbuild/protobuf";-import { EyeIcon } from "lucide-vue-next";-import { NButton } from "naive-ui";-import { computed, ref, watch } from "vue";-import { useI18n } from "vue-i18n";-import { useRoute, useRouter } from "vue-router";-import {- emitPlanStatusChanged,- usePlanContextWithRollout,-} from "@/components/Plan/logic";-import { rolloutServiceClientConnect } from "@/connect";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE } from "@/router/dashboard/projectV1";-import { useCurrentProjectV1 } from "@/store";-import { pushNotification } from "@/store/modules/notification";-import type { Stage } from "@/types/proto-es/v1/rollout_service_pb";-import { CreateRolloutRequestSchema } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanNameFromRolloutName,- extractPlanUIDFromRolloutName,- extractProjectResourceName,-} from "@/utils";-import StageContentView from "../Stage/StageContentView.vue";-import StageNavigationBar from "../Stage/StageNavigationBar.vue";-import { useStageSelection } from "../Stage/useStageSelection";-import PendingTasksPreviewDrawer from "../Task/PendingTasksPreviewDrawer.vue";-import type { TargetType } from "../Task/TaskRolloutActionPanel.vue";-import TaskRolloutActionPanel from "../Task/TaskRolloutActionPanel.vue";-import { useExpectedTaskCount } from "../Task/useExpectedTaskCount";-import { useTaskInstancePreload } from "../Task/useTaskInstancePreload";--const route = useRoute();-const router = useRouter();-const { t } = useI18n();-const { project } = useCurrentProjectV1();-const { rollout, plan, events } = usePlanContextWithRollout();--const routeStageId = computed(() => route.params.stageId as string | undefined);--const { selectedStage } = useStageSelection(- computed(() => rollout.value.stages),- routeStageId,- rollout-);--useTaskInstancePreload(() =>- selectedStage.value ? [selectedStage.value] : []-);--const hasStages = computed(() => rollout.value.stages.length > 0);-const { expectedTaskCount } = useExpectedTaskCount(plan);-const hasPendingTasks = computed(() => {- const actualCount = rollout.value.stages.flatMap((s) => s.tasks).length;- return expectedTaskCount.value > actualCount;-});--const showPreviewDrawer = ref(false);-const showStageActionPanel = ref(false);-const stageAction = ref<"RUN" | "SKIP" | "CANCEL">("RUN");-const stageActionTarget = ref<TargetType | null>(null);--watch(- () => [selectedStage.value, routeStageId.value] as const,- ([stage, currentRouteStageId]) => {- if (stage && !currentRouteStageId) {- const stageId = stage.name.split("/").pop();- const planId = extractPlanUIDFromRolloutName(rollout.value.name);- router.replace({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: extractProjectResourceName(project.value.name),- planId: planId || "_",- stageId: stageId || "_",- },- });- }- },- { immediate: true }-);--const handleStageSelect = (stage: Stage) => {- const stageId = stage.name.split("/").pop();- const planId = extractPlanUIDFromRolloutName(rollout.value.name);- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: extractProjectResourceName(project.value.name),- planId: planId || "_",- stageId: stageId || "_",- },- });-};--const handleRunStage = (stage: Stage) => {- stageAction.value = "RUN";- stageActionTarget.value = { type: "tasks", stage };- showStageActionPanel.value = true;-};--const handleCreateStage = async (stage: Stage) => {- try {- const request = create(CreateRolloutRequestSchema, {- parent: extractPlanNameFromRolloutName(rollout.value.name),- target: stage.environment,- });- await rolloutServiceClientConnect.createRollout(request);- pushNotification({- module: "bytebase",- style: "SUCCESS",- title: t("common.success"),- description: t("common.created"),- });- events.emit("status-changed", { eager: true });- } catch (error) {- pushNotification({- module: "bytebase",- style: "CRITICAL",- title: t("common.error"),- description: String(error),- });- }-};--const handleStageActionConfirmed = () => {- emitPlanStatusChanged(events, { refreshMode: "fast-follow" });- showStageActionPanel.value = false;- stageActionTarget.value = null;-};--const handleTasksCreated = () => {- events.emit("status-changed", { eager: true });-};-</script>diff --git a/frontend/src/components/RolloutV1/components/Stage/StageContentSidebar.vue b/frontend/src/components/RolloutV1/components/Stage/StageContentSidebar.vueindex a663c55918..0acb4aac26 100644--- a/frontend/src/components/RolloutV1/components/Stage/StageContentSidebar.vue+++ b/frontend/src/components/RolloutV1/components/Stage/StageContentSidebar.vue@@ -1,74 +1,21 @@<template>- <!-- Desktop: Sticky sidebar -->- <div- v-if="isWideScreen"- class="shrink-0 pr-4 self-start sticky top-0 w-72 xl:w-80"- >- <!-- Rollback action at top -->- <StageTaskRunsRollback class="px-3 pt-1 pb-2" :stage="stage" />- <!-- Run history section with border -->- <div class="border rounded-lg">- <StageTimeline- :stage="stage"- :task-runs="taskRuns"- mode="sidebar"- />- </div>+ <div class="w-full px-4 py-2">+ <StageTaskRunsRollback class="pb-2" :stage="stage" />+ <StageTimeline+ :stage="stage"+ :task-runs="taskRuns"+ mode="inline"+ /></div>-- <!-- Mobile: Drawer trigger button -->- <template v-else>- <NButton- size="small"- quaternary- class="!px-2"- @click="showDrawer = true"- >- <template #icon>- <MenuIcon :size="16" />- </template>- </NButton>-- <!-- Mobile drawer -->- <Drawer v-model:show="showDrawer" placement="right">- <DrawerContent :title="environment?.title" style="width: 20rem">- <!-- Rollback action at top -->- <StageTaskRunsRollback class="pb-3" :stage="stage" />- <StageTimeline- :stage="stage"- :task-runs="taskRuns"- mode="drawer"- />- </DrawerContent>- </Drawer>- </template></template><script lang="ts" setup>-import { useWindowSize } from "@vueuse/core";-import { MenuIcon } from "lucide-vue-next";-import { NButton } from "naive-ui";-import { computed, ref } from "vue";-import { Drawer, DrawerContent } from "@/components/v2";-import { useEnvironmentV1Store } from "@/store";import type { Stage, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";import StageTaskRunsRollback from "./StageTaskRunsRollback.vue";import StageTimeline from "./StageTimeline.vue";-const props = defineProps<{+defineProps<{stage: Stage | null | undefined;taskRuns: TaskRun[];}>();--const environmentStore = useEnvironmentV1Store();-const { width: windowWidth } = useWindowSize();-const isWideScreen = computed(() => windowWidth.value >= 768);-const showDrawer = ref(false);--const environment = computed(() => {- if (!props.stage) {- return null;- }- return environmentStore.getEnvironmentByName(props.stage.environment);-});</script>diff --git a/frontend/src/components/RolloutV1/components/Stage/StageContentView.vue b/frontend/src/components/RolloutV1/components/Stage/StageContentView.vueindex c3cad0eea8..c5302973d6 100644--- a/frontend/src/components/RolloutV1/components/Stage/StageContentView.vue+++ b/frontend/src/components/RolloutV1/components/Stage/StageContentView.vue@@ -41,31 +41,21 @@</template>{{ $t("rollout.stage.confirm-create") }}</NPopconfirm>- <!-- Mobile: Timeline drawer trigger (rightmost) -->- <StageContentSidebar- v-if="!isWideScreen && isStageCreated(selectedStage)"- :stage="selectedStage"- :task-runs="taskRuns"- /></div></div></div>- <!-- Main content area: responsive layout -->- <div class="flex flex-row">- <!-- Task list content -->- <div class="flex-1 min-w-0">- <TaskList- :stage="selectedStage"- :rollout="rollout"- :filter-statuses="filterStatuses"- :readonly="!isStageCreated(selectedStage)"- />- </div>+ <!-- Main content area -->+ <div class="flex flex-col">+ <TaskList+ :stage="selectedStage"+ :rollout="rollout"+ :filter-statuses="filterStatuses"+ :readonly="!isStageCreated(selectedStage)"+ />- <!-- Desktop: Timeline sidebar --><StageContentSidebar- v-if="isWideScreen && isStageCreated(selectedStage)"+ v-if="isStageCreated(selectedStage)":stage="selectedStage":task-runs="taskRuns"/>@@ -80,16 +70,19 @@</template><script lang="ts" setup>-import { useWindowSize } from "@vueuse/core";import { PlayIcon, PlusIcon } from "lucide-vue-next";import { NButton, NPopconfirm } from "naive-ui";-import { computed, ref } from "vue";+import { computed, ref, watch } from "vue";import { usePlanContextWithRollout } from "@/components/Plan/logic";import { RUNNABLE_TASK_STATUSES } from "@/components/RolloutV1/constants/task";import type { Rollout, Stage } from "@/types/proto-es/v1/rollout_service_pb";import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";import TaskFilter from "../Task/TaskFilter.vue";import TaskList from "../Task/TaskList.vue";+import {+ canRolloutTasks,+ preloadRolloutPermissionContext,+} from "../Task/taskPermissions";import StageContentSidebar from "./StageContentSidebar.vue";const props = defineProps<{@@ -104,19 +97,44 @@ defineEmits<{}>();const filterStatuses = ref<Task_Status[]>([]);+const rolloutPermissionReady = ref(false);-// Responsive layout: sidebar on wide screen (>= 768px), drawer on narrow-const { width: windowWidth } = useWindowSize();-const isWideScreen = computed(() => windowWidth.value >= 768);+const { issue, taskRuns } = usePlanContextWithRollout();-const { taskRuns } = usePlanContextWithRollout();+watch(+ () => props.selectedStage?.tasks.map((task) => task.name) ?? [],+ async () => {+ if (!props.selectedStage || !props.isStageCreated(props.selectedStage)) {+ rolloutPermissionReady.value = true;+ return;+ }+ rolloutPermissionReady.value = false;+ await preloadRolloutPermissionContext(+ props.selectedStage.tasks,+ props.selectedStage.environment+ );+ rolloutPermissionReady.value = true;+ },+ { immediate: true }+);const canRunStage = computed(() => {- if (!props.selectedStage || !props.isStageCreated(props.selectedStage)) {+ if (+ !rolloutPermissionReady.value ||+ !props.selectedStage ||+ !props.isStageCreated(props.selectedStage)+ ) {return false;}- return props.selectedStage.tasks.some((task) =>- RUNNABLE_TASK_STATUSES.includes(task.status)+ return (+ props.selectedStage.tasks.some((task) =>+ RUNNABLE_TASK_STATUSES.includes(task.status)+ ) &&+ canRolloutTasks(+ props.selectedStage.tasks,+ issue.value,+ props.selectedStage.environment+ ));});diff --git a/frontend/src/components/RolloutV1/components/Stage/StageNavigationBar.vue b/frontend/src/components/RolloutV1/components/Stage/StageNavigationBar.vueindex 99013e379b..1e476aa112 100644--- a/frontend/src/components/RolloutV1/components/Stage/StageNavigationBar.vue+++ b/frontend/src/components/RolloutV1/components/Stage/StageNavigationBar.vue@@ -8,8 +8,8 @@class="relative px-4 py-2 transition-all border rounded-t-lg cursor-pointer":class="[selectedStageId === stage.name- ? 'bg-gray-50 border-gray-200 border-b-transparent'- : 'bg-white hover:bg-gray-50 border-transparent border-b-gray-200',+ ? 'bg-white border-gray-200 border-b-transparent'+ : 'hover:bg-gray-50 border-transparent border-b-gray-200',]"@click="$emit('select-stage', stage)">diff --git a/frontend/src/components/RolloutV1/components/Stage/StageTimeline.vue b/frontend/src/components/RolloutV1/components/Stage/StageTimeline.vueindex f41ca4c717..d4cc2d33e9 100644--- a/frontend/src/components/RolloutV1/components/Stage/StageTimeline.vue+++ b/frontend/src/components/RolloutV1/components/Stage/StageTimeline.vue@@ -12,8 +12,52 @@</div></div>- <!-- Timeline entries -->+ <!-- Inline mode: flat single-line rows -->+ <template v-if="isInlineMode">+ <div v-if="isLoading" class="py-4 flex justify-center">+ <BBSpin />+ </div>+ <div+ v-else-if="stageTaskRuns.length === 0"+ class="py-2 text-sm text-gray-500"+ >+ {{ $t("common.no-data") }}+ </div>+ <div v-else class="flex flex-col">+ <div+ v-for="taskRun in displayedTaskRuns"+ :key="taskRun.name"+ class="flex items-center gap-2 py-1.5 text-sm cursor-pointer hover:bg-gray-50 rounded"+ @click="handleClickTarget(taskRun)"+ >+ <TaskStatus+ :status="mapTaskRunStatusToTaskStatus(taskRun.status)"+ size="small"+ :disabled="true"+ class="shrink-0"+ />+ <span class="text-xs text-gray-400 shrink-0 flex items-center gap-1">+ <TimestampDisplay+ :timestamp="taskRun.updateTime"+ custom-class="!text-xs !text-gray-400"+ />+ <template v-if="getTaskRunCreatorDisplay(taskRun)">+ · {{ getTaskRunCreatorDisplay(taskRun)?.title }}+ </template>+ <template v-if="getTaskRunDuration(taskRun)">+ · {{ getTaskRunDuration(taskRun) }}+ </template>+ </span>+ <span class="truncate text-gray-600">+ {{ getTaskTargetDisplay(taskRun).fullPath }}+ </span>+ </div>+ </div>+ </template>++ <!-- Timeline mode (sidebar / drawer) --><div+ v-elseclass="overflow-y-auto pt-1 pb-3":class="isSidebarMode ? 'px-3 max-h-[calc(100vh-300px)]' : 'px-1'">@@ -181,7 +225,8 @@ const props = withDefaults(taskRuns: TaskRun[];// "sidebar" - sticky sidebar on desktop with padding and max-height// "drawer" - inside a drawer with minimal padding for drawer's own spacing- mode?: "sidebar" | "drawer";+ // "inline" - flat single-line rows, no timeline chrome+ mode?: "sidebar" | "drawer" | "inline";}>(),{mode: "sidebar",@@ -190,6 +235,7 @@ const props = withDefaults(// Mode-based stylingconst isSidebarMode = computed(() => props.mode === "sidebar");+const isInlineMode = computed(() => props.mode === "inline");const { project } = useCurrentProjectV1();const userStore = useUserStore();diff --git a/frontend/src/components/RolloutV1/components/Task/TaskItem.vue b/frontend/src/components/RolloutV1/components/Task/TaskItem.vueindex fa61ed2404..bd624ddb44 100644--- a/frontend/src/components/RolloutV1/components/Task/TaskItem.vue+++ b/frontend/src/components/RolloutV1/components/Task/TaskItem.vue@@ -1,9 +1,6 @@<template><div- class="collapsible-task-item relative bg-white border border-gray-300 rounded-lg transition-all group"- :class="[- isExpanded ? 'shadow-sm' : 'hover:shadow-sm',- ]"+ class="collapsible-task-item relative bg-white border rounded-lg transition-all group"><!-- Task content --><div class="w-full" :class="isExpanded ? 'py-4 pl-3 pr-4 space-y-3' : 'py-2.5 pl-3 pr-4'">@@ -15,8 +12,8 @@<div class="flex items-center gap-x-2 flex-1 min-w-0"><!-- Inline checkbox - always visible like Gmail/GitHub --><NCheckbox- v-if="isSelectable":checked="isSelected"+ :disabled="!isSelectable"class="shrink-0"@click.stop@update:checked="emit('toggle-select')"@@ -25,6 +22,8 @@<RouterLinkv-if="!readonly":to="taskDetailRoute"+ active-class=""+ exact-active-class=""class="shrink-0 hover:opacity-80 transition-opacity"><DatabaseDisplay@@ -154,6 +153,8 @@<RouterLinkv-if="!readonly":to="taskDetailRoute"+ active-class=""+ exact-active-class=""><NButton text icon-placement="right" size="tiny" type="info"><template #icon>@@ -236,18 +237,10 @@ import Timestamp from "@/components/misc/Timestamp.vue";import { usePlanContextWithRollout } from "@/components/Plan";import DatabaseDisplay from "@/components/Plan/components/common/DatabaseDisplay.vue";import { emitPlanStatusChanged } from "@/components/Plan/logic";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";+import { buildTaskDetailRoute } from "@/router/dashboard/projectV1RouteHelpers";import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- extractStageNameFromTaskName,- extractStageUID,- extractTaskUID,- isReleaseBasedTask,- releaseNameOfTaskV1,-} from "@/utils";+import { isReleaseBasedTask, releaseNameOfTaskV1 } from "@/utils";import ReleaseInfoCard from "../Rollout/ReleaseInfoCard.vue";import { useTaskRunsForTask } from "../shared/useTaskRunsForTask";import { useTaskRunLogSummary } from "../TaskRun/useTaskRunLogSummary";@@ -306,23 +299,7 @@ const handleActionConfirm = () => {emitPlanStatusChanged(events, { refreshMode: "fast-follow" });};-const taskDetailRoute = computed(() => {- const projectName = extractProjectResourceName(props.task.name);- const planId = extractPlanUIDFromRolloutName(props.task.name);- const stageName = extractStageNameFromTaskName(props.task.name);- const stageId = extractStageUID(stageName);- const taskId = extractTaskUID(props.task.name);-- return {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- params: {- projectId: projectName,- planId: planId || "-",- stageId: stageId || "-",- taskId: taskId || "-",- },- };-});+const taskDetailRoute = computed(() => buildTaskDetailRoute(props.task.name));const isReleaseTask = computed(() => isReleaseBasedTask(props.task));diff --git a/frontend/src/components/RolloutV1/components/Task/TaskList.vue b/frontend/src/components/RolloutV1/components/Task/TaskList.vueindex 8bf0a615b5..c05c04fb17 100644--- a/frontend/src/components/RolloutV1/components/Task/TaskList.vue+++ b/frontend/src/components/RolloutV1/components/Task/TaskList.vue@@ -33,20 +33,23 @@<!-- Show More button --><divv-if="hasMoreTasks"- class="flex justify-center"+ class="flex justify-start">- <button- class="px-4 py-2 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors"+ <NButton+ quaternary+ type="primary"+ size="tiny"@click="loadMoreTasks">{{ $t("common.show-more") }} ({{ remainingTasksCount }} {{ $t("common.remaining") }})- </button>+ </NButton></div></div></div></template><script lang="ts" setup>+import { NButton } from "naive-ui";import { computed, ref, watch } from "vue";import {emitPlanStatusChanged,diff --git a/frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue b/frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vueindex 88a12be4a9..351b917b34 100644--- a/frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue+++ b/frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue@@ -2,7 +2,7 @@<CommonDrawer:show="show":title="title"- :loading="loading"+ :loading="loading || permissionLoading"@show="resetState"@close="$emit('close')">@@ -165,7 +165,7 @@<NTooltip :disabled="validationErrors.length === 0" placement="top"><template #trigger><NButton- :disabled="validationErrors.length > 0"+ :disabled="permissionLoading || validationErrors.length > 0"type="primary"@click="handleConfirm">@@ -231,7 +231,10 @@ import CommonDrawer from "../Rollout/CommonDrawer.vue";import ErrorList from "../Rollout/ErrorList.vue";import TaskDatabaseName from "./TaskDatabaseName.vue";import TaskStatus from "./TaskStatus.vue";-import { canRolloutTasks } from "./taskPermissions";+import {+ canRolloutTasks,+ preloadRolloutPermissionContext,+} from "./taskPermissions";// 1 hour default delay for scheduled tasksconst DEFAULT_RUN_DELAY_MS = 60 * 60 * 1000;@@ -256,6 +259,7 @@ const environmentStore = useEnvironmentV1Store();// Stateconst loading = ref(false);+const permissionLoading = ref(false);const comment = ref("");const runTimeInMS = ref<number | undefined>(undefined);const skipPriorBackup = ref(false);@@ -386,10 +390,19 @@ const validationErrors = computed(() => {// Cache permission check - only update when panel openswatch(() => props.show,- (show) => {+ async (show) => {if (show) {const tasks = props.target.tasks ?? props.target.stage?.tasks ?? [];- canRolloutPermission.value = canRolloutTasks(tasks, issue.value);+ const environment = props.target.stage?.environment;+ permissionLoading.value = true;+ canRolloutPermission.value = false;+ await preloadRolloutPermissionContext(tasks, environment);+ canRolloutPermission.value = canRolloutTasks(+ tasks,+ issue.value,+ environment+ );+ permissionLoading.value = false;}},{ immediate: true }diff --git a/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vue b/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vueindex ac5ddeab74..191cacdbd7 100644--- a/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vue+++ b/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vue@@ -1,7 +1,7 @@<template><div><div- v-if="!readonly && hasActions"+ v-if="hasActions"class="flex flex-row justify-end items-center gap-x-2"><NButton v-if="primaryAction" :size="size" @click="handlePrimaryAction">@@ -38,7 +38,6 @@ import { EllipsisVerticalIcon } from "lucide-vue-next";import { NButton, NDropdown } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";-import { usePlanContextWithRollout } from "@/components/Plan/logic";import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";@@ -60,7 +59,6 @@ const emit = defineEmits<{}>();const { t } = useI18n();-const { readonly } = usePlanContextWithRollout();const {canRun,diff --git a/frontend/src/components/RolloutV1/components/Task/TaskTable.vue b/frontend/src/components/RolloutV1/components/Task/TaskTable.vueindex 7baf1fa5ae..20e31dc29f 100644--- a/frontend/src/components/RolloutV1/components/Task/TaskTable.vue+++ b/frontend/src/components/RolloutV1/components/Task/TaskTable.vue@@ -28,17 +28,12 @@ import { useRouter } from "vue-router";import Timestamp from "@/components/misc/Timestamp.vue";import DatabaseDisplay from "@/components/Plan/components/common/DatabaseDisplay.vue";import { usePlanContextWithRollout } from "@/components/Plan/logic";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";+import { buildTaskDetailRoute } from "@/router/dashboard/projectV1RouteHelpers";import { useDatabaseV1Store } from "@/store";import { getTimeForPbTimestampProtoEs } from "@/types";import type { Task } from "@/types/proto-es/v1/rollout_service_pb";import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- extractStageNameFromTaskName,- humanizeTs,-} from "@/utils";+import { humanizeTs } from "@/utils";import TaskStatus from "./TaskStatus.vue";const semanticTaskType = (type: Task_Type) => {@@ -76,7 +71,7 @@ const emit = defineEmits<{const { t } = useI18n();const router = useRouter();const databaseStore = useDatabaseV1Store();-const { rollout, taskRuns } = usePlanContextWithRollout();+const { taskRuns } = usePlanContextWithRollout();const taskList = computed(() => {if (props.taskStatusFilter.length === 0) {@@ -99,22 +94,9 @@ const handleSelectionChange = (selectedKeys: Array<string | number>) => {emit("update:selected-tasks", selectedTasks);};-const stages = computed(() => rollout.value.stages);-// Virtual scroll configurationconst virtualScrollEnabled = computed(() => taskList.value.length > 100);-// Memoized stage lookup for better performance-const stageMap = computed(() => {- const map = new Map<string, (typeof stages.value)[0]>();- stages.value.forEach((stage) => {- stage.tasks.forEach((task) => {- map.set(task.name, stage);- });- });- return map;-});-const prepareDatabases = async () => {if (taskList.value.length > 0) {try {@@ -136,32 +118,9 @@ watch({ immediate: true });-// Helper function to extract IDs from task and stage names-const getTaskRouteParams = (task: Task) => {- const stage = stageMap.value.get(task.name);- if (!stage) return null;-- const planId = extractPlanUIDFromRolloutName(rollout.value.name);- const stageId = stage.name.split("/").pop();- const taskId = task.name.split("/").pop();-- return { planId, stageId, taskId };-};-// Row click handlerconst handleRowClick = (task: Task) => {- const params = getTaskRouteParams(task);- if (params) {- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- params: {- projectId: extractProjectResourceName(task.name),- planId: extractPlanUIDFromRolloutName(task.name),- stageId: extractStageNameFromTaskName(task.name),- taskId: params.taskId,- },- });- }+ router.push(buildTaskDetailRoute(task.name));};// Row props for click handlingdiff --git a/frontend/src/components/RolloutV1/components/Task/TaskToolbar.vue b/frontend/src/components/RolloutV1/components/Task/TaskToolbar.vueindex 9c14fdee78..457b0a6732 100644--- a/frontend/src/components/RolloutV1/components/Task/TaskToolbar.vue+++ b/frontend/src/components/RolloutV1/components/Task/TaskToolbar.vue@@ -101,7 +101,7 @@<script lang="ts" setup>import { PlayIcon, SkipForwardIcon, XIcon } from "lucide-vue-next";import { NButton, NCheckbox, NTooltip } from "naive-ui";-import { computed, ref } from "vue";+import { computed, ref, watch } from "vue";import { useI18n } from "vue-i18n";import { usePlanContext } from "@/components/Plan/logic";import {@@ -114,7 +114,10 @@ import { Issue_Type } from "@/types/proto-es/v1/issue_service_pb";import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";import type { TaskAction } from "../../types";import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";-import { canRolloutTasks } from "./taskPermissions";+import {+ canRolloutTasks,+ preloadRolloutPermissionContext,+} from "./taskPermissions";const props = defineProps<{selectedTasks: Task[];@@ -135,6 +138,20 @@ const currentUser = useCurrentUserV1();const showActionPanel = ref(false);const pendingAction = ref<TaskAction | null>(null);+const rolloutPermissionReady = ref(false);++watch(+ () => props.allTasks.map((task) => task.name),+ async () => {+ rolloutPermissionReady.value = false;+ await preloadRolloutPermissionContext(+ props.allTasks,+ props.stage.environment+ );+ rolloutPermissionReady.value = true;+ },+ { immediate: true }+);const selectableTasks = computed(() => {return props.allTasks.filter(props.isTaskSelectable);@@ -174,7 +191,12 @@ const getSelectAllTooltip = () => {};const canPerformTaskActions = computed(() => {- return canRolloutTasks(props.selectedTasks, issue.value);+ if (!rolloutPermissionReady.value) return false;+ return canRolloutTasks(+ props.selectedTasks,+ issue.value,+ props.stage.environment+ );});const hasRunnableTasks = computed(() => {@@ -202,6 +224,9 @@ const getBaseDisabledTooltip = (): string => {if (props.selectedTasks.length === 0) {return t("task.no-tasks-selected");}+ if (!rolloutPermissionReady.value) {+ return "";+ }if (!canPerformTaskActions.value) {// Special message for data export issues when user is not the creatorif (@@ -245,6 +270,7 @@ const getCancelTooltip = () =>const isRunDisabled = computed(() => {return (props.selectedTasks.length === 0 ||+ !rolloutPermissionReady.value ||!hasRunnableTasks.value ||!canPerformTaskActions.value);@@ -253,6 +279,7 @@ const isRunDisabled = computed(() => {const isSkipDisabled = computed(() => {return (props.selectedTasks.length === 0 ||+ !rolloutPermissionReady.value ||!hasSkippableTasks.value ||!canPerformTaskActions.value);@@ -261,6 +288,7 @@ const isSkipDisabled = computed(() => {const isCancelDisabled = computed(() => {return (props.selectedTasks.length === 0 ||+ !rolloutPermissionReady.value ||!hasCancellableTasks.value ||!canPerformTaskActions.value);diff --git a/frontend/src/components/RolloutV1/components/Task/taskPermissions.ts b/frontend/src/components/RolloutV1/components/Task/taskPermissions.tsindex 89648407e4..858372345d 100644--- a/frontend/src/components/RolloutV1/components/Task/taskPermissions.ts+++ b/frontend/src/components/RolloutV1/components/Task/taskPermissions.ts@@ -1,12 +1,10 @@import {useCurrentProjectV1,useCurrentUserV1,- useDatabaseV1Store,usePolicyV1Store,useProjectIamPolicyStore,} from "@/store";import { roleNamePrefix } from "@/store/modules/v1/common";-import { isValidDatabaseName } from "@/types";import type { Issue } from "@/types/proto-es/v1/issue_service_pb";import { Issue_Type } from "@/types/proto-es/v1/issue_service_pb";import { PolicyType } from "@/types/proto-es/v1/org_policy_service_pb";@@ -17,6 +15,13 @@ import {memberMapToRolesInProjectIAM,} from "@/utils";+type RolloutPolicyAccessState = "loaded" | "unavailable";++const rolloutPolicyAccessStateByEnvironment = new Map<+ string,+ RolloutPolicyAccessState+>();+/*** Check if the current user can rollout the given tasks* - For data export issues: only the issue creator can rollout@@ -26,7 +31,11 @@ import {* @param issue - Optional issue to check for data export special handling* @returns true if user can rollout, false otherwise*/-export const canRolloutTasks = (tasks: Task[], issue?: Issue): boolean => {+export const canRolloutTasks = (+ tasks: Task[],+ issue?: Issue,+ environment?: string+): boolean => {if (tasks.length === 0) {return false;}@@ -50,26 +59,34 @@ export const canRolloutTasks = (tasks: Task[], issue?: Issue): boolean => {// Second check: if no permission, check if user matches environment rollout policy rolesconst projectIamPolicyStore = useProjectIamPolicyStore();- const databaseStore = useDatabaseV1Store();const policyStore = usePolicyV1Store();+ const projectIamPolicy = projectIamPolicyStore.getProjectIamPolicy(+ project.value.name+ );+ const memberRoles = memberMapToRolesInProjectIAM(projectIamPolicy);+ const userRoles = memberRoles.get(currentUser.value.name);- return tasks.every((task) => {- // Get database from task target- const database = databaseStore.getDatabaseByName(task.target);- // If database is not in cache or is unknown, skip environment policy check- // and allow rollout (user already lacks bb.taskRuns.create, so this is a fallback).- if (!isValidDatabaseName(database.name) || !database.effectiveEnvironment) {- return true;+ return tasks.every(() => {+ if (!environment) {+ return false;}- // Get rollout policy for the environment- // Note: Policies are prefetched by IssueLayout.vue and RolloutLayout.vue+ // Get rollout policy for the environment.+ // Policy data is expected to already be prefetched by the surrounding page.const rolloutPolicy = policyStore.getPolicyByParentAndType({- parentPath: database.effectiveEnvironment,+ parentPath: environment,policyType: PolicyType.ROLLOUT_POLICY,});- // If no rollout policy is defined, allow rollout (permission check already passed)+ // If policy data is not in cache yet, fail closed until the surrounding view+ // has preloaded the relevant rollout policies.+ if (!rolloutPolicy) {+ return (+ rolloutPolicyAccessStateByEnvironment.get(environment) === "unavailable"+ );+ }++ // If no rollout policy is defined, allow rollout.if (!rolloutPolicy?.policy ||rolloutPolicy.policy.case !== "rolloutPolicy"@@ -81,19 +98,47 @@ export const canRolloutTasks = (tasks: Task[], issue?: Issue): boolean => {// Check if current user has any of the required roles in the rollout policyfor (const requiredRole of policy.roles) {- if (requiredRole.startsWith(roleNamePrefix)) {- // Check if user has this role (includes both project and workspace level roles)- const projectIamPolicy = projectIamPolicyStore.getProjectIamPolicy(- project.value.name- );- const memberRoles = memberMapToRolesInProjectIAM(projectIamPolicy);- const userRoles = memberRoles.get(currentUser.value.name);- if (userRoles?.has(requiredRole)) {- return true;- }+ if (+ requiredRole.startsWith(roleNamePrefix) &&+ userRoles?.has(requiredRole)+ ) {+ return true;}}return false;});};++export const preloadRolloutPermissionContext = async (+ tasks: Task[],+ environment?: string+) => {+ if (tasks.length === 0 || !environment) return;++ const { project } = useCurrentProjectV1();+ const policyStore = usePolicyV1Store();+ const projectIamPolicyStore = useProjectIamPolicyStore();++ const environmentNames = [environment];++ await Promise.allSettled([+ projectIamPolicyStore.getOrFetchProjectIamPolicy(project.value.name),+ ]);++ const policyResults = await Promise.allSettled(+ environmentNames.map((environmentName) =>+ policyStore.getOrFetchPolicyByParentAndType({+ parentPath: environmentName,+ policyType: PolicyType.ROLLOUT_POLICY,+ })+ )+ );++ policyResults.forEach((result, index) => {+ rolloutPolicyAccessStateByEnvironment.set(+ environmentNames[index],+ result.status === "fulfilled" ? "loaded" : "unavailable"+ );+ });+};diff --git a/frontend/src/components/RolloutV1/components/Task/useTaskActions.ts b/frontend/src/components/RolloutV1/components/Task/useTaskActions.tsindex f035f31a40..31102c33ed 100644--- a/frontend/src/components/RolloutV1/components/Task/useTaskActions.ts+++ b/frontend/src/components/RolloutV1/components/Task/useTaskActions.ts@@ -1,12 +1,16 @@import type { ComputedRef, Ref } from "vue";import { computed, ref, watch } from "vue";+import { usePlanContext } from "@/components/Plan/logic";import {CANCELABLE_TASK_STATUSES,RUNNABLE_TASK_STATUSES,} from "@/components/RolloutV1/constants/task";import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";import type { TaskAction } from "../../types";-import { canRolloutTasks } from "./taskPermissions";+import {+ canRolloutTasks,+ preloadRolloutPermissionContext,+} from "./taskPermissions";export interface TaskActionTarget {type: "tasks";@@ -34,14 +38,22 @@ export const useTaskActions = (): UseTaskActionsReturn => {const showActionPanel = ref(false);const selectedAction = ref<TaskAction>();+ const { issue } = usePlanContext();// Cache permission check - only re-evaluate when task name changes// This prevents flickering during poller refetchesconst canPerformActions = ref(false);watch(() => task().name,- () => {- canPerformActions.value = canRolloutTasks([task()]);+ async () => {+ canPerformActions.value = false;+ const environment = stage()?.environment;+ await preloadRolloutPermissionContext([task()], environment);+ canPerformActions.value = canRolloutTasks(+ [task()],+ issue.value,+ environment+ );},{ immediate: true });diff --git a/frontend/src/components/RolloutV1/components/Task/useTaskNavigation.ts b/frontend/src/components/RolloutV1/components/Task/useTaskNavigation.tsindex c2a6a2755b..15dac8f87c 100644--- a/frontend/src/components/RolloutV1/components/Task/useTaskNavigation.ts+++ b/frontend/src/components/RolloutV1/components/Task/useTaskNavigation.ts@@ -1,38 +1,12 @@import { useRouter } from "vue-router";-import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";+import { buildTaskDetailRoute } from "@/router/dashboard/projectV1RouteHelpers";import type { Task } from "@/types/proto-es/v1/rollout_service_pb";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- extractStageNameFromTaskName,- extractStageUID,- extractTaskUID,-} from "@/utils";export const useTaskNavigation = () => {const router = useRouter();const navigateToTaskDetail = (task: Task) => {- // Task name format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}- // Use utility functions for consistent parsing- const projectName = extractProjectResourceName(task.name);- const planId = extractPlanUIDFromRolloutName(task.name);-- // Extract stage ID from the task's name (Task → Stage relationship)- const stageName = extractStageNameFromTaskName(task.name);- const stageId = extractStageUID(stageName);-- const taskId = extractTaskUID(task.name);-- router.push({- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- params: {- projectId: projectName,- planId: planId || "-",- stageId: stageId || "-",- taskId: taskId || "-",- },- });+ router.push(buildTaskDetailRoute(task.name));};return {diff --git a/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.ts b/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.tsindex 3c069af8b6..d2976ddb64 100644--- a/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.ts+++ b/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.ts@@ -1,36 +1,15 @@import type { RouteLocationRaw } from "vue-router";import {- PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,-} from "@/router/dashboard/projectV1";-import {- extractPlanUIDFromRolloutName,- extractProjectResourceName,- extractStageNameFromTaskName,- extractStageUID,- extractTaskUID,-} from "@/utils";+ buildStageRoute as buildPlanDetailStageRoute,+ buildTaskDetailRoute as buildPlanDetailTaskRoute,+} from "@/router/dashboard/projectV1RouteHelpers";/*** Build a route location for the task detail view.* Task name format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}*/export const buildTaskDetailRoute = (taskName: string): RouteLocationRaw => {- const projectName = extractProjectResourceName(taskName);- const planId = extractPlanUIDFromRolloutName(taskName);- const stageName = extractStageNameFromTaskName(taskName);- const stageId = extractStageUID(stageName);- const taskId = extractTaskUID(taskName);-- return {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- params: {- projectId: projectName,- planId: planId || "-",- stageId: stageId || "-",- taskId: taskId || "-",- },- };+ return buildPlanDetailTaskRoute(taskName);};/**@@ -38,16 +17,5 @@ export const buildTaskDetailRoute = (taskName: string): RouteLocationRaw => {* Stage name format: projects/{project}/plans/{plan}/rollout/stages/{stage}*/export const buildStageRoute = (stageName: string): RouteLocationRaw => {- const projectName = extractProjectResourceName(stageName);- const planId = extractPlanUIDFromRolloutName(stageName);- const stageId = stageName.split("/").pop();-- return {- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- params: {- projectId: projectName,- planId: planId || "_",- stageId: stageId || "_",- },- };+ return buildPlanDetailStageRoute(stageName);};diff --git a/frontend/src/components/RolloutV1/index.ts b/frontend/src/components/RolloutV1/index.tsindex a465673543..43ce2899f9 100644--- a/frontend/src/components/RolloutV1/index.ts+++ b/frontend/src/components/RolloutV1/index.ts@@ -1,8 +1,3 @@-// Rollout-export { default as RolloutBreadcrumb } from "./components/Rollout/RolloutBreadcrumb.vue";-export { default as RolloutDataTable } from "./components/Rollout/RolloutDataTable.vue";-export { default as RolloutView } from "./components/Rollout/RolloutView.vue";-// Stageexport { default as StageContentView } from "./components/Stage/StageContentView.vue";export { default as StageNavigationBar } from "./components/Stage/StageNavigationBar.vue";diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 0a3c13aff1..07c9c677dd 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -60,6 +60,7 @@"retry": "Retry","skip": "Skip","skipped": "Skipped",+ "bypassed": "Bypassed","dismiss": "Dismiss","allow": "Allow","deny": "Deny",@@ -160,6 +161,8 @@"succeed": "Succeed","success": "Success","failed": "Failed",+ "in-progress": "In Progress",+ "not-started": "Not Started","load-more": "Load more","rows-per-page": "Rows per page","access-denied": "Access denied",@@ -255,6 +258,13 @@"removed": "Removed","submit": "Submit","draft": "Draft",+ "creating": "Creating",+ "deploying": "Deploying",+ "in-review": "In Review",+ "done": "Done",+ "canceled": "canceled",+ "recent": "Recent",+ "and": "and","import": "Import","hard-delete": {"self": "Hard-delete",@@ -265,6 +275,7 @@},"collapse": "Collapse","show-more": "Show more",+ "show-less": "Show less","n-more": "+{n} more","remaining": "remaining","line": "Line",@@ -1112,8 +1123,6 @@"approval-flow": {"self": "Approval flow"},- "force-rollout-hint": "Proceed with manual rollout to override failed checks.",- "checks-block-rollout-hint": "Failed checks are preventing rollout creation. Fix the errors to proceed.","checks-warning-hint": "This plan has failed checks. A manual rollout will be required upon approval.","risk-level": {"self": "Risk level",@@ -1203,9 +1212,34 @@"run": "Run check","navigator": {"changes": "Changes",+ "review": "Review",+ "deploy": "Deploy","checks": "Checks","statement-empty": "Statement is empty"},+ "phase": {+ "review-description": "Submit for review to proceed",+ "deploy-description": "Available when review is approved and checks pass",+ "deploy-description-with-action": "Available when review is approved and checks pass. You can {action} to proceed manually.",+ "create-rollout-action": "create rollout",+ "show-details": "Show details ↓",+ "hide-details": "Hide details ↑"+ },+ "summary": {+ "n-changes": "{n} changes",+ "n-databases": "{n} databases",+ "n-database-groups": "{n} database groups",+ "n-passed": "{n} passed",+ "n-warning": "{n} warning",+ "n-error": "{n} error",+ "n-of-m-approved": "{n} of {m} approved",+ "last-approved-by": "Last approved by {name}",+ "n-of-m-tasks": "{n}/{m} tasks"+ },+ "sidebar": {+ "created-by-at": "Created by {user} · {time}",+ "future-sections-hint": "Review, Labels, Issue link appear after submission"+ },"checks": {"self": "Checks","no-results-match-filters": "No results match your filters",@@ -1274,10 +1308,11 @@},"description": {"placeholder": "Add a description"- }+ },+ "view-discussion": "View discussion",+ "go-to-plan-page": "Go to Plan page"},"rollout": {- "rollouts": "Rollouts","bypass-stage-requirements": "Bypass warnings","task-execution-errors": "Task execution errors","stage": {diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex df8469bbac..e7e9325332 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -53,22 +53,29 @@"canceled": "Cancelado","rejected": "Rechazado","under-review": "En revisión",+ "in-review": "En revisión","approve": "Aprobar","approved": "Aprobado",+ "done": "Hecho","create": "Crear","run": "Ejecutar","retry": "Reintentar","skip": "Saltar","skipped": "Omitido",+ "bypassed": "Omitido","dismiss": "Descartar","allow": "Permitir","deny": "Denegar",+ "and": "y","go-back": "Volver","back": "Volver","next": "Siguiente","edit": "Editar","update": "Actualizar","updated": "Actualizado",+ "deploying": "Desplegando",+ "in-progress": "En progreso",+ "not-started": "No iniciado","visit": "Visitar","role": {"self": "Rol"@@ -258,6 +265,7 @@},"collapse": "Colapsar","show-more": "Mostrar más",+ "show-less": "Mostrar menos","n-more": "+{n} más","remaining": "restante","line": "Línea",@@ -1112,8 +1120,6 @@"approval-flow": {"self": "Flujo de aprobación"},- "force-rollout-hint": "Proceda con el despliegue manual para anular las verificaciones fallidas.",- "checks-block-rollout-hint": "Las verificaciones fallidas impiden la creación del despliegue. Corrija los errores para continuar.","checks-warning-hint": "Este plan tiene verificaciones fallidas. Se requerirá un despliegue manual tras la aprobación.","risk-level": {"self": "Nivel de riesgo",@@ -1203,9 +1209,34 @@"run": "Ejecutar verificación","navigator": {"changes": "Cambios",+ "review": "Revisión",+ "deploy": "Desplegar","checks": "Verificaciones","statement-empty": "La declaración está vacía"},+ "phase": {+ "review-description": "Envíe para revisión para continuar",+ "deploy-description": "Disponible cuando la revisión está aprobada y las comprobaciones pasan",+ "deploy-description-with-action": "Disponible cuando la revisión está aprobada y las comprobaciones pasan. Puede {action} para continuar manualmente.",+ "create-rollout-action": "crear despliegue",+ "show-details": "Mostrar detalles ↓",+ "hide-details": "Ocultar detalles ↑"+ },+ "summary": {+ "n-changes": "{n} cambios",+ "n-databases": "{n} bases de datos",+ "n-database-groups": "{n} grupos de bases de datos",+ "n-passed": "{n} aprobadas",+ "n-warning": "{n} advertencia",+ "n-error": "{n} error",+ "n-of-m-approved": "{n} de {m} aprobadas",+ "last-approved-by": "Última aprobación por {name}",+ "n-of-m-tasks": "{n}/{m} tareas"+ },+ "sidebar": {+ "created-by-at": "Creado por {user} · {time}",+ "future-sections-hint": "Revisión, etiquetas y enlace del issue aparecen después del envío"+ },"checks": {"self": "Verificaciones","no-results-match-filters": "No hay resultados que coincidan con sus filtros",@@ -1274,10 +1305,11 @@},"description": {"placeholder": "Añadir descripción"- }+ },+ "view-discussion": "Ver discusión",+ "go-to-plan-page": "Ir a la página del plan"},"rollout": {- "rollouts": "Despliegues","bypass-stage-requirements": "Advertencias de bypass","task-execution-errors": "Errores de ejecución de tareas","stage": {diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex b7beaf6b31..c71cc16ea8 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -53,22 +53,29 @@"canceled": "キャンセル","rejected": "却下","under-review": "レビュー中",+ "in-review": "レビュー中","approve": "承認する","approved": "承認済み",+ "done": "完了","create": "作成する","run": "実行","retry": "リトライ","skip": "飛び越える","skipped": "スキップ",+ "bypassed": "スキップ済み","dismiss": "閉じる","allow": "許可","deny": "拒否",+ "and": "と","go-back": "戻る","back": "戻る","next": "次のステップ","edit": "編集","update": "更新する","updated": "更新しました",+ "deploying": "デプロイ中",+ "in-progress": "進行中",+ "not-started": "未開始","visit": "アクセス","role": {"self": "ロール"@@ -258,6 +265,7 @@},"collapse": "閉じる","show-more": "もっと見る",+ "show-less": "表示を減らす","n-more": "+{n} もっと","remaining": "残り","line": "行",@@ -1112,8 +1120,6 @@"approval-flow": {"self": "承認の流れ"},- "force-rollout-hint": "手動でロールアウトを作成して、失敗したチェックをオーバーライドしてください。",- "checks-block-rollout-hint": "チェックの失敗によりロールアウトを作成できません。エラーを修正してから続行してください。","checks-warning-hint": "このプランにはチェックエラーがあります。承認後、手動でロールアウトを作成する必要があります。","risk-level": {"self": "リスクレベル",@@ -1203,9 +1209,34 @@"run": "チェックを実行","navigator": {"changes": "変更点",+ "review": "レビュー",+ "deploy": "デプロイ","checks": "チェック","statement-empty": "ステートメントが空です"},+ "phase": {+ "review-description": "続行するにはレビューに提出してください",+ "deploy-description": "レビューが承認され、チェックが通過すると利用可能になります",+ "deploy-description-with-action": "レビューが承認され、チェックが通過すると利用可能になります。手動で進めるには{action}できます。",+ "create-rollout-action": "ロールアウトを作成",+ "show-details": "詳細を表示 ↓",+ "hide-details": "詳細を非表示 ↑"+ },+ "summary": {+ "n-changes": "{n} 件の変更",+ "n-databases": "{n} 個のデータベース",+ "n-database-groups": "{n} 個のデータベースグループ",+ "n-passed": "{n} 件合格",+ "n-warning": "{n} 件の警告",+ "n-error": "{n} 件のエラー",+ "n-of-m-approved": "{m} 件中 {n} 件承認済み",+ "last-approved-by": "{name} が最後に承認",+ "n-of-m-tasks": "{n}/{m} タスク"+ },+ "sidebar": {+ "created-by-at": "{user} が作成 · {time}",+ "future-sections-hint": "レビュー、ラベル、Issue リンクは送信後に表示されます"+ },"checks": {"self": "チェック","no-results-match-filters": "フィルターに一致する結果がありません",@@ -1274,10 +1305,11 @@},"description": {"placeholder": "説明を追加"- }+ },+ "view-discussion": "ディスカッションを表示",+ "go-to-plan-page": "プランページへ移動"},"rollout": {- "rollouts": "ロールアウト","bypass-stage-requirements": "バイパス警告","task-execution-errors": "タスク実行エラー","stage": {diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 5c5b2b7300..4e89d07cfc 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -53,22 +53,29 @@"canceled": "Đã hủy","rejected": "Đã từ chối","under-review": "Đang xem xét",+ "in-review": "Đang xem xét","approve": "Phê duyệt","approved": "Đã phê duyệt",+ "done": "Hoàn tất","create": "Tạo","run": "Chạy","retry": "Thử lại","skip": "Bỏ qua","skipped": "Đã bỏ qua",+ "bypassed": "Đã vượt qua","dismiss": "Loại bỏ","allow": "Cho phép","deny": "Từ chối",+ "and": "và","go-back": "Quay lại","back": "Quay lại","next": "Tiếp theo","edit": "Chỉnh sửa","update": "Cập nhật","updated": "Đã cập nhật",+ "deploying": "Đang triển khai",+ "in-progress": "Đang tiến hành",+ "not-started": "Chưa bắt đầu","visit": "Truy cập","role": {"self": "Vai trò"@@ -258,6 +265,7 @@},"collapse": "Thu gọn","show-more": "Hiển thị thêm",+ "show-less": "Hiển thị ít hơn","n-more": "+{n} nữa","remaining": "còn lại","line": "Dòng",@@ -1112,8 +1120,6 @@"approval-flow": {"self": "Quy trình phê duyệt"},- "force-rollout-hint": "Tiến hành triển khai thủ công để bỏ qua các kiểm tra thất bại.",- "checks-block-rollout-hint": "Kiểm tra thất bại đang ngăn việc tạo triển khai. Hãy sửa lỗi để tiếp tục.","checks-warning-hint": "Kế hoạch này có kiểm tra thất bại. Sẽ cần triển khai thủ công sau khi phê duyệt.","risk-level": {"self": "Mức độ rủi ro",@@ -1203,9 +1209,34 @@"run": "Chạy kiểm tra","navigator": {"changes": "Thay đổi",+ "review": "Xem xét",+ "deploy": "Triển khai","checks": "Kiểm tra","statement-empty": "Câu lệnh trống rỗng"},+ "phase": {+ "review-description": "Gửi để xem xét để tiếp tục",+ "deploy-description": "Có sẵn khi việc xem xét được phê duyệt và kiểm tra đã đạt",+ "deploy-description-with-action": "Có sẵn khi việc xem xét được phê duyệt và kiểm tra đã đạt. Bạn có thể {action} để tiếp tục thủ công.",+ "create-rollout-action": "tạo rollout",+ "show-details": "Hiển thị chi tiết ↓",+ "hide-details": "Ẩn chi tiết ↑"+ },+ "summary": {+ "n-changes": "{n} thay đổi",+ "n-databases": "{n} cơ sở dữ liệu",+ "n-database-groups": "{n} nhóm cơ sở dữ liệu",+ "n-passed": "{n} đã vượt qua",+ "n-warning": "{n} cảnh báo",+ "n-error": "{n} lỗi",+ "n-of-m-approved": "{n} trên {m} đã được phê duyệt",+ "last-approved-by": "Phê duyệt gần nhất bởi {name}",+ "n-of-m-tasks": "{n}/{m} tác vụ"+ },+ "sidebar": {+ "created-by-at": "Tạo bởi {user} · {time}",+ "future-sections-hint": "Xem xét, nhãn và liên kết issue sẽ xuất hiện sau khi gửi"+ },"checks": {"self": "Kiểm tra","no-results-match-filters": "Không có kết quả nào phù hợp với bộ lọc của bạn",@@ -1274,10 +1305,11 @@},"description": {"placeholder": "Thêm mô tả"- }+ },+ "view-discussion": "Xem thảo luận",+ "go-to-plan-page": "Đi tới trang kế hoạch"},"rollout": {- "rollouts": "Triển khai","bypass-stage-requirements": "Bỏ qua cảnh báo","task-execution-errors": "Lỗi thực hiện tác vụ","stage": {diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex ba0ac92c01..884d9afc23 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -60,6 +60,7 @@"retry": "重试","skip": "跳过","skipped": "已跳过",+ "bypassed": "已绕过","dismiss": "关闭","allow": "允许","deny": "拒绝",@@ -69,6 +70,7 @@"edit": "编辑","update": "更新","updated": "已更新",+ "done": "完成","visit": "访问","role": {"self": "角色"@@ -248,6 +250,11 @@"removed": "已移除","submit": "提交","draft": "草稿",+ "deploying": "部署中",+ "in-review": "审批中",+ "in-progress": "进行中",+ "not-started": "未开始",+ "and": "和","import": "导入","hard-delete": {"self": "彻底删除",@@ -258,6 +265,7 @@},"collapse": "收起","show-more": "显示更多",+ "show-less": "显示更少","n-more": "+{n} 更多","remaining": "剩余","line": "行",@@ -1112,8 +1120,6 @@"approval-flow": {"self": "审批流"},- "force-rollout-hint": "手动创建发布以跳过失败的 SQL 检查。",- "checks-block-rollout-hint": "SQL 检查失败导致无法创建发布。请修复错误后再继续。","checks-warning-hint": "此变更计划存在未通过的检查。审批通过后将需要手动创建发布。","risk-level": {"self": "风险等级",@@ -1203,6 +1209,8 @@"run": "运行检查","navigator": {"changes": "变更项",+ "review": "审批",+ "deploy": "部署","checks": "SQL 检查","statement-empty": "变更语句为空"},@@ -1274,10 +1282,34 @@},"description": {"placeholder": "添加描述"+ },+ "view-discussion": "查看讨论",+ "go-to-plan-page": "前往变更计划页",+ "phase": {+ "show-details": "展开详情 ↓",+ "hide-details": "收起详情 ↑",+ "review-description": "提交审批以继续",+ "deploy-description": "审批通过且检查通过后可用",+ "deploy-description-with-action": "审批通过且检查通过后可用。你可以{action}手动推进。",+ "create-rollout-action": "创建发布"+ },+ "summary": {+ "n-changes": "{n} 个变更",+ "n-databases": "{n} 个数据库",+ "n-database-groups": "{n} 个数据库组",+ "n-passed": "{n} 通过",+ "n-warning": "{n} 警告",+ "n-error": "{n} 错误",+ "n-of-m-approved": "{n}/{m} 已审批",+ "last-approved-by": "最后由 {name} 审批",+ "n-of-m-tasks": "{n}/{m} 任务"+ },+ "sidebar": {+ "created-by-at": "由 {user} 创建 · {time}",+ "future-sections-hint": "审批、标签、工单链接将在提交后显示"}},"rollout": {- "rollouts": "发布任务","bypass-stage-requirements": "绕过提醒","task-execution-errors": "任务执行错误","stage": {diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.tsindex 17872377de..81fdb69cc9 100644--- a/frontend/src/router/dashboard/projectV1.ts+++ b/frontend/src/router/dashboard/projectV1.ts@@ -38,42 +38,51 @@ export const PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE = `${PROJECT_V1_ROUTE_PLAN_ROLLexport const PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK = `${PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE}.task`;export const PROJECT_V1_ROUTE_GITOPS = `${PROJECT_V1_ROUTE_DASHBOARD}.gitops`;+const planDetailComponent = () =>+ import("@/components/Plan/components/PlanDetailPage/PlanDetailLayout.vue");++const planDetailMeta: RouteRecordRaw["meta"] = {+ requiredPermissionList: () => [+ "bb.plans.get",+ "bb.planCheckRuns.get",+ "bb.taskRuns.list",+ ],+};++// Plan Detail Page — standalone layout, decoupled from Issue+// All three routes render the same component; route name determines+// whether changes section is auto-expanded and which spec is selected.+const planRoutes: RouteRecordRaw[] = [+ {+ path: "plans/:planId",+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,+ component: planDetailComponent,+ meta: planDetailMeta,+ props: true,+ },+ {+ path: "plans/:planId/specs",+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,+ component: planDetailComponent,+ meta: planDetailMeta,+ props: true,+ },+ {+ path: "plans/:planId/specs/:specId",+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,+ component: planDetailComponent,+ meta: planDetailMeta,+ props: true,+ },+];++// Issue routes — uses IssueLayout (issue-only)const issueRoutes: RouteRecordRaw[] = [{path: "",component: () => import("@/views/project/IssueLayout.vue"),props: true,children: [- {- path: "plans/:planId",- meta: {- requiredPermissionList: () => [- "bb.plans.get",- "bb.planCheckRuns.get",- "bb.taskRuns.list",- ],- },- props: true,- children: [- {- path: "",- name: PROJECT_V1_ROUTE_PLAN_DETAIL,- redirect: {- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,- },- },- {- path: "specs",- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,- component: () => import("@/views/project/PlanSpecsView.vue"),- },- {- path: "specs/:specId",- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,- component: () => import("@/views/project/PlanSpecDetailView.vue"),- },- ],- },{path: "issues/:issueId(\\d+)",name: PROJECT_V1_ROUTE_ISSUE_DETAIL,@@ -87,39 +96,38 @@ const issueRoutes: RouteRecordRaw[] = [},];-// Rollout routes - nested under plans/:planId/rollout+// Legacy rollout paths → redirect to the canonical Plan Detail deploy view.const rolloutRoutes: RouteRecordRaw[] = [{path: "plans/:planId/rollout",- component: () => import("@/views/project/RolloutLayout.vue"),- props: true,- meta: {- title: () => t("common.rollout"),- requiredPermissionList: () => ["bb.rollouts.get", "bb.taskRuns.list"],- },- children: [- {- path: "",- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,- component: () =>- import("@/components/RolloutV1/components/Rollout/RolloutView.vue"),- props: true,- },- {- path: "stages/:stageId",- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,- component: () =>- import("@/components/RolloutV1/components/Rollout/RolloutView.vue"),- props: true,- },- {- path: "stages/:stageId/tasks/:taskId",- name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,- component: () =>- import("@/components/RolloutV1/components/Task/TaskView.vue"),- props: true,+ name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,+ redirect: (to) => ({+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,+ params: { projectId: to.params.projectId, planId: to.params.planId },+ query: { phase: "deploy" },+ }),+ },+ {+ path: "plans/:planId/rollout/stages/:stageId",+ name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,+ redirect: (to) => ({+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,+ params: { projectId: to.params.projectId, planId: to.params.planId },+ query: { phase: "deploy", stageId: to.params.stageId },+ }),+ },+ {+ path: "plans/:planId/rollout/stages/:stageId/tasks/:taskId",+ name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,+ redirect: (to) => ({+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,+ params: { projectId: to.params.projectId, planId: to.params.planId },+ query: {+ phase: "deploy",+ stageId: to.params.stageId,+ taskId: to.params.taskId,},- ],+ }),},];@@ -264,16 +272,6 @@ const projectV1Routes: RouteRecordRaw[] = [component: () => import("@/views/project/ProjectPlanDashboard.vue"),props: true,},- {- path: "rollouts",- name: PROJECT_V1_ROUTE_ROLLOUTS,- meta: {- title: () => t("rollout.rollouts"),- requiredPermissionList: () => ["bb.rollouts.list"],- },- component: () => import("@/views/project/ProjectRolloutDashboard.vue"),- props: true,- },{path: "sync-schema",name: PROJECT_V1_ROUTE_SYNC_SCHEMA,@@ -477,6 +475,7 @@ const projectV1Routes: RouteRecordRaw[] = [component: () => import("@/views/project/ProjectGitOpsDashboard.vue"),props: true,},+ ...planRoutes,...issueRoutes,...rolloutRoutes,],diff --git a/frontend/src/router/dashboard/projectV1RouteHelpers.ts b/frontend/src/router/dashboard/projectV1RouteHelpers.tsnew file mode 100644index 0000000000..e7fd47f3a5--- /dev/null+++ b/frontend/src/router/dashboard/projectV1RouteHelpers.ts@@ -0,0 +1,89 @@+import type { LocationQueryValue, RouteLocationRaw } from "vue-router";+import {+ extractPlanUID,+ extractPlanUIDFromRolloutName,+ extractProjectResourceName,+ extractStageNameFromTaskName,+ extractStageUID,+ extractTaskUID,+} from "@/utils";+import { PROJECT_V1_ROUTE_PLAN_DETAIL } from "./projectV1";++export const PLAN_DETAIL_PHASE_DEPLOY = "deploy";++export const getRouteQueryString = (+ value?: LocationQueryValue | LocationQueryValue[]+): string | undefined => {+ if (typeof value === "string") {+ return value;+ }+ if (Array.isArray(value)) {+ return typeof value[0] === "string" ? value[0] : undefined;+ }+ return undefined;+};++type BuildPlanDeployRouteParams = {+ projectId: string;+ planId: string;+ stageId?: string;+ taskId?: string;+};++export const buildPlanDeployRoute = ({+ projectId,+ planId,+ stageId,+ taskId,+}: BuildPlanDeployRouteParams): RouteLocationRaw => {+ return {+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,+ params: { projectId, planId },+ query: {+ phase: PLAN_DETAIL_PHASE_DEPLOY,+ ...(stageId ? { stageId } : {}),+ ...(taskId ? { taskId } : {}),+ },+ };+};++export const buildPlanDeployRouteFromPlanName = (+ planName: string,+ options?: Omit<BuildPlanDeployRouteParams, "projectId" | "planId">+): RouteLocationRaw => {+ return buildPlanDeployRoute({+ projectId: extractProjectResourceName(planName),+ planId: extractPlanUID(planName) || "_",+ ...options,+ });+};++export const buildPlanDeployRouteFromRolloutName = (+ rolloutName: string,+ options?: Omit<BuildPlanDeployRouteParams, "projectId" | "planId">+): RouteLocationRaw => {+ return buildPlanDeployRoute({+ projectId: extractProjectResourceName(rolloutName),+ planId: extractPlanUIDFromRolloutName(rolloutName) || "_",+ ...options,+ });+};++export const buildTaskDetailRoute = (taskName: string): RouteLocationRaw => {+ const stageName = extractStageNameFromTaskName(taskName);++ return buildPlanDeployRoute({+ projectId: extractProjectResourceName(taskName),+ planId: extractPlanUIDFromRolloutName(taskName) || "-",+ stageId: extractStageUID(stageName) || "-",+ taskId: extractTaskUID(taskName) || "-",+ });+};++export const buildStageRoute = (stageName: string): RouteLocationRaw => {+ return buildPlanDeployRoute({+ projectId: extractProjectResourceName(stageName),+ planId: extractPlanUIDFromRolloutName(stageName) || "_",+ stageId: extractStageUID(stageName) || "_",+ });+};diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.tsindex 1b51f633b2..cb7f83c80e 100644--- a/frontend/src/router/index.ts+++ b/frontend/src/router/index.ts@@ -47,7 +47,6 @@ export const router = createRouter({...dashboardRoutes,...sqlEditorRoutes,],- linkExactActiveClass: "bg-link-hover",scrollBehavior(to /*, from, savedPosition */) {if (to.hash) {try {diff --git a/frontend/src/views/project/IssueLayout.vue b/frontend/src/views/project/IssueLayout.vueindex 9ff9d15962..83a1f67ef3 100644--- a/frontend/src/views/project/IssueLayout.vue+++ b/frontend/src/views/project/IssueLayout.vue@@ -5,7 +5,7 @@<div class="h-full flex flex-col"><HeaderSection />- <div class="flex-1 flex">+ <div class="flex-1 flex border-t border-gray-100"><router-view v-slot="{ Component }"><keep-alive :max="3"><component :is="Component" />@@ -24,7 +24,6 @@<script lang="tsx" setup>import { NSpin } from "naive-ui";import { computed, ref, toRef, watch } from "vue";-import { useI18n } from "vue-i18n";import { onBeforeRouteLeave, onBeforeRouteUpdate } from "vue-router";import {providePlanContext,@@ -41,11 +40,9 @@ import { setDocumentTitle } from "@/utils";const props = defineProps<{projectId: string;- planId?: string;issueId?: string;}>();-const { t } = useI18n();const {isCreating,plan,@@ -56,7 +53,7 @@ const {isInitializing,} = useInitializePlan(toRef(props, "projectId"),- toRef(props, "planId"),+ undefined,toRef(props, "issueId"));const planBaseContext = useBasePlanContext({@@ -67,7 +64,6 @@ const planBaseContext = useBasePlanContext({const containerRef = ref<HTMLElement>();const ready = computed(() => {- // Ready when we have either an issue or a valid plan, and initialization is completereturn (!!issue.value || !!plan.value) && !isInitializing.value;});@@ -97,9 +93,7 @@ watch(() => project.value.title,],() => {- if (isCreating.value) {- setDocumentTitle(t("plan.new-plan"), project.value.title);- } else if (ready.value) {+ if (ready.value) {const entityTitle = issue.value?.title || plan.value?.title;if (entityTitle) {setDocumentTitle(entityTitle, project.value.title);@@ -109,7 +103,6 @@ watch({ immediate: true });-// Set up navigation guards to check for unsaved changesconst handleRouteNavigation = async (_to: unknown,_from: unknown,diff --git a/frontend/src/views/project/PlanSpecDetailView.vue b/frontend/src/views/project/PlanSpecDetailView.vuedeleted file mode 100644index 6fcd8d446e..0000000000--- a/frontend/src/views/project/PlanSpecDetailView.vue+++ /dev/null@@ -1,35 +0,0 @@-<template>- <div class="w-full flex-1 flex">- <SpecDetailView v-if="specId" :key="specId" />- </div>-</template>--<script lang="ts" setup>-import { computed, onMounted } from "vue";-import { useRoute, useRouter } from "vue-router";-import { usePlanContext } from "@/components/Plan";-import { SpecDetailView } from "@/components/Plan/components";-import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";-import { extractIssueUID } from "@/utils";--const route = useRoute();-const router = useRouter();-const { plan } = usePlanContext();--const specId = computed(() => route.params.specId as string | undefined);--onMounted(() => {- // Redirect to issue page for plans with an issue- const hasIssue = !!plan.value.issue;- if (hasIssue) {- router.replace({- name: PROJECT_V1_ROUTE_ISSUE_DETAIL,- params: {- projectId: route.params.projectId,- issueId: extractIssueUID(plan.value.issue),- },- query: route.query,- });- }-});-</script>diff --git a/frontend/src/views/project/PlanSpecsView.vue b/frontend/src/views/project/PlanSpecsView.vuedeleted file mode 100644index 4358e11544..0000000000--- a/frontend/src/views/project/PlanSpecsView.vue+++ /dev/null@@ -1,49 +0,0 @@-<!-- eslint-disable vue/valid-template-root -->-<template></template>--<script lang="ts" setup>-import { head } from "lodash-es";-import { useRoute, useRouter } from "vue-router";-import { usePlanContext } from "@/components/Plan";-import {- PROJECT_V1_ROUTE_ISSUE_DETAIL,- PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,-} from "@/router/dashboard/projectV1";-import { extractIssueUID } from "@/utils";--const route = useRoute();-const router = useRouter();-const { plan } = usePlanContext();--const spec = head(plan.value.specs);--if (!spec) {- throw new Error("No spec found in the plan.");-}--// Redirect to issue page for database change plans with an issue-const hasIssue = !!plan.value.issue;-const isDatabaseChangePlan = plan.value.specs.some(- (s) => s.config.case === "changeDatabaseConfig"-);--if (hasIssue && isDatabaseChangePlan) {- router.replace({- name: PROJECT_V1_ROUTE_ISSUE_DETAIL,- params: {- projectId: route.params.projectId,- issueId: extractIssueUID(plan.value.issue),- },- query: route.query,- });-} else {- router.replace({- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,- params: {- ...route.params,- specId: spec.id,- },- query: route.query,- });-}-</script>diff --git a/frontend/src/views/project/ProjectRolloutDashboard.vue b/frontend/src/views/project/ProjectRolloutDashboard.vuedeleted file mode 100644index 23062de254..0000000000--- a/frontend/src/views/project/ProjectRolloutDashboard.vue+++ /dev/null@@ -1,153 +0,0 @@-<template>- <div class="py-4 w-full flex flex-col">- <div class="px-4 pb-2">- <div- class="w-full flex flex-col lg:flex-row items-start lg:items-center justify-between gap-2"- >- <div class="w-full flex flex-1 items-center justify-between gap-x-2">- <AdvancedSearch- v-model:params="state.params"- class="flex-1"- :scope-options="scopeOptions"- />- <TimeRange- :params="state.params"- scope="updated"- @update:params="state.params = $event"- />- </div>- </div>- </div>- <PagedTable- ref="rolloutPagedTable"- :key="project.name"- :session-key="`project-${project.name}-rollouts`"- :footer-class="'mx-4'"- :fetch-list="fetchRolloutList"- >- <template #table="{ list, loading }">- <RolloutDataTable- :bordered="false"- :loading="loading"- :rollout-list="list"- />- </template>- </PagedTable>- </div>-</template>--<script lang="ts" setup>-import { computed, reactive, ref, watch } from "vue";-import type { ComponentExposed } from "vue-component-type-helpers";-import AdvancedSearch, { TimeRange } from "@/components/AdvancedSearch";-import type { ScopeOption } from "@/components/AdvancedSearch/types";-import { useCommonSearchScopeOptions } from "@/components/AdvancedSearch/useCommonSearchScopeOptions";-import { RolloutDataTable } from "@/components/RolloutV1";-import PagedTable from "@/components/v2/Model/PagedTable.vue";-import { useProjectByName, useRolloutStore } from "@/store";-import {- buildRolloutFindBySearchParams,- type RolloutFind,-} from "@/store/modules/rollout";-import { projectNamePrefix } from "@/store/modules/v1/common";-import {- type Rollout,- Task_Type,-} from "@/types/proto-es/v1/rollout_service_pb";-import {- extractProjectResourceName,- type SearchParams,- type SearchScope,- type SearchScopeId,-} from "@/utils";--interface LocalState {- params: SearchParams;-}--const props = defineProps<{- projectId: string;-}>();--const { project } = useProjectByName(- computed(() => `${projectNamePrefix}${props.projectId}`)-);--const rolloutStore = useRolloutStore();-const rolloutPagedTable = ref<ComponentExposed<typeof PagedTable<Rollout>>>();--const readonlyScopes = computed((): SearchScope[] => {- return [];-});--const defaultSearchParams = () => {- const params: SearchParams = {- query: "",- scopes: [...readonlyScopes.value],- };- return params;-};--const state = reactive<LocalState>({- params: defaultSearchParams(),-});--watch(- () => project.value.name,- () => (state.params = defaultSearchParams())-);--const supportedScopes = computed(() => {- const supportedScopes: SearchScopeId[] = ["updated"];- return supportedScopes;-});--// Custom scope options for rollouts that includes creator functionality-const scopeOptions = computed((): ScopeOption[] => {- const commonOptions = useCommonSearchScopeOptions(supportedScopes.value);-- return [...commonOptions.value];-});--const rolloutSearchParams = computed(() => {- const defaultScopes = [- {- id: "project",- value: extractProjectResourceName(project.value.name),- },- ];- return {- query: state.params.query.trim().toLowerCase(),- scopes: [...state.params.scopes, ...defaultScopes],- } as SearchParams;-});--const mergedRolloutFind = computed((): RolloutFind => {- return buildRolloutFindBySearchParams(rolloutSearchParams.value, {- taskType: [Task_Type.DATABASE_MIGRATE],- });-});--const fetchRolloutList = async ({- pageToken,- pageSize,-}: {- pageToken: string;- pageSize: number;-}) => {- const { nextPageToken, rollouts } = await rolloutStore.listRollouts({- find: mergedRolloutFind.value,- pageSize,- pageToken,- });- return {- nextPageToken,- list: rollouts,- };-};--watch(- () => JSON.stringify(mergedRolloutFind.value),- () => rolloutPagedTable.value?.refresh()-);-</script>diff --git a/frontend/src/views/project/RolloutLayout.vue b/frontend/src/views/project/RolloutLayout.vuedeleted file mode 100644index d6bfe70cbd..0000000000--- a/frontend/src/views/project/RolloutLayout.vue+++ /dev/null@@ -1,113 +0,0 @@-<template>- <div ref="containerRef" class="relative overflow-x-hidden h-full">- <template v-if="ready">- <PollerProvider>- <div class="h-full flex flex-col">- <div class="flex items-center justify-between pt-2 px-3 sm:px-4 shrink-0">- <RolloutBreadcrumb />- <RefreshIndicator />- </div>-- <h1 class="px-3 sm:px-4 pt-1 text-lg font-medium text-main truncate shrink-0">- {{ title }}- </h1>-- <router-view v-slot="{ Component }">- <keep-alive :max="3">- <component :is="Component" />- </keep-alive>- </router-view>- </div>- </PollerProvider>- </template>- <div v-else class="w-full h-full flex flex-col items-center justify-center">- <NSpin />- </div>- </div>-</template>--<script lang="ts" setup>-import { NSpin } from "naive-ui";-import { computed, ref, toRef, watch, watchEffect } from "vue";-import { useI18n } from "vue-i18n";-import {- providePlanContext,- useBasePlanContext,- useInitializePlan,-} from "@/components/Plan";-import RefreshIndicator from "@/components/Plan/components/RefreshIndicator.vue";-import { provideSidebarContext } from "@/components/Plan/logic/sidebar";-import PollerProvider from "@/components/Plan/PollerProvider.vue";-import RolloutBreadcrumb from "@/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vue";-import { usePolicyV1Store, useProjectByName } from "@/store";-import { projectNamePrefix } from "@/store/modules/v1/common";-import { PolicyType } from "@/types/proto-es/v1/org_policy_service_pb";-import { setDocumentTitle } from "@/utils";--const props = defineProps<{- projectId: string;- planId: string;-}>();--const { t } = useI18n();-const {- isCreating,- plan,- planCheckRuns,- issue,- rollout,- taskRuns,- isInitializing,-} = useInitializePlan(toRef(props, "projectId"), toRef(props, "planId"));-const planBaseContext = useBasePlanContext({- isCreating,- plan,- issue,-});-const containerRef = ref<HTMLElement>();-const policyStore = usePolicyV1Store();--const ready = computed(() => !!rollout.value && !isInitializing.value);--// Prefetch rollout policies for all stages-watchEffect(() => {- if (!rollout.value) return;- for (const stage of rollout.value.stages) {- if (stage.environment) {- policyStore- .getOrFetchPolicyByParentAndType({- parentPath: stage.environment,- policyType: PolicyType.ROLLOUT_POLICY,- })- .catch(() => {});- }- }-});-const title = computed(() => issue.value?.title || plan.value?.title || "");--providePlanContext({- isCreating,- plan,- planCheckRuns,- issue,- rollout,- taskRuns,- ...planBaseContext,-});--provideSidebarContext(containerRef);--const projectName = computed(() => `${projectNamePrefix}${props.projectId}`);-const { project } = useProjectByName(projectName);--watch(- [ready, () => plan.value?.title, () => project.value.title],- () => {- if (ready.value) {- const planTitle = plan.value?.title || t("common.rollout");- setDocumentTitle(planTitle, project.value.title);- }- },- { immediate: true }-);-</script>