Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: improve mobile responsiveness for CICD layout (#17341)
boojack90ba72fce534
diff --git a/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue b/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vueindex 1ad9d860fa..ef33e8e5e3 100644--- a/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue+++ b/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue@@ -10,6 +10,16 @@<TitleInput /><div class="flex flex-row items-center justify-end"><Actions />+ <!-- Mobile hamburger menu -->+ <NButton+ v-if="hasSidebar && sidebarMode === 'MOBILE'"+ class="!px-1"+ quaternary+ size="medium"+ @click="handleMobileSidebarOpen"+ >+ <MenuIcon class="w-5 h-5" />+ </NButton></div></div><DescriptionSection v-if="showDescriptionSection" />@@ -17,16 +27,36 @@</template><script lang="ts" setup>-import { CircleDotDashedIcon } from "lucide-vue-next";-import { NTag } from "naive-ui";+import { CircleDotDashedIcon, MenuIcon } from "lucide-vue-next";+import { NButton, NTag } from "naive-ui";import { computed } from "vue";+import { useRoute } from "vue-router";+import { PROJECT_V1_ROUTE_ISSUE_DETAIL_V1 } from "@/router/dashboard/projectV1";import { usePlanContext } from "../../logic";+import { useSidebarContext } from "../../logic/sidebar";import Actions from "./Actions";import DescriptionSection from "./DescriptionSection.vue";import TitleInput from "./TitleInput.vue";+const route = useRoute();const { isCreating, plan } = usePlanContext();+const hasSidebar = computed(() => {+ // Check if we're in a layout with sidebar (Issue overview tab only)+ // The sidebar only exists when there's an issue AND we're on the overview tab+ if (!plan.value.issue) return false;++ // Check current route to see if we're on the overview tab+ // This would be the ISSUE_DETAIL_V1 route, not the PLAN_DETAIL or ROLLOUT routes+ return route.name === PROJECT_V1_ROUTE_ISSUE_DETAIL_V1;+});++const { mode: sidebarMode, mobileSidebarOpen } = useSidebarContext();++const handleMobileSidebarOpen = () => {+ mobileSidebarOpen.value = true;+};+const showDraftTag = computed(() => {return !isCreating.value && !plan.value.issue && !plan.value.rollout;});diff --git a/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue b/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vueindex ae7c3dbe94..06565cda62 100644--- a/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue@@ -1,31 +1,63 @@<template>- <div class="flex-1 flex w-full border-t -mt-px">+ <div ref="containerRef" class="flex-1 flex w-full border-t -mt-px"><!-- Left Panel - Activity --><div class="flex-1 shrink p-4 space-y-4"><slot /><ActivitySection /></div>- <div class="w-80 shrink-0 flex flex-col border-l">+ <!-- Desktop Sidebar -->+ <div+ v-if="sidebarMode === 'DESKTOP'"+ class="shrink-0 flex flex-col border-l"+ :style="{+ width: `${desktopSidebarWidth}px`,+ }"+ ><Sidebar /></div>++ <!-- Mobile Sidebar -->+ <template v-if="sidebarMode === 'MOBILE'">+ <Drawer :show="mobileSidebarOpen" @close="mobileSidebarOpen = false">+ <div+ style="+ min-width: 240px;+ width: 80vw;+ max-width: 320px;+ padding: 0.5rem;+ "+ >+ <Sidebar />+ </div>+ </Drawer>+ </template></div></template><script setup lang="ts">-import { computed, unref } from "vue";+import { computed, ref, unref } from "vue";import { provideIssueContext, useBaseIssueContext } from "@/components/IssueV1";+import { Drawer } from "@/components/v2";import { extractUserId, useCurrentProjectV1, useCurrentUserV1 } from "@/store";import type { ComposedIssue } from "@/types";import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";import { hasProjectPermissionV2 } from "@/utils";import { usePlanContextWithIssue } from "../..";+import { useSidebarContext } from "../../logic/sidebar";import { ActivitySection } from "./ActivitySection";import { Sidebar } from "./Sidebar";const { project, ready } = useCurrentProjectV1();const { plan, issue, rollout } = usePlanContextWithIssue();const currentUser = useCurrentUserV1();+const containerRef = ref<HTMLElement>();++const {+ mode: sidebarMode,+ desktopSidebarWidth,+ mobileSidebarOpen,+} = useSidebarContext();const issueBaseContext = useBaseIssueContext({// Always set to false.diff --git a/frontend/src/components/Plan/components/RefreshIndicator.vue b/frontend/src/components/Plan/components/RefreshIndicator.vueindex 2c8e0ec335..8e4a70f5d8 100644--- a/frontend/src/components/Plan/components/RefreshIndicator.vue+++ b/frontend/src/components/Plan/components/RefreshIndicator.vue@@ -1,5 +1,5 @@<template>- <div class="flex items-center gap-2">+ <div class="hidden sm:flex items-center gap-2"><span v-if="lastRefreshDisplay" class="text-xs text-gray-400">{{$t("plan.refresh-indicator.last-refresh", { time: lastRefreshDisplay })diff --git a/frontend/src/components/Plan/components/RolloutView/StageActions.vue b/frontend/src/components/Plan/components/RolloutView/StageActions.vuenew file mode 100644index 0000000000..62fd0b6913--- /dev/null+++ b/frontend/src/components/Plan/components/RolloutView/StageActions.vue@@ -0,0 +1,54 @@+<template>+ <template v-if="isCreated && runableTasks.length > 0">+ <NButton+ size="small"+ :disabled="!canRunTasks"+ @click.stop="$emit('run-tasks')"+ >+ <template #icon>+ <PlayIcon />+ </template>+ {{ $t("common.run") }}+ </NButton>+ </template>+ <template v-else-if="!isCreated && canCreateRollout">+ <NPopconfirm+ :negative-text="null"+ :positive-text="$t('common.confirm')"+ @positive-click="$emit('create-rollout')"+ >+ <template #trigger>+ <NTooltip>+ <template #trigger>+ <NButton :size="'small'">+ <template #icon>+ <CircleFadingPlusIcon class="w-5 h-5" />+ </template>+ {{ $t("common.start") }}+ </NButton>+ </template>+ {{ $t("rollout.stage.start-stage") }}+ </NTooltip>+ </template>+ {{ $t("common.confirm-and-add") }}+ </NPopconfirm>+ </template>+</template>++<script setup lang="ts">+import { CircleFadingPlusIcon, PlayIcon } from "lucide-vue-next";+import { NButton, NPopconfirm, NTooltip } from "naive-ui";+import type { Task } from "@/types/proto-es/v1/rollout_service_pb";++defineProps<{+ isCreated: boolean;+ runableTasks: Task[];+ canRunTasks: boolean;+ canCreateRollout: boolean;+}>();++defineEmits<{+ (event: "run-tasks"): void;+ (event: "create-rollout"): void;+}>();+</script>diff --git a/frontend/src/components/Plan/components/RolloutView/StageCard.vue b/frontend/src/components/Plan/components/RolloutView/StageCard.vueindex dbd26e9b2b..ac6223fb89 100644--- a/frontend/src/components/Plan/components/RolloutView/StageCard.vue+++ b/frontend/src/components/Plan/components/RolloutView/StageCard.vue@@ -12,17 +12,18 @@"@click="isCreated && handleClickStageTitle()">- <div class="flex items-start justify-between gap-4">- <!-- Left side: Stage title and status counts -->- <div class="flex-1 flex items-start gap-2">+ <div+ class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4"+ >+ <!-- Top/Left section: Stage info -->+ <div class="flex items-start justify-between gap-2">+ <!-- Stage title and status --><div class="flex items-start gap-2"><TaskStatus :status="stageStatus" size="medium" /><div class="flex flex-col gap-1">- <h3- class="text-base font-medium text-gray-900 whitespace-nowrap truncate"- >+ <h3 class="text-base font-medium text-gray-900 truncate"><EnvironmentV1Name- class="inline-block w-24"+ class="inline-block sm:w-24":environment="environment":link="false":null-environment-placeholder="'Null'"@@ -35,152 +36,137 @@</div></div>- <!-- Tasks and task status counts -->- <div v-if="isCreated" class="flex-1 flex flex-col">- <!-- Task status counts -->- <div class="flex items-center gap-2 flex-wrap">- <template v-for="status in TASK_STATUS_FILTERS" :key="status">- <NTag- v-if="getTaskCount(status) > 0"- round- size="medium"- :type="- status === Task_Status.RUNNING- ? 'info'- : status === Task_Status.FAILED- ? 'error'- : 'default'- "- class="cursor-pointer hover:opacity-80 transition-opacity"- @click.stop="handleTaskStatusClick(status)"- >- <template #avatar>- <TaskStatus :status="status" size="small" disabled />- </template>- <div class="flex flex-row items-center gap-2">- <span class="select-none text-base">{{- stringifyTaskStatus(status)- }}</span>- <span class="select-none text-base font-medium">{{- getTaskCount(status)- }}</span>- </div>- </NTag>- </template>- <!-- Toggle button for tasks -->- <NButton- v-if="filteredTasks.length > 0"- quaternary- round- size="small"- class="!px-2"- @click.stop="showTasks = !showTasks"- >- <template #icon>- <ChevronDownIcon v-if="!showTasks" class="text-gray-500" />- <ChevronUpIcon v-else class="text-gray-500" />- </template>- </NButton>- </div>- <!-- Tasks -->- <div- v-if="filteredTasks.length > 0 && showTasks"- class="mt-2 flex flex-row gap-2 flex-wrap"- >+ <!-- Mobile action buttons -->+ <div class="sm:hidden flex items-center">+ <StageActions+ :is-created="isCreated"+ :runable-tasks="runableTasks"+ :can-run-tasks="canRunTasks"+ :can-create-rollout="canCreateRollout"+ @run-tasks="handleRunAllTasks"+ @create-rollout="createRolloutToStage"+ />+ </div>+ </div>++ <!-- Bottom/Center section: Tasks -->+ <div v-if="isCreated" class="flex flex-col sm:flex-1">+ <!-- Task status counts -->+ <div class="flex items-center gap-2 flex-wrap">+ <template v-for="status in TASK_STATUS_FILTERS" :key="status"><NTag- v-for="task in displayedTasks"- :key="task.name"+ v-if="getTaskCount(status) > 0"round- size="small"- :bordered="false"- @click.stop="handleTaskClick(task)"+ size="medium"+ :type="+ status === Task_Status.RUNNING+ ? 'info'+ : status === Task_Status.FAILED+ ? 'error'+ : 'default'+ "+ class="cursor-pointer hover:opacity-80 transition-opacity"+ @click.stop="handleTaskStatusClick(status)"><template #avatar>- <TaskStatus :status="task.status" size="tiny" disabled />+ <TaskStatus :status="status" size="small" disabled /></template>- <div class="flex items-center flex-nowrap gap-2">- <DatabaseDisplay :database="task.target" />- <template v-if="task.runTime">- <span class="font-mono text-control-light opacity-80"- >/</span- >- <NTooltip>- <template #trigger>- <div class="flex items-center gap-1">- <CalendarClockIcon- :size="14"- class="text-control-light"- />- <span class="text-control">{{- humanizeTs(- getTimeForPbTimestampProtoEs(task.runTime, 0) /- 1000- )- }}</span>- </div>- </template>- <div class="space-y-1">- <div class="text-sm opacity-80">- {{ $t("task.scheduled-time") }}- </div>- <div class="text-sm whitespace-nowrap">- {{ formatFullDateTime(task.runTime) }}- </div>- </div>- </NTooltip>- </template>+ <div class="flex flex-row items-center gap-2">+ <span class="select-none text-base">{{+ stringifyTaskStatus(status)+ }}</span>+ <span class="select-none text-base font-medium">{{+ getTaskCount(status)+ }}</span></div></NTag>- <NTag- v-if="remainingTaskCount > 0"- round- size="small"- type="default"- :bordered="false"- class="opacity-80"- :class="isCreated && 'cursor-pointer hover:opacity-100'"- @click.stop="handleClickStageTitle()"- >- +{{ remainingTaskCount }} more- </NTag>- </div>- </div>- </div>-- <!-- Right side: Actions -->- <div class="flex justify-end items-center">- <NButton- v-if="isCreated && runableTasks.length > 0"- size="small"- :disabled="!canRunTasks"- @click.stop="handleRunAllTasks"- >- <template #icon>- <PlayIcon /></template>- {{ $t("common.run") }}- </NButton>- <NPopconfirm- v-else-if="!isCreated && canCreateRollout"- :negative-text="null"- :positive-text="$t('common.confirm')"- @positive-click="createRolloutToStage"+ <!-- Toggle button for tasks -->+ <NButton+ v-if="filteredTasks.length > 0"+ quaternary+ round+ size="small"+ class="!px-2"+ @click.stop="showTasks = !showTasks"+ >+ <template #icon>+ <ChevronDownIcon v-if="!showTasks" class="text-gray-500" />+ <ChevronUpIcon v-else class="text-gray-500" />+ </template>+ </NButton>+ </div>+ <!-- Tasks -->+ <div+ v-if="filteredTasks.length > 0 && showTasks"+ class="mt-2 flex flex-row gap-2 flex-wrap">- <template #trigger>- <NTooltip>- <template #trigger>- <NButton :size="'small'">- <template #icon>- <CircleFadingPlusIcon class="w-5 h-5" />+ <NTag+ v-for="task in displayedTasks"+ :key="task.name"+ round+ size="small"+ :bordered="false"+ @click.stop="handleTaskClick(task)"+ >+ <template #avatar>+ <TaskStatus :status="task.status" size="tiny" disabled />+ </template>+ <div class="flex items-center flex-nowrap gap-2">+ <DatabaseDisplay :database="task.target" />+ <template v-if="task.runTime">+ <span class="font-mono text-control-light opacity-80">/</span>+ <NTooltip>+ <template #trigger>+ <div class="flex items-center gap-1">+ <CalendarClockIcon+ :size="14"+ class="text-control-light"+ />+ <span class="text-control">{{+ humanizeTs(+ getTimeForPbTimestampProtoEs(task.runTime, 0) / 1000+ )+ }}</span>+ </div></template>- {{ $t("common.start") }}- </NButton>+ <div class="space-y-1">+ <div class="text-sm opacity-80">+ {{ $t("task.scheduled-time") }}+ </div>+ <div class="text-sm whitespace-nowrap">+ {{ formatFullDateTime(task.runTime) }}+ </div>+ </div>+ </NTooltip></template>- {{ $t("rollout.stage.start-stage") }}- </NTooltip>- </template>- {{ $t("common.confirm-and-add") }}- </NPopconfirm>+ </div>+ </NTag>+ <NTag+ v-if="remainingTaskCount > 0"+ round+ size="small"+ type="default"+ :bordered="false"+ class="opacity-80"+ :class="isCreated && 'cursor-pointer hover:opacity-100'"+ @click.stop="handleClickStageTitle()"+ >+ +{{ remainingTaskCount }} more+ </NTag>+ </div>+ </div>++ <!-- Desktop action buttons -->+ <div class="hidden sm:flex justify-end items-start">+ <StageActions+ :is-created="isCreated"+ :runable-tasks="runableTasks"+ :can-run-tasks="canRunTasks"+ :can-create-rollout="canCreateRollout"+ @run-tasks="handleRunAllTasks"+ @create-rollout="createRolloutToStage"+ /></div></div></div>@@ -191,13 +177,11 @@import type { Timestamp as TimestampPb } from "@bufbuild/protobuf/wkt";import dayjs from "dayjs";import {- CircleFadingPlusIcon,ChevronDownIcon,ChevronUpIcon,CalendarClockIcon,- PlayIcon,} from "lucide-vue-next";-import { NTooltip, NButton, NPopconfirm, NTag } from "naive-ui";+import { NTooltip, NButton, NTag } from "naive-ui";import { twMerge } from "tailwind-merge";import { computed, ref, watch } from "vue";import { useRouter } from "vue-router";@@ -229,6 +213,7 @@ import {humanizeTs,} from "@/utils";import { usePlanContextWithRollout } from "../../logic";+import StageActions from "./StageActions.vue";import { useTaskActionPermissions } from "./taskPermissions";const props = defineProps<{diff --git a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vueindex ec8055550b..ed64c4b884 100644--- a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue+++ b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue@@ -8,7 +8,7 @@<SQLCheckV1Section v-if="isCreating" /><PlanCheckSection v-else /></template>- <div class="w-full space-y-3 pt-3">+ <div class="w-full space-y-3 pt-3 overflow-x-hidden"><StatementSection /><Configuration /></div>diff --git a/frontend/src/views/project/CICDLayout.vue b/frontend/src/views/project/CICDLayout.vueindex 6c1a04a3b1..132402def8 100644--- a/frontend/src/views/project/CICDLayout.vue+++ b/frontend/src/views/project/CICDLayout.vue@@ -1,5 +1,5 @@<template>- <div class="relative overflow-x-hidden h-full">+ <div ref="containerRef" class="relative overflow-x-hidden h-full"><template v-if="ready"><PollerProvider><div class="h-full flex flex-col">@@ -78,6 +78,7 @@ import PollerProvider from "@/components/Plan/PollerProvider.vue";import { HeaderSection } from "@/components/Plan/components";import RefreshIndicator from "@/components/Plan/components/RefreshIndicator.vue";import { provideIssueReviewContext } from "@/components/Plan/logic/issue-review";+import { provideSidebarContext } from "@/components/Plan/logic/sidebar";import { useNavigationGuard } from "@/components/Plan/logic/useNavigationGuard";import { useIssueLayoutVersion } from "@/composables/useIssueLayoutVersion";import { useBodyLayoutContext } from "@/layouts/common";@@ -136,6 +137,7 @@ const planBaseContext = useBasePlanContext({});const { enabledNewLayout } = useIssueLayoutVersion();const isLoading = ref(true);+const containerRef = ref<HTMLElement>();const ready = computed(() => {return !isInitializing.value && !!plan.value && !isLoading.value;@@ -167,6 +169,8 @@ providePlanContext({provideIssueReviewContext(computed(() => issue.value));+provideSidebarContext(containerRef);+watch(() => isInitializing.value,() => {