Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore(frontend): lift Vue helpers into React layer + extend cross-framework CI guard (#20329)
boojack2a806ce64d30
diff --git a/docs/plans/2026-05-13-pr1-learnmorelink-chain-design.md b/docs/plans/2026-05-13-pr1-learnmorelink-chain-design.mdnew file mode 100644index 0000000000..b2a17e398b--- /dev/null+++ b/docs/plans/2026-05-13-pr1-learnmorelink-chain-design.md@@ -0,0 +1,122 @@+# PR-1 — LearnMoreLink Chain: Design++**Date:** 2026-05-13+**Parent doc:** [2026-05-12-react-migration-status-and-plan.md](./2026-05-12-react-migration-status-and-plan.md)+**Sequence:** First of three planned chain-cutting PRs. Follow-ups: PR-2 (MonacoEditor suite migration), PR-3 (BBAttention.vue migration).++---++## Goal++Delete `frontend/src/components/LearnMoreLink.vue` by inlining its short `<a + icon>` markup into the two Vue files that still call it.++`LearnMoreLink.vue` is **VUE-ONLY** (React callers already use the React `LearnMoreLink.tsx`). The two Vue callers are:++1. `frontend/src/bbkit/BBAttention.vue` — uses `<LearnMoreLink>` as a template element.+2. `frontend/src/components/MonacoEditor/utils.ts` — calls `h(LearnMoreLink, ...)` programmatically.++## Strategy: inline, don't abstract++The Vue component's template is 8 meaningful lines (an `<a>` element + an `ExternalLinkIcon`). The two callers each touch it exactly once. A shared helper would replace one import with another and add a layer for no benefit. Inline the markup directly.++## Scope: one PR++### 1. Edit `frontend/src/bbkit/BBAttention.vue`++**Replace the import:**++```diff+- import LearnMoreLink from "@/components/LearnMoreLink.vue";++ import { ExternalLinkIcon } from "lucide-vue-next";+```++**Replace the element:**++```diff+- <LearnMoreLink v-if="link" :url="link" class="ml-1 text-sm" />++ <a++ v-if="link"++ :href="link"++ target="__BLANK"++ class="inline-flex items-center normal-link ml-1 text-sm"++ >++ {{ $t("common.learn-more") }}++ <ExternalLinkIcon class="w-4 h-4 ml-1" />++ </a>+```++Notes:+- Keep classes `inline-flex items-center normal-link` — these come from the original `LearnMoreLink.vue` template (`color === "normal"` branch); preserving them keeps visual parity.+- `target="__BLANK"` matches the original template verbatim (note: the original uses `__BLANK`, not the conventional `_blank`; we preserve to avoid behavior drift).+- Drop the `external` conditional — `BBAttention`'s `link` prop is always an http(s) docs URL in current usage. If a future caller passes a non-external link, the icon is the only cosmetic difference.++### 2. Edit `frontend/src/components/MonacoEditor/utils.ts`++**Replace the import:**++```diff+- import LearnMoreLink from "../LearnMoreLink.vue";++ import { ExternalLinkIcon } from "lucide-vue-next";+```++**Replace the `h()` call:**++```diff+- h(LearnMoreLink, {+- url: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",+- }),++ h(++ "a",++ {++ href: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",++ target: "__BLANK",++ class: "inline-flex items-center normal-link",++ },++ [t("common.learn-more"), h(ExternalLinkIcon, { class: "w-4 h-4 ml-1" })]++ ),+```++### 3. Delete the Vue file++```bash+git rm frontend/src/components/LearnMoreLink.vue+```++### 4. Locale++`common.learn-more` stays — both new inlines call `$t("common.learn-more")` / `t("common.learn-more")`. ESLint `@intlify/vue-i18n/no-unused-keys` will not flag it.++## Validation++1. `rm -f frontend/.eslintcache` — clear ESLint cache (avoids the local-vs-CI mismatch from PR #20321 where stale cache hid an unused-key violation).+2. `pnpm --dir frontend type-check`+3. `pnpm --dir frontend check` — full lint chain.+4. `pnpm --dir frontend test` — existing tests, including the React→Vue import guard from PR #20321. The guard should still pass (Phase A's allowlist is untouched).+5. Manual smoke:+ - **BBAttention** — find one usage that passes a `link` prop and verify the learn-more anchor renders correctly. Quick search: `rg ':link=' frontend/src/ -tvue -l | head`.+ - **Monaco connection error** — simulate the WebSocket setup failure path. The error notification (`pushNotification` with `style: "CRITICAL"`) should render the learn-more link inside the Monaco-related error toast.++## Done when++- `frontend/src/components/LearnMoreLink.vue` does not exist.+- `rg 'LearnMoreLink' frontend/src/ -tvue -tts` returns only the matches inside the React `LearnMoreLink.tsx` and the React `lucide-react` import — no Vue imports of `LearnMoreLink.vue` anywhere.+- All automated checks pass.+- Both manual smoke paths render identical UI to pre-PR.++## Risks++Low. ~10 lines of inline replacement, 1 file deleted. The CSS classes are preserved so visual parity holds. Two failure modes:++- **`__BLANK` vs `_blank`**: the original used the non-standard `__BLANK` literal. Most browsers treat any unknown `target` as a new window, so behavior is unchanged. We preserve verbatim to avoid an accidental UX change.+- **`normal-link` class**: defined elsewhere (likely a global CSS class). Verified to exist in the codebase before deletion; if a future restyle removes it, the inlines fall back to default link styling — minor cosmetic only.++## Out of scope++- React-side `LearnMoreLink.tsx` — untouched. Continues serving React callers.+- BBAttention.vue's own migration to React — that's PR-3.+- MonacoEditor's overall migration — that's PR-2; after it lands, the `utils.ts` edit in this PR gets deleted entirely (with the rest of the Vue Monaco suite).+- Other VUE-ONLY chains (`UserAvatar`, `OverlayStackManager`, etc.) — separate future PRs.++## Estimated cost++~30 minutes including manual smoke.diff --git a/docs/plans/2026-05-13-pr1-learnmorelink-chain-plan.md b/docs/plans/2026-05-13-pr1-learnmorelink-chain-plan.mdnew file mode 100644index 0000000000..bcb7f5739b--- /dev/null+++ b/docs/plans/2026-05-13-pr1-learnmorelink-chain-plan.md@@ -0,0 +1,366 @@+# PR-1 — LearnMoreLink Chain: Implementation Plan++> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.++**Goal:** Delete `frontend/src/components/LearnMoreLink.vue` by inlining its `<a + ExternalLinkIcon>` markup into its two Vue callers (`bbkit/BBAttention.vue` and `MonacoEditor/utils.ts`).++**Architecture:** All three changes (two file edits + one deletion) land in a single atomic commit. Splitting would leave an intermediate state with a dangling import. Validation chain matches Phase A's: type-check, lint (with cleared ESLint cache to avoid the local-vs-CI mismatch we hit in PR #20321), tests, and the existing React→Vue CI guard.++**Tech Stack:** Vue 3, Naive UI, lucide-vue-next, vue-i18n, vitest, TypeScript, pnpm.++**Spec:** [`docs/plans/2026-05-13-pr1-learnmorelink-chain-design.md`](./2026-05-13-pr1-learnmorelink-chain-design.md)++---++## Pre-work: Baseline & branch++- [ ] **Step 0.1:** Confirm working tree clean and on a fresh main.++```bash+git status+git branch --show-current+```++Expected: clean tree, on `main`. If not on main, ask the user before proceeding.++- [ ] **Step 0.2:** Pull latest main.++```bash+git fetch origin main+git pull --ff-only origin main+```++- [ ] **Step 0.3:** Create the feature branch.++```bash+git checkout -b chore/pr1-drop-learnmorelink-vue+```++- [ ] **Step 0.4:** Baseline type-check (≈1 min).++Run: `pnpm --dir frontend type-check`+Expected: exit 0.++If type-check fails on a clean tree, stop and report — do not start edits.++---++## Task 1: Inline the link in BBAttention.vue++**Files:**+- Modify: `frontend/src/bbkit/BBAttention.vue` — line 10 (template usage) and line 37 (import)++- [ ] **Step 1.1: Replace the import on line 37**++Edit `frontend/src/bbkit/BBAttention.vue`:++```diff+- import LearnMoreLink from "@/components/LearnMoreLink.vue";++ import { ExternalLinkIcon } from "lucide-vue-next";+```++After this step, lines 33–37 should read:++```vue+<script lang="ts" setup>+import { NAlert, NButton } from "naive-ui";+import { computed } from "vue";+import { useI18n } from "vue-i18n";+import { ExternalLinkIcon } from "lucide-vue-next";+```++- [ ] **Step 1.2: Replace the `<LearnMoreLink>` element on line 10**++Edit `frontend/src/bbkit/BBAttention.vue`:++```diff+- <LearnMoreLink v-if="link" :url="link" class="ml-1 text-sm" />++ <a++ v-if="link"++ :href="link"++ target="__BLANK"++ class="inline-flex items-center normal-link ml-1 text-sm"++ >++ {{ $t("common.learn-more") }}++ <ExternalLinkIcon class="w-4 h-4 ml-1" />++ </a>+```++After this step, the `<slot name="default">` block (lines 6–13 originally) should read:++```vue+ <slot name="default">+ <div v-if="description" class="text-sm">+ <p class="whitespace-pre-wrap">+ {{ $te(description) ? $t(description) : description }}+ <a+ v-if="link"+ :href="link"+ target="__BLANK"+ class="inline-flex items-center normal-link ml-1 text-sm"+ >+ {{ $t("common.learn-more") }}+ <ExternalLinkIcon class="w-4 h-4 ml-1" />+ </a>+ </p>+ </div>+ </slot>+```++Notes:+- `target="__BLANK"` is intentional — matches the original `LearnMoreLink.vue` template verbatim. Browsers treat any non-`_blank` non-`_self`/`_parent`/`_top` value as a new window, so behavior is unchanged. Preserving the literal avoids accidental UX drift.+- The classes `inline-flex items-center normal-link` come from the original `LearnMoreLink.vue` template (`color === "normal"` branch). `normal-link` is defined in `frontend/src/assets/css/tailwind.css:302` — verified to exist.++---++## Task 2: Inline the link in MonacoEditor/utils.ts++**Files:**+- Modify: `frontend/src/components/MonacoEditor/utils.ts` — line 7 (import) and lines 129–131 (`h(LearnMoreLink, ...)` call)++- [ ] **Step 2.1: Replace the import on line 7**++Edit `frontend/src/components/MonacoEditor/utils.ts`:++```diff+- import LearnMoreLink from "../LearnMoreLink.vue";++ import { ExternalLinkIcon } from "lucide-vue-next";+```++After this step, lines 1–9 should read:++```ts+import { Range } from "monaco-editor";+import { h, isRef, unref, watch } from "vue";+import { ExternalLinkIcon } from "lucide-vue-next";+import { t } from "@/plugins/i18n";+import { pushNotification } from "@/store";+import type { Language, MaybeRef, SQLDialect } from "@/types";+import { minmax } from "@/utils";+import sqlFormatter from "./sqlFormatter";+import type { IStandaloneCodeEditor, Selection } from "./types";+```++(Note the import order — `lucide-vue-next` is a third-party package, so it sits with the other third-party imports near the top, before the `@/...` aliases. Biome's organize-imports may rearrange; if so, accept the rearrangement.)++- [ ] **Step 2.2: Replace the `h(LearnMoreLink, ...)` call on lines 129–131**++Edit `frontend/src/components/MonacoEditor/utils.ts`:++```diff+- h(LearnMoreLink, {+- url: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",+- }),++ h(++ "a",++ {++ href: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",++ target: "__BLANK",++ class: "inline-flex items-center normal-link",++ },++ [t("common.learn-more"), h(ExternalLinkIcon, { class: "w-4 h-4 ml-1" })]++ ),+```++After this step, the `errorNotification` body (lines 119–135 originally) should read:++```ts+export const errorNotification = (err: unknown) => {+ pushNotification({+ module: "bytebase",+ style: "CRITICAL",+ title: messages.title(),+ description: () => {+ const message = extractErrorMessage(err);+ return [+ h("p", {}, messages.description()),+ message ? h("p", {}, message) : null,+ h(+ "a",+ {+ href: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",+ target: "__BLANK",+ class: "inline-flex items-center normal-link",+ },+ [t("common.learn-more"), h(ExternalLinkIcon, { class: "w-4 h-4 ml-1" })]+ ),+ ];+ },+ });+};+```++---++## Task 3: Delete LearnMoreLink.vue++**Files:**+- Delete: `frontend/src/components/LearnMoreLink.vue`++- [ ] **Step 3.1: Confirm no remaining importers**++```bash+rg -n --type-add 'tsx:*.tsx' --type-add 'vue:*.vue' -tts -tvue -ttsx 'LearnMoreLink' frontend/src/ 2>/dev/null \+ | grep -v '^frontend/src/components/LearnMoreLink\.vue:' \+ | grep -v '^frontend/src/react/components/LearnMoreLink\.tsx:'+```++Expected: zero hits. The only remaining mentions should be in the file we're about to delete and in the React `LearnMoreLink.tsx` (which we're not touching).++If any hit appears, stop — a caller was missed. Investigate before deleting.++- [ ] **Step 3.2: Delete the file**++```bash+git rm frontend/src/components/LearnMoreLink.vue+```++---++## Task 4: Validate++- [ ] **Step 4.1: Clear the ESLint cache**++```bash+rm -f frontend/.eslintcache+```++This avoids the cache-staleness issue we hit in PR #20321 where `pnpm check` passed locally but failed in CI on an unused-locale-key violation.++- [ ] **Step 4.2: Type-check**++```bash+pnpm --dir frontend type-check+```++Expected: exit 0.++If failure: likely caused by an unmigrated reference. Inspect the type error message; it will point at the line. Fix and re-run.++- [ ] **Step 4.3: Full lint chain**++```bash+pnpm --dir frontend check+```++Expected: exit 0. This runs `eslint --cache src && biome ci . && check-react-i18n && check-react-layering && sort_i18n_keys --check`. Importantly, ESLint's `@intlify/vue-i18n/no-unused-keys` rule sees both new inlines call `$t("common.learn-more")` / `t("common.learn-more")`, so the `common.learn-more` key stays "used."++If failure on `common.learn-more`: re-verify both inlines reference it. The Vue template uses `{{ $t("common.learn-more") }}`; the TS call uses `t("common.learn-more")`. The ESLint rule scans `.vue`, `.ts`, `.tsx` and matches both.++- [ ] **Step 4.4: Tests**++```bash+pnpm --dir frontend test+```++Expected: 1873 tests pass (same count as PR #20321 baseline). The React→Vue CI guard from PR #20321 has nothing new to flag (no React file imports `.vue` here).++- [ ] **Step 4.5: Visual smoke (manual)**++```bash+PG_URL=postgresql://bbdev@localhost/bbdev pnpm --dir frontend dev+```++Verify two paths:++1. **BBAttention with `link` prop.** Find one:+ ```bash+ rg ':link=' frontend/src/ -tvue -l | head -5+ ```+ Visit a page that renders one of those `BBAttention` callers (typical candidates: settings pages with subscription-gating banners) and confirm the inline learn-more anchor:+ - Renders next to the description text+ - Has the external-link icon+ - Opens in a new window when clicked+ - Has the same visual styling as before this PR++2. **Monaco connection error notification.** Trigger by running Bytebase against a misconfigured WebSocket endpoint, or temporarily mock the failure to exercise `errorNotification` in `MonacoEditor/utils.ts`. The notification should render the learn-more link as a styled anchor with the icon.++If visual parity is broken: review the `normal-link` class behavior (it's defined in `frontend/src/assets/css/tailwind.css:302`). The pre-PR `LearnMoreLink.vue` template applied `inline-flex items-center normal-link` for the "normal" color branch — we replicate it.++---++## Task 5: Commit, push, and open the PR++- [ ] **Step 5.1: Single atomic commit**++```bash+git add frontend/src/bbkit/BBAttention.vue frontend/src/components/MonacoEditor/utils.ts+git commit -m "$(cat <<'EOF'+chore(frontend): drop LearnMoreLink.vue, inline anchor markup++LearnMoreLink.vue was VUE-ONLY after Phase A — only two Vue callers+remained (bbkit/BBAttention.vue and components/MonacoEditor/utils.ts).+Its template is a thin `<a + ExternalLinkIcon>` wrapper, so inlining+is shorter than the indirection.++- BBAttention.vue: replace `<LearnMoreLink :url=link>` with a plain+ `<a target="__BLANK">` carrying the same classes; swap import for+ lucide-vue-next ExternalLinkIcon.+- MonacoEditor/utils.ts: replace `h(LearnMoreLink, {...})` with the+ equivalent `h("a", {...}, [t("common.learn-more"), h(ExternalLinkIcon, ...)])`.+- Delete frontend/src/components/LearnMoreLink.vue.++`common.learn-more` locale key stays — both inlines still call it.++Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>+EOF+)"+```++The `git rm` from Step 3.2 has already staged the deletion, so a single `git commit` captures both edits + the deletion.++- [ ] **Step 5.2: Push**++```bash+git push -u origin chore/pr1-drop-learnmorelink-vue+```++- [ ] **Step 5.3: Open PR**++```bash+gh pr create --title "chore(frontend): drop LearnMoreLink.vue, inline anchor markup" --body "$(cat <<'EOF'+## Summary++First of three planned chain-cutting PRs after Phase A+([status](docs/plans/2026-05-12-react-migration-status-and-plan.md),+[design](docs/plans/2026-05-13-pr1-learnmorelink-chain-design.md)).++`LearnMoreLink.vue` was VUE-ONLY after Phase A's cross-framework guard+landed — only two Vue callers remained:++- `bbkit/BBAttention.vue` — template usage.+- `components/MonacoEditor/utils.ts` — programmatic `h()` call.++Its template is a thin `<a + ExternalLinkIcon>` wrapper. Inlining the+markup into both callers is shorter than the indirection. The Vue file+is deleted in the same change.++The React `LearnMoreLink.tsx` is untouched — it continues serving the+React layer.++## Test plan+- [x] `pnpm --dir frontend type-check` passes+- [x] `pnpm --dir frontend check` passes (eslint, biome, react-i18n, react-layering, locale sorter)+- [x] `pnpm --dir frontend test` passes (1873 tests, including the React→Vue import guard)+- [ ] Manual smoke: an attention banner with a `link` prop renders the inline learn-more anchor with correct styling and the external-link icon+- [ ] Manual smoke: the Monaco WebSocket-error notification renders the learn-more anchor as expected++🤖 Generated with [Claude Code](https://claude.com/claude-code)+EOF+)"+```++---++## Done when++- `frontend/src/components/LearnMoreLink.vue` no longer exists.+- `rg -n 'LearnMoreLink' frontend/src/ -tvue -tts` returns no hits inside Vue or TS files (the file is gone; the React `LearnMoreLink.tsx` remains untouched).+- All automated checks pass on CI.+- The two manual smoke paths render UI identical to pre-PR.++## Self-review notes++- **Spec coverage:** Spec's Section 1 = Task 1; Section 2 = Task 2; Section 3 = Task 3; Section 4 (Locale) is verified inline in Task 4.3; Validation list maps 1:1 to Task 4 steps.+- **Atomic commit rationale:** The spec calls for a single atomic change because the two edits + one deletion are interdependent (deleting first leaves broken imports; editing first leaves an unused file). The plan honors that with a single commit at Step 5.1.+- **No new CI guard entries needed:** Phase A's React→Vue guard allowlist (`SessionExpiredSurfaceMount`, `AgentWindowMount`) is unaffected. Adding `LearnMoreLink.vue` would have required an entry only if we were temporarily keeping it; we delete it instead.diff --git a/frontend/src/bbkit/BBAttention.vue b/frontend/src/bbkit/BBAttention.vueindex ce1931fa25..9938b07588 100644--- a/frontend/src/bbkit/BBAttention.vue+++ b/frontend/src/bbkit/BBAttention.vue@@ -7,7 +7,15 @@<div v-if="description" class="text-sm"><p class="whitespace-pre-wrap">{{ $te(description) ? $t(description) : description }}- <LearnMoreLink v-if="link" :url="link" class="ml-1 text-sm" />+ <a+ v-if="link"+ :href="link"+ target="__BLANK"+ class="inline-flex items-center normal-link ml-1 text-sm"+ >+ {{ $t("common.learn-more") }}+ <ExternalLinkIcon class="w-4 h-4 ml-1" />+ </a></p></div></slot>@@ -31,10 +39,10 @@</template><script lang="ts" setup>+import { ExternalLinkIcon } from "lucide-vue-next";import { NAlert, NButton } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";-import LearnMoreLink from "@/components/LearnMoreLink.vue";const props = withDefaults(defineProps<{diff --git a/frontend/src/components/LearnMoreLink.vue b/frontend/src/components/LearnMoreLink.vuedeleted file mode 100644index 9aeb8d2b96..0000000000--- a/frontend/src/components/LearnMoreLink.vue+++ /dev/null@@ -1,32 +0,0 @@-<template>- <a- v-if="url"- class="inline-flex items-center"- :class="[color === 'normal' ? 'normal-link' : 'light-link']"- :href="url"- :target="external ? '__BLANK' : ''"- >- {{ text }}- <ExternalLinkIcon v-if="external" class="w-4 h-4 ml-1" />- </a>-</template>--<script lang="ts" setup>-import { ExternalLinkIcon } from "lucide-vue-next";-import { computed } from "vue";-import { t } from "@/plugins/i18n";--const props = withDefaults(- defineProps<{- url: string;- text?: string;- color?: "normal" | "light";- }>(),- {- color: "normal",- text: () => t("common.learn-more"),- }-);--const external = computed(() => props.url.startsWith("http"));-</script>diff --git a/frontend/src/components/MonacoEditor/utils.ts b/frontend/src/components/MonacoEditor/utils.tsindex f4063c5824..c879eda762 100644--- a/frontend/src/components/MonacoEditor/utils.ts+++ b/frontend/src/components/MonacoEditor/utils.ts@@ -1,10 +1,10 @@+import { ExternalLinkIcon } from "lucide-vue-next";import { Range } from "monaco-editor";import { h, isRef, unref, watch } from "vue";import { t } from "@/plugins/i18n";import { pushNotification } from "@/store";import type { Language, MaybeRef, SQLDialect } from "@/types";import { minmax } from "@/utils";-import LearnMoreLink from "../LearnMoreLink.vue";import sqlFormatter from "./sqlFormatter";import type { IStandaloneCodeEditor, Selection } from "./types";@@ -126,9 +126,18 @@ export const errorNotification = (err: unknown) => {return [h("p", {}, messages.description()),message ? h("p", {}, message) : null,- h(LearnMoreLink, {- url: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",- }),+ h(+ "a",+ {+ href: "https://docs.bytebase.com/administration/production-setup/#enable-https-and-websocket",+ target: "__BLANK",+ class: "inline-flex items-center normal-link",+ },+ [+ t("common.learn-more"),+ h(ExternalLinkIcon, { class: "w-4 h-4 ml-1" }),+ ]+ ),];},});diff --git a/frontend/src/components/SQLReview/components/RuleConfigComponents/index.ts b/frontend/src/components/SQLReview/components/RuleConfigComponents/index.tsdeleted file mode 100644index eea524d655..0000000000--- a/frontend/src/components/SQLReview/components/RuleConfigComponents/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./types";diff --git a/frontend/src/components/User/UserAvatar.vue b/frontend/src/components/User/UserAvatar.vuedeleted file mode 100644index ef2c7bd320..0000000000--- a/frontend/src/components/User/UserAvatar.vue+++ /dev/null@@ -1,43 +0,0 @@-<template>- <BBAvatar- :username="username"- :email="email"- :size="size"- :override-class="overrideClass"- :override-text-size="overrideTextSize"- />-</template>--<script lang="ts" setup>-import { computed } from "vue";-import { BBAvatar } from "@/bbkit";-import type { BBAvatarSizeType } from "@/bbkit/types";-import { UNKNOWN_ID, unknownUser } from "@/types";-import { type User } from "@/types/proto-es/v1/user_service_pb";-import type { VueClass } from "@/utils";--const props = withDefaults(- defineProps<{- user?: User;- size?: BBAvatarSizeType;- overrideClass?: VueClass;- overrideTextSize?: string;- }>(),- {- user: () => unknownUser(),- }-);--const username = computed((): string => {- if (props.user.name === `users/${UNKNOWN_ID}`) {- return "?";- }- return props.user.title;-});-const email = computed(() => {- if (props.user.name === `users/${UNKNOWN_ID}`) {- return undefined;- }- return props.user.email;-});-</script>diff --git a/frontend/src/components/misc/AccountTag.vue b/frontend/src/components/misc/AccountTag.vuedeleted file mode 100644index f0e12c04ec..0000000000--- a/frontend/src/components/misc/AccountTag.vue+++ /dev/null@@ -1,21 +0,0 @@-<template>- <NTag v-if="accountType === AccountType.SERVICE_ACCOUNT || accountType === AccountType.WORKLOAD_IDENTITY" v-bind="$attrs" round type="info">- {{ accountType === AccountType.SERVICE_ACCOUNT- ? $t("settings.members.service-account")- : $t("settings.members.workload-identity")- }}- </NTag>-</template>--<script lang="ts" setup>-import { NTag } from "naive-ui";-import { computed } from "vue";-import { AccountType, getAccountTypeByEmail } from "@/types";-import type { User } from "@/types/proto-es/v1/user_service_pb";--const props = defineProps<{- user: User;-}>();--const accountType = computed(() => getAccountTypeByEmail(props.user.email));-</script>diff --git a/frontend/src/components/misc/YouTag.vue b/frontend/src/components/misc/YouTag.vuedeleted file mode 100644index 19e05ffa65..0000000000--- a/frontend/src/components/misc/YouTag.vue+++ /dev/null@@ -1,18 +0,0 @@-<template>- <NTag :size="size" v-bind="$attrs" round type="success">- {{ $t("common.you") }}- </NTag>-</template>--<script lang="ts" setup>-import { NTag } from "naive-ui";--withDefaults(- defineProps<{- size?: "tiny" | "small" | "medium" | "large";- }>(),- {- size: "small",- }-);-</script>diff --git a/frontend/src/components/v2/Model/cells/UserNameCell.vue b/frontend/src/components/v2/Model/cells/UserNameCell.vueindex d0b2e0bbc9..37f2ef276f 100644--- a/frontend/src/components/v2/Model/cells/UserNameCell.vue+++ b/frontend/src/components/v2/Model/cells/UserNameCell.vue@@ -1,6 +1,6 @@<template><div class="flex flex-row items-center" :class="gapClass">- <UserAvatar :user="user" :size="avatarSize" />+ <BBAvatar :username="avatarUsername" :email="avatarEmail" :size="avatarSize" /><div class="flex flex-row items-center min-w-0"><div class="flex flex-col min-w-0">@@ -30,8 +30,21 @@<NTag v-if="user.profile?.source && showSource" :size="tagSize" round type="info">{{ user.profile.source }}</NTag>- <YouTag v-if="currentUserV1.name === user.name" :size="tagSize"/>- <AccountTag :user="user" :size="tagSize" />+ <NTag v-if="currentUserV1.name === user.name" :size="tagSize" round type="success">+ {{ $t("common.you") }}+ </NTag>+ <NTag+ v-if="userAccountType === AccountType.SERVICE_ACCOUNT || userAccountType === AccountType.WORKLOAD_IDENTITY"+ :size="tagSize"+ round+ type="info"+ >+ {{+ userAccountType === AccountType.SERVICE_ACCOUNT+ ? $t("settings.members.service-account")+ : $t("settings.members.workload-identity")+ }}+ </NTag><NTag v-if="user.mfaEnabled && showMfaEnabled" :size="tagSize" type="success" round>{{ $t("two-factor.enabled") }}</NTag>@@ -86,12 +99,10 @@import { ReplyIcon } from "lucide-vue-next";import { NButton, NEllipsis, NTag } from "naive-ui";import { computed } from "vue";-import AccountTag from "@/components/misc/AccountTag.vue";-import YouTag from "@/components/misc/YouTag.vue";-import UserAvatar from "@/components/User/UserAvatar.vue";+import { BBAvatar } from "@/bbkit";import { CopyButton, HighlightLabelText } from "@/components/v2";import { useCurrentUserV1 } from "@/store";-import { AccountType, getAccountTypeByEmail } from "@/types";+import { AccountType, getAccountTypeByEmail, UNKNOWN_ID } from "@/types";import { State } from "@/types/proto-es/v1/common_pb";import type { User } from "@/types/proto-es/v1/user_service_pb";import { hasWorkspacePermissionV2 } from "@/utils";@@ -149,6 +160,16 @@ const avatarSize = computed(() => {}});+const avatarUsername = computed(() =>+ props.user.name === `users/${UNKNOWN_ID}` ? "?" : props.user.title+);++const avatarEmail = computed(() =>+ props.user.name === `users/${UNKNOWN_ID}` ? undefined : props.user.email+);++const userAccountType = computed(() => getAccountTypeByEmail(props.user.email));+const gapClass = computed(() => {if (props.size === "tiny") {return "gap-x-1";diff --git a/frontend/src/react/components/DatabaseGroupForm.tsx b/frontend/src/react/components/DatabaseGroupForm.tsxindex 4e6a2821a9..1fc4b7c6d5 100644--- a/frontend/src/react/components/DatabaseGroupForm.tsx+++ b/frontend/src/react/components/DatabaseGroupForm.tsx@@ -2,10 +2,6 @@ import { create } from "@bufbuild/protobuf";import { cloneDeep, head, isEqual } from "lodash-es";import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import {- FactorList,- getDatabaseGroupOptionConfigMap,-} from "@/components/DatabaseGroup/utils";import type { ConditionGroupExpr } from "@/plugins/cel";import {buildCELExpr,@@ -19,6 +15,10 @@ import { MatchedDatabaseView } from "@/react/components/MatchedDatabaseView";import { ResourceIdField } from "@/react/components/ResourceIdField";import { Button } from "@/react/components/ui/button";import { Input } from "@/react/components/ui/input";+import {+ FactorList,+ getDatabaseGroupOptionConfigMap,+} from "@/react/lib/database-group/utils";import { pushNotification, useDBGroupStore } from "@/store";import {databaseGroupNamePrefix,diff --git a/frontend/src/react/components/monaco/ReadonlyMonaco.tsx b/frontend/src/react/components/monaco/ReadonlyMonaco.tsxindex 81bff8607f..cf085c715d 100644--- a/frontend/src/react/components/monaco/ReadonlyMonaco.tsx+++ b/frontend/src/react/components/monaco/ReadonlyMonaco.tsx@@ -1,11 +1,11 @@import type * as monaco from "monaco-editor";-import type { MonacoModule } from "@/components/MonacoEditor";import type { Language } from "@/types";import { MonacoEditor } from "./MonacoEditor";import type {AdviceOption,IStandaloneEditorConstructionOptions,LineHighlightOption,+ MonacoModule,} from "./types";export interface ReadonlyMonacoProps {diff --git a/frontend/src/react/components/role-grant/DDLWarningCallout.tsx b/frontend/src/react/components/role-grant/DDLWarningCallout.tsxindex 4427edda3a..f547031fe1 100644--- a/frontend/src/react/components/role-grant/DDLWarningCallout.tsx+++ b/frontend/src/react/components/role-grant/DDLWarningCallout.tsx@@ -1,6 +1,6 @@import { useTranslation } from "react-i18next";-import type { EnvLimitationKind } from "@/components/ProjectMember/utils";import { Alert } from "@/react/components/ui/alert";+import type { EnvLimitationKind } from "@/react/lib/project-member/utils";type DDLWarningProps =| { type: "drawer"; kind: EnvLimitationKind }diff --git a/frontend/src/react/components/sql-editor/ExecuteHint.tsx b/frontend/src/react/components/sql-editor/ExecuteHint.tsxindex 4e6182ddb0..af3bedb2dd 100644--- a/frontend/src/react/components/sql-editor/ExecuteHint.tsx+++ b/frontend/src/react/components/sql-editor/ExecuteHint.tsx@@ -1,9 +1,9 @@import { Trans, useTranslation } from "react-i18next";import { v4 as uuidv4 } from "uuid";-import { applyPlanTitleToQuery } from "@/components/Plan/logic/title";import { Alert } from "@/react/components/ui/alert";import { Button } from "@/react/components/ui/button";import { useVueState } from "@/react/hooks/useVueState";+import { applyPlanTitleToQuery } from "@/react/lib/plan/title";import { router } from "@/router";import { PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL } from "@/router/dashboard/projectV1";import {diff --git a/frontend/src/react/components/sql-editor/Panels/common/CodeViewer.tsx b/frontend/src/react/components/sql-editor/Panels/common/CodeViewer.tsxindex 64e3575599..937d2f62df 100644--- a/frontend/src/react/components/sql-editor/Panels/common/CodeViewer.tsx+++ b/frontend/src/react/components/sql-editor/Panels/common/CodeViewer.tsx@@ -8,12 +8,12 @@ import {useState,} from "react";import { useTranslation } from "react-i18next";-import type { MonacoModule } from "@/components/MonacoEditor";-import formatSQL from "@/components/MonacoEditor/sqlFormatter";import { aiContextEvents } from "@/plugins/ai/logic";import * as promptUtils from "@/plugins/ai/logic/prompt";import type { ChatAction } from "@/plugins/ai/types";import { ReadonlyMonaco } from "@/react/components/monaco/ReadonlyMonaco";+import { formatSQL } from "@/react/components/monaco/sqlFormatter";+import type { MonacoModule } from "@/react/components/monaco/types";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";import { cn } from "@/react/lib/utils";diff --git a/frontend/src/react/components/sql-editor/Panels/common/DefinitionViewer.tsx b/frontend/src/react/components/sql-editor/Panels/common/DefinitionViewer.tsxindex 50ec8ddf85..e8335a3b90 100644--- a/frontend/src/react/components/sql-editor/Panels/common/DefinitionViewer.tsx+++ b/frontend/src/react/components/sql-editor/Panels/common/DefinitionViewer.tsx@@ -1,11 +1,11 @@import type * as monaco from "monaco-editor";import { useCallback, useEffect, useMemo, useState } from "react";-import type { MonacoModule } from "@/components/MonacoEditor";-import formatSQL from "@/components/MonacoEditor/sqlFormatter";import { aiContextEvents } from "@/plugins/ai/logic";import * as promptUtils from "@/plugins/ai/logic/prompt";import type { ChatAction } from "@/plugins/ai/types";import { ReadonlyMonaco } from "@/react/components/monaco/ReadonlyMonaco";+import { formatSQL } from "@/react/components/monaco/sqlFormatter";+import type { MonacoModule } from "@/react/components/monaco/types";import { useSQLEditorUIStore } from "@/store";import { dialectOfEngineV1 } from "@/types";import type { Database } from "@/types/proto-es/v1/database_service_pb";diff --git a/frontend/src/react/components/sql-editor/Panels/common/useAIActions.ts b/frontend/src/react/components/sql-editor/Panels/common/useAIActions.tsindex d6b779adf8..7e6b958f9f 100644--- a/frontend/src/react/components/sql-editor/Panels/common/useAIActions.ts+++ b/frontend/src/react/components/sql-editor/Panels/common/useAIActions.ts@@ -1,7 +1,7 @@import type * as monaco from "monaco-editor";import { useEffect } from "react";-import type { MonacoModule } from "@/components/MonacoEditor";import type { ChatAction } from "@/plugins/ai/types";+import type { MonacoModule } from "@/react/components/monaco/types";import { useVueState } from "@/react/hooks/useVueState";import { useSettingV1Store } from "@/store";import { Setting_SettingName } from "@/types/proto-es/v1/setting_service_pb";diff --git a/frontend/src/react/components/sql-editor/ResultView/ErrorView.tsx b/frontend/src/react/components/sql-editor/ResultView/ErrorView.tsxindex af5f4a6000..e5b92291a3 100644--- a/frontend/src/react/components/sql-editor/ResultView/ErrorView.tsx+++ b/frontend/src/react/components/sql-editor/ResultView/ErrorView.tsx@@ -1,7 +1,7 @@import { type IRange, Selection } from "monaco-editor";import { type ReactNode, useMemo } from "react";import { useTranslation } from "react-i18next";-import { positionWithOffset } from "@/components/MonacoEditor/utils";+import { positionWithOffset } from "@/react/components/monaco/utils";import { activeSQLEditorRef } from "@/react/components/sql-editor/StandardPanel/state";import { Alert } from "@/react/components/ui/alert";import { Button } from "@/react/components/ui/button";diff --git a/frontend/src/react/components/sql-editor/SQLEditorHomePage.tsx b/frontend/src/react/components/sql-editor/SQLEditorHomePage.tsxindex 47cd754a7b..4a25dac1fc 100644--- a/frontend/src/react/components/sql-editor/SQLEditorHomePage.tsx+++ b/frontend/src/react/components/sql-editor/SQLEditorHomePage.tsx@@ -7,7 +7,6 @@ import {Group as PanelGroup,Separator as PanelResizeHandle,} from "react-resizable-panels";-import { applyPlanTitleToQuery } from "@/components/Plan/logic/title";import { IAMRemindDialog } from "@/react/components/IAMRemindDialog";import { Quickstart } from "@/react/components/Quickstart";import { resizeHandleClass } from "@/react/components/SchemaEditorLite/resize";@@ -21,6 +20,7 @@ import {LAYER_SURFACE_CLASS,} from "@/react/components/ui/layer";import { useVueState } from "@/react/hooks/useVueState";+import { applyPlanTitleToQuery } from "@/react/lib/plan/title";import { cn } from "@/react/lib/utils";import { useNavigate } from "@/react/router";import { PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL } from "@/router/dashboard/projectV1";diff --git a/frontend/src/react/components/sql-editor/SchemaPane/actions.tsx b/frontend/src/react/components/sql-editor/SchemaPane/actions.tsxindex 20a3e990a0..dc9a90be8c 100644--- a/frontend/src/react/components/sql-editor/SchemaPane/actions.tsx+++ b/frontend/src/react/components/sql-editor/SchemaPane/actions.tsx@@ -15,8 +15,8 @@ import {import type { ReactNode } from "react";import { useCallback, useMemo } from "react";import { useTranslation } from "react-i18next";-import formatSQL from "@/components/MonacoEditor/sqlFormatter";import { useExecuteSQL } from "@/composables/useExecuteSQL";+import { formatSQL } from "@/react/components/monaco/sqlFormatter";import { router } from "@/router";import { SQL_EDITOR_DATABASE_MODULE } from "@/router/sqlEditor";import {diff --git a/frontend/src/react/components/sql-editor/StandardPanel/SQLEditor.tsx b/frontend/src/react/components/sql-editor/StandardPanel/SQLEditor.tsxindex 1d09b26817..6c02b5b8e5 100644--- a/frontend/src/react/components/sql-editor/StandardPanel/SQLEditor.tsx+++ b/frontend/src/react/components/sql-editor/StandardPanel/SQLEditor.tsx@@ -2,19 +2,19 @@ import type { IDisposable, IRange } from "monaco-editor";import * as monaco from "monaco-editor";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { v1 as uuidv1 } from "uuid";+import { aiContextEvents } from "@/plugins/ai/logic";+import * as promptUtils from "@/plugins/ai/logic/prompt";+import type { ChatAction } from "@/plugins/ai/types";+import { MonacoEditor } from "@/react/components/monaco/MonacoEditor";import type {IStandaloneCodeEditor,MonacoModule,Selection as MonacoSelection,-} from "@/components/MonacoEditor";+} from "@/react/components/monaco/types";import {extensionNameOfLanguage,formatEditorContent,-} from "@/components/MonacoEditor/utils";-import { aiContextEvents } from "@/plugins/ai/logic";-import * as promptUtils from "@/plugins/ai/logic/prompt";-import type { ChatAction } from "@/plugins/ai/types";-import { MonacoEditor } from "@/react/components/monaco/MonacoEditor";+} from "@/react/components/monaco/utils";import { useVueState } from "@/react/hooks/useVueState";import {useConnectionOfCurrentSQLEditorTab,diff --git a/frontend/src/react/components/sql-editor/StandardPanel/state.ts b/frontend/src/react/components/sql-editor/StandardPanel/state.tsindex 687fd57c49..86c4586700 100644--- a/frontend/src/react/components/sql-editor/StandardPanel/state.ts+++ b/frontend/src/react/components/sql-editor/StandardPanel/state.ts@@ -1,5 +1,5 @@import { shallowRef } from "vue";-import { type IStandaloneCodeEditor } from "@/components/MonacoEditor";+import { type IStandaloneCodeEditor } from "@/react/components/monaco/types";export const activeSQLEditorRef = shallowRef<IStandaloneCodeEditor>();diff --git a/frontend/src/react/components/sql-editor/TerminalPanel/CompactSQLEditor.tsx b/frontend/src/react/components/sql-editor/TerminalPanel/CompactSQLEditor.tsxindex 35d6367b55..c2e134c48b 100644--- a/frontend/src/react/components/sql-editor/TerminalPanel/CompactSQLEditor.tsx+++ b/frontend/src/react/components/sql-editor/TerminalPanel/CompactSQLEditor.tsx@@ -2,12 +2,12 @@ import { debounce } from "lodash-es";import type { IDisposable } from "monaco-editor";import * as monaco from "monaco-editor";import { useCallback, useEffect, useMemo, useRef } from "react";+import { MonacoEditor } from "@/react/components/monaco/MonacoEditor";import type {IStandaloneCodeEditor,MonacoModule,-} from "@/components/MonacoEditor";-import { formatEditorContent } from "@/components/MonacoEditor/utils";-import { MonacoEditor } from "@/react/components/monaco/MonacoEditor";+} from "@/react/components/monaco/types";+import { formatEditorContent } from "@/react/components/monaco/utils";import { useVueState } from "@/react/hooks/useVueState";import {useConnectionOfCurrentSQLEditorTab,diff --git a/frontend/src/react/components/sql-editor/TerminalPanel/TerminalPanel.tsx b/frontend/src/react/components/sql-editor/TerminalPanel/TerminalPanel.tsxindex 0a9f418ab8..a4744684ec 100644--- a/frontend/src/react/components/sql-editor/TerminalPanel/TerminalPanel.tsx+++ b/frontend/src/react/components/sql-editor/TerminalPanel/TerminalPanel.tsx@@ -2,7 +2,7 @@ import { Loader2 } from "lucide-react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { watch } from "vue";-import type { IStandaloneCodeEditor } from "@/components/MonacoEditor";+import type { IStandaloneCodeEditor } from "@/react/components/monaco/types";import { ConnectionHolder } from "@/react/components/sql-editor/ConnectionHolder";import { EditorAction } from "@/react/components/sql-editor/EditorAction";import { ResultView } from "@/react/components/sql-editor/ResultView";diff --git a/frontend/src/react/components/sql-review/Panels.tsx b/frontend/src/react/components/sql-review/Panels.tsxindex d991992f99..639303bae8 100644--- a/frontend/src/react/components/sql-review/Panels.tsx+++ b/frontend/src/react/components/sql-review/Panels.tsx@@ -1,6 +1,5 @@import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import { getRuleKey } from "@/components/SQLReview/components/utils";import { Alert } from "@/react/components/ui/alert";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";@@ -14,6 +13,7 @@ import {} from "@/react/components/ui/sheet";import { useEscapeKey } from "@/react/hooks/useEscapeKey";import { useVueState } from "@/react/hooks/useVueState";+import { getRuleKey } from "@/react/lib/sql-review/utils";import {pushNotification,useEnvironmentV1Store,diff --git a/frontend/src/react/components/sql-review/ReviewCreation.tsx b/frontend/src/react/components/sql-review/ReviewCreation.tsxindex 80e51ade09..53f35f3924 100644--- a/frontend/src/react/components/sql-review/ReviewCreation.tsx+++ b/frontend/src/react/components/sql-review/ReviewCreation.tsx@@ -3,10 +3,10 @@ import { isEqual } from "lodash-es";import { Plus } from "lucide-react";import { useCallback, useState } from "react";import { useTranslation } from "react-i18next";-import { getTemplateId } from "@/components/SQLReview/components/utils";import { ResourceIdField } from "@/react/components/ResourceIdField";import { Button } from "@/react/components/ui/button";import { Input } from "@/react/components/ui/input";+import { getTemplateId } from "@/react/lib/sql-review/utils";import { router } from "@/router";import {WORKSPACE_ROUTE_SQL_REVIEW,diff --git a/frontend/src/react/components/sql-review/RuleComponents.tsx b/frontend/src/react/components/sql-review/RuleComponents.tsxindex f359e0b33f..cda5fe6b98 100644--- a/frontend/src/react/components/sql-review/RuleComponents.tsx+++ b/frontend/src/react/components/sql-review/RuleComponents.tsx@@ -1,9 +1,6 @@import { CircleHelpIcon, XIcon } from "lucide-react";import { useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";-import type { PayloadValueType } from "@/components/SQLReview/components/RuleConfigComponents/types";-import { getRulePayload } from "@/components/SQLReview/components/RuleConfigComponents/utils";-import { payloadValueListToComponentList } from "@/components/SQLReview/components/utils";import { Badge } from "@/react/components/ui/badge";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";@@ -15,6 +12,9 @@ import {import { Input } from "@/react/components/ui/input";import { Tooltip } from "@/react/components/ui/tooltip";import i18n from "@/react/i18n";+import type { PayloadValueType } from "@/react/lib/sql-review/rule-config-types";+import { getRulePayload } from "@/react/lib/sql-review/rule-config-utils";+import { payloadValueListToComponentList } from "@/react/lib/sql-review/utils";import { Engine } from "@/types/proto-es/v1/common_pb";import { SQLReviewRule_Level } from "@/types/proto-es/v1/review_config_service_pb";import type {diff --git a/frontend/src/react/components/sql-review/RuleTable.tsx b/frontend/src/react/components/sql-review/RuleTable.tsxindex eccf1ad1c3..5dfebb43fa 100644--- a/frontend/src/react/components/sql-review/RuleTable.tsx+++ b/frontend/src/react/components/sql-review/RuleTable.tsx@@ -1,7 +1,6 @@import { ChevronDown, ChevronRight, ExternalLink, Pencil } from "lucide-react";import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import { getRuleKey } from "@/components/SQLReview/components/utils";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";import { SearchInput } from "@/react/components/ui/search-input";@@ -14,6 +13,7 @@ import {TableRow,} from "@/react/components/ui/table";import { Tabs, TabsList, TabsTrigger } from "@/react/components/ui/tabs";+import { getRuleKey } from "@/react/lib/sql-review/utils";import type { Engine } from "@/types/proto-es/v1/common_pb";import { SQLReviewRule_Level } from "@/types/proto-es/v1/review_config_service_pb";import type { RuleTemplateV2 } from "@/types/sqlReview";diff --git a/frontend/src/react/components/sql-review/TemplateSelector.test.tsx b/frontend/src/react/components/sql-review/TemplateSelector.test.tsxindex 6cebe3e246..40c66302fc 100644--- a/frontend/src/react/components/sql-review/TemplateSelector.test.tsx+++ b/frontend/src/react/components/sql-review/TemplateSelector.test.tsx@@ -39,7 +39,7 @@ vi.mock("@/react/hooks/useVueState", () => ({useVueState: mocks.useVueState,}));-vi.mock("@/components/SQLReview/components/utils", () => ({+vi.mock("@/react/lib/sql-review/utils", () => ({rulesToTemplate: mocks.rulesToTemplate,}));diff --git a/frontend/src/react/components/sql-review/TemplateSelector.tsx b/frontend/src/react/components/sql-review/TemplateSelector.tsxindex 0f57409ac1..d35c8f3c6e 100644--- a/frontend/src/react/components/sql-review/TemplateSelector.tsx+++ b/frontend/src/react/components/sql-review/TemplateSelector.tsx@@ -1,11 +1,11 @@import { CheckCircle } from "lucide-react";import { useEffect, useMemo } from "react";import { useTranslation } from "react-i18next";-import { rulesToTemplate } from "@/components/SQLReview/components/utils";import { EnvironmentLabel } from "@/react/components/EnvironmentLabel";import { Badge } from "@/react/components/ui/badge";import { Separator } from "@/react/components/ui/separator";import { useVueState } from "@/react/hooks/useVueState";+import { rulesToTemplate } from "@/react/lib/sql-review/utils";import { cn } from "@/react/lib/utils";import { useProjectV1Store, useSQLReviewStore } from "@/store";import {diff --git a/frontend/src/components/ColumnDataTable/utils.ts b/frontend/src/react/lib/column-data-table/utils.tssimilarity index 100%rename from frontend/src/components/ColumnDataTable/utils.tsrename to frontend/src/react/lib/column-data-table/utils.tsdiff --git a/frontend/src/components/DatabaseGroup/utils.ts b/frontend/src/react/lib/database-group/utils.tssimilarity index 100%rename from frontend/src/components/DatabaseGroup/utils.tsrename to frontend/src/react/lib/database-group/utils.tsdiff --git a/frontend/src/components/Plan/logic/issue.ts b/frontend/src/react/lib/plan/issue.tssimilarity index 100%rename from frontend/src/components/Plan/logic/issue.tsrename to frontend/src/react/lib/plan/issue.tsdiff --git a/frontend/src/components/Plan/logic/title.test.ts b/frontend/src/react/lib/plan/title.test.tssimilarity index 100%rename from frontend/src/components/Plan/logic/title.test.tsrename to frontend/src/react/lib/plan/title.test.tsdiff --git a/frontend/src/components/Plan/logic/title.ts b/frontend/src/react/lib/plan/title.tssimilarity index 100%rename from frontend/src/components/Plan/logic/title.tsrename to frontend/src/react/lib/plan/title.tsdiff --git a/frontend/src/components/ProjectMember/utils.test.ts b/frontend/src/react/lib/project-member/utils.test.tssimilarity index 100%rename from frontend/src/components/ProjectMember/utils.test.tsrename to frontend/src/react/lib/project-member/utils.test.tsdiff --git a/frontend/src/components/ProjectMember/utils.ts b/frontend/src/react/lib/project-member/utils.tssimilarity index 100%rename from frontend/src/components/ProjectMember/utils.tsrename to frontend/src/react/lib/project-member/utils.tsdiff --git a/frontend/src/components/SensitiveData/classification-example.json b/frontend/src/react/lib/sensitive-data/classification-example.jsonsimilarity index 100%rename from frontend/src/components/SensitiveData/classification-example.jsonrename to frontend/src/react/lib/sensitive-data/classification-example.jsondiff --git a/frontend/src/components/SensitiveData/components/utils.ts b/frontend/src/react/lib/sensitive-data/components-utils.tssimilarity index 91%rename from frontend/src/components/SensitiveData/components/utils.tsrename to frontend/src/react/lib/sensitive-data/components-utils.tsindex 5b89aa63fd..51dd858efb 100644--- a/frontend/src/components/SensitiveData/components/utils.ts+++ b/frontend/src/react/lib/sensitive-data/components-utils.ts@@ -1,5 +1,8 @@import { create } from "@bufbuild/protobuf";import { uniq } from "lodash-es";+// ResourceSelectOption sits in a v2/Select Vue dir but is a framework-neutral+// type alias over naive-ui's SelectOption. It can't move until ExprEditor/+// context's OptionConfig (which also references it) migrates to React.import type { ResourceSelectOption } from "@/components/v2/Select/RemoteResourceSelector/types";import type { Factor, Operator } from "@/plugins/cel";import { CollectionOperatorList, EqualityOperatorList } from "@/plugins/cel";diff --git a/frontend/src/components/SensitiveData/exemptionDataUtils.test.ts b/frontend/src/react/lib/sensitive-data/exemptionDataUtils.test.tssimilarity index 100%rename from frontend/src/components/SensitiveData/exemptionDataUtils.test.tsrename to frontend/src/react/lib/sensitive-data/exemptionDataUtils.test.tsdiff --git a/frontend/src/components/SensitiveData/exemptionDataUtils.ts b/frontend/src/react/lib/sensitive-data/exemptionDataUtils.tssimilarity index 100%rename from frontend/src/components/SensitiveData/exemptionDataUtils.tsrename to frontend/src/react/lib/sensitive-data/exemptionDataUtils.tsdiff --git a/frontend/src/components/SensitiveData/types.ts b/frontend/src/react/lib/sensitive-data/types.tssimilarity index 100%rename from frontend/src/components/SensitiveData/types.tsrename to frontend/src/react/lib/sensitive-data/types.tsdiff --git a/frontend/src/components/SensitiveData/utils.ts b/frontend/src/react/lib/sensitive-data/utils.tssimilarity index 96%rename from frontend/src/components/SensitiveData/utils.tsrename to frontend/src/react/lib/sensitive-data/utils.tsindex 95e7c012b8..114690fdf6 100644--- a/frontend/src/components/SensitiveData/utils.ts+++ b/frontend/src/react/lib/sensitive-data/utils.ts@@ -1,4 +1,3 @@-import type { MaskData } from "@/components/SensitiveData/types";import type { DatabaseResource } from "@/types";import type { MaskingExemptionPolicy_Exemption } from "@/types/proto-es/v1/org_policy_service_pb";import { extractDatabaseResourceName } from "@/utils";@@ -11,7 +10,7 @@ import {CEL_ATTRIBUTE_RESOURCE_SCHEMA_NAME,CEL_ATTRIBUTE_RESOURCE_TABLE_NAME,} from "@/utils/cel-attributes";-import type { SensitiveColumn } from "./types";+import type { MaskData, SensitiveColumn } from "./types";export const getMaskDataIdentifier = (maskData: MaskData): string => {return `${maskData.schema}.${maskData.table}.${maskData.column}`;diff --git a/frontend/src/components/SQLReview/components/RuleConfigComponents/types.ts b/frontend/src/react/lib/sql-review/rule-config-types.tssimilarity index 100%rename from frontend/src/components/SQLReview/components/RuleConfigComponents/types.tsrename to frontend/src/react/lib/sql-review/rule-config-types.tsdiff --git a/frontend/src/components/SQLReview/components/RuleConfigComponents/utils.ts b/frontend/src/react/lib/sql-review/rule-config-utils.tssimilarity index 89%rename from frontend/src/components/SQLReview/components/RuleConfigComponents/utils.tsrename to frontend/src/react/lib/sql-review/rule-config-utils.tsindex 878f1b58ca..aefb434df1 100644--- a/frontend/src/components/SQLReview/components/RuleConfigComponents/utils.ts+++ b/frontend/src/react/lib/sql-review/rule-config-utils.ts@@ -1,5 +1,5 @@import type { RuleTemplateV2 } from "@/types/sqlReview";-import type { PayloadValueType } from "./types";+import type { PayloadValueType } from "./rule-config-types";export const getRulePayload = (rule: RuleTemplateV2): PayloadValueType[] => {const { componentList } = rule;diff --git a/frontend/src/components/SQLReview/components/utils.ts b/frontend/src/react/lib/sql-review/utils.tssimilarity index 97%rename from frontend/src/components/SQLReview/components/utils.tsrename to frontend/src/react/lib/sql-review/utils.tsindex ea6cfd7b0b..d8975a53f2 100644--- a/frontend/src/components/SQLReview/components/utils.ts+++ b/frontend/src/react/lib/sql-review/utils.ts@@ -5,7 +5,7 @@ import type {} from "@/types";import { convertPolicyRuleToRuleTemplate, ruleTemplateMapV2 } from "@/types";import { SQLReviewRule_Type } from "@/types/proto-es/v1/review_config_service_pb";-import type { PayloadValueType } from "./RuleConfigComponents";+import type { PayloadValueType } from "./rule-config-types";export const getRuleKey = (rule: RuleTemplateV2) =>`${rule.engine}:${rule.type}`;diff --git a/frontend/src/react/locales/en-US.json b/frontend/src/react/locales/en-US.jsonindex 172c5a7983..f3462f9980 100644--- a/frontend/src/react/locales/en-US.json+++ b/frontend/src/react/locales/en-US.json@@ -1720,6 +1720,7 @@"expires-in-days_other": "Expires in {{days}} days","expires-today": "Expires today","grant-exemption": "Grant Exemption",+ "level": "level","n-exemptions_one": "{{n}} exemption","n-exemptions_other": "{{n}} exemptions","no-exemptions": "No masking exemptions granted yet",diff --git a/frontend/src/react/locales/es-ES.json b/frontend/src/react/locales/es-ES.jsonindex 548f2be702..a25cbfdda3 100644--- a/frontend/src/react/locales/es-ES.json+++ b/frontend/src/react/locales/es-ES.json@@ -1712,6 +1712,7 @@"expires-in-days_other": "Expira en {{days}} días","expires-today": "Expira hoy","grant-exemption": "Conceder Exención",+ "level": "nivel","n-exemptions_one": "{{n}} exención","n-exemptions_other": "{{n}} exenciones","no-exemptions": "Aún no se han concedido exenciones de enmascaramiento",diff --git a/frontend/src/react/locales/ja-JP.json b/frontend/src/react/locales/ja-JP.jsonindex 2e7a907592..8dab59832d 100644--- a/frontend/src/react/locales/ja-JP.json+++ b/frontend/src/react/locales/ja-JP.json@@ -1712,6 +1712,7 @@"expires-in-days_other": "{{days}} 日後に期限切れ","expires-today": "本日期限切れ","grant-exemption": "免除を付与",+ "level": "レベル","n-exemptions_one": "{{n}} 件の免除","n-exemptions_other": "{{n}} 件の免除","no-exemptions": "マスキング免除はまだ付与されていません",diff --git a/frontend/src/react/locales/vi-VN.json b/frontend/src/react/locales/vi-VN.jsonindex da9914ee1c..860ff260ea 100644--- a/frontend/src/react/locales/vi-VN.json+++ b/frontend/src/react/locales/vi-VN.json@@ -1712,6 +1712,7 @@"expires-in-days_other": "Hết hạn sau {{days}} ngày","expires-today": "Hết hạn hôm nay","grant-exemption": "Cấp Miễn trừ",+ "level": "cấp","n-exemptions_one": "{{n}} miễn trừ","n-exemptions_other": "{{n}} miễn trừ","no-exemptions": "Chưa có miễn trừ che giấu nào được cấp",diff --git a/frontend/src/react/locales/zh-CN.json b/frontend/src/react/locales/zh-CN.jsonindex 0dd05184ca..e21443c604 100644--- a/frontend/src/react/locales/zh-CN.json+++ b/frontend/src/react/locales/zh-CN.json@@ -1712,6 +1712,7 @@"expires-in-days_other": "{{days}} 天后到期","expires-today": "今天到期","grant-exemption": "授予豁免",+ "level": "等级","n-exemptions_one": "{{n}} 项豁免","n-exemptions_other": "{{n}} 项豁免","no-exemptions": "尚未授予脱敏豁免",diff --git a/frontend/src/react/no-react-to-vue-imports.test.ts b/frontend/src/react/no-react-to-vue-imports.test.tsindex a3de898f33..9dfbd20c83 100644--- a/frontend/src/react/no-react-to-vue-imports.test.ts+++ b/frontend/src/react/no-react-to-vue-imports.test.ts@@ -18,6 +18,24 @@ const allowedVueImports = new Set([const vueImportPattern = /from\s+["']([^"']+\.vue)["']/g;+// Vue-side helper modules that have React equivalents in+// frontend/src/react/components/monaco/. React code must import from the+// React copy, not from the Vue dir. The Vue dir stays alive because the+// AI plugin (frontend/src/plugins/ai/) still uses the Vue Monaco+// components — but React must not reach across.+const bannedReactToVueModulePrefixes = [+ "@/components/MonacoEditor",+ // Framework-neutral helpers that were moved out of components/ into the+ // React layer. The Vue counterpart directories no longer exist; this+ // entry locks the path back from being recreated.+ "@/components/Plan",+ "@/components/SQLReview",+ "@/components/ProjectMember",+ "@/components/ColumnDataTable",+ "@/components/SensitiveData",+ "@/components/DatabaseGroup",+];+describe("React layer must not import .vue files", () => {test("no .tsx or .ts file under frontend/src/react/ imports a .vue file", () => {const violations: string[] = [];@@ -40,4 +58,25 @@ describe("React layer must not import .vue files", () => {}expect(violations).toEqual([]);});++ test("no .tsx or .ts file under frontend/src/react/ imports Vue-side helper modules with React equivalents", () => {+ const importPattern = /from\s+["']([^"']+)["']/g;+ const violations: string[] = [];+ for (const [file, source] of Object.entries(sources)) {+ if (file.endsWith("/no-react-to-vue-imports.test.ts")) continue;+ if (file.endsWith("/no-legacy-vue-deps.test.ts")) continue;++ let match: RegExpExecArray | null;+ importPattern.lastIndex = 0;+ while ((match = importPattern.exec(source)) !== null) {+ const importPath = match[1];+ for (const prefix of bannedReactToVueModulePrefixes) {+ if (importPath === prefix || importPath.startsWith(`${prefix}/`)) {+ violations.push(`${file}: ${importPath}`);+ }+ }+ }+ }+ expect(violations).toEqual([]);+ });});diff --git a/frontend/src/react/pages/project/ProjectDatabaseDetailPage.test.tsx b/frontend/src/react/pages/project/ProjectDatabaseDetailPage.test.tsxindex 43b5804388..5bd5ca1aac 100644--- a/frontend/src/react/pages/project/ProjectDatabaseDetailPage.test.tsx+++ b/frontend/src/react/pages/project/ProjectDatabaseDetailPage.test.tsx@@ -310,7 +310,7 @@ vi.mock("@/store/modules/v1/actuator", () => ({useActuatorV1Store: mocks.useActuatorV1Store,}));-vi.mock("@/components/Plan/logic/issue", () => ({+vi.mock("@/react/lib/plan/issue", () => ({preCreateIssue: mocks.preCreateIssue,}));diff --git a/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx b/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsxindex 0723a3bf32..27ae61414e 100644--- a/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx+++ b/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx@@ -1,7 +1,6 @@import { Edit, EllipsisVertical } from "lucide-react";import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import { preCreateIssue } from "@/components/Plan/logic/issue";import { DatabaseGroupForm } from "@/react/components/DatabaseGroupForm";import { FeatureAttention } from "@/react/components/FeatureAttention";import { PermissionGuard } from "@/react/components/PermissionGuard";@@ -18,6 +17,7 @@ import {DropdownMenuTrigger,} from "@/react/components/ui/dropdown-menu";import { useVueState } from "@/react/hooks/useVueState";+import { preCreateIssue } from "@/react/lib/plan/issue";import { router } from "@/router";import { PROJECT_V1_ROUTE_DATABASE_GROUPS } from "@/router/dashboard/projectV1";import { hasFeature, useDBGroupStore, useProjectV1Store } from "@/store";diff --git a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx b/frontend/src/react/pages/project/ProjectDatabasesPage.tsxindex c010bc1e79..f11a255a75 100644--- a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx+++ b/frontend/src/react/pages/project/ProjectDatabasesPage.tsx@@ -3,7 +3,6 @@ import { FieldMaskSchema } from "@bufbuild/protobuf/wkt";import { Plus } from "lucide-react";import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import { preCreateIssue } from "@/components/Plan/logic/issue";import {AdvancedSearch,getValueFromScopes,@@ -27,6 +26,7 @@ import {} from "@/react/components/ui/alert-dialog";import { Button } from "@/react/components/ui/button";import { useVueState } from "@/react/hooks/useVueState";+import { preCreateIssue } from "@/react/lib/plan/issue";import {pushNotification,useActuatorV1Store,diff --git a/frontend/src/react/pages/project/ProjectMaskingExemptionCreatePage.tsx b/frontend/src/react/pages/project/ProjectMaskingExemptionCreatePage.tsxindex ae504b0a1c..2466062ba5 100644--- a/frontend/src/react/pages/project/ProjectMaskingExemptionCreatePage.tsx+++ b/frontend/src/react/pages/project/ProjectMaskingExemptionCreatePage.tsx@@ -4,9 +4,6 @@ import { CircleHelp } from "lucide-react";import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";import { type OptionConfig } from "@/components/ExprEditor/context";-import { getClassificationLevelOptions } from "@/components/SensitiveData/components/utils";-import { rewriteResourceDatabase } from "@/components/SensitiveData/exemptionDataUtils";-import { getExpressionsForDatabaseResource } from "@/components/SensitiveData/utils";import type { ConditionGroupExpr, Factor, Operator } from "@/plugins/cel";import {buildCELExpr,@@ -25,6 +22,9 @@ import { FeatureModal } from "@/react/components/ui/feature-modal";import { Input } from "@/react/components/ui/input";import { Tooltip } from "@/react/components/ui/tooltip";import { useVueState } from "@/react/hooks/useVueState";+import { getClassificationLevelOptions } from "@/react/lib/sensitive-data/components-utils";+import { rewriteResourceDatabase } from "@/react/lib/sensitive-data/exemptionDataUtils";+import { getExpressionsForDatabaseResource } from "@/react/lib/sensitive-data/utils";import { router } from "@/router";import {hasFeature,diff --git a/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx b/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsxindex 1dfa7d2b45..0b16367bbd 100644--- a/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx+++ b/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx@@ -3,19 +3,6 @@ import dayjs from "dayjs";import { ChevronRight, ShieldCheck } from "lucide-react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";-import {- buildMemberSummary,- generateGrantTitle,- getConditionExpression,- groupByMember,- parseExpirationTimestamp,-} from "@/components/SensitiveData/exemptionDataUtils";-import type {- AccessUser,- ClassificationLevel,- ExemptionGrant,- ExemptionMember,-} from "@/components/SensitiveData/types";import { operatorDisplayLabel } from "@/plugins/cel/types/operator";import {AdvancedSearch,@@ -43,6 +30,19 @@ import {} from "@/react/components/ui/table";import { Tabs, TabsList, TabsTrigger } from "@/react/components/ui/tabs";import { useVueState } from "@/react/hooks/useVueState";+import {+ buildMemberSummary,+ generateGrantTitle,+ getConditionExpression,+ groupByMember,+ parseExpirationTimestamp,+} from "@/react/lib/sensitive-data/exemptionDataUtils";+import type {+ AccessUser,+ ClassificationLevel,+ ExemptionGrant,+ ExemptionMember,+} from "@/react/lib/sensitive-data/types";import { cn } from "@/react/lib/utils";import { router } from "@/router";import { PROJECT_V1_ROUTE_MASKING_EXEMPTION_CREATE } from "@/router/dashboard/projectV1";diff --git a/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx b/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsxindex 60f8b13638..905fadece0 100644--- a/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx+++ b/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx@@ -12,7 +12,6 @@ import {import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { v4 as uuidv4 } from "uuid";-import { applyPlanTitleToQuery } from "@/components/Plan/logic/title";import {AdvancedSearch,type ScopeOption,@@ -41,6 +40,7 @@ import { useEscapeKey } from "@/react/hooks/useEscapeKey";import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";import { useSessionPageSize } from "@/react/hooks/useSessionPageSize";import { useVueState } from "@/react/hooks/useVueState";+import { applyPlanTitleToQuery } from "@/react/lib/plan/title";import { cn } from "@/react/lib/utils";import { router } from "@/router";import {diff --git a/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx b/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsxindex 39cb274a81..55b05ec6e6 100644--- a/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx+++ b/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx@@ -13,7 +13,6 @@ import {import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { v4 as uuidv4 } from "uuid";-import { applyPlanTitleToQuery } from "@/components/Plan/logic/title";import { DatabaseSelect } from "@/react/components/DatabaseSelect";import { EngineIcon } from "@/react/components/EngineIcon";import { EnvironmentSelect } from "@/react/components/EnvironmentSelect";@@ -46,6 +45,7 @@ import {import { useClickOutside } from "@/react/hooks/useClickOutside";import { useEscapeKey } from "@/react/hooks/useEscapeKey";import { useVueState } from "@/react/hooks/useVueState";+import { applyPlanTitleToQuery } from "@/react/lib/plan/title";import { cn } from "@/react/lib/utils";import { router } from "@/router";import { PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL } from "@/router/dashboard/projectV1";diff --git a/frontend/src/react/pages/project/database-detail/DatabaseDetailActions.tsx b/frontend/src/react/pages/project/database-detail/DatabaseDetailActions.tsxindex 567c43a3a9..322e533496 100644--- a/frontend/src/react/pages/project/database-detail/DatabaseDetailActions.tsx+++ b/frontend/src/react/pages/project/database-detail/DatabaseDetailActions.tsx@@ -1,10 +1,10 @@import { ArrowRightLeft, Pencil } from "lucide-react";import { useMemo } from "react";import { useTranslation } from "react-i18next";-import { preCreateIssue } from "@/components/Plan/logic/issue";import { PermissionGuard } from "@/react/components/PermissionGuard";import { Button } from "@/react/components/ui/button";import { useVueState } from "@/react/hooks/useVueState";+import { preCreateIssue } from "@/react/lib/plan/issue";import { usePermissionStore, useProjectV1Store } from "@/store";import type { Permission } from "@/types";import type { Database } from "@/types/proto-es/v1/database_service_pb";diff --git a/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.test.tsx b/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.test.tsxindex 006a55099a..f3304dbce5 100644--- a/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.test.tsx+++ b/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.test.tsx@@ -6,7 +6,7 @@ import type {import { act } from "react";import { createRoot } from "react-dom/client";import { beforeEach, describe, expect, test, vi } from "vitest";-import type { SensitiveColumn } from "@/components/SensitiveData/types";+import type { SensitiveColumn } from "@/react/lib/sensitive-data/types";(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }@@ -47,15 +47,15 @@ vi.mock("react-i18next", () => ({vi.mock("@/components/ExprEditor/context", () => ({}));-vi.mock("@/components/SensitiveData/components/utils", () => ({+vi.mock("@/react/lib/sensitive-data/components-utils", () => ({getClassificationLevelOptions: () => [],}));-vi.mock("@/components/SensitiveData/exemptionDataUtils", () => ({+vi.mock("@/react/lib/sensitive-data/exemptionDataUtils", () => ({rewriteResourceDatabase: vi.fn((expression: string) => expression),}));-vi.mock("@/components/SensitiveData/utils", () => ({+vi.mock("@/react/lib/sensitive-data/utils", () => ({convertSensitiveColumnToDatabaseResource: vi.fn((column) => ({databaseFullName: column.database.name,schema: column.maskData.schema,diff --git a/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.tsx b/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.tsxindex a92e7f45d1..7b55f1e3f8 100644--- a/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.tsx+++ b/frontend/src/react/pages/project/database-detail/catalog/GrantAccessDialog.tsx@@ -4,13 +4,6 @@ import { CircleHelp } from "lucide-react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { type OptionConfig } from "@/components/ExprEditor/context";-import { getClassificationLevelOptions } from "@/components/SensitiveData/components/utils";-import { rewriteResourceDatabase } from "@/components/SensitiveData/exemptionDataUtils";-import type { SensitiveColumn } from "@/components/SensitiveData/types";-import {- convertSensitiveColumnToDatabaseResource,- getExpressionsForDatabaseResource as getResourceExpressions,-} from "@/components/SensitiveData/utils";import type { ConditionGroupExpr, Factor, Operator } from "@/plugins/cel";import {buildCELExpr,@@ -36,6 +29,13 @@ import { FeatureModal } from "@/react/components/ui/feature-modal";import { Input } from "@/react/components/ui/input";import { Tooltip } from "@/react/components/ui/tooltip";import { useVueState } from "@/react/hooks/useVueState";+import { getClassificationLevelOptions } from "@/react/lib/sensitive-data/components-utils";+import { rewriteResourceDatabase } from "@/react/lib/sensitive-data/exemptionDataUtils";+import type { SensitiveColumn } from "@/react/lib/sensitive-data/types";+import {+ convertSensitiveColumnToDatabaseResource,+ getExpressionsForDatabaseResource as getResourceExpressions,+} from "@/react/lib/sensitive-data/utils";import { featureToRef, pushNotification, usePolicyV1Store } from "@/store";import type { DatabaseResource } from "@/types";import { ExprSchema } from "@/types/proto-es/google/type/expr_pb";diff --git a/frontend/src/react/pages/project/database-detail/catalog/SensitiveColumnTable.tsx b/frontend/src/react/pages/project/database-detail/catalog/SensitiveColumnTable.tsxindex 8d41febc7e..73794bd538 100644--- a/frontend/src/react/pages/project/database-detail/catalog/SensitiveColumnTable.tsx+++ b/frontend/src/react/pages/project/database-detail/catalog/SensitiveColumnTable.tsx@@ -1,7 +1,6 @@import { Trash2 } from "lucide-react";import { useMemo } from "react";import { useTranslation } from "react-i18next";-import type { MaskData } from "@/components/SensitiveData/types";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";import {@@ -19,6 +18,7 @@ import {TableHeader,TableRow,} from "@/react/components/ui/table";+import type { MaskData } from "@/react/lib/sensitive-data/types";import { router } from "@/router";import type { Database } from "@/types/proto-es/v1/database_service_pb";import { autoDatabaseRoute } from "@/utils";diff --git a/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.test.tsx b/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.test.tsxindex 8cf0f5665e..0c3a251f43 100644--- a/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.test.tsx+++ b/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.test.tsx@@ -141,7 +141,7 @@ vi.mock("@/utils", () => ({hasWorkspacePermissionV2: mocks.hasWorkspacePermissionV2,}));-vi.mock("@/components/ColumnDataTable/utils", () => ({+vi.mock("@/react/lib/column-data-table/utils", () => ({updateColumnCatalog: mocks.updateColumnCatalog,updateTableCatalog: mocks.updateTableCatalog,}));diff --git a/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.tsx b/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.tsxindex 25e16c0580..beec5f54d4 100644--- a/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.tsx+++ b/frontend/src/react/pages/project/database-detail/overview/TableDetailDialog.tsx@@ -4,10 +4,6 @@ import { Pencil, X } from "lucide-react";import type { MouseEvent, ReactNode } from "react";import { useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import {- updateColumnCatalog,- updateTableCatalog,-} from "@/components/ColumnDataTable/utils";import { FeatureAttention } from "@/react/components/FeatureAttention";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";@@ -28,6 +24,10 @@ import {} from "@/react/components/ui/table";import { Textarea } from "@/react/components/ui/textarea";import { useVueState } from "@/react/hooks/useVueState";+import {+ updateColumnCatalog,+ updateTableCatalog,+} from "@/react/lib/column-data-table/utils";import {getTableCatalog,pushNotification,diff --git a/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.test.tsx b/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.test.tsxindex 4e719f6a29..746485c792 100644--- a/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.test.tsx+++ b/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.test.tsx@@ -72,7 +72,7 @@ vi.mock("@/utils", () => ({hasWorkspacePermissionV2: mocks.hasWorkspacePermissionV2,}));-vi.mock("@/components/ColumnDataTable/utils", () => ({+vi.mock("@/react/lib/column-data-table/utils", () => ({updateTableCatalog: mocks.updateTableCatalog,}));diff --git a/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.tsx b/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.tsxindex 251b59aa0a..8547df9a52 100644--- a/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.tsx+++ b/frontend/src/react/pages/project/database-detail/overview/TableMetadataTable.tsx@@ -1,6 +1,5 @@import { useEffect, useMemo } from "react";import { useTranslation } from "react-i18next";-import { updateTableCatalog } from "@/components/ColumnDataTable/utils";import {Table,TableBody,@@ -10,6 +9,7 @@ import {TableRow,} from "@/react/components/ui/table";import { useVueState } from "@/react/hooks/useVueState";+import { updateTableCatalog } from "@/react/lib/column-data-table/utils";import {featureToRef,getTableCatalog,diff --git a/frontend/src/react/pages/project/database-detail/panels/DatabaseCatalogPanel.tsx b/frontend/src/react/pages/project/database-detail/panels/DatabaseCatalogPanel.tsxindex 92d896539b..640864596b 100644--- a/frontend/src/react/pages/project/database-detail/panels/DatabaseCatalogPanel.tsx+++ b/frontend/src/react/pages/project/database-detail/panels/DatabaseCatalogPanel.tsx@@ -2,14 +2,6 @@ import { create } from "@bufbuild/protobuf";import { ShieldCheck } from "lucide-react";import { useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import type {- MaskData,- MaskDataTarget,-} from "@/components/SensitiveData/types";-import {- getMaskDataIdentifier,- isCurrentColumnException,-} from "@/components/SensitiveData/utils";import { FeatureAttention } from "@/react/components/FeatureAttention";import { FeatureBadge } from "@/react/components/FeatureBadge";import { PermissionGuard } from "@/react/components/PermissionGuard";@@ -28,6 +20,14 @@ import {} from "@/react/components/ui/dialog";import { Input } from "@/react/components/ui/input";import { useVueState } from "@/react/hooks/useVueState";+import type {+ MaskData,+ MaskDataTarget,+} from "@/react/lib/sensitive-data/types";+import {+ getMaskDataIdentifier,+ isCurrentColumnException,+} from "@/react/lib/sensitive-data/utils";import {featureToRef,pushNotification,diff --git a/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx b/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsxindex a1df1246b1..2387394eb2 100644--- a/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx+++ b/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx@@ -24,7 +24,7 @@ vi.mock("react-i18next", () => ({}),}));-vi.mock("@/components/ProjectMember/utils", () => ({+vi.mock("@/react/lib/project-member/utils", () => ({getRoleEnvironmentLimitationKind: (role: string) =>role === "roles/sqlEditorUser" ? "DDL/DML" : undefined,}));diff --git a/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.tsx b/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.tsxindex 4c0692a420..9b508dc36b 100644--- a/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.tsx+++ b/frontend/src/react/pages/project/issue-detail/components/IssueDetailRoleGrantDetails.tsx@@ -1,7 +1,6 @@import dayjs from "dayjs";import { useEffect, useState } from "react";import { useTranslation } from "react-i18next";-import { getRoleEnvironmentLimitationKind } from "@/components/ProjectMember/utils";import { DDLWarningCallout } from "@/react/components/role-grant/DDLWarningCallout";import {Table,@@ -13,6 +12,7 @@ import {} from "@/react/components/ui/table";import { useEnvironmentList } from "@/react/hooks/useAppState";import { useVueState } from "@/react/hooks/useVueState";+import { getRoleEnvironmentLimitationKind } from "@/react/lib/project-member/utils";import {useDatabaseV1Store,useEnvironmentV1Store,diff --git a/frontend/src/react/pages/settings/DataClassificationPage.tsx b/frontend/src/react/pages/settings/DataClassificationPage.tsxindex b9885ef158..1df5bdeef7 100644--- a/frontend/src/react/pages/settings/DataClassificationPage.tsx+++ b/frontend/src/react/pages/settings/DataClassificationPage.tsx@@ -4,12 +4,12 @@ import { Pencil, Trash2, Undo2, X } from "lucide-react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { v4 as uuidv4 } from "uuid";-import classificationExample from "@/components/SensitiveData/classification-example.json";import { ClassificationTree } from "@/react/components/ClassificationTree";import { FeatureAttention } from "@/react/components/FeatureAttention";import { LearnMoreLink } from "@/react/components/LearnMoreLink";import { Button } from "@/react/components/ui/button";import { useVueState } from "@/react/hooks/useVueState";+import classificationExample from "@/react/lib/sensitive-data/classification-example.json";import {pushNotification,useSettingV1Store,diff --git a/frontend/src/react/pages/settings/GlobalMaskingPage.tsx b/frontend/src/react/pages/settings/GlobalMaskingPage.tsxindex 789acf4b06..cf710cb4b8 100644--- a/frontend/src/react/pages/settings/GlobalMaskingPage.tsx+++ b/frontend/src/react/pages/settings/GlobalMaskingPage.tsx@@ -10,10 +10,6 @@ import {import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { v4 as uuidv4 } from "uuid";-import {- factorOperatorOverrideMap,- getClassificationLevelOptions,-} from "@/components/SensitiveData/components/utils";import type { ConditionGroupExpr, Factor, SimpleExpr } from "@/plugins/cel";import {buildCELExpr,@@ -35,6 +31,10 @@ import {SelectValue,} from "@/react/components/ui/select";import { useVueState } from "@/react/hooks/useVueState";+import {+ factorOperatorOverrideMap,+ getClassificationLevelOptions,+} from "@/react/lib/sensitive-data/components-utils";import {pushNotification,useActuatorV1Store,diff --git a/frontend/src/react/pages/settings/MemberBindingEnvironmentBanner.tsx b/frontend/src/react/pages/settings/MemberBindingEnvironmentBanner.tsxindex 338dee5e5e..e636106d2e 100644--- a/frontend/src/react/pages/settings/MemberBindingEnvironmentBanner.tsx+++ b/frontend/src/react/pages/settings/MemberBindingEnvironmentBanner.tsx@@ -1,6 +1,6 @@-import type { EnvLimitationKind } from "@/components/ProjectMember/utils";import { EnvironmentLabel } from "@/react/components/EnvironmentLabel";import { DDLWarningCallout } from "@/react/components/role-grant/DDLWarningCallout";+import type { EnvLimitationKind } from "@/react/lib/project-member/utils";import type { ProjectRoleBindingEnvironmentLimitationState } from "./membersPageEnvironment";export function MemberBindingEnvironmentBanner({diff --git a/frontend/src/react/pages/settings/MembersPage.tsx b/frontend/src/react/pages/settings/MembersPage.tsxindex 0d3169d784..31dc1d1605 100644--- a/frontend/src/react/pages/settings/MembersPage.tsx+++ b/frontend/src/react/pages/settings/MembersPage.tsx@@ -21,10 +21,6 @@ import { useTranslation } from "react-i18next";import { groupProjectRoleBindings } from "@/components/Member/projectRoleBindings";import type { GroupBinding, MemberBinding } from "@/components/Member/types";import { getMemberBindings } from "@/components/Member/utils";-import {- getRoleEnvironmentLimitationKind,- roleHasDatabaseLimitation,-} from "@/components/ProjectMember/utils";import { AccountMultiSelect } from "@/react/components/AccountMultiSelect";import { DatabaseResourceSelector as DatabaseResourceSelectorComponent } from "@/react/components/DatabaseResourceSelector";import { EnvironmentMultiSelect } from "@/react/components/EnvironmentMultiSelect";@@ -65,6 +61,10 @@ import {import { Tooltip } from "@/react/components/ui/tooltip";import { useEscapeKey } from "@/react/hooks/useEscapeKey";import { useVueState } from "@/react/hooks/useVueState";+import {+ getRoleEnvironmentLimitationKind,+ roleHasDatabaseLimitation,+} from "@/react/lib/project-member/utils";import { cn } from "@/react/lib/utils";import {useNavigate,diff --git a/frontend/src/react/pages/settings/RequestRoleSheet.test.tsx b/frontend/src/react/pages/settings/RequestRoleSheet.test.tsxindex ec6b5a684e..b4a81f3ff4 100644--- a/frontend/src/react/pages/settings/RequestRoleSheet.test.tsx+++ b/frontend/src/react/pages/settings/RequestRoleSheet.test.tsx@@ -157,7 +157,7 @@ vi.mock("@/router/dashboard/projectV1", () => ({PROJECT_V1_ROUTE_ISSUE_DETAIL: "issue-detail",}));-vi.mock("@/components/ProjectMember/utils", () => ({+vi.mock("@/react/lib/project-member/utils", () => ({// Wrap in vi.fn() so per-test overrides (vi.mocked(x).mockReturnValue(...))// work — plain arrow functions can't be re-mocked at runtime.// Default: PROJECT_OWNER is not a SQL-permission role — both return@@ -329,7 +329,7 @@ async function typeReason(text: string): Promise<void> {beforeEach(async () => {vi.spyOn(window, "open").mockImplementation(() => null);// Reset env-kind mock between tests so per-test overrides don't leak.- const utilsMock = await import("@/components/ProjectMember/utils");+ const utilsMock = await import("@/react/lib/project-member/utils");vi.mocked(utilsMock.getRoleEnvironmentLimitationKind).mockReturnValue(undefined);@@ -411,7 +411,7 @@ describe("RequestRoleSheet — enforceIssueTitle (BYT-9310)", () => {it("renders DDL/DML warning under env multiselect when role has env limitation", async () => {// Override default helper mock for this case so the env section appears.- const utilsMock = await import("@/components/ProjectMember/utils");+ const utilsMock = await import("@/react/lib/project-member/utils");vi.mocked(utilsMock.getRoleEnvironmentLimitationKind).mockImplementation(() => "DDL/DML");diff --git a/frontend/src/react/pages/settings/RequestRoleSheet.tsx b/frontend/src/react/pages/settings/RequestRoleSheet.tsxindex 3814ae54ce..8140f886ad 100644--- a/frontend/src/react/pages/settings/RequestRoleSheet.tsx+++ b/frontend/src/react/pages/settings/RequestRoleSheet.tsx@@ -3,10 +3,6 @@ import { DurationSchema } from "@bufbuild/protobuf/wkt";import dayjs from "dayjs";import { useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import {- getRoleEnvironmentLimitationKind,- roleHasDatabaseLimitation,-} from "@/components/ProjectMember/utils";import { issueServiceClientConnect } from "@/connect";import type { ConditionGroupExpr, Factor, Operator } from "@/plugins/cel";import {@@ -35,6 +31,10 @@ import {} from "@/react/components/ui/sheet";import { Textarea } from "@/react/components/ui/textarea";import { useVueState } from "@/react/hooks/useVueState";+import {+ getRoleEnvironmentLimitationKind,+ roleHasDatabaseLimitation,+} from "@/react/lib/project-member/utils";import { router } from "@/router";import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";import {diff --git a/frontend/src/react/pages/settings/SQLReviewDetailPage.tsx b/frontend/src/react/pages/settings/SQLReviewDetailPage.tsxindex e1c0cdae2a..9e3228885e 100644--- a/frontend/src/react/pages/settings/SQLReviewDetailPage.tsx+++ b/frontend/src/react/pages/settings/SQLReviewDetailPage.tsx@@ -1,7 +1,6 @@import { Trash2 } from "lucide-react";import { useCallback, useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";-import { rulesToTemplate } from "@/components/SQLReview/components/utils";import { PermissionGuard } from "@/react/components/PermissionGuard";import { AttachResourcesPanel } from "@/react/components/sql-review/Panels";import { ResourceLink } from "@/react/components/sql-review/ResourceLink";@@ -19,6 +18,7 @@ import {} from "@/react/components/ui/dialog";import { Input } from "@/react/components/ui/input";import { useVueState } from "@/react/hooks/useVueState";+import { rulesToTemplate } from "@/react/lib/sql-review/utils";import { router } from "@/router";import { WORKSPACE_ROUTE_SQL_REVIEW } from "@/router/dashboard/workspaceRoutes";import { pushNotification, useSQLReviewStore } from "@/store";diff --git a/frontend/src/react/pages/settings/membersPageEnvironment.test.ts b/frontend/src/react/pages/settings/membersPageEnvironment.test.tsindex d77fc4b766..2eeebed2ac 100644--- a/frontend/src/react/pages/settings/membersPageEnvironment.test.ts+++ b/frontend/src/react/pages/settings/membersPageEnvironment.test.ts@@ -2,7 +2,7 @@ import { describe, expect, test, vi } from "vitest";import type { Binding } from "@/types/proto-es/v1/iam_policy_pb";import { getProjectRoleBindingEnvironmentLimitationState } from "./membersPageEnvironment";-vi.mock("@/components/ProjectMember/utils", () => ({+vi.mock("@/react/lib/project-member/utils", () => ({getRoleEnvironmentLimitationKind: (role: string) =>role === "roles/sqlEditorUser" ? "DDL/DML" : undefined,}));diff --git a/frontend/src/react/pages/settings/membersPageEnvironment.ts b/frontend/src/react/pages/settings/membersPageEnvironment.tsindex 42944baa06..a29eb6002e 100644--- a/frontend/src/react/pages/settings/membersPageEnvironment.ts+++ b/frontend/src/react/pages/settings/membersPageEnvironment.ts@@ -1,4 +1,4 @@-import { getRoleEnvironmentLimitationKind } from "@/components/ProjectMember/utils";+import { getRoleEnvironmentLimitationKind } from "@/react/lib/project-member/utils";import type { Binding } from "@/types/proto-es/v1/iam_policy_pb";import { convertFromExpr } from "@/utils/issue/cel";diff --git a/frontend/src/utils/accessGrant.ts b/frontend/src/utils/accessGrant.tsindex 23418bb73a..b4081f5c22 100644--- a/frontend/src/utils/accessGrant.ts+++ b/frontend/src/utils/accessGrant.ts@@ -1,11 +1,11 @@import dayjs from "dayjs";+import { NTag } from "naive-ui";import { h } from "vue";import BBAvatar from "@/bbkit/BBAvatar.vue";import type {ScopeOption,ValueOption,} from "@/components/AdvancedSearch/types";-import YouTag from "@/components/misc/YouTag.vue";import { RichDatabaseName } from "@/components/v2";import { t } from "@/plugins/i18n";import { useCurrentUserV1, useDatabaseV1Store, useUserStore } from "@/store";@@ -235,7 +235,13 @@ export const getAccessSearchOptions = ({h("span", user.title),];if (user.name === me.value.name) {- children.push(h(YouTag));+ children.push(+ h(+ NTag,+ { size: "small", round: true, type: "success" },+ { default: () => t("common.you") }+ )+ );}return h("div",