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(sql-editor): implement new sheet panel and navigation (#7233)
Liu Jid3270461db41
diff --git a/frontend/src/components/ProvideSQLEditorContext.vue b/frontend/src/components/ProvideSQLEditorContext.vueindex 163f178ccc..008a0c6ff1 100644--- a/frontend/src/components/ProvideSQLEditorContext.vue+++ b/frontend/src/components/ProvideSQLEditorContext.vue@@ -17,6 +17,7 @@ import {useInstanceV1Store,useDatabaseV1Store,useEnvironmentV1Store,+ useUserStore,} from "@/store";import {Connection,@@ -382,6 +383,8 @@ const syncURLWithConnection = () => {};onMounted(async () => {+ await useUserStore().fetchUserList();+if (connectionTreeStore.tree.state === ConnectionTreeState.UNSET) {connectionTreeStore.tree.state = ConnectionTreeState.LOADING;// Initialize project list state for iam policy.diff --git a/frontend/src/layouts/SQLEditorLayout.vue b/frontend/src/layouts/SQLEditorLayout.vueindex 3819540592..a7064319c3 100644--- a/frontend/src/layouts/SQLEditorLayout.vue+++ b/frontend/src/layouts/SQLEditorLayout.vue@@ -1,11 +1,6 @@<template><div class="relative h-screen overflow-hidden flex flex-col"><BannersWrapper />- <nav class="bg-white border-b border-block-border">- <div class="max-w-full mx-auto px-4">- <EditorHeader />- </div>- </nav><!-- Suspense is experimental, be aware of the potential change --><Suspense><template #default>@@ -31,7 +26,6 @@<script lang="ts" setup>import ProvideSQLEditorContext from "@/components/ProvideSQLEditorContext.vue";import { pushNotification, useActuatorV1Store } from "@/store";-import EditorHeader from "@/views/sql-editor/EditorHeader.vue";import BannersWrapper from "@/components/BannersWrapper.vue";const actuatorStore = useActuatorV1Store();diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 0fd3e82fe0..66036ceaac 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1766,7 +1766,6 @@"sheet-is-read-only": "The shared sheet is read-only."},"view-all-tabs": "View all Tabs",- "sheet": "Sheet","sheets": "Sheets","connection-holder": "Click nodes on the left panel to get started","link-access": "Link access",@@ -1801,7 +1800,11 @@"clear-screen": "Clear screen","query-time": "Query time","request-query": "Request Query",- "connection-lost": "Connection lost. Will try to reconnect when executing next query."+ "connection-lost": "Connection lost. Will try to reconnect when executing next query.",+ "sheet": {+ "choose-sheet": "Choose Sheet",+ "self": "Sheet"+ }},"schema-editor": {"self": "Schema Editor",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 8eb6e1be63..fb107642a8 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -1764,7 +1764,6 @@"sheet-is-read-only": "La hoja compartida es solo de lectura."},"view-all-tabs": "Ver todas las pestañas",- "sheet": "Hoja","sheets": "Hojas","connection-holder": "Haz clic en los nodos del panel izquierdo para comenzar","link-access": "Acceso al enlace",@@ -1799,7 +1798,11 @@"clear-screen": "Limpiar pantalla","query-time": "Tiempo de consulta","request-query": "Solicitar consulta",- "connection-lost": "Conexión perdida. \nIntentará volver a conectarse al ejecutar la siguiente consulta."+ "connection-lost": "Conexión perdida. \nIntentará volver a conectarse al ejecutar la siguiente consulta.",+ "sheet": {+ "choose-sheet": "Elegir hoja",+ "self": "Hoja"+ }},"schema-editor": {"self": "Editor de esquema",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex a56e24457f..187ad066c7 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1759,7 +1759,6 @@"sheet-is-read-only": "分享的工作表是只读的,无法编辑。"},"view-all-tabs": "查看所有标签页",- "sheet": "工作表","sheets": "工作表","connection-holder": "点击左侧数据库列表中的节点来建立连接","link-access": "链接访问权限",@@ -1794,7 +1793,11 @@"clear-screen": "清屏","query-time": "查询时间","request-query": "申请查询权限",- "connection-lost": "连接丢失。下一次执行查询时将尝试重新连接。"+ "connection-lost": "连接丢失。下一次执行查询时将尝试重新连接。",+ "sheet": {+ "choose-sheet": "选择工作表",+ "self": "工作表"+ }},"schema-editor": {"self": "Schema 编辑器",diff --git a/frontend/src/views/sql-editor/EditorCommon/SaveSheetModal.vue b/frontend/src/views/sql-editor/EditorCommon/SaveSheetModal.vueindex f1ab6a000f..79b3a1c04e 100644--- a/frontend/src/views/sql-editor/EditorCommon/SaveSheetModal.vue+++ b/frontend/src/views/sql-editor/EditorCommon/SaveSheetModal.vue@@ -21,6 +21,7 @@ import {Sheet_Type,Sheet,} from "@/types/proto/v1/sheet_service";+import { useSheetPanelContext } from "../TabList/SheetPanel/common";type LocalState = {showModal: boolean;@@ -29,6 +30,7 @@ type LocalState = {const tabStore = useTabStore();const databaseStore = useDatabaseV1Store();const sheetV1Store = useSheetV1Store();+const { events: sheetEvents } = useSheetPanelContext();const state = reactive<LocalState>({showModal: false,@@ -85,6 +87,9 @@ const doSaveSheet = async (sheetTitle?: string) => {isSaved: true,name: sheetTitle,});++ // Refresh "my" sheet list.+ sheetEvents.emit("refresh", { views: ["my"] });}};diff --git a/frontend/src/views/sql-editor/SQLEditorPage.vue b/frontend/src/views/sql-editor/SQLEditorPage.vueindex 982ba3a2f2..074f404ae5 100644--- a/frontend/src/views/sql-editor/SQLEditorPage.vue+++ b/frontend/src/views/sql-editor/SQLEditorPage.vue@@ -133,6 +133,7 @@ import AdminModeButton from "./EditorCommon/AdminModeButton.vue";import SchemaEditorModal from "@/components/AlterSchemaPrepForm/SchemaEditorModal.vue";import { useWindowSize } from "@vueuse/core";import { InstanceV1Name } from "@/components/v2";+import { provideSheetPanelContext } from "./TabList/SheetPanel/common";type LocalState = {sidebarExpanded: boolean;@@ -216,6 +217,9 @@ const handleAlterSchema = async (params: {window.open(url, "_blank");}};++// provide context for SheetPanel+provideSheetPanelContext();</script><style>diff --git a/frontend/src/views/sql-editor/TabList/SheetPanel/SheetPanel.vue b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetPanel.vuenew file mode 100644index 0000000000..a934653db9--- /dev/null+++ b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetPanel.vue@@ -0,0 +1,84 @@+<template>+ <div class="w-[40vw] max-w-[calc(100vw-2rem)]">+ <NTabs v-model:value="view">+ <NTabPane name="my" :tab="$t('sheet.my-sheets')">+ <SheetTable view="my" @select-sheet="handleSelectSheet" />+ </NTabPane>+ <NTabPane name="shared" :tab="$t('sheet.shared-with-me')">+ <SheetTable view="shared" @select-sheet="handleSelectSheet" />+ </NTabPane>+ <NTabPane name="starred" :tab="$t('common.starred')">+ <SheetTable view="starred" @select-sheet="handleSelectSheet" />+ </NTabPane>+ </NTabs>+ </div>+</template>++<script setup lang="ts">+import { NTabs, NTabPane } from "naive-ui";+import { useI18n } from "vue-i18n";++import { Sheet } from "@/types/proto/v1/sheet_service";+import { emptyConnection, isSheetReadableV1 } from "@/utils";+import { UNKNOWN_ID } from "@/types";+import { pushNotification, useInstanceV1Store, useTabStore } from "@/store";+import { getInstanceAndDatabaseId } from "@/store/modules/v1/common";+import { useSheetPanelContext } from "./common";+import SheetTable from "./SheetTable";++const emit = defineEmits<{+ (event: "close"): void;+}>();++const { t } = useI18n();+const tabStore = useTabStore();+const { view } = useSheetPanelContext();++const handleSelectSheet = async (sheet: Sheet) => {+ const openingSheetTab = tabStore.tabList.find(+ (tab) => tab.sheetName == sheet.name+ );++ if (!isSheetReadableV1(sheet)) {+ pushNotification({+ module: "bytebase",+ style: "CRITICAL",+ title: t("common.access-denied"),+ });+ return false;+ }+ if (openingSheetTab) {+ // Switch to a sheet tab if it's open already.+ tabStore.setCurrentTabId(openingSheetTab.id);+ } else {+ // Open the sheet in a "temp" tab otherwise.+ tabStore.selectOrAddTempTab();+ }++ let insId = String(UNKNOWN_ID);+ let dbId = String(UNKNOWN_ID);+ if (sheet.database) {+ const [instanceName, databaseId] = getInstanceAndDatabaseId(sheet.database);+ const ins = await useInstanceV1Store().getOrFetchInstanceByName(+ `instances/${instanceName}`+ );+ insId = ins.uid;+ dbId = databaseId;+ }++ tabStore.updateCurrentTab({+ sheetName: sheet.name,+ name: sheet.title,+ statement: new TextDecoder().decode(sheet.content),+ isSaved: true,+ connection: {+ ...emptyConnection(),+ // TODO: legacy instance id.+ instanceId: insId,+ databaseId: dbId,+ },+ });++ emit("close");+};+</script>diff --git a/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/Dropdown.vue b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/Dropdown.vuenew file mode 100644index 0000000000..e2a810bfb1--- /dev/null+++ b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/Dropdown.vue@@ -0,0 +1,137 @@+<template>+ <NDropdown+ v-if="options.length > 0"+ trigger="click"+ :options="options"+ @select="handleAction"+ >+ <heroicons-outline:dots-horizontal+ class="w-6 h-auto border border-gray-300 bg-white p-1 rounded outline-none shadow"+ />+ </NDropdown>+</template>++<script lang="ts" setup>+import { computed } from "vue";+import { useI18n } from "vue-i18n";+import { type DropdownOption, NDropdown, useDialog } from "naive-ui";++import { Sheet } from "@/types/proto/v1/sheet_service";+import { useSheetPanelContext, type SheetViewMode } from "../common";+import { isSheetWritableV1 } from "@/utils";+import { useSheetV1Store, pushNotification } from "@/store";+import {+ Sheet_Visibility,+ Sheet_Source,+ Sheet_Type,+} from "@/types/proto/v1/sheet_service";++const props = defineProps<{+ view: SheetViewMode;+ sheet: Sheet;+}>();++const { t } = useI18n();+const sheetV1Store = useSheetV1Store();+const dialog = useDialog();+const { events } = useSheetPanelContext();++const options = computed(() => {+ const options: DropdownOption[] = [];+ const { sheet, view } = props;++ if (sheet.starred) {+ options.push({+ key: "unstar",+ label: t("common.unstar"),+ });+ } else {+ options.push({+ key: "star",+ label: t("common.star"),+ });+ }++ const canWriteSheet = isSheetWritableV1(sheet);+ if (canWriteSheet) {+ options.push({+ key: "delete",+ label: t("common.delete"),+ });+ }+ if (view === "shared") {+ options.push({+ key: "duplicate",+ label: t("common.duplicate"),+ });+ }++ return options;+});++const handleAction = async (key: string) => {+ const { sheet } = props;+ if (key === "delete") {+ const dialogInstance = dialog.create({+ title: t("sheet.hint-tips.confirm-to-delete-this-sheet"),+ type: "info",+ autoFocus: false,+ closable: false,+ maskClosable: false,+ closeOnEsc: false,+ async onPositiveClick() {+ await sheetV1Store.deleteSheetByName(sheet.name);+ events.emit("refresh", { views: ["my", "shared", "starred"] });+ dialogInstance.destroy();+ },+ onNegativeClick() {+ dialogInstance.destroy();+ },+ negativeText: t("common.cancel"),+ positiveText: t("common.confirm"),+ showIcon: true,+ });+ } else if (key === "star" || key === "unstar") {+ await sheetV1Store.upsertSheetOrganizer({+ sheet: sheet.name,+ starred: key === "star",+ });+ events.emit("refresh", { views: ["starred"] });+ } else if (key === "duplicate") {+ const dialogInstance = dialog.create({+ title: t("sheet.hint-tips.confirm-to-duplicate-sheet"),+ type: "info",+ autoFocus: false,+ closable: false,+ maskClosable: false,+ closeOnEsc: false,+ async onPositiveClick() {+ await sheetV1Store.createSheet(+ sheetV1Store.getSheetParentPath(sheet.name),+ {+ title: sheet.title,+ content: sheet.content,+ database: sheet.database,+ visibility: Sheet_Visibility.VISIBILITY_PRIVATE,+ source: Sheet_Source.SOURCE_BYTEBASE,+ type: Sheet_Type.TYPE_SQL,+ payload: "{}",+ }+ );+ pushNotification({+ module: "bytebase",+ style: "INFO",+ title: t("sheet.notifications.duplicate-success"),+ });+ dialogInstance.destroy();+ },+ onNegativeClick() {+ dialogInstance.destroy();+ },+ negativeText: t("common.cancel"),+ positiveText: t("common.confirm"),+ showIcon: true,+ });+ }+};+</script>diff --git a/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/SheetTable.vue b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/SheetTable.vuenew file mode 100644index 0000000000..36c31d9f82--- /dev/null+++ b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/SheetTable.vue@@ -0,0 +1,130 @@+<template>+ <BBGrid+ :column-list="columns"+ :data-source="sheetList"+ :show-placeholder="true"+ :ready="!isLoading"+ row-key="name"+ @click-row="handleSheetClick"+ >+ <template #item="{ item: sheet }: BBGridRow<Sheet>">+ <div class="bb-grid-cell">+ {{ sheet.title }}+ </div>+ <div class="bb-grid-cell">+ <ProjectV1Name :project="projectForSheet(sheet)" :link="false" />+ </div>+ <div class="bb-grid-cell">+ {{ visibilityDisplayName(sheet.visibility) }}+ </div>+ <div v-if="showCreator" class="bb-grid-cell">+ {{ creatorForSheet(sheet) }}+ </div>+ <div class="bb-grid-cell">+ <HumanizeDate :date="sheet.updateTime" />+ </div>+ <div class="bb-grid-cell" @click.stop>+ <Dropdown :sheet="sheet" :view="view" />+ </div>+ </template>+ </BBGrid>+</template>++<script lang="ts" setup>+import { computed } from "vue";+import { useI18n } from "vue-i18n";++import { Sheet } from "@/types/proto/v1/sheet_service";+import { BBGrid, BBGridRow, BBGridColumn } from "@/bbkit";+import { SheetViewMode, useSheetPanelContextByView } from "../common";+import Dropdown from "./Dropdown.vue";+import { extractProjectResourceName } from "@/utils";+import { useUserStore, useProjectV1Store } from "@/store";+import { Sheet_Visibility } from "@/types/proto/v1/sheet_service";+import HumanizeDate from "@/components/misc/HumanizeDate.vue";+import { ProjectV1Name } from "@/components/v2";+import { onMounted } from "vue";++const props = defineProps<{+ view: SheetViewMode;+}>();++const emit = defineEmits<{+ (event: "select-sheet", sheet: Sheet): void;+}>();++const { t } = useI18n();+const projectStore = useProjectV1Store();+const userStore = useUserStore();+const { isInitialized, isLoading, sheetList, fetchSheetList } =+ useSheetPanelContextByView(props.view);++const showCreator = computed(() => {+ return props.view === "shared" || props.view === "starred";+});++const handleSheetClick = (sheet: Sheet) => {+ emit("select-sheet", sheet);+};++const columns = computed(() => {+ const NAME: BBGridColumn = {+ title: t("common.name"),+ width: "2fr",+ };+ const PROJECT: BBGridColumn = {+ title: t("common.project"),+ width: "minmax(auto, 1fr)",+ };+ const VISIBILITY: BBGridColumn = {+ title: t("common.visibility"),+ width: "minmax(auto, 1fr)",+ };+ const CREATOR: BBGridColumn = {+ title: t("common.creator"),+ width: "minmax(auto, 1fr)",+ };+ const UPDATED: BBGridColumn = {+ title: t("common.updated-at"),+ width: "minmax(auto, 1fr)",+ };+ const OPERATION: BBGridColumn = {+ title: "",+ width: "auto",+ };+ const columns = [NAME, PROJECT, VISIBILITY];+ if (showCreator.value) {+ columns.push(CREATOR);+ }+ columns.push(UPDATED, OPERATION);+ return columns;+});++const projectForSheet = (sheet: Sheet) => {+ const project = extractProjectResourceName(sheet.name);+ return projectStore.getProjectByName(`projects/${project}`);+};++const creatorForSheet = (sheet: Sheet) => {+ return userStore.getUserByIdentifier(sheet.creator)?.title ?? sheet.creator;+};++const visibilityDisplayName = (visibility: Sheet_Visibility) => {+ switch (visibility) {+ case Sheet_Visibility.VISIBILITY_PRIVATE:+ return t("sql-editor.private");+ case Sheet_Visibility.VISIBILITY_PROJECT:+ return t("common.project");+ case Sheet_Visibility.VISIBILITY_PUBLIC:+ return t("sql-editor.public");+ default:+ return "";+ }+};++onMounted(() => {+ if (!isInitialized.value) {+ fetchSheetList();+ }+});+</script>diff --git a/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/index.ts b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/index.tsnew file mode 100644index 0000000000..7c7bac0e73--- /dev/null+++ b/frontend/src/views/sql-editor/TabList/SheetPanel/SheetTable/index.ts@@ -0,0 +1,3 @@+import SheetTable from "./SheetTable.vue";++export default SheetTable;diff --git a/frontend/src/views/sql-editor/TabList/SheetPanel/common.ts b/frontend/src/views/sql-editor/TabList/SheetPanel/common.tsnew file mode 100644index 0000000000..ee40e24cc0--- /dev/null+++ b/frontend/src/views/sql-editor/TabList/SheetPanel/common.ts@@ -0,0 +1,102 @@+import { InjectionKey, Ref, inject, provide, ref } from "vue";+import { useSheetV1Store } from "@/store";+import { Sheet } from "@/types/proto/v1/sheet_service";+import { getSheetIssueBacktracePayloadV1 } from "@/utils";+import Emittery from "emittery";++export const SheetViewModeList = ["my", "shared", "starred"] as const;+export type SheetViewMode = typeof SheetViewModeList[number];++type SheetPanelEvents = Emittery<{+ refresh: { views: SheetViewMode[] };+}>;++const useFetchSheetList = (viewMode: SheetViewMode) => {+ const sheetStore = useSheetV1Store();++ const isInitialized = ref(false);+ const isLoading = ref(false);+ const sheetList = ref<Sheet[]>([]);++ const fetchSheetList = async () => {+ isLoading.value = true;+ try {+ let list: Sheet[] = [];+ switch (viewMode) {+ case "my":+ list = await sheetStore.fetchMySheetList();+ break;+ case "shared":+ list = await sheetStore.fetchSharedSheetList();+ break;+ case "starred":+ list = await sheetStore.fetchStarredSheetList();+ break;+ }++ // Hide those sheets from issue.+ sheetList.value = list.filter((sheet) => {+ return !getSheetIssueBacktracePayloadV1(sheet);+ });++ isInitialized.value = true;+ } finally {+ isLoading.value = false;+ }+ };++ return {+ isInitialized,+ isLoading,+ sheetList,+ fetchSheetList,+ };+};++export type SheetPanelContext = {+ showPanel: Ref<boolean>;+ view: Ref<SheetViewMode>;+ views: Record<SheetViewMode, ReturnType<typeof useFetchSheetList>>;+ events: SheetPanelEvents;+};++export const KEY = Symbol(+ "bb.sql-editor.sheet-panel"+) as InjectionKey<SheetPanelContext>;++export const useSheetPanelContext = () => {+ return inject(KEY)!;+};++export const useSheetPanelContextByView = (view: SheetViewMode) => {+ const context = useSheetPanelContext();+ return context.views[view];+};++export const provideSheetPanelContext = () => {+ const context: SheetPanelContext = {+ showPanel: ref(false),+ view: ref("my"),+ views: {+ my: useFetchSheetList("my"),+ shared: useFetchSheetList("shared"),+ starred: useFetchSheetList("starred"),+ },+ events: new Emittery(),+ };++ context.events.on("refresh", ({ views }) => {+ views.forEach((view) => {+ // If the panel is shown and the view is current view, re-fetch immediately.+ if (context.showPanel.value && view === context.view.value) {+ context.views[view].fetchSheetList();+ } else {+ // Otherwise reset the view status to isInitialized=false+ context.views[view].isInitialized.value = false;+ context.views[view].sheetList.value = [];+ }+ });+ });++ provide(KEY, context);+};diff --git a/frontend/src/views/sql-editor/TabList/SheetPanel/index.ts b/frontend/src/views/sql-editor/TabList/SheetPanel/index.tsnew file mode 100644index 0000000000..616a1bd733--- /dev/null+++ b/frontend/src/views/sql-editor/TabList/SheetPanel/index.ts@@ -0,0 +1,3 @@+import SheetPanel from "./SheetPanel.vue";++export default SheetPanel;diff --git a/frontend/src/views/sql-editor/TabList/TabList.vue b/frontend/src/views/sql-editor/TabList/TabList.vueindex 994fdd5ed6..9e2f653b5c 100644--- a/frontend/src/views/sql-editor/TabList/TabList.vue+++ b/frontend/src/views/sql-editor/TabList/TabList.vue@@ -1,6 +1,8 @@<template>- <div class="flex box-border text-gray-500 text-sm border-b">- <div class="relative flex flex-nowrap overflow-hidden">+ <div+ class="flex justify-between items-center box-border text-gray-500 text-sm border-b pr-1"+ >+ <div class="relative flex flex-1 flex-nowrap overflow-hidden"><Draggableid="tab-list"ref="tabListRef"@@ -29,26 +31,41 @@/></template></Draggable>++ <button class="px-1" @click="handleAddTab">+ <heroicons-solid:plus+ class="h-6 w-6 p-1 hover:bg-gray-200 rounded-md"+ />+ </button></div>- <button class="px-1" @click="handleAddTab">- <heroicons-solid:plus class="h-6 w-6 p-1 hover:bg-gray-200 rounded-md" />- </button>+ <NButton size="tiny" @click="showSheetPanel = true">+ {{ $t("sql-editor.sheet.choose-sheet") }}+ </NButton>++ <Drawer v-model:show="showSheetPanel">+ <DrawerContent :title="$t('sql-editor.sheet.self')">+ <SheetPanel @close="showSheetPanel = false" />+ </DrawerContent>+ </Drawer></div></template><script lang="ts" setup>import { ref, reactive, nextTick, computed, onMounted, watch } from "vue";import { useI18n } from "vue-i18n";-import { useDialog } from "naive-ui";+import { useDialog, NButton } from "naive-ui";import Draggable from "vuedraggable";import scrollIntoView from "scroll-into-view-if-needed";+import { useResizeObserver } from "@vueuse/core";import type { TabInfo } from "@/types";import { TabMode } from "@/types";import { useTabStore } from "@/store";+import { Drawer, DrawerContent } from "@/components/v2";import TabItem from "./TabItem";-import { useResizeObserver } from "@vueuse/core";+import SheetPanel from "./SheetPanel";+import { useSheetPanelContext } from "./SheetPanel/common";type LocalState = {dragging: boolean;@@ -65,6 +82,7 @@ const state = reactive<LocalState>({hoverTabId: "",});+const { showPanel: showSheetPanel } = useSheetPanelContext();const tabListRef = ref<InstanceType<typeof Draggable>>();const scrollState = reactive({@@ -186,6 +204,6 @@ onMounted(() => recalculateScrollState());}.tab-list {- @apply flex flex-nowrap overflow-x-auto w-full hide-scrollbar;+ @apply flex flex-nowrap overflow-x-auto max-w-full hide-scrollbar;}</style>