Skip to content

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

chore(frontend): remove Vue migration leftovers, consolidate tests and checks (#21436)

Danny Xub5f796111e97
diff --git a/docs/design/mcp-capability-ladder.md b/docs/design/mcp-capability-ladder.md
index 71b1ebb66e..31c26cc797 100644
--- a/docs/design/mcp-capability-ladder.md
+++ b/docs/design/mcp-capability-ladder.md
@@ -315,7 +315,7 @@ All strings, so the change and the locale files have one source. Keys under
- `MCPConsentCeiling.tsx`: replace the read, write and workflow lines with the row titles from the
same table.
- Locale: keys under `settings.mcp.ladder.*` in all five locale files;
- `frontend/scripts/check-react-i18n.mjs` guards them. The retired mode-description keys are
+ `frontend/scripts/check-i18n.mjs` guards them. The retired mode-description keys are
removed, not left empty.
- Tests: the served set per mode; the disclosure collapsed by default, opens, persists, and follows
the pick; the details toggle reveals sub-items on every row and persists with the open state; the
diff --git a/frontend/AGENTS.md b/frontend/AGENTS.md
index 32f2f3fc43..62d5626edf 100644
--- a/frontend/AGENTS.md
+++ b/frontend/AGENTS.md
@@ -48,12 +48,18 @@ Use route ownership as the primary organization axis. Do not add a generic `feat
- Start from the route in `src/app/router/routes/`, then open the matching subtree under `src/routes/`.
- Keep route-only code beside its route. Promote code to `components`, `hooks`, or `lib` only after it has multiple independent consumers.
- Colocate new types and helpers with their route or module. Do not grow the broad `types` and `utils` barrels without a cross-module need.
-- Put a large reusable workflow in `src/modules/<name>/`; do not spread one subsystem across `components`, `stores`, and a migration-era `views` directory.
+- Put a large reusable workflow in `src/modules/<name>/`; do not spread one subsystem across `components` and `stores`.
- Shared code and modules must not import from `src/routes/`. Move the shared implementation to its actual owner instead.
- Prefer direct owner imports such as `@/modules/sql-editor/store` over broad barrels when the owner is known.
- Historical migration plans under `docs/` describe old paths and are not current architecture guidance.
- `CLAUDE.md` files only import their adjacent `AGENTS.md`; update `AGENTS.md` as the source of truth.
-- `node frontend/scripts/check-frontend-structure.mjs` runs the structure guard. Do not bypass failures by recreating retired framework, view, or singular-store namespaces.
+
+## Tests and checks
+
+- Name a test after the file it tests and keep it beside that file: `Foo.tsx` → `Foo.test.tsx`. One test file per source file — no topic suffixes such as `Foo.i18n.test.ts` or `FooLayout.test.ts`, and no `__tests__/` directories.
+- Tests import and exercise code. Never read source files as text in a test.
+- Rules about code are checks, not tests. Prefer Biome: `noRestrictedImports` in `biome.json` for import boundaries, a GritQL plugin in `biome-plugins/` for code patterns. A check Biome cannot express goes in a `scripts/check-<name>.mjs`, which `pnpm test` runs automatically; locale rules live in `scripts/check-i18n.mjs`.
+- Browser flows belong in `tests/e2e/`.
## shadcn Skill
@@ -83,7 +89,7 @@ React UI components live in `src/components/ui/` and follow shadcn-style pattern
- Menus, popovers, dropdowns, and custom floating panels should use shared `DropdownMenu`, `Popover`, `Combobox`, `Select`, `Dialog`, or `Sheet` primitives rather than ad hoc `absolute top-full z-*` markup.
- Do not portal feature UI directly to `document.body` or a `document.body` alias. Use the shared overlay primitives, or explicitly mount into the correct semantic root with `getLayerRoot(<family>)`.
- Do not hide raw global overlay classes in constants, imported helpers, `cn()` inputs, or interpolated template literals. A value like `fixed inset-0 z-50` is still forbidden even when it is not written directly in `className`.
- - When adding or changing React overlays, run `node frontend/scripts/check-react-layering.mjs` before handing off. The scanner is intended to catch raw high-z overlays, forbidden body portals, and policy drift in feature code.
+ - When adding or changing React overlays, run `node frontend/scripts/check-layering.mjs` before handing off. The scanner is intended to catch raw high-z overlays, forbidden body portals, and policy drift in feature code.
- The scanner is a guardrail, not proof of policy compliance. It intentionally avoids full static analysis, so imported, dynamic, shadowed, or complex expressions may be unresolved; passing the check does not permit raw global z-index overlays or body portals.
### Component Patterns
diff --git a/frontend/biome-plugins/cel-filter-literals.grit b/frontend/biome-plugins/cel-filter-literals.grit
new file mode 100644
index 0000000000..85a6cfb30c
--- /dev/null
+++ b/frontend/biome-plugins/cel-filter-literals.grit
@@ -0,0 +1,22 @@
+// A value interpolated straight into a double-quoted CEL string literal breaks
+// the filter the moment it holds a `"`, and the backend rejects the whole
+// expression. celString / celStringList / celMapField in
+// src/utils/v1/celLiteral.ts own the quotes so the escape cannot be forgotten.
+language js
+
+JsTemplateExpression() as $template where {
+ or {
+ and {
+ $template <: r"[\s\S]*\.(?:contains|matches|startsWith|endsWith)\(\"\$\{[\s\S]*",
+ register_diagnostic(span=$template, message="Raw value in a CEL string argument; use name.contains(${celString(x)}).")
+ },
+ and {
+ $template <: r"[\s\S]*(?:[a-z][a-zA-Z0-9_.]*|\}|\])\s*(?:==|!=|>=|<=|<|>)\s*\"\$\{[\s\S]*",
+ register_diagnostic(span=$template, message="Raw value in a CEL comparison operand; use state == ${celString(x)}.")
+ },
+ and {
+ $template <: r"[\s\S]*\bin\s*\[\$\{[^\n]*\"\$\{[\s\S]*",
+ register_diagnostic(span=$template, message="Raw value in a CEL list element; use engine in ${celStringList(xs)}.")
+ }
+ }
+}
diff --git a/frontend/biome-plugins/no-crypto-randomuuid.grit b/frontend/biome-plugins/no-crypto-randomuuid.grit
new file mode 100644
index 0000000000..87d8d94776
--- /dev/null
+++ b/frontend/biome-plugins/no-crypto-randomuuid.grit
@@ -0,0 +1,5 @@
+language js
+
+`crypto.randomUUID($args)` as $call where {
+ register_diagnostic(span=$call, message="Use v4 from the uuid package instead of crypto.randomUUID() for compatibility.")
+}
diff --git a/frontend/biome.json b/frontend/biome.json
index ef90bbb75b..63cbb46d24 100644
--- a/frontend/biome.json
+++ b/frontend/biome.json
@@ -11,6 +11,7 @@
"!!src/types/proto-es/**"
]
},
+ "plugins": ["./biome-plugins/no-crypto-randomuuid.grit"],
"formatter": {
"enabled": true,
"indentStyle": "space",
@@ -46,6 +47,14 @@
"style": {
"noCommonJs": "error",
"noNamespace": "error",
+ "noRestrictedImports": {
+ "level": "error",
+ "options": {
+ "paths": {
+ "vue": "Only src/apps/explain-visualizer may use Vue."
+ }
+ }
+ },
"useArrayLiterals": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "off",
@@ -259,6 +268,51 @@
"enabled": false
}
},
+ {
+ "includes": [
+ "src/api/**",
+ "src/components/**",
+ "src/hooks/**",
+ "src/lib/**",
+ "src/modules/**",
+ "src/stores/**"
+ ],
+ "linter": {
+ "rules": {
+ "style": {
+ "noRestrictedImports": {
+ "level": "error",
+ "options": {
+ "paths": {
+ "vue": "Only src/apps/explain-visualizer may use Vue."
+ },
+ "patterns": [
+ {
+ "group": ["@/routes/**"],
+ "message": "Shared code must not import from src/routes; move the code to its shared owner."
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ "!src/**/*.test.ts",
+ "!src/**/*.test.tsx"
+ ],
+ "plugins": ["./biome-plugins/cel-filter-literals.grit"]
+ },
+ {
+ "includes": ["src/apps/explain-visualizer/**"],
+ "linter": {
+ "rules": { "style": { "noRestrictedImports": "off" } }
+ }
+ },
{
"includes": ["*.json", "**/*.json", "*.json5", "**/*.json5"],
"javascript": { "globals": [] },
diff --git a/frontend/package.json b/frontend/package.json
index 538ae9f6da..5f240a282d 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -3,13 +3,13 @@
"license": "SEE LICENSE IN LICENSE",
"packageManager": "[email protected]",
"scripts": {
- "prepare": "sh ./scripts/copy_config_files.sh && node scripts/generate_openapi_index.js",
+ "prepare": "sh ./scripts/copy-config-files.sh && node scripts/generate-openapi-index.js",
"dev": "export NODE_OPTIONS=--max_old_space_size=8000 && pnpm run prepare && vite --mode dev-local",
"release": "export NODE_OPTIONS=--max_old_space_size=8000 && pnpm run prepare && vite build --mode release --outDir=../backend/server/dist --emptyOutDir",
"release-docker": "export NODE_OPTIONS=--max_old_space_size=8000 && pnpm run prepare && vite build --mode release",
"release-aws": "export NODE_OPTIONS=--max_old_space_size=8000 && pnpm run prepare && vite build --mode release-aws",
"test": "node scripts/run-gate.mjs",
- "fix": "node scripts/sort_i18n_keys.mjs && biome check --write .",
+ "fix": "node scripts/sort-i18n-keys.mjs && biome check --write .",
"i18n": "node i18n.ts && pnpm fix",
"bundle-visualize": "export NODE_OPTIONS=--max_old_space_size=80000 && vite-bundle-visualizer -c vite.config.ts",
"test:e2e:install": "playwright install chromium"
diff --git a/frontend/scripts/check-frontend-structure.mjs b/frontend/scripts/check-frontend-structure.mjs
deleted file mode 100644
index e59b115093..0000000000
--- a/frontend/scripts/check-frontend-structure.mjs
+++ /dev/null
@@ -1,134 +0,0 @@
-import { existsSync, readFileSync, readdirSync } from "node:fs";
-import { dirname, relative, resolve } from "node:path";
-import { fileURLToPath } from "node:url";
-
-const scriptDir = dirname(fileURLToPath(import.meta.url));
-const frontendRoot = resolve(scriptDir, "..");
-const repoRoot = resolve(frontendRoot, "..");
-const sourceRoot = resolve(frontendRoot, "src");
-
-const errors = [];
-
-const removedDirectories = [
- "react",
- "features",
- "views",
- "layouts",
- "plugins",
- "connect",
- "store",
-];
-for (const directory of removedDirectories) {
- if (existsSync(resolve(sourceRoot, directory))) {
- errors.push(`src/${directory}/ must not be recreated`);
- }
-}
-
-const requiredDirectories = [
- "app",
- "app/router",
- "api",
- "components/ui",
- "modules",
- "routes/auth",
- "routes/project",
- "routes/workspace",
- "stores/app",
-];
-for (const directory of requiredDirectories) {
- if (!existsSync(resolve(sourceRoot, directory))) {
- errors.push(`required owner directory is missing: src/${directory}`);
- }
-}
-
-const listSourceFiles = (directory) =>
- readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
- const path = resolve(directory, entry.name);
- if (entry.isDirectory()) return listSourceFiles(path);
- return /\.(?:ts|tsx)$/.test(entry.name) ? [path] : [];
- });
-
-const retiredAliases = [
- ["@", "react"].join("/"),
- ["@", "views"].join("/"),
- ["@", "layouts"].join("/"),
- ["@", "connect"].join("/"),
- ["@", "plugins"].join("/"),
-];
-
-const sourceFiles = listSourceFiles(sourceRoot);
-for (const file of sourceFiles) {
- const source = readFileSync(file, "utf8");
- const path = relative(frontendRoot, file);
- for (const alias of retiredAliases) {
- if (source.includes(alias)) errors.push(`${path} uses retired alias ${alias}`);
- }
- if (/from\s+["']@\/store(?:[\/"'])/.test(source)) {
- errors.push(`${path} uses retired alias @/store`);
- }
-}
-
-const sharedRoots = ["api", "components", "hooks", "lib", "modules", "stores"];
-for (const root of sharedRoots) {
- for (const file of listSourceFiles(resolve(sourceRoot, root))) {
- const source = readFileSync(file, "utf8");
- if (source.includes("@/routes/")) {
- errors.push(`${relative(frontendRoot, file)} imports route-owned code`);
- }
- }
-}
-
-const agentFiles = [
- resolve(repoRoot, "AGENTS.md"),
- resolve(repoRoot, "CLAUDE.md"),
- resolve(repoRoot, "docs/superpowers/AGENTS.md"),
- resolve(repoRoot, "docs/agents/frontend-ux.md"),
- resolve(frontendRoot, "AGENTS.md"),
- resolve(frontendRoot, "CLAUDE.md"),
- resolve(frontendRoot, "components.json"),
- resolve(frontendRoot, "package.json"),
- resolve(frontendRoot, "vite.config.ts"),
- resolve(frontendRoot, "explain-visualizer.html"),
- resolve(frontendRoot, ".claude/BUTTON_SPACING_STANDARDIZATION.md"),
- resolve(frontendRoot, "tests/e2e/AGENTS.md"),
- resolve(frontendRoot, "src/modules/agent/AGENTS.md"),
- resolve(frontendRoot, "src/modules/sql-editor/AGENTS.md"),
-];
-const retiredDocumentationTokens = [
- ["src", "react"].join("/"),
- ["src", "features"].join("/"),
- ["src", "views"].join("/"),
- ["src", "layouts"].join("/"),
- ["src", "plugins"].join("/"),
- ["src", "connect"].join("/"),
- ["src", "store", ""].join("/"),
- ["@", "react"].join("/"),
- "VueShellBridgeEvent",
- "bb.vue-notification",
-];
-for (const file of agentFiles) {
- if (!existsSync(file)) {
- errors.push(`agent-facing file is missing: ${relative(repoRoot, file)}`);
- continue;
- }
- const source = readFileSync(file, "utf8");
- for (const token of retiredDocumentationTokens) {
- if (source.includes(token)) {
- errors.push(`${relative(repoRoot, file)} contains retired reference ${token}`);
- }
- }
-}
-
-for (const file of [resolve(repoRoot, "CLAUDE.md"), resolve(frontendRoot, "CLAUDE.md")]) {
- if (readFileSync(file, "utf8").trim() !== "@AGENTS.md") {
- errors.push(`${relative(repoRoot, file)} must delegate only to AGENTS.md`);
- }
-}
-
-if (errors.length > 0) {
- console.error("Frontend structure check failed:\n");
- for (const error of errors) console.error(`- ${error}`);
- process.exit(1);
-}
-
-console.log("Frontend structure check passed");
diff --git a/frontend/scripts/check-react-i18n.mjs b/frontend/scripts/check-i18n.mjs
similarity index 77%
rename from frontend/scripts/check-react-i18n.mjs
rename to frontend/scripts/check-i18n.mjs
index 9ee0d71683..9af44b96a4 100644
--- a/frontend/scripts/check-react-i18n.mjs
+++ b/frontend/scripts/check-i18n.mjs
@@ -1,16 +1,18 @@
-// frontend/scripts/check-react-i18n.mjs
+// frontend/scripts/check-i18n.mjs
//
// Enforces strict 1:1 mapping between source code and canonical locale files:
// 1. Missing keys — t("key") in code but key not in locale files
// 2. Unused keys — key in locale files but not referenced in code
// 3. Consistency — all locale files must have the exact same key set
-// 4. Placeholder syntax — react-i18next uses {{name}}; flag stray Vue-style
-// {name} placeholders left over from migration
+// 4. Placeholders — i18next uses {{name}}, and every locale uses the
+// same placeholders as en-US
// 5. Banned wording — retired user-facing terms must not reappear in
// locale values (keys and code identifiers are
// exempt — only rendered strings are checked)
+// 6. Section layout — SQL Review messages live only in sql-review/
+// 7. Linked wording — strings that must quote, or must not reuse, another
//
-// Usage: node frontend/scripts/check-react-i18n.mjs
+// Usage: node frontend/scripts/check-i18n.mjs
import { readFileSync, readdirSync } from "fs";
import { resolve, dirname } from "path";
@@ -83,49 +85,15 @@ const DYNAMIC_PREFIXES = [
// exempt the two sibling keys named literally.
"oauth2.consent.mcp.undisclosed.undisclosable.",
"oauth2.consent.mcp.undisclosed.unknown.",
- // Keys consumed by SHARED non-React `.ts` modules that translate via
- // `@/lib/i18n` (the same react-i18next instance — vue-i18n is gone), but
- // live OUTSIDE this checker's React-only scan, so they read as unused. They
- // must stay in the canonical locale files. Listed with the shared caller
- // that uses them:
- // - role.*.self / .description — displayRoleTitle / displayRoleTitleFromList
- // (src/utils/role.ts, src/lib/role.ts)
- "role.",
- // - project.webhook.activity-item.* — projectWebhookV1ActivityItemList
- // (src/types/v1/projectWebhook.ts)
- "project.webhook.activity-item.",
- // - webhook / IM type names — projectWebhookV1TypeItemList (same file)
- "common.dingtalk",
- "common.discord",
- "common.feishu",
- "common.google-chat",
- "common.lark",
- "common.slack",
- "common.teams",
- "common.wecom",
- // - common.canceled — src/utils/accessGrant.ts
- "common.canceled",
- // - common.no-license — src/utils/v1/instance.ts (instance display name)
- "common.no-license",
- // - data-source.{admin,read-only} — dataSourceType (src/utils/v1/instance.ts)
- "data-source.admin",
- "data-source.read-only",
- // - sheet.{mine,shared} — src/modules/sql-editor/model/Sheet/context.ts
- "sheet.mine",
- "sheet.shared",
- // - task.status.* — stringifyTaskStatus / stringifyTaskRunStatus
- // (src/utils/v1/issue/rollout.ts); failed/skipped also have literal
- // React callers and stay unlisted
+ // Passed through the `translate` parameter of stringifyTaskStatus /
+ // stringifyTaskRunStatus (src/utils/v1/issue/rollout.ts), which the t("…")
+ // scan does not match; failed/skipped also have literal callers.
"task.status.available",
"task.status.canceled",
"task.status.done",
"task.status.not-started",
"task.status.pending",
"task.status.running",
- // - auth.token-expired-description — src/api/middlewares/authInterceptorMiddleware.ts
- "auth.token-expired-description",
- // - issue.title.export-data — src/utils/v1/issue/issue.ts
- "issue.title.export-data",
];
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -207,11 +175,9 @@ function collectSourceKeys() {
const files = SOURCE_SCAN_DIRS.flatMap((dir) => [
...findFiles(dir, ".tsx"),
...findFiles(dir, ".ts"),
- ...findFiles(dir, ".vue"),
]);
const keys = new Set();
// Only match single/double quoted strings — template literals with ${} are dynamic keys.
- // This covers React `t("key")`, shared-module `t("key")`, and Vue `$t("key")`.
const re = /\bt\(\s*["']([^"']+)["']/g;
// <Trans i18nKey="..."> — react-i18next component-interpolation pattern
const transRe = /\bi18nKey\s*=\s*["']([^"']+)["']/g;
@@ -339,12 +305,13 @@ for (const locale of LOCALES) {
}
// ---------------------------------------------------------------------------
-// Check 4: Vue-style {name} placeholders (must be {{name}} for react-i18next)
+// Check 4: placeholders
// ---------------------------------------------------------------------------
-// react-i18next interpolates {{name}}. A bare {name} (not part of {{name}})
-// is a left-over from Vue's vue-i18n syntax and renders literally — see
-// the bug fixed alongside this check.
+// i18next interpolates {{name}}; a bare {name} renders literally. A locale
+// whose placeholders differ from en-US renders a raw placeholder or drops the
+// interpolated value.
const SINGLE_BRACE_RE = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_]*)\}(?!\})/g;
+const PLACEHOLDER_RE = /\{\{\s*([\w.-]+)(?:\s*,[^}]*)?\s*\}\}/g;
function findSingleBracePlaceholders(obj, path = "") {
const issues = [];
@@ -362,8 +329,15 @@ function findSingleBracePlaceholders(obj, path = "") {
return issues;
}
+function placeholders(value) {
+ return [...value.matchAll(PLACEHOLDER_RE)]
+ .map((m) => m[1])
+ .sort()
+ .join(", ");
+}
+
// Parse a locale's four section files as [pathPrefix, parsedJson] pairs.
-// Single source of truth for the locale file layout — used by checks 4 and 5.
+// Single source of truth for the locale file layout — used by checks 4–7.
function localeSections(locale) {
return [
["", `${locale}.json`],
@@ -382,7 +356,7 @@ for (const locale of LOCALES) {
);
if (issues.length > 0) {
console.error(
- `${locale}: ${issues.length} string(s) with Vue-style {name} placeholders — react-i18next needs {{name}}:\n`
+ `${locale}: ${issues.length} string(s) with {name} placeholders — i18next needs {{name}}:\n`
);
for (const { key, value, names } of issues) {
error(` - ${key} → ${JSON.stringify(value)} (placeholders: ${names.join(", ")})`);
@@ -391,6 +365,36 @@ for (const locale of LOCALES) {
}
}
+// Main-file values win over section values, matching src/lib/i18n/index.ts.
+function localeValues(locale) {
+ const [[, main], ...sections] = localeSections(locale);
+ return Object.assign(
+ {},
+ ...sections.map(([prefix, data]) => flatten(data, prefix)),
+ flatten(main)
+ );
+}
+
+const enUSValues = localeValues("en-US");
+for (const locale of LOCALES) {
+ if (locale === "en-US") continue;
+ const values = localeValues(locale);
+ const mismatched = Object.entries(enUSValues).filter(
+ ([key, value]) =>
+ typeof values[key] === "string" &&
+ placeholders(values[key]) !== placeholders(String(value))
+ );
+ if (mismatched.length > 0) {
+ console.error(
+ `${locale}: ${mismatched.length} string(s) whose placeholders differ from en-US:\n`
+ );
+ for (const [key, value] of mismatched) {
+ error(` - ${key}: en-US {${placeholders(String(value))}}, ${locale} {${placeholders(values[key])}}`);
+ }
+ console.error();
+ }
+}
+
// ---------------------------------------------------------------------------
// Check 5: banned wording in locale values
//
@@ -438,11 +442,52 @@ for (const locale of LOCALES) {
}
}
+// ---------------------------------------------------------------------------
+// Check 6: SQL Review messages live only in sql-review/
+// ---------------------------------------------------------------------------
+// The i18n module merges each main locale file over its sections, so a
+// "sql-review" key in a main file would shadow the SQL Review section.
+for (const locale of LOCALES) {
+ const [, main] = localeSections(locale)[0];
+ if (main["sql-review"] !== undefined) {
+ error(`${locale}.json: move "sql-review" messages to sql-review/${locale}.json`);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Check 7: linked wording
+// ---------------------------------------------------------------------------
+// The data-export setting's description quotes the "Request export" button
+// label so admins can connect the policy to what users see; the label has
+// been renamed before (#21081, #21200). The unmask capability is a different
+// mechanism from the Masking Exemptions feature, so its strings must not
+// reuse the feature's name (zh once shipped 脱敏豁免 on the unmask button).
+for (const locale of LOCALES) {
+ const values = localeValues(locale);
+ const label = values["sql-editor.request-export"] ?? "";
+ const description =
+ values["settings.general.workspace.data-export.description"] ?? "";
+ if (!label || !description.includes(label)) {
+ error(
+ `${locale}: settings.general.workspace.data-export.description must quote sql-editor.request-export (${JSON.stringify(label)})`
+ );
+ }
+ const featureName = values["project.masking-exemption.self"] ?? "";
+ for (const key of ["sql-editor.request-unmask", "sql-editor.grant-type-unmask"]) {
+ const value = values[key] ?? "";
+ if (featureName && value.toLowerCase().includes(featureName.toLowerCase())) {
+ error(
+ `${locale}: ${key} (${JSON.stringify(value)}) must not reuse the Masking Exemptions feature name (${JSON.stringify(featureName)})`
+ );
+ }
+ }
+}
+
// ---------------------------------------------------------------------------
// Result
// ---------------------------------------------------------------------------
if (errors > 0) {
process.exit(1);
} else {
- console.log("React i18n: all checks passed (missing keys, unused keys, cross-locale consistency, placeholder syntax, banned wording).");
+ console.log("i18n: all checks passed.");
}
diff --git a/frontend/scripts/check-react-layering.mjs b/frontend/scripts/check-layering.mjs
similarity index 98%
rename from frontend/scripts/check-react-layering.mjs
rename to frontend/scripts/check-layering.mjs
index cb3b97c7af..d8ae741955 100644
--- a/frontend/scripts/check-react-layering.mjs
+++ b/frontend/scripts/check-layering.mjs
@@ -1,6 +1,6 @@
-// frontend/scripts/check-react-layering.mjs
+// frontend/scripts/check-layering.mjs
//
-// Enforces the React semantic overlay layering policy introduced by PR #20012.
+// Enforces the semantic overlay layering policy introduced by PR #20012.
// Feature code must not create global z-index overlays directly. Use shared UI
// primitives or portal into the semantic layer roots instead.
//
@@ -663,7 +663,7 @@ const main = () => {
if (violations.length > 0) {
console.error(
- `React layering policy violations (${violations.length}). ` +
+ `Layering policy violations (${violations.length}). ` +
"Use shared overlay primitives or getLayerRoot(\"overlay\").\n"
);
for (const violation of violations) {
@@ -679,8 +679,8 @@ const main = () => {
console.log(
violations.length === 0
- ? "React layering policy: all checks passed."
- : "React layering policy: report-only mode completed with violations."
+ ? "Layering policy: all checks passed."
+ : "Layering policy: report-only mode completed with violations."
);
};
diff --git a/frontend/scripts/check-react-layering.test.mjs b/frontend/scripts/check-layering.test.mjs
similarity index 98%
rename from frontend/scripts/check-react-layering.test.mjs
rename to frontend/scripts/check-layering.test.mjs
index da270c7352..2bd1ec8bdf 100644
--- a/frontend/scripts/check-react-layering.test.mjs
+++ b/frontend/scripts/check-layering.test.mjs
@@ -1,10 +1,11 @@
+// @vitest-environment node
import { describe, expect, test } from "vitest";
-import { scanSource } from "./check-react-layering.mjs";
+import { scanSource } from "./check-layering.mjs";
const FEATURE_FILE = "src/routes/project/Feature.tsx";
const APPROVED_FILE = "src/components/ui/overlay.tsx";
-describe("check-react-layering", () => {
+describe("check-layering", () => {
test("flags raw overlay classes stored in local constants", () => {
const violations = scanSource(
`
diff --git a/frontend/scripts/check-no-crypto-randomuuid.mjs b/frontend/scripts/check-no-crypto-randomuuid.mjs
deleted file mode 100644
index e58815a82d..0000000000
--- a/frontend/scripts/check-no-crypto-randomuuid.mjs
+++ /dev/null
@@ -1,43 +0,0 @@
-import { existsSync, readdirSync, readFileSync } from "node:fs";
-import { join, relative } from "node:path";
-
-const repoRoot = process.cwd();
-const srcRoot = join(repoRoot, "src");
-const sourceFilePattern = /\.(?:cjs|cts|js|jsx|mjs|mts|ts|tsx)$/;
-const ignoredDirectories = new Set(["dist", "node_modules", "proto-es"]);
-const bannedPattern = /\bcrypto\s*\.\s*randomUUID\s*\(/;
-
-function listSourceFiles(dir) {
- if (!existsSync(dir)) {
- return [];
- }
-
- return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
- const path = join(dir, entry.name);
- if (entry.isDirectory()) {
- if (ignoredDirectories.has(entry.name)) {
- return [];
- }
- return listSourceFiles(path);
- }
- return sourceFilePattern.test(entry.name) ? [path] : [];
- });
-}
-
-const violations = [];
-for (const file of listSourceFiles(srcRoot)) {
- const source = readFileSync(file, "utf-8");
- if (bannedPattern.test(source)) {
- violations.push(relative(repoRoot, file));
- }
-}
-
-if (violations.length > 0) {
- console.error(
- "Use v4 from the uuid package instead of crypto.randomUUID() for compatibility:"
- );
- for (const violation of violations) {
- console.error(` - ${violation}`);
- }
- process.exitCode = 1;
-}
diff --git a/frontend/scripts/check-ui-guideline.test.mjs b/frontend/scripts/check-ui-guideline.test.mjs
index 9eef20a4f5..09eef4d36d 100644
--- a/frontend/scripts/check-ui-guideline.test.mjs
+++ b/frontend/scripts/check-ui-guideline.test.mjs
@@ -1,3 +1,4 @@
+// @vitest-environment node
import { existsSync, readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, test } from "vitest";
diff --git a/frontend/scripts/copy_config_files.sh b/frontend/scripts/copy-config-files.sh
similarity index 92%
rename from frontend/scripts/copy_config_files.sh
rename to frontend/scripts/copy-config-files.sh
index cf52f3c896..379c47b811 100644
--- a/frontend/scripts/copy_config_files.sh
+++ b/frontend/scripts/copy-config-files.sh
@@ -13,4 +13,4 @@ copy_atomic() {
copy_atomic ../backend/enterprise/plan.yaml ./src/types/plan.yaml
copy_atomic ../backend/common/permission/permission.yaml ./src/types/iam/permission.yaml
-node ./scripts/generate_permissions.js
+node ./scripts/generate-permissions.js
diff --git a/frontend/scripts/generate_openapi_index.js b/frontend/scripts/generate-openapi-index.js
similarity index 100%
rename from frontend/scripts/generate_openapi_index.js
rename to frontend/scripts/generate-openapi-index.js
diff --git a/frontend/scripts/generate_permissions.js b/frontend/scripts/generate-permissions.js
similarity index 93%
rename from frontend/scripts/generate_permissions.js
rename to frontend/scripts/generate-permissions.js
index 5882ba0ae2..73d87fbb8e 100755
--- a/frontend/scripts/generate_permissions.js
+++ b/frontend/scripts/generate-permissions.js
@@ -20,7 +20,7 @@ const permissions = data.permissions;
// Generate TypeScript content
const tsContent = `// This file is auto-generated from permission.yaml. DO NOT EDIT manually.
-// Run 'pnpm run generate:permissions' or 'sh scripts/copy_config_files.sh' to regenerate.
+// Run 'sh scripts/copy-config-files.sh' to regenerate.
export type Permission =
${permissions.map(p => ` | "${p}"`).join('\n')};
diff --git a/frontend/scripts/run-gate.mjs b/frontend/scripts/run-gate.mjs
index 15b0c2a741..5690fc9cc3 100644
--- a/frontend/scripts/run-gate.mjs
+++ b/frontend/scripts/run-gate.mjs
@@ -9,14 +9,12 @@
// has finished, so a failure reads the same as it did serially -- interleaved
// live output from four concurrent stages would not.
import { spawn } from "node:child_process";
+import { readdirSync } from "node:fs";
-const GUARDS = [
- "check-frontend-structure",
- "check-ui-guideline",
- "check-no-crypto-randomuuid",
- "check-react-i18n",
- "check-react-layering",
-];
+// Every scripts/check-*.mjs runs, so a new check cannot be left out of the gate.
+const GUARDS = readdirSync(new URL(".", import.meta.url))
+ .filter((file) => /^check-.*(?<!\.test)\.mjs$/.test(file))
+ .sort();
const BIG_HEAP = { NODE_OPTIONS: "--max_old_space_size=8000" };
@@ -28,7 +26,7 @@ const STAGES = [
argv: [
"sh",
"-c",
- [...GUARDS.map((g) => `node scripts/${g}.mjs`), "node scripts/sort_i18n_keys.mjs --check"].join(" && "),
+ [...GUARDS.map((g) => `node scripts/${g}`), "node scripts/sort-i18n-keys.mjs --check"].join(" && "),
],
},
{ name: "tsc", argv: ["pnpm", "exec", "tsc", "--build", "--force"], env: BIG_HEAP },
diff --git a/frontend/scripts/sort_i18n_keys.mjs b/frontend/scripts/sort-i18n-keys.mjs
similarity index 100%
rename from frontend/scripts/sort_i18n_keys.mjs
rename to frontend/scripts/sort-i18n-keys.mjs
diff --git a/frontend/scripts/sort_i18n_keys.test.mjs b/frontend/scripts/sort-i18n-keys.test.mjs
similarity index 99%
rename from frontend/scripts/sort_i18n_keys.test.mjs
rename to frontend/scripts/sort-i18n-keys.test.mjs
index f5f8365b24..05f62df60f 100644
--- a/frontend/scripts/sort_i18n_keys.test.mjs
+++ b/frontend/scripts/sort-i18n-keys.test.mjs
@@ -1,3 +1,4 @@
+// @vitest-environment node
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -7,7 +8,7 @@ import {
normalizeLocaleFile,
sortLocaleFiles,
sortObjectKeys,
-} from "./sort_i18n_keys.mjs";
+} from "./sort-i18n-keys.mjs";
let tempDir = "";
diff --git a/frontend/src/app/AppRoot.tsx b/frontend/src/app/AppRoot.tsx
index 4fc2fb00b9..a157dae609 100644
--- a/frontend/src/app/AppRoot.tsx
+++ b/frontend/src/app/AppRoot.tsx
@@ -14,7 +14,7 @@ setRouteNameIndex(buildRouteNameIndex());
// Single root-route loader: runs on every navigation (the root route matches
// every URL). Resolves the matched leaf route's `handle.name` and delegates to
-// the faithful `beforeEach` port; a returned `redirect()` Response navigates.
+// `rootGuard`; a returned `redirect()` Response navigates.
function rootLoader({ request }: LoaderFunctionArgs) {
const url = new URL(request.url);
const matched = matchRoutes(routes, url.pathname);
diff --git a/frontend/src/app/AuthGate.tsx b/frontend/src/app/AuthGate.tsx
index 056907c03a..d0a6127809 100644
--- a/frontend/src/app/AuthGate.tsx
+++ b/frontend/src/app/AuthGate.tsx
@@ -18,14 +18,13 @@ import { pushNotification } from "@/stores";
import { useAppStore } from "@/stores/app";
import { isDev } from "@/utils";
-// Session-validity poll interval (1 min dev, 5 min prod), mirroring the legacy
-// AuthContext.vue.
+// Session-validity poll interval (1 min dev, 5 min prod).
const CHECK_AUTHORIZATION_INTERVAL = isDev() ? 60 * 1000 : 60 * 1000 * 5;
-// Replaces AuthContext.vue: gates the app render on the authenticated session
-// (loading workspace-scoped data first), polls session validity, redirects on a
-// cross-tab user switch, and mounts the inactivity reminder. Reads session
-// state from the app store (the single source of truth).
+// Gates the app render on the authenticated session (loading workspace-scoped
+// data first), polls session validity, redirects on a cross-tab user switch,
+// and mounts the inactivity reminder. Reads session state from the app store
+// (the single source of truth).
export function AuthGate({ children }: { children: ReactNode }) {
const isLoggedIn = useAppStore((s) => s.isLoggedIn());
const currentUser = useAppStore((s) => s.currentUser);
diff --git a/frontend/src/app/RootLayout.tsx b/frontend/src/app/RootLayout.tsx
index 679426425e..cb870cbf70 100644
--- a/frontend/src/app/RootLayout.tsx
+++ b/frontend/src/app/RootLayout.tsx
@@ -12,7 +12,7 @@ import { Toaster } from "@/components/ui/toaster";
import { Watermark } from "@/components/Watermark";
import { AgentWindow } from "@/modules/agent/components/AgentWindow";
-// Translate a react-router Location into the legacy `ReactRoute` snapshot the
+// Translate a react-router Location into the `ReactRoute` snapshot the
// registered `beforeEach` leave guards expect (they read `to.name` /
// `to.fullPath`). Route name comes from matching the path against the table.
function snapshotLocation(location: Location): ReactRoute {
@@ -29,10 +29,10 @@ function snapshotLocation(location: Location): ReactRoute {
);
}
-// Single blocker reproducing vue-router's global `beforeEach` cancellation:
-// consults every registered leave guard and blocks the navigation if any calls
-// `next(false)`. The guards run `window.confirm` synchronously and remember a
-// pending target themselves, so a blocked navigation simply stays put.
+// Single blocker that consults every registered `beforeEach` leave guard and
+// blocks the navigation if any calls `next(false)`. The guards run
+// `window.confirm` synchronously and remember a pending target themselves, so
+// a blocked navigation simply stays put.
function LeaveGuardBlocker() {
const blockerRef = useRef<ReturnType<typeof useBlocker> | null>(null);
const blocker = useBlocker(
@@ -59,10 +59,9 @@ function LeaveGuardBlocker() {
}
// Root route element for the react-router app shell. Hosts the global overlays
-// that previously lived in `ReactApp.tsx` (Watermark / Toaster / AgentWindow /
-// SessionExpiredSurfaceGate) and wraps the routed tree in `<AuthGate>` so the
-// session lifecycle (load gate, poll, cross-tab switch, inactivity reminder)
-// runs around every page.
+// (Watermark / Toaster / AgentWindow / SessionExpiredSurfaceGate) and wraps the
+// routed tree in `<AuthGate>` so the session lifecycle (load gate, poll,
+// cross-tab switch, inactivity reminder) runs around every page.
export function RootLayout() {
return (
<>
diff --git a/frontend/src/app/SessionExpiredSurfaceGate.tsx b/frontend/src/app/SessionExpiredSurfaceGate.tsx
index c1a4c98d73..258cf735c8 100644
--- a/frontend/src/app/SessionExpiredSurfaceGate.tsx
+++ b/frontend/src/app/SessionExpiredSurfaceGate.tsx
@@ -9,8 +9,7 @@ export function SessionExpiredSurfaceGate() {
const isLoggedIn = useAppStore((s) => s.isLoggedIn());
const unauthenticatedOccurred = useAppStore((s) => s.unauthenticatedOccurred);
const currentPath = route.fullPath;
- // Match the guards that previously lived in AuthContext.vue: the
- // surface is only shown for an already-signed-in user on a non-auth
+ // The surface is only shown for an already-signed-in user on a non-auth
// route who just lost their session — otherwise the modal would block
// signin/signup flows.
if (isAuthRoute || !isLoggedIn || !unauthenticatedOccurred) return null;
diff --git a/frontend/src/app/layouts/BodyLayout.tsx b/frontend/src/app/layouts/BodyLayout.tsx
index bb2cd0eb81..744f747bd8 100644
--- a/frontend/src/app/layouts/BodyLayout.tsx
+++ b/frontend/src/app/layouts/BodyLayout.tsx
@@ -13,19 +13,11 @@ import { ProjectSidebar } from "@/components/ProjectSidebar";
import { RoutePermissionGuardShell } from "@/components/RoutePermissionGuardShell";
import { WorkspaceSetupGuide } from "@/modules/workspace-setup-guide/WorkspaceSetupGuide";
-// Ported from `src/layouts/BodyLayout.vue`. Mounts the workspace
-// `DashboardBodyShell` (header + sidebar slot + body slot) and portals the
-// React sidebar, routed body (`<Outlet/>` — the Vue named views collapse to
-// one outlet here, gated by `RoutePermissionGuardShell` on non-project
-// routes), and quickstart into the shell's reported targets. The
-// shell owns the responsive sidebar / mobile drawer; this layout supplies the
-// React `DashboardSidebar` tree directly instead of the Vue ReactSidebarMount.
-// Also ports the agent keyboard shortcut from the Vue layout's lifecycle.
-//
-// NOTE: the Vue layout's periodic "refresh reminder" (actuatorStore
-// .tryToRemindRefresh) is intentionally omitted — it reads Pinia-only actuator
-// state with no app-store equivalent yet, and this layout is restricted to
-// `useAppStore` / react-router reads. Reattach once that surface is ported.
+// Mounts the workspace `DashboardBodyShell` (header + sidebar slot + body slot)
+// and portals the sidebar, routed body (`<Outlet/>`, gated by
+// `RoutePermissionGuardShell` on non-project routes), and quickstart into the
+// shell's reported targets. The shell owns the responsive sidebar / mobile
+// drawer.
export function BodyLayout() {
const matches = useMatches();
const location = useLocation();
@@ -34,7 +26,7 @@ export function BodyLayout() {
)?.name;
const isRootPath = currentRouteName === WORKSPACE_ROOT_MODULE;
// Workspace "My Issues" is a standalone full-width page: header (with logo)
- // but no sidebar, mirroring the Vue IssuesRouteShell (variant="issues").
+ // but no sidebar (the shell's `issues` variant).
const isMyIssues = currentRouteName === WORKSPACE_ROUTE_MY_ISSUES;
// Project-scoped routes (`workspace.project.*`) get the project sidebar; the
// bare projects list (`workspace.project`) keeps the workspace sidebar.
@@ -57,14 +49,13 @@ export function BodyLayout() {
// into the shell's content target and reports a non-null target only once the
// route's `requiredPermissions` are satisfied, so a restricted page never
// mounts (it shows the permission-denied / request-role fallback instead).
- // This mirrors the Vue `BodyLayout.vue` content teleport. Project routes
- // (`workspace.project.*`) bypass this gate — their gating belongs to
- // `ProjectRouteShell`, which loads the project resource for project-scoped
- // permission checks.
+ // Project routes (`workspace.project.*`) bypass this gate — their gating
+ // belongs to `ProjectRouteGate`, which loads the project resource for
+ // project-scoped permission checks.
const [permissionTarget, setPermissionTarget] =
useState<HTMLDivElement | null>(null);
- // Agent toggle shortcut (Ctrl/Cmd+Shift+A), ported from the Vue layout.
+ // Agent toggle shortcut (Ctrl/Cmd+Shift+A).
useEffect(() => {
const handler = async (e: KeyboardEvent) => {
if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key === "A") {
diff --git a/frontend/src/app/layouts/DashboardLayout.tsx b/frontend/src/app/layouts/DashboardLayout.tsx
index 914183fc9d..adef4e4dc7 100644
--- a/frontend/src/app/layouts/DashboardLayout.tsx
+++ b/frontend/src/app/layouts/DashboardLayout.tsx
@@ -5,12 +5,10 @@ import type { DashboardFrameShellTargets } from "@/app/dashboard-shell";
import { DashboardFrameShell } from "@/components/DashboardFrameShell";
import { useEnsureWorkspaceCommonData } from "@/hooks/useEnsureWorkspaceCommonData";
-// Ported from `src/layouts/DashboardLayout.vue`. The Vue layout mounted
-// `DashboardFrameShell` and teleported `<router-view name="body"/>` into the
-// shell's body target. In React the named view collapses to the single
-// `<Outlet/>`, portaled into the body element the shell reports via `onReady`.
-// The shell renders banners + a loading gate; this layout also kicks off the
-// workspace-scope bootstrap (idempotent, deduped by the app store).
+// Mounts `DashboardFrameShell` and portals the routed `<Outlet/>` into the body
+// element the shell reports via `onReady`. The shell renders banners + a
+// loading gate; this layout also kicks off the workspace-scope bootstrap
+// (idempotent, deduped by the app store).
export function DashboardLayout() {
useEnsureWorkspaceCommonData();
diff --git a/frontend/src/app/layouts/SplashLayout.tsx b/frontend/src/app/layouts/SplashLayout.tsx
index 3a928f6f57..ec3f627d9e 100644
--- a/frontend/src/app/layouts/SplashLayout.tsx
+++ b/frontend/src/app/layouts/SplashLayout.tsx
@@ -6,9 +6,9 @@ import signupImage from "@/assets/illustration/signup.webp";
import { useAppStore } from "@/stores/app";
import { PlanType } from "@/types/proto-es/v1/subscription_service_pb";
-// Ported from `src/layouts/SplashLayout.vue`. Two-column auth chrome: an
-// optional branding illustration on the left (shown unless the workspace is on
-// a non-trialing enterprise plan) and the routed auth page on the right.
+// Two-column auth chrome: an optional branding illustration on the left (shown
+// unless the workspace is on a non-trialing enterprise plan) and the routed
+// auth page on the right.
export function SplashLayout() {
const matches = useMatches();
const currentRouteName = (
diff --git a/frontend/src/app/mountApp.ts b/frontend/src/app/mountApp.ts
index ffee139b15..38d1ecb7f0 100644
--- a/frontend/src/app/mountApp.ts
+++ b/frontend/src/app/mountApp.ts
@@ -3,10 +3,9 @@ import { buildTree, loadCoreDeps, type ReactComponent } from "@/app/runtime";
// Vite resolves the glob at build time and produces a lazy chunk.
const appRootLoaders = import.meta.glob("./AppRoot.tsx");
-// Mounts the single React-Router application root (replaces the Vue
-// `createApp(App)` mount + the separate `#react-app` overlay mount). The
-// global overlays (Toaster, AgentWindow, SessionExpiredSurface, Watermark)
-// live in RootLayout, so this one root hosts everything.
+// Mounts the single React-Router application root. The global overlays
+// (Toaster, AgentWindow, SessionExpiredSurface, Watermark) live in RootLayout,
+// so this one root hosts everything.
export async function mountReactRouterApp(selector: string) {
const container = document.querySelector(selector);
if (!container) {
diff --git a/frontend/src/app/router/ProjectRouteGate.tsx b/frontend/src/app/router/ProjectRouteGate.tsx
index ba50d7edac..c3abc96dc7 100644
--- a/frontend/src/app/router/ProjectRouteGate.tsx
+++ b/frontend/src/app/router/ProjectRouteGate.tsx
@@ -19,13 +19,9 @@ import { projectResourceNameFromId, useAppStore } from "@/stores/app";
// permission checks need the loaded `Project` resource, so this loads the
// project (and its IAM policy, via `usePermissionDataReady`) before gating the
// routed leaf on `route.requiredPermissions` — the aggregated parent
-// (`bb.projects.get`) + leaf permission lists from the route handles. Mirrors
-// the project-load + gate of the Vue-bridge `ProjectRouteShell`, but renders an
-// `<Outlet/>` for react-router instead of a teleport target. A user lacking a
-// route permission sees the request-role / permission-denied fallback instead
-// of mounting the page and failing on individual API calls. (The rest of
-// `ProjectRouteShell`'s chrome — archived banner, IAM-remind dialog, document
-// title — stays with the deferred shell-mounting phase.)
+// (`bb.projects.get`) + leaf permission lists from the route handles. A user
+// lacking a route permission sees the request-role / permission-denied fallback
+// instead of mounting the page and failing on individual API calls.
export function ProjectRouteGate() {
const params = useParams();
const projectId = params.projectId ?? "";
@@ -54,7 +50,7 @@ export function ProjectRouteGate() {
if (stale) return;
if (!nextProject) {
// Project missing or not accessible (e.g. no `bb.projects.get`): drop
- // it from recent visits and bounce to landing, like ProjectRouteShell.
+ // it from recent visits and bounce to landing.
const projectRoute = navigateRef.current.resolve({
name: PROJECT_V1_ROUTE_DETAIL,
params: { projectId },
diff --git a/frontend/src/app/router/currentRouteSnapshot.test.ts b/frontend/src/app/router/currentRouteSnapshot.test.ts
deleted file mode 100644
index 0c91d9ce66..0000000000
--- a/frontend/src/app/router/currentRouteSnapshot.test.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-// @vitest-environment node
-import { beforeEach, describe, expect, it, vi } from "vitest";
-import {
- PROJECT_V1_ROUTE_WEBHOOK_CREATE,
- PROJECT_V1_ROUTE_WEBHOOK_DETAIL,
- PROJECT_V1_ROUTE_WEBHOOKS,
- SQL_EDITOR_HOME_MODULE,
-} from "./handles";
-import { resolveRouteName, router } from "./index";
-import { setAppRouter, setRouteNameIndex } from "./navigation";
-
-beforeEach(() => {
- setRouteNameIndex(
- new Map<string, string>([
- [PROJECT_V1_ROUTE_WEBHOOKS, "/projects/:projectId/webhooks"],
- [PROJECT_V1_ROUTE_WEBHOOK_CREATE, "/projects/:projectId/webhooks/new"],
- [
- PROJECT_V1_ROUTE_WEBHOOK_DETAIL,
- "/projects/:projectId/webhooks/:webhookResourceId",
- ],
- ])
- );
- setAppRouter({
- navigate: vi.fn(),
- state: {
- location: {
- pathname: "/projects/project-sample/webhooks",
- search: "",
- hash: "",
- },
- matches: [
- {
- handle: { name: PROJECT_V1_ROUTE_WEBHOOKS },
- params: { projectId: "project-sample" },
- },
- ],
- initialized: true,
- },
- });
-});
-
-// Guardrail for the "getSnapshot should be cached" infinite-loop class.
-// `router.currentRoute.value` backs the `useReactiveRoute` `useSyncExternalStore`
-// snapshot. If it returns a fresh object on every read, any external-store
-// consumer re-renders forever (this crashed the SQL Editor: GutterBar →
-// useReactiveRoute → "Maximum update depth exceeded"). The snapshot is memoized in
-// `currentRouteSnapshot` to keep a stable reference between actual route
-// changes; this test fails if that memoization regresses.
-describe("router.currentRoute snapshot stability", () => {
- it("returns a referentially stable object across reads without navigation", () => {
- const a = router.currentRoute.value;
- const b = router.currentRoute.value;
- expect(a).toBe(b);
- });
-});
-
-describe("router named route params", () => {
- it("inherits current params when resolving project child routes", () => {
- expect(
- router.resolve({ name: PROJECT_V1_ROUTE_WEBHOOK_CREATE }).fullPath
- ).toBe("/projects/project-sample/webhooks/new");
- expect(
- router.resolve({
- name: PROJECT_V1_ROUTE_WEBHOOK_DETAIL,
- params: { webhookResourceId: "hook-1" },
- }).fullPath
- ).toBe("/projects/project-sample/webhooks/hook-1");
- });
-
- it("resolves a pathname to the most specific registered route name", () => {
- expect(resolveRouteName("/projects/project-sample/webhooks/new")).toBe(
- PROJECT_V1_ROUTE_WEBHOOK_CREATE
- );
- expect(resolveRouteName("/projects/project-sample/webhooks/hook-1")).toBe(
- PROJECT_V1_ROUTE_WEBHOOK_DETAIL
- );
- });
-
- it("prefers the leaf route name when parent and index routes share a path", () => {
- setRouteNameIndex(
- new Map<string, string>([
- ["sql-editor", "/sql-editor"],
- [SQL_EDITOR_HOME_MODULE, "/sql-editor"],
- ])
- );
-
- expect(resolveRouteName("/sql-editor")).toBe(SQL_EDITOR_HOME_MODULE);
- });
-});
diff --git a/frontend/src/app/router/guard.ts b/frontend/src/app/router/guard.ts
index 2d61327292..2372a815c6 100644
--- a/frontend/src/app/router/guard.ts
+++ b/frontend/src/app/router/guard.ts
@@ -40,7 +40,6 @@ const SIGNIN_QUERY_PARAMS = [
] as const;
// Auth/landing route names that don't require an authenticated session.
-// Inlined (rather than importing `@/utils/auth`, which pulls the Vue router).
export function isAuthRelatedRoute(routeName: string): boolean {
return [
AUTH_SIGNIN_MODULE,
@@ -116,8 +115,8 @@ const ALLOWED_ROUTE_PATTERNS = [
"sql-editor",
];
-// Resolve the redirect target for the bare workspace root ("/"), mirroring the
-// legacy `DummyRootView`. The root path has no page of its own:
+// Resolve the redirect target for the bare workspace root ("/"). The root path
+// has no page of its own:
// - EDITOR change-mode workspaces go to the SQL Editor home
// - otherwise the user's last meaningful visit, if any
// - falling back to the landing page
@@ -166,7 +165,7 @@ function readLastVisit(
}
// Ignore root-ish / transient paths so we don't redirect "/" back to itself or
-// to a route that itself redirects (mirrors `DummyRootView`'s ignore list).
+// to a route that itself redirects.
function isMeaningfulVisit(path: string): boolean {
return !(
path === "" ||
@@ -182,12 +181,11 @@ function isMeaningfulVisit(path: string): boolean {
}
/**
- * Faithful port of the legacy vue-router `beforeEach` guard
- * (`src/router/index.ts`). Runs as the react-router root-route loader: the
- * root `.tsx` loader resolves the matched leaf route's `handle.name` (via
- * `matchRoutes`) and calls this. Returns a `redirect()` Response to navigate
- * elsewhere, or `null` to allow the navigation. Session state is read from the
- * app store (the single source of truth).
+ * Runs as the react-router root-route loader: the root `.tsx` loader resolves
+ * the matched leaf route's `handle.name` (via `matchRoutes`) and calls this.
+ * Returns a `redirect()` Response to navigate elsewhere, or `null` to allow the
+ * navigation. Session state is read from the app store (the single source of
+ * truth).
*/
export function rootGuard({
name,
@@ -303,7 +301,7 @@ export function rootGuard({
return redirect(resolvePath(AUTH_PASSWORD_RESET_MODULE));
}
- // The bare workspace root ("/") has no page — redirect like DummyRootView.
+ // The bare workspace root ("/") has no page, so always redirect.
if (toName === WORKSPACE_ROOT_MODULE) {
return redirect(resolveRootRedirect(store));
}
diff --git a/frontend/src/app/router/handles.ts b/frontend/src/app/router/handles.ts
index 2a8f6ac17d..888fd0ea9d 100644
--- a/frontend/src/app/router/handles.ts
+++ b/frontend/src/app/router/handles.ts
@@ -1,6 +1,6 @@
// Route-name constants and metadata for the React Router configuration.
-// --- dashboard/workspaceRoutes (inlined) ---
+// --- Workspace ---
export const WORKSPACE_ROOT_MODULE = "workspace.root";
export const WORKSPACE_ROUTE_LANDING = "workspace.landing";
export const WORKSPACE_ROUTE_MY_ISSUES = "workspace.my-issues";
@@ -34,7 +34,7 @@ export const WORKSPACE_ROUTE_MCP = `${WORKSPACE_ROUTE_INTEGRATION}.mcp`;
export const WORKSPACE_ROUTE_403 = "error.403";
export const WORKSPACE_ROUTE_404 = "error.404";
-// --- auth.ts ---
+// --- Auth ---
export const AUTH_SIGNIN_MODULE = "auth.signin";
export const AUTH_SIGNUP_MODULE = "auth.signup";
export const AUTH_MFA_MODULE = "auth.mfa";
@@ -46,7 +46,7 @@ export const AUTH_SETUP_MODULE = "auth.setup";
export const AUTH_2FA_SETUP_MODULE = "auth.2fa.setup";
export const OAUTH2_CONSENT_MODULE = "oauth2.consent";
-// --- sqlEditor.ts ---
+// --- SQL Editor ---
export const SQL_EDITOR_HOME_MODULE = "sql-editor.home";
export const SQL_EDITOR_PROJECT_MODULE = "sql-editor.project";
export const SQL_EDITOR_INSTANCE_MODULE = "sql-editor.instance";
@@ -54,7 +54,7 @@ export const SQL_EDITOR_DATABASE_MODULE = "sql-editor.database";
export const SQL_EDITOR_SAVED_QUERY_MODULE = "sql-editor.saved-query";
export const SQL_EDITOR_QUERY_HISTORY_MODULE = "sql-editor.query-history";
-// --- dashboard/workspaceSetting.ts ---
+// --- Settings and account ---
export const SETTING_ROUTE = "setting";
export const SETTING_ROUTE_WORKSPACE = `${SETTING_ROUTE}.workspace`;
export const ACCOUNT_ROUTE = "account";
@@ -62,15 +62,15 @@ export const ACCOUNT_ROUTE_TWO_FACTOR = `${ACCOUNT_ROUTE}.two-factor`;
export const SETTING_ROUTE_WORKSPACE_GENERAL = `${SETTING_ROUTE_WORKSPACE}.general`;
export const SETTING_ROUTE_WORKSPACE_SUBSCRIPTION = `${SETTING_ROUTE_WORKSPACE}.subscription`;
-// --- dashboard/instance.ts ---
+// --- Instance ---
export const INSTANCE_ROUTE_CREATE = `${INSTANCE_ROUTE_DASHBOARD}.create`;
export const INSTANCE_ROUTE_DETAIL = `${INSTANCE_ROUTE_DASHBOARD}.detail`;
export const INSTANCE_ROUTE_DATABASE_DETAIL = `${INSTANCE_ROUTE_DASHBOARD}.database.detail`;
-// --- dashboard/environmentV1.ts ---
+// --- Environment ---
export const ENVIRONMENT_V1_ROUTE_DETAIL = `${ENVIRONMENT_V1_ROUTE_DASHBOARD}.detail`;
-// --- dashboard/projectV1.ts ---
+// --- Project ---
export const PROJECT_V1_ROUTE_DETAIL = `${PROJECT_V1_ROUTE_DASHBOARD}.detail`;
export const PROJECT_V1_ROUTE_INSTANCES = `${PROJECT_V1_ROUTE_DASHBOARD}.instance`;
export const PROJECT_V1_ROUTE_INSTANCE_CREATE = `${PROJECT_V1_ROUTE_INSTANCES}.create`;
@@ -107,7 +107,7 @@ export const PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE = `${PROJECT_V1_ROUTE_PLAN_ROLL
export const PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK = `${PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE}.task`;
export const PROJECT_V1_ROUTE_GITOPS = `${PROJECT_V1_ROUTE_DASHBOARD}.gitops`;
-// --- dashboard/projectV1RouteHelpers.ts ---
+// --- Project route helpers ---
export const PLAN_DETAIL_PHASE_CHANGES = "changes";
export const PLAN_DETAIL_PHASE_REVIEW = "review";
export const PLAN_DETAIL_PHASE_DEPLOY = "deploy";
@@ -135,7 +135,6 @@ export const isPlanDetailPhase = (
value === PLAN_DETAIL_PHASE_DEPLOY;
// Normalize a query value (string | string[] | undefined) to a single string.
-// Ported vue-free from projectV1RouteHelpers.getRouteQueryString.
export function getRouteQueryString(
value?: string | string[] | undefined
): string | undefined {
diff --git a/frontend/src/app/router/index.test.tsx b/frontend/src/app/router/index.test.tsx
new file mode 100644
index 0000000000..a6b583511a
--- /dev/null
+++ b/frontend/src/app/router/index.test.tsx
@@ -0,0 +1,236 @@
+import { act } from "react";
+import { createRoot } from "react-dom/client";
+import { createMemoryRouter, Outlet } from "react-router";
+import { RouterProvider } from "react-router/dom";
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
+import {
+ PROJECT_V1_ROUTE_WEBHOOK_CREATE,
+ PROJECT_V1_ROUTE_WEBHOOK_DETAIL,
+ PROJECT_V1_ROUTE_WEBHOOKS,
+ SQL_EDITOR_DATABASE_MODULE,
+ SQL_EDITOR_HOME_MODULE,
+} from "./handles";
+import {
+ type ReactRoute,
+ resolveRouteName,
+ router,
+ useCurrentRoute,
+} from "./index";
+import { setAppRouter, setRouteNameIndex } from "./navigation";
+
+(
+ globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
+).IS_REACT_ACT_ENVIRONMENT = true;
+
+const mocks = vi.hoisted(() => ({
+ // When true, the router hooks return the fixture below instead of reading a
+ // router context; otherwise they are the real react-router hooks.
+ useFixtureRoute: false,
+ location: {
+ pathname: "/sql-editor/projects/proj1/instances/inst1/databases/db1",
+ search: "?schema=public",
+ hash: "",
+ },
+ parentParams: {},
+ matches: [
+ {
+ handle: { name: "sql-editor" },
+ params: {},
+ },
+ {
+ handle: { name: "sql-editor.database" },
+ params: {
+ project: "proj1",
+ instance: "inst1",
+ database: "db1",
+ },
+ },
+ ],
+}));
+
+vi.mock("react-router", async (importOriginal) => {
+ const actual = await importOriginal<typeof import("react-router")>();
+ return {
+ ...actual,
+ useLocation: () =>
+ mocks.useFixtureRoute ? mocks.location : actual.useLocation(),
+ useMatches: () =>
+ mocks.useFixtureRoute ? mocks.matches : actual.useMatches(),
+ useParams: () =>
+ mocks.useFixtureRoute ? mocks.parentParams : actual.useParams(),
+ };
+});
+
+const registerRouterOnWebhooksPage = () => {
+ setRouteNameIndex(
+ new Map<string, string>([
+ [PROJECT_V1_ROUTE_WEBHOOKS, "/projects/:projectId/webhooks"],
+ [PROJECT_V1_ROUTE_WEBHOOK_CREATE, "/projects/:projectId/webhooks/new"],
+ [
+ PROJECT_V1_ROUTE_WEBHOOK_DETAIL,
+ "/projects/:projectId/webhooks/:webhookResourceId",
+ ],
+ ])
+ );
+ setAppRouter({
+ navigate: vi.fn(),
+ state: {
+ location: {
+ pathname: "/projects/project-sample/webhooks",
+ search: "",
+ hash: "",
+ },
+ matches: [
+ {
+ handle: { name: PROJECT_V1_ROUTE_WEBHOOKS },
+ params: { projectId: "project-sample" },
+ },
+ ],
+ initialized: true,
+ },
+ });
+};
+
+describe("useCurrentRoute", () => {
+ beforeEach(() => {
+ mocks.useFixtureRoute = true;
+ });
+
+ afterEach(() => {
+ mocks.useFixtureRoute = false;
+ });
+
+ test("uses leaf match params when rendered from a parent layout", () => {
+ let route: ReactRoute | undefined;
+ const CaptureRoute = () => {
+ route = useCurrentRoute();
+ return null;
+ };
+
+ const container = document.createElement("div");
+ document.body.appendChild(container);
+ const root = createRoot(container);
+
+ act(() => {
+ root.render(<CaptureRoute />);
+ });
+
+ expect(route?.name).toBe("sql-editor.database");
+ expect(route?.params).toEqual({
+ project: "proj1",
+ instance: "inst1",
+ database: "db1",
+ });
+
+ act(() => {
+ root.unmount();
+ container.remove();
+ });
+ });
+});
+
+describe("useCurrentRoute with real router context", () => {
+ test("returns leaf SQL Editor params when called from the parent layout", async () => {
+ let route: ReactRoute | undefined;
+ const CaptureFromParentLayout = () => {
+ route = useCurrentRoute();
+ return <Outlet />;
+ };
+
+ const memoryRouter = createMemoryRouter(
+ [
+ {
+ path: "/sql-editor",
+ handle: { name: "sql-editor" },
+ element: <CaptureFromParentLayout />,
+ children: [
+ {
+ path: "projects/:project/instances/:instance/databases/:database",
+ handle: { name: SQL_EDITOR_DATABASE_MODULE },
+ element: null,
+ },
+ ],
+ },
+ ],
+ {
+ initialEntries: [
+ "/sql-editor/projects/proj1/instances/inst1/databases/db1?schema=public",
+ ],
+ }
+ );
+
+ const container = document.createElement("div");
+ document.body.appendChild(container);
+ const root = createRoot(container);
+
+ await act(async () => {
+ root.render(<RouterProvider router={memoryRouter} />);
+ });
+
+ expect(route?.name).toBe(SQL_EDITOR_DATABASE_MODULE);
+ expect(route?.params).toEqual({
+ project: "proj1",
+ instance: "inst1",
+ database: "db1",
+ });
+ expect(route?.query).toEqual({ schema: "public" });
+
+ act(() => {
+ root.unmount();
+ container.remove();
+ });
+ });
+});
+
+// Guardrail for the "getSnapshot should be cached" infinite-loop class.
+// `router.currentRoute.value` backs the `useReactiveRoute` `useSyncExternalStore`
+// snapshot. If it returns a fresh object on every read, any external-store
+// consumer re-renders forever (this crashed the SQL Editor: GutterBar →
+// useReactiveRoute → "Maximum update depth exceeded"). The snapshot is memoized in
+// `currentRouteSnapshot` to keep a stable reference between actual route
+// changes; this test fails if that memoization regresses.
+describe("router.currentRoute snapshot stability", () => {
+ beforeEach(registerRouterOnWebhooksPage);
+
+ test("returns a referentially stable object across reads without navigation", () => {
+ const a = router.currentRoute.value;
+ const b = router.currentRoute.value;
+ expect(a).toBe(b);
+ });
+});
+
+describe("router named route params", () => {
+ beforeEach(registerRouterOnWebhooksPage);
+
+ test("inherits current params when resolving project child routes", () => {
+ expect(
+ router.resolve({ name: PROJECT_V1_ROUTE_WEBHOOK_CREATE }).fullPath
+ ).toBe("/projects/project-sample/webhooks/new");
+ expect(
+ router.resolve({
+ name: PROJECT_V1_ROUTE_WEBHOOK_DETAIL,
+ params: { webhookResourceId: "hook-1" },
+ }).fullPath
+ ).toBe("/projects/project-sample/webhooks/hook-1");
+ });
+
+ test("resolves a pathname to the most specific registered route name", () => {
+ expect(resolveRouteName("/projects/project-sample/webhooks/new")).toBe(
+ PROJECT_V1_ROUTE_WEBHOOK_CREATE
+ );
+ expect(resolveRouteName("/projects/project-sample/webhooks/hook-1")).toBe(
+ PROJECT_V1_ROUTE_WEBHOOK_DETAIL
+ );
+ });
+
+ test("prefers the leaf route name when parent and index routes share a path", () => {
+ setRouteNameIndex(
+ new Map<string, string>([
+ ["sql-editor", "/sql-editor"],
+ [SQL_EDITOR_HOME_MODULE, "/sql-editor"],
+ ])
+ );
+
+ expect(resolveRouteName("/sql-editor")).toBe(SQL_EDITOR_HOME_MODULE);
+ });
+});
diff --git a/frontend/src/app/router/index.ts b/frontend/src/app/router/index.ts
index e9380b2a02..be2d01f28a 100644
--- a/frontend/src/app/router/index.ts
+++ b/frontend/src/app/router/index.ts
@@ -23,8 +23,8 @@ import {
subscribeRoute,
} from "./navigation";
-// Re-export the route-name constants from the vue-free handles module so React
-// consumers keep importing them from `@/app/router`.
+// Re-export the route-name constants from the handles module so consumers can
+// import them from `@/app/router`.
export {
AUTH_SIGNIN_MODULE,
DATABASE_ROUTE_DASHBOARD,
@@ -69,13 +69,9 @@ export type ReactRoute = {
requiredPermissions: Permission[];
title?: string;
overrideDocumentTitle: boolean;
- // Mirrors vue-router `route.meta` — carries the per-route handle so legacy
- // `currentRoute.value.meta.*` reads keep working.
- meta: Record<string, unknown>;
};
-// vue-router-style navigation target (kept for source compatibility with the
-// ~existing consumers): a raw path string, or `{ name, params, query }`.
+// Navigation target: a raw path string, or `{ name, params, query }`.
export type RouteTarget =
| string
| {
@@ -91,8 +87,8 @@ export type RouteTarget =
export type ReactResolvedRoute = { href: string; fullPath: string };
-// Per-route metadata carried on `handle` (mirrors the legacy vue-router
-// `meta`). Ported route definitions attach these alongside `name`.
+// Per-route metadata carried on `handle`. Route definitions attach these
+// alongside `name`.
type RouteHandle = {
name?: string;
requiredPermissionList?: () => Permission[];
@@ -126,9 +122,9 @@ function resolveTarget(to: RouteTarget): string {
return to.fullPath;
}
// No name/path/fullPath: a query (and/or hash) update against the *current*
- // location. vue-router's `router.replace({ query })` keeps the current path;
- // returning "/" here instead would bounce the user to the workspace root
- // (and its redirect), e.g. the DatabasesPage URL-sync landing on /issues.
+ // location, so `router.replace({ query })` keeps the current path. Returning
+ // "/" here instead would bounce the user to the workspace root (and its
+ // redirect), e.g. the DatabasesPage URL-sync landing on /issues.
const search = to.query ? buildSearchString(to.query) : "";
const path = window.location.pathname;
return `${search ? `${path}?${search}` : path}${hash}`;
@@ -179,13 +175,12 @@ function assembleRoute(
)
),
overrideDocumentTitle: leafHandle?.overrideDocumentTitle ?? false,
- meta: (leafHandle as Record<string, unknown> | undefined) ?? {},
};
route.title = leafHandle?.title?.(route);
return route;
}
-/** React-router-backed current route, shaped like the legacy bridge. */
+/** React-router-backed current route. */
export function useCurrentRoute(): ReactRoute {
const location = useLocation();
const matches = useMatches();
@@ -270,15 +265,11 @@ export function isSqlEditorRouteName(name: string | undefined): boolean {
return name?.startsWith("sql-editor") ?? false;
}
-// --- vue-router-instance drop-in --------------------------------------------
-// A module-level object mirroring the imperative surface of the legacy
-// vue-router instance (`import { router } from "@/router"`), backed by the
-// react-router data router. Lets the ~110 imperative call sites keep their
-// usage unchanged through teardown — only the import path moves to
-// `@/app/router`.
+// --- Imperative router ------------------------------------------------------
+// A module-level object exposing imperative navigation, backed by the
+// react-router data router.
-// vue-router `next()` callback: no-arg / `RouteTarget` proceeds, `false`
-// cancels.
+// Guard `next()` callback: no-arg / `RouteTarget` proceeds, `false` cancels.
type GuardNext = (target?: boolean | RouteTarget) => void;
export type NavigationHistoryAction = "POP" | "PUSH" | "REPLACE";
export type BeforeEachGuardOptions = {
@@ -297,9 +288,9 @@ const beforeEachGuards = new Set<BeforeEachGuard>();
// Runs every registered `beforeEach` guard against a pending navigation and
// reports whether it should be BLOCKED (a guard called `next(false)`). The app
-// root consults this from a single `useBlocker`, reproducing vue-router's
-// global guard semantics. Guards that redirect (`next(target)`) are treated as
-// "proceed" here — the existing leave guards only ever proceed or cancel.
+// root consults this from a single `useBlocker`. Guards that redirect
+// (`next(target)`) are treated as "proceed" here — the existing leave guards
+// only ever proceed or cancel.
export function runBeforeEachGuards(
to: ReactRoute,
from: ReactRoute,
@@ -327,7 +318,7 @@ export const router = {
back: () => routerGo(-1),
go: (delta: number) => routerGo(delta),
isReady: () => isAppRouterReady(),
- // vue-router exposed `currentRoute` as a Ref; consumers read `.value`.
+ // A getter, so each `currentRoute.value` read returns the latest snapshot.
get currentRoute(): { value: ReactRoute } {
return {
get value() {
@@ -344,8 +335,8 @@ export const router = {
afterEach(hook: () => void): () => void {
return subscribeRoute(hook);
},
- // Named routes for the agent's route-map listing; shaped like the vue-router
- // records the agent reads (`path` / `name` / `children`).
+ // Named routes for the agent's route-map listing, in the record shape the
+ // agent reads (`path` / `name` / `children`).
getRoutes(): { path: string; name?: string; children: unknown[] }[] {
return getRegisteredRoutes().map((r) => ({
path: r.path,
@@ -355,7 +346,7 @@ export const router = {
},
};
-// The drop-in router's type, for code that takes the router as a parameter
+// The imperative router's type, for code that takes the router as a parameter
// (e.g. the agent tool factories) instead of importing it directly.
export type AppRouterInstance = typeof router;
diff --git a/frontend/src/app/router/lazyPage.ts b/frontend/src/app/router/lazyPage.ts
index 29d5d16123..2ca7453e3b 100644
--- a/frontend/src/app/router/lazyPage.ts
+++ b/frontend/src/app/router/lazyPage.ts
@@ -3,17 +3,17 @@ import { useLocation, useMatches, useParams } from "react-router";
// Adapter for react-router's `lazy` route field.
//
-// Page components were authored for the Vue layer, which injected route data as
-// props. react-router renders a route's `Component` with no props, so we wrap
-// the resolved page in a thin component that forwards the current route data:
+// Page components take route data as props. react-router renders a route's
+// `Component` with no props, so we wrap the resolved page in a thin component
+// that forwards the current route data:
// - `useParams()` → the `:param` props (projectId, instanceId, databaseName,
// issueId, …). Without these the project issue dashboard built a
// `project:<projectId>` scope from `undefined` and crashed.
// - `routeName` → the matched leaf route's `handle.name`, and `routeQuery` →
// the parsed query string. Pages like the plan detail decide which phase /
-// stage / task / spec to show from these (mirroring the Vue `route.name` /
-// `route.query`); `routeHash` preserves secondary anchors during canonical
-// redirects. Without injection that selection silently never fires.
+// stage / task / spec to show from these; `routeHash` preserves secondary
+// anchors during canonical redirects. Without injection that selection
+// silently never fires.
// Pages that don't declare these props simply ignore the extras.
export const lazyPage =
<T extends Record<string, unknown>>(
diff --git a/frontend/src/app/router/navigation.ts b/frontend/src/app/router/navigation.ts
index 1cc244bd03..22665902f3 100644
--- a/frontend/src/app/router/navigation.ts
+++ b/frontend/src/app/router/navigation.ts
@@ -29,13 +29,12 @@ type AppRouterLike = {
state?: RouterState;
};
-// vue-router navigated by route *name*; react-router navigates by *path*. To
-// keep the ported guard + auth lifecycle a faithful translation (they redirect
-// by name), we resolve names to concrete paths via a `name -> path pattern`
-// index. The index is BUILT from the route table on the React (.tsx) side and
-// REGISTERED here (`setRouteNameIndex`) — this module stays a pure `.ts` helper.
+// react-router navigates by *path*, but the guard and auth lifecycle redirect
+// by route *name*, so names resolve to concrete paths via a `name -> path
+// pattern` index. The index is BUILT from the route table on the React (.tsx)
+// side and REGISTERED here (`setRouteNameIndex`) — this module stays a pure
+// `.ts` helper.
-// vue-router accepted strings, numbers and arrays as query/param values.
type NavParams = Record<string, string | string[] | undefined>;
type NavQuery = Record<string, unknown>;
@@ -51,8 +50,8 @@ export function getRegisteredRoutes(): { name: string; path: string }[] {
return [...nameIndex.entries()].map(([name, path]) => ({ name, path }));
}
-// Coerce a vue-router-style query (values may be strings, numbers, arrays,
-// null/undefined) into a URL search string.
+// Coerce a query (values may be strings, numbers, arrays, null/undefined) into
+// a URL search string.
export function buildSearchString(query: NavQuery): string {
const search = new URLSearchParams();
for (const [key, value] of Object.entries(query)) {
@@ -106,16 +105,15 @@ export function resolvePath(
return path;
}
-// The createBrowserRouter instance, registered by the app root in Phase 4 so
-// non-component code (the auth slice) can navigate without importing the root
-// (which would cycle through the route lazies / app store).
+// The createBrowserRouter instance, registered by the app root so non-component
+// code (the auth slice) can navigate without importing the root (which would
+// cycle through the route lazies / app store).
let appRouter: AppRouterLike | undefined;
export function setAppRouter(router: AppRouterLike): void {
appRouter = router;
}
-// Navigate by route name (mirrors vue-router `router.push({ name, query })`).
export function navigateByName(
name: string,
options: { params?: NavParams; query?: NavQuery } & NavigationOptions = {}
@@ -125,7 +123,7 @@ export function navigateByName(
return Promise.resolve(appRouter?.navigate(path, navigationOptions));
}
-// Navigate to a raw path (mirrors `router.push(path)` / `router.replace(path)`).
+// Navigate to a raw path (backs `router.push(path)` / `router.replace(path)`).
export function navigateToPath(
path: string,
options: NavigationOptions = {}
@@ -133,26 +131,26 @@ export function navigateToPath(
return Promise.resolve(appRouter?.navigate(path, options));
}
-// Current data-router state (location + matches), for non-hook snapshots used
-// by the `router.currentRoute.value` drop-in.
+// Current data-router state (location + matches), for the non-hook
+// `router.currentRoute.value` snapshot.
export function getAppRouterState(): RouterState | undefined {
return appRouter?.state;
}
-// Subscribe to route changes (mirrors vue-router `router.afterEach`); returns
-// an unregister fn.
+// Subscribe to route changes (backs `router.afterEach`); returns an unregister
+// fn.
export function subscribeRoute(onChange: () => void): () => void {
if (!appRouter?.subscribe) return () => {};
return appRouter.subscribe(() => onChange());
}
-// History delta navigation (mirrors `router.back()` / `router.go(n)`).
+// History delta navigation (backs `router.back()` / `router.go(n)`).
export function routerGo(delta: number): void {
appRouter?.navigate(delta);
}
-// Resolves once the data router has completed its initial load (mirrors
-// vue-router `router.isReady()`).
+// Resolves once the data router has completed its initial load (backs
+// `router.isReady()`).
export function isAppRouterReady(): Promise<void> {
if (!appRouter || appRouter.state?.initialized !== false) {
return Promise.resolve();
diff --git a/frontend/src/app/router/routes.test.tsx b/frontend/src/app/router/routes.test.tsx
index 1b7cc4ecc5..7eba5a4372 100644
--- a/frontend/src/app/router/routes.test.tsx
+++ b/frontend/src/app/router/routes.test.tsx
@@ -9,12 +9,10 @@ import { buildReactRoute } from "./index";
import { routes } from "./routes";
import { sqlEditorRoutes } from "./routes/sqlEditor";
-// Guardrail for the "blank body" route bug class. During the Vue→React router
-// migration, several leaf routes were ported as bare `{ path, handle }` objects
-// with no `element`/`lazy`/`Component`. react-router renders such a leaf as an
-// empty `<Outlet/>`, so the page shows nothing (e.g. `/projects/bbdev` and the
-// legacy rollout/environment-detail routes). A leaf must therefore either
-// render something or redirect:
+// Guardrail for the "blank body" route bug class. react-router renders a bare
+// `{ path, handle }` leaf (no `element`/`lazy`/`Component`) as an empty
+// `<Outlet/>`, so the page shows nothing. A leaf must therefore either render
+// something or redirect:
// - `lazy` / `element` / `Component` — renders a page
// - `loader` — performs a (typically param-aware) redirect()
// - an ancestor flagged `handle.layoutAsPage` — the ancestor renders the
diff --git a/frontend/src/app/router/routes.tsx b/frontend/src/app/router/routes.tsx
index 9a29e03716..e676ff7893 100644
--- a/frontend/src/app/router/routes.tsx
+++ b/frontend/src/app/router/routes.tsx
@@ -42,7 +42,7 @@ function joinPath(parent: string, child: string): string {
// Flatten the nested route table into a `name -> full path pattern` map,
// joining parent/child segments. Registered into `navigation.ts` at app boot so
-// the ported guard + auth lifecycle can resolve their by-name redirects to
+// the route guard and auth lifecycle can resolve their by-name redirects to
// paths. Lives here (a `.tsx` module) so `navigation.ts` stays a pure `.ts`.
export function buildRouteNameIndex(
list: RouteObject[] = routes,
diff --git a/frontend/src/app/router/routes/auth.tsx b/frontend/src/app/router/routes/auth.tsx
index f4329ce507..312aa0f2da 100644
--- a/frontend/src/app/router/routes/auth.tsx
+++ b/frontend/src/app/router/routes/auth.tsx
@@ -45,9 +45,9 @@ export const authRoutes: RouteObject[] = [
),
},
{
- // vue used `alias: "signin"` on the index child; react-router has no
- // alias, so `/auth/signin` is an explicit sibling rendering the same
- // page under the same route name.
+ // react-router has no route alias, so `/auth/signin` is an explicit
+ // sibling rendering the same page under the same route name as the
+ // index child.
path: "signin",
handle: { name: AUTH_SIGNIN_MODULE },
lazy: lazyPage(
diff --git a/frontend/src/app/router/routes/dashboard.tsx b/frontend/src/app/router/routes/dashboard.tsx
index 57206cc913..091ce51e4c 100644
--- a/frontend/src/app/router/routes/dashboard.tsx
+++ b/frontend/src/app/router/routes/dashboard.tsx
@@ -482,9 +482,9 @@ const workspaceSettingRoutes: RouteObject[] = [
},
];
-// Environment detail — redirect-only route in vue (it redirected to the
-// environments dashboard with the environment name as a `#hash`). A leaf with
-// no element/lazy renders a blank body, so the redirect is the element here.
+// Environment detail is redirect-only: it goes to the environments dashboard
+// with the environment name as a `#hash`. A leaf with no element/lazy renders a
+// blank body, so the loader performs the redirect.
const environmentV1Routes: RouteObject[] = [
{
path: "environments/:environmentName",
@@ -548,12 +548,12 @@ const instanceRoutes: RouteObject[] = [
// Project routes (`/projects/:projectId/**`).
//
// The `requiredPermissionList` entries on the parent (`bb.projects.get`) and
-// each leaf are ported 1:1 from the legacy vue routes and aggregate via
-// `assembleRoute` into `route.requiredPermissions`. `ProjectRouteGate` (the
-// parent element) loads the project and enforces those permissions before its
-// `<Outlet/>` mounts the leaf — project-scoped checks need the loaded `Project`
-// resource, which is why `BodyLayout` routes project routes straight to this
-// gate instead of its generic workspace-level `RoutePermissionGuardShell`.
+// each leaf aggregate via `assembleRoute` into `route.requiredPermissions`.
+// `ProjectRouteGate` (the parent element) loads the project and enforces those
+// permissions before its `<Outlet/>` mounts the leaf — project-scoped checks
+// need the loaded `Project` resource, which is why `BodyLayout` routes project
+// routes straight to this gate instead of its generic workspace-level
+// `RoutePermissionGuardShell`.
const projectV1Routes: RouteObject[] = [
{
path: "projects/:projectId",
@@ -566,8 +566,7 @@ const projectV1Routes: RouteObject[] = [
index: true,
handle: { name: PROJECT_V1_ROUTE_DETAIL },
// The project root has no page of its own — redirect to the Issues
- // tab (mirrors the legacy vue-router DETAIL → ISSUES redirect). `issues`
- // is relative to the parent `projects/:projectId`.
+ // tab. `issues` is relative to the parent `projects/:projectId`.
element: <Navigate to="issues" replace />,
},
{
@@ -979,8 +978,8 @@ const projectV1Routes: RouteObject[] = [
},
];
-// `/` DashboardLayout → BodyLayout child holding the dashboard routes, plus
-// the `/issues` IssuesRouteShell route.
+// `/` DashboardLayout → BodyLayout child holding the dashboard routes,
+// including the `/issues` My Issues page.
export const dashboardRoutes: RouteObject[] = [
{
path: "/",
diff --git a/frontend/src/app/router/routes/sqlEditor.tsx b/frontend/src/app/router/routes/sqlEditor.tsx
index ce4f90a6ea..5a798368a8 100644
--- a/frontend/src/app/router/routes/sqlEditor.tsx
+++ b/frontend/src/app/router/routes/sqlEditor.tsx
@@ -14,9 +14,9 @@ import type { Permission } from "@/types";
// current route itself and decides what to render. It does NOT render an
// `<Outlet/>`, so we wrap it in a small layout-route component that renders
// the layout alongside an `<Outlet/>`. The child routes use an explicit null
-// element — they exist only so navigation by route name resolves to a path,
-// matching the original vue `NoopRouteComponent` children. Explicit null also
-// prevents React Router from warning that the matched leaf has no element.
+// element — they exist only so navigation by route name resolves to a path.
+// Explicit null also prevents React Router from warning that the matched leaf
+// has no element.
const SQLEditorLayout = lazy(() =>
import("@/modules/sql-editor/components/SQLEditorLayout").then((m) => ({
default: m.SQLEditorLayout,
@@ -38,9 +38,8 @@ export const sqlEditorRoutes: RouteObject[] = [
// routes are intentionally element-less and render into an empty Outlet.
// The route-reachability test relies on this flag to allow those children.
// `SQLEditorRouteShell` gates the editor on `route.requiredPermissions`,
- // so the parent must carry the route permission list (ported 1:1 from the
- // legacy vue `/sql-editor` route). The child modules inherit it via the
- // matched-chain aggregation in `assembleRoute`.
+ // so the parent must carry the route permission list. The child modules
+ // inherit it via the matched-chain aggregation in `assembleRoute`.
handle: {
name: "sql-editor",
layoutAsPage: true,
diff --git a/frontend/src/app/router/useCurrentRoute.integration.test.tsx b/frontend/src/app/router/useCurrentRoute.integration.test.tsx
deleted file mode 100644
index 0d51b40476..0000000000
--- a/frontend/src/app/router/useCurrentRoute.integration.test.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import { act } from "react";
-import { createRoot } from "react-dom/client";
-import { createMemoryRouter, Outlet } from "react-router";
-import { RouterProvider } from "react-router/dom";
-import { describe, expect, test } from "vitest";
-import { SQL_EDITOR_DATABASE_MODULE } from "./handles";
-import { type ReactRoute, useCurrentRoute } from "./index";
-
-(
- globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
-).IS_REACT_ACT_ENVIRONMENT = true;
-
-describe("useCurrentRoute with real router context", () => {
- test("returns leaf SQL Editor params when called from the parent layout", async () => {
- let route: ReactRoute | undefined;
- const CaptureFromParentLayout = () => {
- route = useCurrentRoute();
- return <Outlet />;
- };
-
- const router = createMemoryRouter(
- [
- {
- path: "/sql-editor",
- handle: { name: "sql-editor" },
- element: <CaptureFromParentLayout />,
- children: [
- {
- path: "projects/:project/instances/:instance/databases/:database",
- handle: { name: SQL_EDITOR_DATABASE_MODULE },
- element: null,
- },
- ],
- },
- ],
- {
- initialEntries: [
- "/sql-editor/projects/proj1/instances/inst1/databases/db1?schema=public",
- ],
- }
- );
-
- const container = document.createElement("div");
- document.body.appendChild(container);
- const root = createRoot(container);
-
- await act(async () => {
- root.render(<RouterProvider router={router} />);
- });
-
- expect(route?.name).toBe(SQL_EDITOR_DATABASE_MODULE);
- expect(route?.params).toEqual({
- project: "proj1",
- instance: "inst1",
- database: "db1",
- });
- expect(route?.query).toEqual({ schema: "public" });
-
- act(() => {
- root.unmount();
- container.remove();
- });
- });
-});
diff --git a/frontend/src/app/router/useCurrentRoute.test.tsx b/frontend/src/app/router/useCurrentRoute.test.tsx
deleted file mode 100644
index 41951dc513..0000000000
--- a/frontend/src/app/router/useCurrentRoute.test.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { act } from "react";
-import { createRoot } from "react-dom/client";
-import { beforeEach, describe, expect, test, vi } from "vitest";
-import { type ReactRoute, useCurrentRoute } from "./index";
-
-(
- globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
-).IS_REACT_ACT_ENVIRONMENT = true;
-
-const mocks = vi.hoisted(() => ({
- location: {
- pathname: "/sql-editor/projects/proj1/instances/inst1/databases/db1",
- search: "?schema=public",
- hash: "",
- },
- parentParams: {},
- matches: [
- {
- handle: { name: "sql-editor" },
- params: {},
- },
- {
- handle: { name: "sql-editor.database" },
- params: {
- project: "proj1",
- instance: "inst1",
- database: "db1",
- },
- },
- ],
-}));
-
-vi.mock("react-router", () => ({
- useLocation: () => mocks.location,
- useMatches: () => mocks.matches,
- useNavigate: () => vi.fn(),
- useParams: () => mocks.parentParams,
-}));
-
-beforeEach(() => {
- vi.clearAllMocks();
-});
-
-describe("useCurrentRoute", () => {
- test("uses leaf match params when rendered from a parent layout", () => {
- let route: ReactRoute | undefined;
- const CaptureRoute = () => {
- route = useCurrentRoute();
- return null;
- };
-
- const container = document.createElement("div");
- document.body.appendChild(container);
- const root = createRoot(container);
-
- act(() => {
- root.render(<CaptureRoute />);
- });
-
- expect(route?.name).toBe("sql-editor.database");
- expect(route?.params).toEqual({
- project: "proj1",
- instance: "inst1",
- database: "db1",
- });
-
- act(() => {
- root.unmount();
- container.remove();
- });
- });
-});
diff --git a/frontend/src/architecture/cel-filter-literals.test.ts b/frontend/src/architecture/cel-filter-literals.test.ts
deleted file mode 100644
index 3ae45d8e9b..0000000000
--- a/frontend/src/architecture/cel-filter-literals.test.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-// @vitest-environment node
-import { readdirSync, readFileSync } from "node:fs";
-import { join, relative } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const repoRoot = process.cwd();
-const srcRoot = join(repoRoot, "src");
-// Tests are excluded: they spell out expected filter strings literally, which
-// is exactly what an assertion should do.
-const sourceFilePattern = /(?<!\.test)\.(?:ts|tsx)$/;
-const generatedRoot = join(srcRoot, "types", "proto-es");
-
-// A value interpolated straight into a double-quoted CEL string literal breaks
-// the filter the moment it holds a `"` — a SQL identifier, anything typed into
-// a search box — and the backend rejects the whole expression with
-// InvalidArgument. `celString` / `celStringList` / `celMapField` in
-// `src/utils/v1/celLiteral.ts` own the quotes so the escape cannot be forgotten.
-const rawInterpolationRules = [
- {
- what: "a CEL string argument — use `name.contains(${celString(x)})`",
- pattern: /\.(?:contains|matches|startsWith|endsWith)\("\$\{/,
- },
- {
- what: "a CEL comparison operand — use `state == ${celString(x)}`",
- // The left operand may be a plain field, a computed one (`${field} ==`,
- // which getLabelFilter builds), or an index (`labels["k"] ==`).
- pattern: /(?:[a-z][a-zA-Z0-9_.]*|\}|\])\s*(?:==|!=|>=|<=|<|>)\s*"\$\{/,
- },
- {
- what: "a CEL list element — use `engine in ${celStringList(xs)}`",
- pattern: /\bin\s*\[\$\{[^\n]*"\$\{/,
- },
-];
-
-function listSourceFiles(dir: string): string[] {
- return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
- const path = join(dir, entry.name);
- if (path === generatedRoot) {
- return [];
- }
- if (entry.isDirectory()) {
- return listSourceFiles(path);
- }
- return sourceFilePattern.test(entry.name) ? [path] : [];
- });
-}
-
-describe("CEL filter string literals", () => {
- test("no filter builder interpolates a raw value into a CEL literal", () => {
- const violations: string[] = [];
- for (const file of listSourceFiles(srcRoot)) {
- const lines = readFileSync(file, "utf-8").split("\n");
- lines.forEach((line, index) => {
- for (const rule of rawInterpolationRules) {
- if (rule.pattern.test(line)) {
- violations.push(
- `${relative(srcRoot, file)}:${index + 1} — ${rule.what}`
- );
- }
- }
- });
- }
- expect(violations).toEqual([]);
- });
-});
diff --git a/frontend/src/architecture/e2e-sample-bootstrap.test.ts b/frontend/src/architecture/e2e-sample-bootstrap.test.ts
deleted file mode 100644
index ac88e4bbba..0000000000
--- a/frontend/src/architecture/e2e-sample-bootstrap.test.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const frameworkDir = join(import.meta.dirname, "../../tests/e2e/framework");
-const apiClientSource = readFileSync(
- join(frameworkDir, "api-client.ts"),
- "utf8"
-);
-const bootstrapSource = readFileSync(
- join(frameworkDir, "mode-start-new-bytebase.ts"),
- "utf8"
-);
-const setupProjectSource = readFileSync(
- join(frameworkDir, "setup-project.ts"),
- "utf8"
-);
-
-describe("E2E sample bootstrap", () => {
- test("uses the project-scoped sample API and its single-instance result", () => {
- expect(apiClientSource).not.toContain(
- ["/v1/actuator", ["setup", "Sample"].join("")].join(":")
- );
- expect(apiClientSource).toContain("instances:prepareSampleProjectInstance");
-
- expect(bootstrapSource).not.toContain(
- ["api", ["setup", "Sample()"].join("")].join(".")
- );
- expect(bootstrapSource).toContain("api.prepareSampleProjectInstance(");
- expect(bootstrapSource).not.toContain("instances/prod-sample-instance");
- expect(bootstrapSource).not.toContain("[port + 3, port + 4]");
-
- expect(setupProjectSource).toContain("updateDatabaseEnvironment(");
- expect(setupProjectSource).toContain('"environments/prod"');
- });
-});
diff --git a/frontend/src/architecture/legacy-boundaries.test.ts b/frontend/src/architecture/legacy-boundaries.test.ts
deleted file mode 100644
index f3a59f8598..0000000000
--- a/frontend/src/architecture/legacy-boundaries.test.ts
+++ /dev/null
@@ -1,293 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-const sources = import.meta.glob(
- [
- "../routes/project/**/*.{ts,tsx}",
- "../routes/workspace/**/*.{ts,tsx}",
- "../routes/auth/**/*.{ts,tsx}",
- "../components/**/*.{ts,tsx}",
- "../modules/sql-editor/**/*.{ts,tsx}",
- ],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const currentUserMigrationSources = import.meta.glob(
- [
- "../**/*.{ts,tsx}",
- "../modules/ai/components/**/*.{ts,tsx}",
- "../api/middlewares/activeInterceptorMiddleware.ts",
- "../utils/pagination.ts",
- "../utils/v1/savedQuery.ts",
- ],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const instanceMigrationSources = import.meta.glob(
- ["../utils/expr.ts", "../utils/v1/issue/issue.ts"],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const removedLegacyInstanceStoreSources = import.meta.glob(
- ["../routes/workspace/InstancesPage.tsx", "../stores/modules/v1/index.ts"],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const databaseMigrationSources = import.meta.glob(
- [
- "../utils/expr.ts",
- "../utils/v1/revision.ts",
- "../utils/v1/changelog.ts",
- "../utils/v1/issue/rollout.ts",
- "../utils/v1/issue/issue.ts",
- "../stores/modules/v1/index.ts",
- ],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const dbSchemaMigrationSources = import.meta.glob(
- ["../**/*.{ts,tsx}", "../stores/modules/v1/index.ts"],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const legacyVueImportPattern =
- /@\/components\/(?:Plan|RolloutV1|IssueV1|PlanCheckRun|DatabaseDetail)\/[^"']+\.vue/g;
-
-const legacyImplementationPaths = [
- "@/components/Plan/components",
- "@/components/RolloutV1/components",
- "@/components/IssueV1/components/RoleGrant",
- "@/components/DatabaseDetail/Settings",
-];
-
-describe("React Project and Settings legacy Vue dependencies", () => {
- test("do not import deleted Project Vue implementation paths", () => {
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- const vueImports = source.match(legacyVueImportPattern) ?? [];
- for (const vueImport of vueImports) {
- violations.push(`${file}: ${vueImport}`);
- }
- for (const legacyPath of legacyImplementationPaths) {
- if (source.includes(legacyPath)) {
- violations.push(`${file}: ${legacyPath}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("console and SQL Editor shell do not re-import legacy Vue permission chain", () => {
- const legacyLayoutPrefix = ["@", "layouts"].join("/");
- const bannedImports = [
- "@/components/Permission/RoutePermissionGuard.vue",
- "@/components/Permission/ComponentPermissionGuard.vue",
- "./RoleGrantPanel.vue",
- "@/components/FeatureGuard",
- "@/components/IssueV1/components/Sidebar/IssueLabels",
- "./IssueLabelSelector.vue",
- "@/components/ProjectMember/AddProjectMember/AddProjectMemberForm.vue",
- `${legacyLayoutPrefix}/ProjectV1Layout.vue`,
- `${legacyLayoutPrefix}/SettingLayout.vue`,
- `${legacyLayoutPrefix}/InstanceLayout.vue`,
- `${legacyLayoutPrefix}/IssuesLayout.vue`,
- ];
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- for (const bannedImport of bannedImports) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("route permission guard reads React permission state", () => {
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- if (!file.endsWith("/ComponentPermissionGuard.tsx")) {
- continue;
- }
- for (const bannedImport of [
- "usePermissionStore",
- "@/components/PermissionGuard",
- ]) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("ProjectRouteShell does not preload unrelated permission state", () => {
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- if (!file.endsWith("/ProjectRouteShell.tsx")) {
- continue;
- }
- for (const bannedImport of [
- '"@/store"',
- "useProjectIamPolicyStore",
- "loadSubscription",
- ]) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("Phase 1 protobuf resource consumers use the React app store", () => {
- const bannedImports = [
- "useGroupStore",
- "useIdentityProviderStore",
- "useAccessGrantStore",
- "@/stores/modules/idp",
- "@/stores/modules/accessGrant",
- ];
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- for (const bannedImport of bannedImports) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("Phase 2 protobuf resource consumers use the React app store", () => {
- const bannedImports = [
- "useUserStore",
- "useRoleStore",
- "@/stores/modules/user",
- "@/stores/modules/role",
- ];
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- for (const bannedImport of bannedImports) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("migrated React and utility surfaces do not use the legacy current-user hook", () => {
- const legacyCurrentUserHook = ["use", "Current", "User", "V1"].join("");
- const violations: string[] = [];
- for (const [file, source] of Object.entries(currentUserMigrationSources)) {
- if (file.endsWith("/legacy-boundaries.test.ts")) {
- continue;
- }
- if (source.includes(legacyCurrentUserHook)) {
- violations.push(file);
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("migrated router and utility surfaces do not use legacy instance stores", () => {
- const bannedImports = ["useInstanceV1Store", "useInstanceResourceByName"];
- const violations: string[] = [];
- for (const [file, source] of Object.entries(instanceMigrationSources)) {
- for (const bannedImport of bannedImports) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("migrated instance surfaces do not expose the legacy instance store module", () => {
- const bannedImports = ["@/stores/modules/v1/instance", "./instance"];
- const violations: string[] = [];
- for (const [file, source] of Object.entries(
- removedLegacyInstanceStoreSources
- )) {
- for (const bannedImport of bannedImports) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("migrated database surfaces do not use the legacy database store", () => {
- const bannedImports = [
- "useDatabaseV1Store",
- "@/stores/modules/v1/database",
- ];
- const violations: string[] = [];
- for (const [file, source] of Object.entries(databaseMigrationSources)) {
- for (const bannedImport of bannedImports) {
- if (source.includes(bannedImport)) {
- violations.push(`${file}: ${bannedImport}`);
- }
- }
- if (file.endsWith("../stores/modules/v1/index.ts")) {
- const bannedStoreModuleExport = "./database";
- if (source.includes(bannedStoreModuleExport)) {
- violations.push(`${file}: ${bannedStoreModuleExport}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("migrated DB schema surfaces do not expose the legacy DB schema store", () => {
- const violations: string[] = [];
- for (const [file, source] of Object.entries(dbSchemaMigrationSources)) {
- if (file.endsWith("/legacy-boundaries.test.ts")) {
- continue;
- }
- if (source.includes("@/stores/modules/v1/dbSchema")) {
- violations.push(`${file}: @/stores/modules/v1/dbSchema`);
- }
- if (
- !file.endsWith(".test.ts") &&
- !file.endsWith(".test.tsx") &&
- source.includes("useDBSchemaV1Store")
- ) {
- violations.push(`${file}: useDBSchemaV1Store`);
- }
- if (
- file.endsWith("../stores/modules/v1/index.ts") &&
- source.includes("./dbSchema")
- ) {
- violations.push(`${file}: ./dbSchema`);
- }
- }
- expect(violations).toEqual([]);
- });
-});
diff --git a/frontend/src/architecture/no-vue-imports.test.ts b/frontend/src/architecture/no-vue-imports.test.ts
deleted file mode 100644
index ddccabc9db..0000000000
--- a/frontend/src/architecture/no-vue-imports.test.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-// Scan the entire application source tree. The only remaining Vue runtime is
-// encapsulated by apps/explain-visualizer and does not expose .vue modules.
-const sources = import.meta.glob("../**/*.{ts,tsx}", {
- query: "?raw",
- import: "default",
- eager: true,
-}) as Record<string, string>;
-
-const allowedVueImports = new Set<string>();
-
-const vueImportPattern = /from\s+["']([^"']+\.vue)["']/g;
-
-// Retired implementation prefixes must not be recreated.
-const bannedReactToVueModulePrefixes = [
- "@/components/MonacoEditor",
- "@/components/Plan",
- "@/components/SQLReview",
- "@/components/ProjectMember",
- "@/components/ColumnDataTable",
- "@/components/SensitiveData",
- "@/components/DatabaseGroup",
-];
-
-describe("application source must not import .vue files", () => {
- test("no application TypeScript file imports a .vue file", () => {
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- // Don't scan this guard itself (it contains .vue strings as test data
- // in the allowlist above).
- if (file.endsWith("/no-vue-imports.test.ts")) continue;
- // Don't scan the sibling guard (same reason — it has .vue strings as
- // banned-import test data).
- if (file.endsWith("/legacy-boundaries.test.ts")) continue;
-
- let match: RegExpExecArray | null;
- vueImportPattern.lastIndex = 0;
- while ((match = vueImportPattern.exec(source)) !== null) {
- const importPath = match[1];
- if (!allowedVueImports.has(importPath)) {
- violations.push(`${file}: ${importPath}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("does not recreate retired implementation module prefixes", () => {
- const importPattern = /from\s+["']([^"']+)["']/g;
- const violations: string[] = [];
- for (const [file, source] of Object.entries(sources)) {
- if (file.endsWith("/no-vue-imports.test.ts")) continue;
- if (file.endsWith("/legacy-boundaries.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/architecture/vue-boundary.test.ts b/frontend/src/architecture/vue-boundary.test.ts
deleted file mode 100644
index 7acbafa3bd..0000000000
--- a/frontend/src/architecture/vue-boundary.test.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-// @vitest-environment node
-import { existsSync, readdirSync, readFileSync } from "node:fs";
-import { join, relative } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const repoRoot = process.cwd();
-const srcRoot = join(repoRoot, "src");
-const allowedVueImportPaths = new Set([
- "apps/explain-visualizer/PostgresPlanView.tsx",
-]);
-const sourceFilePattern = /\.(?:ts|tsx|d\.ts)$/;
-const bannedVueImportPattern = /from\s+["']vue["']/g;
-const bannedVueUseImportPattern = /from\s+["']@vueuse\/[^"']+["']/g;
-const packageJsonPath = join(repoRoot, "package.json");
-
-function listSourceFiles(dir: string): string[] {
- return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
- const path = join(dir, entry.name);
- if (entry.isDirectory()) {
- return listSourceFiles(path);
- }
- return sourceFilePattern.test(entry.name) ? [path] : [];
- });
-}
-
-describe("standalone Vue reactivity dependencies", () => {
- test("only the explain visualizer imports Vue runtime APIs", () => {
- const violations: string[] = [];
- for (const file of listSourceFiles(srcRoot)) {
- const source = readFileSync(file, "utf-8");
- const relativePath = relative(srcRoot, file);
- const importsVue = bannedVueImportPattern.test(source);
- const importsVueUse = bannedVueUseImportPattern.test(source);
- bannedVueImportPattern.lastIndex = 0;
- bannedVueUseImportPattern.lastIndex = 0;
- if (
- (importsVue || importsVueUse) &&
- !allowedVueImportPaths.has(relativePath)
- ) {
- violations.push(relativePath);
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("does not depend on @vueuse/core", () => {
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")) as {
- dependencies?: Record<string, string>;
- devDependencies?: Record<string, string>;
- };
-
- expect(packageJson.dependencies?.["@vueuse/core"]).toBeUndefined();
- expect(packageJson.devDependencies?.["@vueuse/core"]).toBeUndefined();
- });
-});
-
-describe("Vue build tooling", () => {
- test("does not configure Vue Vite plugins or generated component registries", () => {
- const viteConfig = readFileSync(join(repoRoot, "vite.config.ts"), "utf-8");
-
- expect(viteConfig).not.toMatch(/@vitejs\/plugin-vue\b/);
- expect(viteConfig).not.toMatch(/@vitejs\/plugin-vue-jsx\b/);
- expect(viteConfig).not.toMatch(/unplugin-vue-components/);
- expect(viteConfig).not.toMatch(/\bvue\(\)/);
- expect(viteConfig).not.toMatch(/\bvueJsx\(/);
- expect(viteConfig).not.toMatch(/\bComponents\(/);
- expect(viteConfig).toContain("explain-visualizer-vue");
- expect(existsSync(join(repoRoot, "components.d.ts"))).toBe(false);
- });
-
- test("does not keep ESLint configuration", () => {
- expect(existsSync(join(repoRoot, "eslint.config.mjs"))).toBe(false);
- });
-
- test("does not keep Vue type-check or build-only package entries", () => {
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")) as {
- scripts?: Record<string, string>;
- dependencies?: Record<string, string>;
- devDependencies?: Record<string, string>;
- };
- const dependencyNames = Object.keys(packageJson.dependencies ?? {});
- const devDependencyNames = Object.keys(packageJson.devDependencies ?? {});
-
- // Asserted across every script rather than one name, so consolidating or
- // renaming the gate cannot silently retire this policy.
- expect(
- Object.values(packageJson.scripts ?? {}).some((script) =>
- /\bvue-tsc\b/.test(script)
- )
- ).toBe(false);
- expect(dependencyNames.filter((name) => name.startsWith("@vue/"))).toEqual(
- []
- );
- expect(
- dependencyNames.filter((name) => name.startsWith("@vueuse/"))
- ).toEqual([]);
- expect(
- dependencyNames.filter((name) => name.startsWith("@intlify/"))
- ).toEqual([]);
- expect(
- devDependencyNames.filter(
- (name) =>
- name.startsWith("@vue/") ||
- name.startsWith("@vueuse/") ||
- name.startsWith("@intlify/") ||
- name.startsWith("@vitejs/plugin-vue") ||
- [
- "eslint-plugin-vue",
- "unplugin-vue-components",
- "vue-component-type-helpers",
- "vue-tsc",
- ].includes(name)
- )
- ).toEqual([]);
- expect(existsSync(join(repoRoot, "tsconfig.react.json"))).toBe(false);
- expect(existsSync(join(srcRoot, "react"))).toBe(false);
- });
-});
-
-describe("frontend lint tooling", () => {
- test("uses Biome as the single frontend linter", () => {
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")) as {
- scripts?: Record<string, string>;
- devDependencies?: Record<string, string>;
- };
- const scripts = Object.values(packageJson.scripts ?? {});
-
- expect(existsSync(join(repoRoot, "eslint.config.mjs"))).toBe(false);
- expect(scripts.some((script) => /\beslint\b/.test(script))).toBe(false);
- expect(packageJson.devDependencies?.["eslint"]).toBeUndefined();
- expect(packageJson.devDependencies?.["typescript-eslint"]).toBeUndefined();
- });
-
- test("keeps frontend compatibility policy checks outside ESLint", () => {
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")) as {
- scripts?: Record<string, string>;
- };
-
- expect(
- existsSync(join(repoRoot, "scripts", "check-no-crypto-randomuuid.mjs"))
- ).toBe(true);
- // The guard must be wired into the gate. That wiring lives in the gate
- // runner now rather than in a package.json script string, so search both.
- const gateSources = [
- ...Object.values(packageJson.scripts ?? {}),
- readFileSync(join(repoRoot, "scripts", "run-gate.mjs"), "utf-8"),
- ];
- expect(
- gateSources.some((source) =>
- source.includes("check-no-crypto-randomuuid")
- )
- ).toBe(true);
- });
-});
diff --git a/frontend/src/components/AdvancedSearch.tsx b/frontend/src/components/AdvancedSearch.tsx
index 1ebfeb6339..073f9256c8 100644
--- a/frontend/src/components/AdvancedSearch.tsx
+++ b/frontend/src/components/AdvancedSearch.tsx
@@ -61,8 +61,7 @@ interface AdvancedSearchProps {
onParamsChange: (params: SearchParams) => void;
/**
* Fires on Enter while no scope/value dropdown is active. Hosts use this
- * for "press Enter to advance to the next match" — mirrors the Vue
- * `@keyup:enter` shortcut on the result-view search bar.
+ * for "press Enter to advance to the next match".
*/
onEnter?: () => void;
}
@@ -377,7 +376,6 @@ export function AdvancedSearch({
if (id) {
setMenuView("value");
setMenuIndex(0);
- // Show "scope:" prefix in the input to match Vue behavior
setInputText(`${id}:`);
} else {
setMenuView("scope");
diff --git a/frontend/src/components/BytebaseLogo.tsx b/frontend/src/components/BytebaseLogo.tsx
index b46a8c7b6b..37853492ba 100644
--- a/frontend/src/components/BytebaseLogo.tsx
+++ b/frontend/src/components/BytebaseLogo.tsx
@@ -14,9 +14,8 @@ type Props = {
};
/**
- * Replaces frontend/src/components/BytebaseLogo.vue. Shows the workspace's
- * custom logo when set, otherwise the bundled Bytebase fallback SVG.
- *
+ * Shows the workspace's custom logo when set, otherwise the bundled Bytebase
+ * fallback SVG.
*/
export function BytebaseLogo({
builtinTheme = "light",
diff --git a/frontend/src/components/ComponentPermissionGuard.tsx b/frontend/src/components/ComponentPermissionGuard.tsx
index 188e1497f8..ecd6d32e31 100644
--- a/frontend/src/components/ComponentPermissionGuard.tsx
+++ b/frontend/src/components/ComponentPermissionGuard.tsx
@@ -268,7 +268,7 @@ export function PermissionDeniedFallback({
*
* - If the user has all required permissions, children are rendered normally.
* - If the user is missing permissions, an error alert is shown listing the
- * missing permissions — matching the Vue `ComponentPermissionGuard` behavior.
+ * missing permissions.
*/
export function ComponentPermissionGuard({
permissions,
diff --git a/frontend/src/components/CustomApproval/RuleEditSheetLayout.test.ts b/frontend/src/components/CustomApproval/RuleEditSheetLayout.test.ts
deleted file mode 100644
index 94f72dca62..0000000000
--- a/frontend/src/components/CustomApproval/RuleEditSheetLayout.test.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const componentDir = dirname(fileURLToPath(import.meta.url));
-
-describe("RuleEditSheet layout", () => {
- test("uses shared form primitives in the approval rule drawer", () => {
- const source = readFileSync(
- join(componentDir, "RuleEditSheet.tsx"),
- "utf8"
- );
-
- expect(source).toContain("<FormFieldGroup>");
- expect(source).toContain("<FormField");
- expect(source).toContain("FormTitle");
- expect(source).not.toContain("FormLabel");
- expect(source).toContain('id="approval-rule-title"');
- expect(source).toContain('id="approval-rule-description"');
- expect(source).not.toContain('className="flex flex-col gap-y-2"');
- expect(source).not.toContain(
- 'className="text-sm font-medium text-control"'
- );
- expect(source).not.toContain('className="textlabel"');
- expect(source).not.toContain('className="textinfolabel text-sm"');
- });
-});
diff --git a/frontend/src/components/DashboardFrameShell.test.tsx b/frontend/src/components/DashboardFrameShell.test.tsx
index 75c843cb7a..f220753f7e 100644
--- a/frontend/src/components/DashboardFrameShell.test.tsx
+++ b/frontend/src/components/DashboardFrameShell.test.tsx
@@ -23,16 +23,6 @@ vi.mock("@/stores/app", () => ({
useAppStore: mocks.useAppStore,
}));
-// The legacy-Pinia bootstrap block reads these from `@/stores`.
-vi.mock("@/stores", () => ({
- useEnvironmentV1Store: () => ({
- fetchEnvironments: mocks.fetchEnvironments,
- }),
- useSettingV1Store: () => ({
- getOrFetchSettingByName: mocks.getOrFetchSettingByName,
- }),
-}));
-
vi.mock("./BannersWrapper", () => ({
BannersWrapper: () => <div data-testid="banners-wrapper" />,
}));
diff --git a/frontend/src/components/DashboardSidebar.tsx b/frontend/src/components/DashboardSidebar.tsx
index b2c80850d9..caec9134c8 100644
--- a/frontend/src/components/DashboardSidebar.tsx
+++ b/frontend/src/components/DashboardSidebar.tsx
@@ -252,7 +252,7 @@ function useSidebarItems(): SidebarItem[] {
}
// ---------------------------------------------------------------------------
-// Filter logic (mirrors CommonSidebar.vue filteredSidebarList)
+// Filter logic
// ---------------------------------------------------------------------------
function filterSidebarList(items: SidebarItem[]): SidebarItem[] {
diff --git a/frontend/src/components/DataExportButton.tsx b/frontend/src/components/DataExportButton.tsx
index f99c0db424..8ce516f3b1 100644
--- a/frontend/src/components/DataExportButton.tsx
+++ b/frontend/src/components/DataExportButton.tsx
@@ -167,8 +167,6 @@ const downloadAll = async (
};
/**
- * React port of `frontend/src/components/DataExportButton.vue`.
- *
* - DRAWER view: opens a Sheet with row-count / format / optional password
* fields, plus a `formContent` slot for caller-provided fields (e.g. the
* batch-export database picker).
diff --git a/frontend/src/components/DatabaseGroupDataTable.tsx b/frontend/src/components/DatabaseGroupDataTable.tsx
index 1555beef0e..879bcbbefb 100644
--- a/frontend/src/components/DatabaseGroupDataTable.tsx
+++ b/frontend/src/components/DatabaseGroupDataTable.tsx
@@ -39,11 +39,9 @@ type Props = {
};
/**
- * Replaces frontend/src/components/DatabaseGroup/DatabaseGroupDataTable.vue.
- * Shared React port. Columns — in order — are: optional selection, title,
- * expression, optional external-link, optional actions (kebab menu with
- * Delete). Supports optional client-side pagination for the "manage
- * groups" admin use case.
+ * Columns — in order — are: optional selection, title, expression, optional
+ * external-link, optional actions (kebab menu with Delete). Supports optional
+ * client-side pagination for the "manage groups" admin use case.
*/
export function DatabaseGroupDataTable({
databaseGroupList,
diff --git a/frontend/src/components/IssueTable.i18n.test.ts b/frontend/src/components/IssueTable.i18n.test.ts
deleted file mode 100644
index 061453837c..0000000000
--- a/frontend/src/components/IssueTable.i18n.test.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-// @vitest-environment node
-import i18next from "i18next";
-import { describe, expect, test } from "vitest";
-import enUS from "@/locales/en-US.json";
-import esES from "@/locales/es-ES.json";
-import jaJP from "@/locales/ja-JP.json";
-import viVN from "@/locales/vi-VN.json";
-import zhCN from "@/locales/zh-CN.json";
-
-const LOCALES = {
- "en-US": enUS,
- "zh-CN": zhCN,
- "es-ES": esES,
- "ja-JP": jaJP,
- "vi-VN": viVN,
-} as const;
-
-describe("IssueTable locale interpolation", () => {
- test.each(Object.entries(LOCALES))(
- "interpolates the disabled batch action in %s",
- (locale, translation) => {
- const i18n = i18next.createInstance();
-
- void i18n.init({
- resources: {
- [locale]: { translation },
- },
- lng: locale,
- interpolation: {
- escapeValue: false,
- },
- initAsync: false,
- });
-
- expect(
- i18n.t("issue.batch-transition.not-allowed-tips", {
- operation: "TRANSITION",
- })
- ).toContain("TRANSITION");
- }
- );
-});
diff --git a/frontend/src/components/IssueTable.tsx b/frontend/src/components/IssueTable.tsx
index ba6873c0af..1273df2dd3 100644
--- a/frontend/src/components/IssueTable.tsx
+++ b/frontend/src/components/IssueTable.tsx
@@ -9,6 +9,7 @@ import {
AdvancedSearch,
type ScopeOption,
type SearchParams,
+ type SearchScope,
type ValueOption,
} from "@/components/AdvancedSearch";
import { HighlightLabelText } from "@/components/HighlightLabelText";
@@ -72,8 +73,6 @@ import {
getValuesFromSearchParams,
projectOfIssue,
upsertScope,
- type SearchParams as VueSearchParams,
- type SearchScope as VueSearchScope,
} from "@/utils";
// ===========================================================================
@@ -221,7 +220,7 @@ export function PresetButtons({
const isActive = useCallback(
(preset: PresetValue): boolean => {
- const vp = params as VueSearchParams;
+ const vp = params as SearchParams;
if (preset === "WAITING_APPROVAL") {
return (
getValueFromSearchParams(vp, "approval") ===
@@ -254,7 +253,7 @@ export function PresetButtons({
(preset: PresetValue) => {
const myEmail = me?.email ?? "";
const readonlyScopes = params.scopes.filter((s) => s.readonly);
- let newParams: VueSearchParams = {
+ let newParams: SearchParams = {
query: "",
scopes: [...readonlyScopes],
};
@@ -292,7 +291,7 @@ export function PresetButtons({
scopes: newParams.scopes.map((s) => ({
id: s.id,
value: s.value,
- readonly: (s as VueSearchScope & { readonly?: boolean }).readonly,
+ readonly: (s as SearchScope & { readonly?: boolean }).readonly,
})),
});
},
diff --git a/frontend/src/components/IssuesRouteShell.tsx b/frontend/src/components/IssuesRouteShell.tsx
deleted file mode 100644
index db5cb3a17f..0000000000
--- a/frontend/src/components/IssuesRouteShell.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { useCallback } from "react";
-import type {
- DashboardShellTargets,
- ReactRouteShellTargets,
-} from "@/app/dashboard-shell";
-import { DashboardBodyShell } from "@/components/DashboardBodyShell";
-
-interface IssuesRouteShellProps {
- routeKey?: string;
- onReady?: (targets: ReactRouteShellTargets | null) => void;
-}
-
-export function IssuesRouteShell({ routeKey, onReady }: IssuesRouteShellProps) {
- const handleReady = useCallback(
- (targets: DashboardShellTargets) => {
- onReady?.({
- content: targets.content,
- quickstart: targets.quickstart,
- mainContainer: targets.mainContainer,
- });
- },
- [onReady]
- );
-
- return (
- <DashboardBodyShell
- variant="issues"
- routeKey={routeKey}
- onReady={handleReady}
- />
- );
-}
diff --git a/frontend/src/components/PermissionGuard.tsx b/frontend/src/components/PermissionGuard.tsx
index 648ecee77c..eca00934f7 100644
--- a/frontend/src/components/PermissionGuard.tsx
+++ b/frontend/src/components/PermissionGuard.tsx
@@ -12,7 +12,7 @@ import { BlockTooltip, Tooltip } from "./ui/tooltip";
* Reads directly from the Zustand IAM caches without triggering a load —
* every current caller mounts inside a route shell that already preloads
* (`BannersWrapper` → `useWorkspacePermission` for workspace,
- * `ProjectRouteShell` / `SQLEditorRouteShell` → `usePermissionDataReady`
+ * `ProjectRouteGate` / `SQLEditorRouteShell` → `usePermissionDataReady`
* for project). If a future orphan caller appears, add the trigger then.
*/
export function usePermissionCheck(
@@ -66,7 +66,7 @@ interface PermissionGuardProps {
* </PermissionGuard>
* ```
*
- * 2. Render-prop children (like Vue PermissionGuardWrapper slot props):
+ * 2. Render-prop children:
* ```tsx
* <PermissionGuard permissions={["bb.projects.update"]} project={project}>
* {({ disabled }) => <Button disabled={disabled}>Save</Button>}
diff --git a/frontend/src/components/ProjectRouteShell.tsx b/frontend/src/components/ProjectRouteShell.tsx
deleted file mode 100644
index 3bab3f7852..0000000000
--- a/frontend/src/components/ProjectRouteShell.tsx
+++ /dev/null
@@ -1,173 +0,0 @@
-import { LoaderCircle } from "lucide-react";
-import { useEffect, useMemo, useRef, useState } from "react";
-import { useTranslation } from "react-i18next";
-import type { ReactRouteShellTargets } from "@/app/dashboard-shell";
-import {
- PROJECT_V1_ROUTE_DETAIL,
- useCurrentRoute,
- useNavigate,
- WORKSPACE_ROUTE_LANDING,
-} from "@/app/router";
-import { IAMRemindDialog } from "@/components/IAMRemindDialog";
-import { RoutePermissionGuardShell } from "@/components/RoutePermissionGuardShell";
-import { Alert } from "@/components/ui/alert";
-import { useNotify } from "@/hooks/useAppState";
-import { projectResourceNameFromId, useAppStore } from "@/stores/app";
-import { State } from "@/types/proto-es/v1/common_pb";
-import { setDocumentTitle } from "@/utils";
-
-interface ProjectRouteShellProps {
- projectId: string;
- routeKey?: string;
- onReady?: (targets: ReactRouteShellTargets | null) => void;
-}
-
-export function ProjectRouteShell({
- projectId,
- routeKey,
- onReady,
-}: ProjectRouteShellProps) {
- const { t } = useTranslation();
- const route = useCurrentRoute();
- const navigate = useNavigate();
- const navigateRef = useRef(navigate);
- navigateRef.current = navigate;
- const onReadyRef = useRef(onReady);
- onReadyRef.current = onReady;
- const notify = useNotify();
- const projectName = projectResourceNameFromId(projectId);
- const project = useAppStore((state) => state.projectsByName[projectName]);
- const defaultProjectName = useAppStore(
- (state) => state.serverInfo?.defaultProject ?? ""
- );
- const allowEdit = useAppStore((state) =>
- project
- ? project.state !== State.DELETED &&
- state.hasProjectPermission(project, "bb.projects.update")
- : false
- );
- const fetchProject = useAppStore((state) => state.fetchProject);
- const loadServerInfo = useAppStore((state) => state.loadServerInfo);
- const loadCurrentUser = useAppStore((state) => state.loadCurrentUser);
- const loadProjectIamPolicy = useAppStore(
- (state) => state.loadProjectIamPolicy
- );
- const setRecentProject = useAppStore((state) => state.setRecentProject);
- const removeRecentVisit = useAppStore((state) => state.removeRecentVisit);
- const [readyProjectName, setReadyProjectName] = useState("");
-
- useEffect(() => {
- let stale = false;
- setReadyProjectName("");
- onReadyRef.current?.(null);
-
- const load = async () => {
- await Promise.all([loadCurrentUser(), loadServerInfo()]);
- const nextProject = await fetchProject(projectName);
- if (stale) return;
- if (!nextProject) {
- const projectRoute = navigateRef.current.resolve({
- name: PROJECT_V1_ROUTE_DETAIL,
- params: { projectId },
- });
- removeRecentVisit(projectRoute.fullPath);
- const error = useAppStore.getState().projectErrorsByName[projectName];
- if (error) {
- notify({
- module: "bytebase",
- style: "CRITICAL",
- title: `Failed to fetch project ${projectId}`,
- description: error.message,
- });
- }
- void navigateRef.current.replace({ name: WORKSPACE_ROUTE_LANDING });
- return;
- }
- setRecentProject(nextProject.name);
- await loadProjectIamPolicy(nextProject.name);
- if (!stale) {
- setReadyProjectName(projectName);
- }
- };
-
- void load();
- return () => {
- stale = true;
- onReadyRef.current?.(null);
- };
- }, [
- fetchProject,
- loadCurrentUser,
- loadProjectIamPolicy,
- loadServerInfo,
- notify,
- projectId,
- projectName,
- removeRecentVisit,
- setRecentProject,
- ]);
-
- const ready = readyProjectName === projectName;
-
- useEffect(() => {
- if (!ready || !project) return;
- if (route.title) {
- setDocumentTitle(route.title, project.title);
- } else {
- setDocumentTitle(project.title);
- }
- }, [project, ready, route.title]);
-
- const routeProps = useMemo(
- () => ({
- projectId,
- allowEdit,
- }),
- [allowEdit, projectId]
- );
-
- if (!ready || !project) {
- return (
- <div className="fixed inset-0 bg-background flex flex-col items-center justify-center">
- <LoaderCircle className="size-5 animate-spin text-control-light" />
- </div>
- );
- }
-
- const isDefaultProject = project.name === defaultProjectName;
-
- return (
- <>
- {project.state === State.DELETED && (
- <div className="h-8 w-full text-base font-medium bg-control text-main-text flex justify-center items-center py-2 mb-4">
- {t("common.archived")}
- </div>
- )}
- {isDefaultProject && (
- <div className="m-4">
- <h1 className="mb-4 text-xl font-bold leading-6 text-main truncate">
- {t("database.unassigned-databases")}
- </h1>
- <Alert
- variant="info"
- className="mb-4"
- description={t("project.overview.info-slot-content")}
- />
- </div>
- )}
- <RoutePermissionGuardShell
- project={project}
- routeKey={routeKey}
- className="m-4"
- targetClassName="h-full min-h-0"
- onReady={(target) =>
- onReady?.({
- content: target,
- routeProps,
- })
- }
- />
- <IAMRemindDialog project={project} />
- </>
- );
-}
diff --git a/frontend/src/components/ProjectSelect.tsx b/frontend/src/components/ProjectSelect.tsx
index 15c81c55c5..8b7a7f69cd 100644
--- a/frontend/src/components/ProjectSelect.tsx
+++ b/frontend/src/components/ProjectSelect.tsx
@@ -38,11 +38,10 @@ export function ProjectSelect({
portal,
}: ProjectSelectProps) {
const { t } = useTranslation();
- // Projects referenced by `value` that aren't in the paged fetch.
- // Mirrors Vue's `additionalOptions` so deep-linked URLs (e.g.
- // `/sql-editor/projects/foo/...`) show the correct project label
- // when the user lands on the page before the matching page-1 fetch
- // returns it.
+ // Projects referenced by `value` that aren't in the paged fetch, so
+ // deep-linked URLs (e.g. `/sql-editor/projects/foo/...`) show the correct
+ // project label when the user lands on the page before the matching page-1
+ // fetch returns it.
const [additionalProjects, setAdditionalProjects] = useState<Project[]>([]);
// Read `excludeDefault` from a ref inside the callback so the
diff --git a/frontend/src/components/ProjectSidebar.tsx b/frontend/src/components/ProjectSidebar.tsx
index d1647017e1..3252c196b4 100644
--- a/frontend/src/components/ProjectSidebar.tsx
+++ b/frontend/src/components/ProjectSidebar.tsx
@@ -245,7 +245,7 @@ export function ProjectSidebar() {
recordVisitRef.current = record;
// Ensure the project is fetched into the store cache.
- // ProjectRouteShell also fetches it, but this guards against race conditions.
+ // ProjectRouteGate also fetches it, but this guards against race conditions.
useEffect(() => {
if (projectId) {
useAppStore
diff --git a/frontend/src/components/ProjectTable.tsx b/frontend/src/components/ProjectTable.tsx
index bfb883d8be..f57a3b7bfe 100644
--- a/frontend/src/components/ProjectTable.tsx
+++ b/frontend/src/components/ProjectTable.tsx
@@ -34,30 +34,30 @@ export interface ProjectTableProps {
/** Rows to render. */
readonly projectList: readonly Project[];
/**
- * When set, the row whose `name` matches gets a leading check icon
- * (mirrors Vue's `:current-project` mode used in the project switcher).
+ * When set, the row whose `name` matches gets a leading check icon (used in
+ * the project switcher).
*/
readonly currentProject?: Project;
/** Highlight keyword for the id and title cells. */
readonly keyword?: string;
/**
* Show the loading spinner row instead of `emptyContent` when there
- * are no projects. Mirrors NDataTable's `:loading` prop.
+ * are no projects.
*/
readonly loading?: boolean;
/**
* Custom empty-state node. Defaults to a "No data" placeholder.
*/
readonly emptyContent?: ReactNode;
- /** Mirrors Vue's `:show-selection`. Adds a leading checkbox column. */
+ /** Adds a leading checkbox column. */
readonly showSelection?: boolean;
- /** Mirrors Vue's `:show-labels`. Defaults to true. */
+ /** Shows the labels column. Defaults to true. */
readonly showLabels?: boolean;
/** Adds a dedicated state column. */
readonly showState?: boolean;
/**
- * Mirrors Vue's `:show-actions`. When set, the trailing column renders
- * `renderActions(project)` (typically the project action dropdown).
+ * When set, the trailing column renders `renderActions(project)` (typically
+ * the project action dropdown).
*/
readonly showActions?: boolean;
readonly renderActions?: RenderActions;
@@ -78,12 +78,9 @@ export interface ProjectTableProps {
}
/**
- * React port of `frontend/src/components/v2/Model/ProjectV1Table.vue`.
- *
* Renders the standard project listing — id / title / labels columns,
* with optional leading current-project check, leading selection
- * checkboxes, and trailing action-dropdown slot. Matches the prop
- * shape of the Vue component so call sites read the same way.
+ * checkboxes, and trailing action-dropdown slot.
*
* Two surfaces consume this today:
* - `ProjectsPage` (settings) — `showSelection` + `showActions` +
@@ -393,8 +390,8 @@ function ResourceStateBadge({ state }: { state: State }) {
}
/**
- * Mirrors Vue's `LabelsCell` — show up to N labels inline, "..." for
- * the rest, and a tooltip on hover that lists all of them.
+ * Show up to N labels inline, "..." for the rest, and a tooltip on hover that
+ * lists all of them.
*/
function LabelsCell({ labels }: { labels: { [key: string]: string } }) {
const entries = Object.entries(labels);
diff --git a/frontend/src/components/TableSchemaViewer.tsx b/frontend/src/components/TableSchemaViewer.tsx
index d1617e1513..38799b80d2 100644
--- a/frontend/src/components/TableSchemaViewer.tsx
+++ b/frontend/src/components/TableSchemaViewer.tsx
@@ -23,8 +23,6 @@ type Props = {
};
/**
- * React port of `frontend/src/components/TableSchemaViewer.vue`.
- *
* Fetches the SDL-style schema text for a database / schema / table /
* view via `databaseServiceClientConnect.getSchemaString` and displays
* it read-only. Header shows a `schema.object` (or `object` for
diff --git a/frontend/src/components/auth/InactiveRemindModal.tsx b/frontend/src/components/auth/InactiveRemindModal.tsx
index 622972dd55..747cea0603 100644
--- a/frontend/src/components/auth/InactiveRemindModal.tsx
+++ b/frontend/src/components/auth/InactiveRemindModal.tsx
@@ -34,8 +34,7 @@ export function InactiveRemindModal() {
}
};
read();
- // Poll for same-tab updates (VueUse writes aren't broadcast as `storage`
- // events in the same tab).
+ // Poll for same-tab updates; `storage` events only fire in other tabs.
const pollId = setInterval(read, 1000);
const onStorage = (e: StorageEvent) => {
if (e.key === storageKey) read();
diff --git a/frontend/src/components/database/CreateDatabaseSheetLayout.test.ts b/frontend/src/components/database/CreateDatabaseSheetLayout.test.ts
deleted file mode 100644
index b852464549..0000000000
--- a/frontend/src/components/database/CreateDatabaseSheetLayout.test.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const componentDir = dirname(fileURLToPath(import.meta.url));
-
-describe("CreateDatabaseSheet layout", () => {
- test("uses shared form primitives in the create database drawer", () => {
- const source = readFileSync(
- join(componentDir, "CreateDatabaseSheet.tsx"),
- "utf8"
- );
-
- expect(source).toContain("<FormFieldGroup>");
- expect(source).toContain("<FormField");
- expect(source).toContain("FormTitle");
- expect(source).not.toContain("FormLabel");
- expect(source).toContain('id="create-database-name"');
- expect(source).toContain('id="create-database-title"');
- expect(source).toContain('t("create-db.issue-title")');
- expect(source).not.toContain('t("common.title")');
- expect(source).not.toContain('className="block text-sm font-medium mb-1"');
- expect(source).not.toContain('className="flex flex-col gap-y-2"');
- });
-});
diff --git a/frontend/src/components/header/ProfileMenuTrigger.tsx b/frontend/src/components/header/ProfileMenuTrigger.tsx
index d2e080f978..f52a0ab17f 100644
--- a/frontend/src/components/header/ProfileMenuTrigger.tsx
+++ b/frontend/src/components/header/ProfileMenuTrigger.tsx
@@ -285,8 +285,8 @@ export function ProfileMenuTrigger({
<DropdownMenuItem
onClick={() => {
setOpen(false);
- // logout() computes the signin redirect itself (mirrors the
- // legacy Pinia auth store) and hard-redirects to clear state.
+ // logout() computes the signin redirect itself and
+ // hard-redirects to clear state.
void useAppStore.getState().logout();
}}
>
diff --git a/frontend/src/components/header/ProjectCreateDialogLayout.test.ts b/frontend/src/components/header/ProjectCreateDialogLayout.test.ts
deleted file mode 100644
index 87ba0180ab..0000000000
--- a/frontend/src/components/header/ProjectCreateDialogLayout.test.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const componentDir = dirname(fileURLToPath(import.meta.url));
-
-describe("ProjectCreateDialog layout", () => {
- test("uses shared form primitives in the create project drawer", () => {
- const source = readFileSync(
- join(componentDir, "ProjectCreateDialog.tsx"),
- "utf8"
- );
-
- expect(source).toContain("<FormFieldGroup>");
- expect(source).toContain("<FormField>");
- expect(source).toContain("FormTitle");
- expect(source).not.toContain("FormLabel");
- expect(source).toContain('id="create-project-title"');
- expect(source).not.toContain('className="flex flex-col gap-y-6"');
- expect(source).not.toContain("<label");
- });
-
- test("opens the database page after creating a project", () => {
- const source = readFileSync(
- join(componentDir, "ProjectCreateDialog.tsx"),
- "utf8"
- );
-
- expect(source).toContain("PROJECT_V1_ROUTE_DATABASES");
- expect(source).toContain("name: PROJECT_V1_ROUTE_DATABASES");
- expect(source).toContain(
- "projectId: extractProjectResourceName(createdProject.name)"
- );
- expect(source).toContain(
- "query: { [PRODUCT_INTRO_QUERY_KEY]: CONNECT_DATABASE_PRODUCT_INTRO }"
- );
- expect(source).not.toContain("path: `/${createdProject.name}`");
- });
-});
diff --git a/frontend/src/components/header/ProjectSwitchPanel.test.tsx b/frontend/src/components/header/ProjectSwitchPanel.test.tsx
index 49da9e14bb..b7e7d49d20 100644
--- a/frontend/src/components/header/ProjectSwitchPanel.test.tsx
+++ b/frontend/src/components/header/ProjectSwitchPanel.test.tsx
@@ -231,7 +231,6 @@ describe("ProjectSwitchPanel", () => {
render();
- // Rows are now `<tr>` (table layout, mirroring Vue's ProjectV1Table).
const row = Array.from(container.querySelectorAll("tr")).find((tr) =>
tr.textContent?.includes("Recent Project")
);
diff --git a/frontend/src/components/header/ProjectSwitchPanel.tsx b/frontend/src/components/header/ProjectSwitchPanel.tsx
index 8a3f13bc2c..ca35002584 100644
--- a/frontend/src/components/header/ProjectSwitchPanel.tsx
+++ b/frontend/src/components/header/ProjectSwitchPanel.tsx
@@ -138,11 +138,10 @@ export function ProjectSwitchPanel({
);
}, [recentProjectList, searchText]);
- // Mirrors Vue's `actualSelectedTab` — force the All view when a search
- // keyword is active but yields no recent matches, regardless of which
- // tab the user explicitly clicked. Keeping the trigger highlight in
- // sync is the consumer's responsibility (we pass `actualSelectedTab`
- // to `<Tabs value=…>` so both indicator and panel agree).
+ // Force the All view when a search keyword is active but yields no recent
+ // matches, regardless of which tab the user explicitly clicked. Keeping the
+ // trigger highlight in sync is the consumer's responsibility (we pass
+ // `actualSelectedTab` to `<Tabs value=…>` so both indicator and panel agree).
const actualSelectedTab = useMemo<ProjectSwitchTab>(() => {
if (
searchText.trim().length > 0 &&
diff --git a/frontend/src/components/header/no-vue-deps.test.ts b/frontend/src/components/header/no-vue-deps.test.ts
deleted file mode 100644
index 8b3bd55f42..0000000000
--- a/frontend/src/components/header/no-vue-deps.test.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-const sources = import.meta.glob(
- ["./*.{ts,tsx}", "../BytebaseLogo.tsx", "../DashboardSidebar.tsx"],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const appStateSources = import.meta.glob(
- ["../../hooks/useAppState.ts", "../../stores/app/**/*.ts"],
- {
- query: "?raw",
- import: "default",
- eager: true,
- }
-) as Record<string, string>;
-
-const forbidden = [
- "useVueState",
- '"@/store"',
- "@/components/Project/useRecentProjects",
- "hasWorkspacePermissionV2",
- "hasProjectPermissionV2",
- "@/router",
-];
-
-describe("React dashboard chrome dependencies", () => {
- test("does not directly depend on Vue, Pinia, or Vue Router", () => {
- const violations = [];
- for (const [file, source] of Object.entries(sources)) {
- if (file.endsWith(".test.ts") || file.endsWith(".test.tsx")) {
- continue;
- }
- for (const token of forbidden) {
- if (source.includes(token)) {
- violations.push(`${file}: ${token}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-
- test("does not keep header-specific app state names", () => {
- const violations = [];
- for (const [file, source] of Object.entries(appStateSources)) {
- for (const token of [
- "HeaderAppState",
- "useHeaderAppStore",
- "useHeaderApp",
- ]) {
- if (source.includes(token)) {
- violations.push(`${file}: ${token}`);
- }
- }
- }
- expect(violations).toEqual([]);
- });
-});
diff --git a/frontend/src/components/instance/ConnectionRecovery.test.ts b/frontend/src/components/instance/ConnectionRecovery.test.ts
index 8452fe55a0..fa9602d946 100644
--- a/frontend/src/components/instance/ConnectionRecovery.test.ts
+++ b/frontend/src/components/instance/ConnectionRecovery.test.ts
@@ -1,5 +1,3 @@
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
import { act, createElement } from "react";
import { createRoot } from "react-dom/client";
import { beforeEach, describe, expect, test, vi } from "vitest";
@@ -41,58 +39,6 @@ describe("ConnectionRecovery", () => {
expect(normalizeConnectionFailureCategory(undefined)).toBe("unknown");
});
- test("renders recovery with the shared warning alert", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/ConnectionRecovery.tsx"),
- "utf-8"
- );
-
- expect(source).toContain('from "@/components/ui/alert"');
- expect(source).toContain("<Alert");
- expect(source).toContain('variant="warning"');
- expect(source).not.toContain("border-control-border bg-control-bg");
- expect(source).not.toContain("toLowerCase");
- });
-
- test("shows category-specific recovery steps", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/ConnectionRecovery.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("steps:");
- expect(source).toContain("recovery.steps.map");
- expect(source).toContain("<ul");
- expect(source).toContain("<li");
- expect(source).toContain("instance.connection-recovery.auth.steps");
- expect(source).toContain("instance.connection-recovery.network.steps");
- expect(source).toContain("instance.connection-recovery.permission.steps");
- expect(source).toContain("instance.connection-recovery.timeout.steps");
- expect(source).toContain("instance.connection-recovery.tls.steps");
- expect(source).toContain("instance.connection-recovery.unsupported.steps");
- expect(source).toContain("instance.connection-recovery.unknown.steps");
- });
-
- test("links to official connection docs instead of backend-only guidance", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/ConnectionRecovery.tsx"),
- "utf-8"
- );
- const enUS = readFileSync(
- join(process.cwd(), "src/locales/en-US.json"),
- "utf-8"
- );
-
- expect(source).toContain(
- '"https://docs.bytebase.com/get-started/connect/overview?source=console"'
- );
- expect(source).toContain('target="_blank"');
- expect(source).toContain('rel="noreferrer"');
- expect(source).toContain("instance.connection-recovery.docs");
- expect(enUS).not.toContain("Check Bytebase backend logs");
- expect(enUS).not.toContain("Review required connection fields");
- });
-
test("shows Cloud-specific network recovery in SaaS mode", async () => {
mocks.isSaaSMode = true;
const container = document.createElement("div");
diff --git a/frontend/src/components/instance/DataSourceForm.test.ts b/frontend/src/components/instance/DataSourceForm.test.ts
deleted file mode 100644
index 2c7f2dd4e3..0000000000
--- a/frontend/src/components/instance/DataSourceForm.test.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const source = () =>
- readFileSync(
- join(process.cwd(), "src/components/instance/DataSourceForm.tsx"),
- "utf-8"
- );
-
-describe("DataSourceForm password sources", () => {
- test("keeps a draft per instance data source and secret provider", () => {
- const form = source();
-
- expect(form).toContain("sourceDraftStateRef");
- expect(form).toContain("invalidateSourceDrafts");
- expect(form).toContain("dataSourceResetEvent");
- expect(form).toContain("sourceDraftsRef.current.get(dataSource.id)");
- expect(form).toContain("drafts.set(");
- expect(form).toContain("const existingDraft = drafts.get(secretType)");
- expect(form).toContain("ds.externalSecret = existingDraft");
- });
-
- test("exports Redis Sentinel fields for the connection mode panel", () => {
- expect(source()).toContain("export function RedisSentinelFields");
- });
-
- test("does not initialize a provider from another provider's identifiers", () => {
- const form = source();
-
- expect(form).not.toContain("ds.externalSecret?.secretName ??");
- expect(form).not.toContain("ds.externalSecret?.passwordKeyName ??");
- expect(form).toContain('secretName: ""');
- expect(form).toContain('passwordKeyName: ""');
- });
-
- test("keeps the password source selector beside the Bytebase password input", () => {
- const form = source();
- const sourceIndex = form.indexOf("{passwordSourceControl}");
- const inputIndex = form.indexOf('type="password"', sourceIndex);
-
- expect(sourceIndex).toBeGreaterThan(0);
- expect(inputIndex).toBeGreaterThan(sourceIndex);
- });
-
- test("places the Bytebase password storage hint below the password title", () => {
- const form = source();
- const plainPasswordIndex = form.indexOf("/* Plain password */");
- const storedHintIndex = form.indexOf(
- "instance.password-source.stored-in-bytebase",
- plainPasswordIndex
- );
- const passwordInputIndex = form.indexOf(
- 'type="password"',
- plainPasswordIndex
- );
-
- expect(plainPasswordIndex).toBeGreaterThan(0);
- expect(storedHintIndex).toBeGreaterThan(plainPasswordIndex);
- expect(storedHintIndex).toBeLessThan(passwordInputIndex);
- expect(form.slice(storedHintIndex - 100, storedHintIndex)).toContain(
- "description={"
- );
- });
-
- test("places external secret documentation below the source title", () => {
- const form = source();
- const externalSecretFieldIndex = form.indexOf(
- "/* External secret fields */"
- );
- const passwordSourceControlIndex = form.indexOf(
- "{passwordSourceControl}",
- externalSecretFieldIndex
- );
- const learnMoreIndex = form.indexOf(
- "<LearnMoreLink",
- externalSecretFieldIndex
- );
-
- expect(externalSecretFieldIndex).toBeGreaterThan(0);
- expect(learnMoreIndex).toBeGreaterThan(externalSecretFieldIndex);
- expect(learnMoreIndex).toBeLessThan(passwordSourceControlIndex);
- expect(form.slice(learnMoreIndex - 100, learnMoreIndex)).toContain(
- "description={"
- );
- });
-});
-
-describe("DataSourceForm connection information buttons", () => {
- test("uses named shared buttons for connection information panels", () => {
- const form = source();
-
- expect(form).not.toContain("<button");
- expect(form).toContain('aria-label={t("instance.authentication")}');
- expect(form).toContain(
- 'aria-label={t("data-source.ssl.connection-security")}'
- );
- expect(form).toContain('aria-label={t("data-source.ssh-connection")}');
- expect(form).toContain('onOpenInfoPanel("authentication")');
- expect(form).toContain('onOpenInfoPanel("ssl")');
- expect(form).toContain('onOpenInfoPanel("ssh")');
- expect(form.match(/className="-ml-1 w-6 shrink-0 p-0"/g)).toHaveLength(3);
- });
-});
-
-describe("DataSourceForm extra parameters", () => {
- test("uses the same action width for add and remove rows", () => {
- const extraParameters = source().slice(
- source().indexOf("/* Extra connection parameters */")
- );
-
- expect(extraParameters.match(/className="w-24 shrink-0"/g)).toHaveLength(2);
- });
-});
-
-describe("DataSourceForm layout", () => {
- test("uses a 24px rhythm between connection fields", () => {
- expect(source()).toContain(
- 'className="grid grid-cols-1 gap-y-6 gap-x-4 border-none sm:grid-cols-3"'
- );
- });
-});
diff --git a/frontend/src/components/instance/DataSourceForm.tsx b/frontend/src/components/instance/DataSourceForm.tsx
index 824027eafb..12b0a95e80 100644
--- a/frontend/src/components/instance/DataSourceForm.tsx
+++ b/frontend/src/components/instance/DataSourceForm.tsx
@@ -2445,7 +2445,6 @@ export function DataSourceForm({
);
}
-// Matches Vue OracleSIDAndServiceNameInput.vue exactly
function OracleSIDServiceNameInput({
sid,
serviceName,
diff --git a/frontend/src/components/instance/InfoPanel.i18n.test.tsx b/frontend/src/components/instance/InfoPanel.test.tsx
similarity index 100%
rename from frontend/src/components/instance/InfoPanel.i18n.test.tsx
rename to frontend/src/components/instance/InfoPanel.test.tsx
diff --git a/frontend/src/components/instance/InstanceDashboard.test.ts b/frontend/src/components/instance/InstanceDashboard.test.ts
deleted file mode 100644
index 839a3cd91c..0000000000
--- a/frontend/src/components/instance/InstanceDashboard.test.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-describe("InstanceDashboard", () => {
- test("does not expose force archive paths for project instances", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceDashboard.tsx"),
- "utf-8"
- );
-
- expect(source).toMatch(
- /archiveInstance\(\s*instance,\s*project \? false : forceArchive\s*\)/
- );
- expect(source).toContain("{!project && (");
- expect(source).toContain("forceArchive={!project}");
- });
-
- test("resets scoped state when the project parent changes", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceDashboard.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("const previousParentRef = useRef(parent);");
- expect(source).toContain("fetchIdRef.current += 1;");
- expect(source).toContain("setInstances([]);");
- expect(source).toContain('nextPageTokenRef.current = "";');
- expect(source).toContain("setHasMore(false);");
- expect(source).toContain("setSelectedNames(new Set());");
- expect(source).toContain("}, [parent]);");
- });
-
- test("allows the connect-instance intro on project instance pages", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceDashboard.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("disabled: !canCreate,");
- expect(source).not.toContain(
- 'disabled: layout === "project" || !canCreate,'
- );
- });
-});
diff --git a/frontend/src/components/instance/InstanceFormBody.i18n.test.ts b/frontend/src/components/instance/InstanceFormBody.i18n.test.ts
deleted file mode 100644
index b2d25e0904..0000000000
--- a/frontend/src/components/instance/InstanceFormBody.i18n.test.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-// @vitest-environment node
-import i18next from "i18next";
-import { describe, expect, test } from "vitest";
-import enUS from "@/locales/en-US.json";
-import esES from "@/locales/es-ES.json";
-import jaJP from "@/locales/ja-JP.json";
-import viVN from "@/locales/vi-VN.json";
-import zhCN from "@/locales/zh-CN.json";
-
-const LOCALES = {
- "en-US": enUS,
- "zh-CN": zhCN,
- "es-ES": esES,
- "ja-JP": jaJP,
- "vi-VN": viVN,
-} as const;
-
-describe("Instance form locale interpolation", () => {
- test.each(Object.entries(LOCALES))(
- "renders host and proxy placeholders literally in %s",
- (locale, translation) => {
- const i18n = i18next.createInstance();
-
- void i18n.init({
- resources: {
- [locale]: { translation },
- },
- lng: locale,
- interpolation: {
- escapeValue: false,
- },
- initAsync: false,
- });
-
- expect(i18n.t("instance.sentence.host.none-snowflake")).toContain(" | ");
- expect(i18n.t("instance.sentence.host.none-snowflake")).not.toContain(
- "{"
- );
- expect(i18n.exists("instance.sentence.host.saas")).toBe(true);
- expect(
- i18n.exists("instance.failed-to-connect-instance-saas-local-host")
- ).toBe(true);
- expect(
- i18n.exists(
- "instance.connection-recovery.network.description-self-hosted"
- )
- ).toBe(true);
- expect(
- i18n.exists("instance.connection-recovery.network.description-saas")
- ).toBe(true);
- expect(i18n.t("instance.sentence.proxy.snowflake")).toContain("@");
- expect(i18n.t("instance.sentence.proxy.snowflake")).not.toContain("{");
- }
- );
-
- test("uses concise English connection status messages", () => {
- expect(enUS.instance["failed-to-connect-instance"]).toBe(
- "Connection test failed."
- );
- expect(enUS.instance["successfully-connected-instance"]).toBe(
- "Connection successful."
- );
- expect(enUS.instance["unable-to-connect"]).toContain(
- "Review the guidance above, or continue"
- );
- expect(enUS.instance.sentence["firewall-info"]).toBe(
- "Allowlist the Bytebase Cloud IP in your database firewall."
- );
- });
-});
diff --git a/frontend/src/components/instance/InstanceFormBody.test.ts b/frontend/src/components/instance/InstanceFormBody.test.ts
deleted file mode 100644
index 76f3435a72..0000000000
--- a/frontend/src/components/instance/InstanceFormBody.test.ts
+++ /dev/null
@@ -1,293 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-describe("InstanceFormBody", () => {
- test("uses a boolean value for the engine selector disclosure", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).not.toContain(
- 'inert={isEngineSelectorCollapsed ? "" : undefined}'
- );
- expect(source).toContain(
- "inert={isEngineSelectorCollapsed ? true : undefined}"
- );
- expect(source).not.toContain("isConnectionOptionsCollapsed");
- });
-
- test("renders database sync controls inside the connection card", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- const basicInfoIndex = source.indexOf("{/* Basic Info Card */}");
- const connectionCardIndex = source.indexOf("{/* Connection Card */}");
- const syncDatabasesIndex = source.indexOf("<SyncDatabases");
- const connectionOptionsIndex = source.indexOf("optionsOnly");
-
- expect(basicInfoIndex).toBeGreaterThanOrEqual(0);
- expect(connectionCardIndex).toBeGreaterThan(basicInfoIndex);
- expect(syncDatabasesIndex).toBeGreaterThan(connectionCardIndex);
- expect(connectionOptionsIndex).toBeGreaterThan(connectionCardIndex);
- expect(connectionOptionsIndex).toBeLessThan(syncDatabasesIndex);
- });
-
- test("renders database sync controls only once", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source.match(/<SyncDatabases/g)).toHaveLength(1);
- });
-
- test("groups Redis node and Sentinel master settings with the selected mode", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
- const redisModeIndex = source.indexOf("{/* Redis connection type */}");
- const additionalAddressesIndex = source.indexOf(
- "<AdditionalAddressesFields",
- redisModeIndex
- );
- const sentinelFieldsIndex = source.indexOf(
- "<RedisSentinelFields",
- redisModeIndex
- );
- const credentialsIndex = source.indexOf(
- "{/* Credentials (auth method, username, password) */}",
- redisModeIndex
- );
-
- expect(redisModeIndex).toBeGreaterThanOrEqual(0);
- expect(additionalAddressesIndex).toBeGreaterThan(redisModeIndex);
- expect(sentinelFieldsIndex).toBeGreaterThan(additionalAddressesIndex);
- expect(credentialsIndex).toBeGreaterThan(sentinelFieldsIndex);
- });
-
- test("labels project-aware database sync without a redundant alert", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).not.toContain("instance.sync-databases.project-self");
- expect(source).not.toContain("showLabel && !hasProjectContext");
- expect(source).toContain("title=");
- expect(source).toContain("showLabel ? (");
- expect(source).toContain("instance.sync-databases.description");
- expect(source).toContain('t("instance.sync-databases.self")');
- expect(source).not.toContain("instance.sync-databases.project-description");
- expect(source).toContain("instance.sync-databases.project-sync-all");
- expect(source).toContain("projectName");
- expect(source).not.toContain('useProjectByName(projectName ?? "")');
- expect(source).not.toContain("fetchProject(routeProjectName");
- expect(source).toContain("projectName={parent}");
- expect(source).not.toContain("ResourceLink");
- });
-
- test("preserves the project parent when the resource id changes", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).toContain(
- "parent ? `${parent}/instances/${id}` : `instances/${id}`"
- );
- expect(source).toContain(
- "parent ? `${parent}/instances/${id}` : `${instanceNamePrefix}${id}`"
- );
- expect(source).not.toContain("router.currentRoute.value.query.project");
- });
-
- test("does not treat an inaccessible instance as a duplicate resource id", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("existing.name !== UNKNOWN_INSTANCE_NAME");
- });
-
- test("offers sync-all database details from the create instance form", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
- const titleIndex = source.indexOf('t("instance.sync-databases.self")');
- const infoTriggerIndex = source.indexOf(
- 'onOpenInfoPanel("sync-databases")'
- );
- const descriptionIndex = source.indexOf(
- 't("instance.sync-databases.description")'
- );
- const syncControlIndex = source.indexOf(
- "<SegmentedControl",
- descriptionIndex
- );
-
- expect(source).toContain(
- "onOpenInfoPanel?: (section: InfoSection) => void"
- );
- expect(source).toContain("onOpenInfoPanel={onOpenInfoPanel}");
- expect(source).toContain('aria-label={t("instance.sync-databases.self")}');
- expect(source).toContain('<Info className="size-3.5" />');
- expect(infoTriggerIndex).toBeGreaterThan(titleIndex);
- expect(infoTriggerIndex).toBeLessThan(descriptionIndex);
- expect(infoTriggerIndex).toBeLessThan(syncControlIndex);
- });
-
- test("lets users load more database sync options", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("pendingScrollDatabaseRef");
- expect(source).toContain("scrollIntoView");
- expect(source).toContain("visibleDatabaseCount");
- expect(source).toContain("setVisibleDatabaseCount");
- expect(source).toContain(
- "filteredDatabases.slice(0, visibleDatabaseCount)"
- );
- expect(source).toContain('t("common.load-more")');
- expect(source).not.toContain('{t("common.load-more")} (');
- expect(source).not.toContain(
- "filteredDatabases.length - MAX_VISIBLE_DATABASES"
- );
- });
-
- test("shows cloud connection instruction under the connection section title", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- const connectionTitleIndex = source.indexOf(
- 't("instance.section.connection")'
- );
- const firewallInfoIndex = source.indexOf(
- 't("instance.sentence.firewall-info")'
- );
- const firewallAlertIndex = source.indexOf(
- '<Alert variant="info"',
- connectionTitleIndex
- );
- const connectionGridIndex = source.indexOf(
- 'className="flex flex-col gap-4"',
- connectionTitleIndex
- );
- const authenticationIndex = source.indexOf(
- "<DataSourceForm",
- connectionTitleIndex
- );
-
- expect(connectionTitleIndex).toBeGreaterThanOrEqual(0);
- expect(firewallAlertIndex).toBeGreaterThan(connectionTitleIndex);
- expect(firewallAlertIndex).toBeLessThan(firewallInfoIndex);
- expect(firewallInfoIndex).toBeGreaterThan(connectionTitleIndex);
- expect(connectionGridIndex).toBeGreaterThan(connectionTitleIndex);
- expect(firewallAlertIndex).toBeGreaterThan(connectionGridIndex);
- expect(firewallInfoIndex).toBeLessThan(authenticationIndex);
- expect(source).toContain(
- 'href="https://docs.bytebase.com/get-started/cloud#prerequisites"'
- );
-
- const firewallAlert = source.slice(
- firewallAlertIndex,
- source.indexOf("</Alert>", firewallAlertIndex)
- );
- expect(firewallAlert).toContain(
- '<span>{t("instance.sentence.firewall-info")}</span>'
- );
- expect(firewallAlert).toContain("<LearnMoreLink");
- expect(firewallAlert).not.toContain("<a");
- });
-
- test("keeps Docker-only host suggestions out of Bytebase Cloud", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).toContain('t("instance.sentence.host.saas")');
- expect(source).toContain('t("instance.sentence.host.none-snowflake")');
- });
-
- test("keeps the sync databases information trigger at the shared xs size", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
- const syncDatabases = source.slice(
- source.indexOf("export function SyncDatabases"),
- source.indexOf("export function InstanceFormBody")
- );
-
- expect(syncDatabases).toContain('className="-ml-1 w-6 shrink-0 p-0"');
- });
-
- test("moves the localized testing label into the sticky form actions", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormButtons.tsx"),
- "utf-8"
- );
-
- expect(source).toContain('t("instance.testing-connection")');
- expect(source).not.toContain('`${t("instance.test-connection")}...`');
- });
-
- test("shows connection recovery for explicit test connection failures", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormButtons.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("ConnectionRecovery");
- expect(source).toContain("testConnectionFailure");
- expect(source).toContain("message: testResult.message");
- expect(source).toContain("failureCategory: testResult.failureCategory");
- expect(source).toContain("setTestConnectionFailure(undefined)");
- expect(source).toContain(
- "category={testConnectionFailure.failureCategory}"
- );
- });
-
- test("distinguishes sync-all from empty selected database list", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).not.toContain(
- 'const key = syncAll ? "" : [...selectedSet].sort().join("\\0");'
- );
- expect(source).toContain('syncAll ? "all" : "selected"');
- expect(source).toContain(
- "[...selectedSet].sort((a, b) => a.localeCompare(b))"
- );
- });
-
- test("preserves an explicitly empty database sync selection", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/instance/InstanceFormBody.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("syncDatabases?: SyncDatabasesMessage");
- expect(source).toContain(
- "const [syncAll, setSyncAll] = useState(syncDatabases === undefined);"
- );
- expect(source).toContain("syncDatabases={basicInfo.syncDatabases}");
- expect(source).not.toContain(
- "syncDatabases={basicInfo.syncDatabases?.databases ?? []}"
- );
- });
-});
diff --git a/frontend/src/components/monaco/MonacoEditor.tsx b/frontend/src/components/monaco/MonacoEditor.tsx
index cc2d583afc..3e9ecac3e6 100644
--- a/frontend/src/components/monaco/MonacoEditor.tsx
+++ b/frontend/src/components/monaco/MonacoEditor.tsx
@@ -599,9 +599,7 @@ export function MonacoEditor({
// LSP `setMetadata` — must run *after* the editor + its model are
// attached so the language server has a document to bind the
// metadata to. We gate on `ready`, which the big editor effect
- // flips true once `editor.setModel(model)` has run. Mirrors Vue's
- // `useAutoComplete` call site, which lives inside the post-setup
- // path of `MonacoTextModelEditor.vue`.
+ // flips true once `editor.setModel(model)` has run.
//
// Skipped entirely when the caller does not opt in to SQL LSP via
// `autoCompleteContext`, so editors like `SchemaEditorLite` that mount
@@ -718,9 +716,9 @@ export function MonacoEditor({
ref={containerRef}
className={cn(
"w-full overflow-clip text-sm",
- // Match Vue's `bb-monaco-editor` — flush against the host
- // shell with no border or rounded corners. Consumers that
- // want a chrome can wrap the component themselves.
+ // Flush against the host shell with no border or rounded
+ // corners. Consumers that want a chrome can wrap the component
+ // themselves.
autoHeight ? "" : "h-full"
)}
style={autoHeight ? { height } : undefined}
diff --git a/frontend/src/components/monaco/services.ts b/frontend/src/components/monaco/services.ts
index 1edc758d7c..b8cea26f87 100644
--- a/frontend/src/components/monaco/services.ts
+++ b/frontend/src/components/monaco/services.ts
@@ -6,13 +6,6 @@ import "@codingame/monaco-vscode-theme-defaults-default-extension";
import getThemeServiceOverride from "@codingame/monaco-vscode-theme-service-override";
import "vscode/localExtensionHost";
-// Vue and React both ship their own Monaco wrappers during the React migration.
-// Without the guards below, whichever module evaluates second would clobber
-// `window.MonacoEnvironment` (losing worker labels the other side needs) and
-// re-trigger `@codingame/monaco-vscode-api` `initialize`, which is a *global*
-// one-shot — the second call rejects and leaves the editor spinner stuck
-// forever until a hard refresh. See BYT-9242.
-
type WorkerLoader = () => Worker;
const workerLoaders: Partial<Record<string, WorkerLoader>> = {
@@ -61,9 +54,9 @@ window.MonacoEnvironment = {
},
};
-// Share the init promise across both Vue and React Monaco wrappers. The
-// underlying `@codingame/monaco-vscode-api` `initialize` is a global one-shot,
-// so both sides must await the same promise rather than each caching its own.
+// `@codingame/monaco-vscode-api` `initialize` is a *global* one-shot: a second
+// call rejects and leaves the editor spinner stuck forever until a hard
+// refresh (BYT-9242), so every caller must await the same promise.
const GLOBAL_INIT_KEY = "__bytebaseMonacoServicesInitPromise__";
type GlobalWithMonacoInit = typeof globalThis & {
diff --git a/frontend/src/components/role-grant/DDLWarningCallout.locale.test.ts b/frontend/src/components/role-grant/DDLWarningCallout.locale.test.ts
deleted file mode 100644
index 1c7ffb6b5b..0000000000
--- a/frontend/src/components/role-grant/DDLWarningCallout.locale.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-import enReact from "@/locales/en-US.json";
-import esReact from "@/locales/es-ES.json";
-import jaReact from "@/locales/ja-JP.json";
-import viReact from "@/locales/vi-VN.json";
-import zhReact from "@/locales/zh-CN.json";
-
-// Locale-format guard for the new role-grant warning strings. Component
-// tests use a mock t() that doesn't see the real locale strings, so a typo
-// like "kind" instead of "{{kind}}" — or a translator dropping a placeholder
-// in a non-EN locale — would slip through. This test loads every React
-// locale and asserts placeholder presence directly. Cross-locale key parity
-// is enforced separately by frontend/scripts/check-react-i18n.mjs, but key
-// parity ≠ placeholder parity.
-
-const locales = {
- "en-US": enReact,
- "zh-CN": zhReact,
- "ja-JP": jaReact,
- "es-ES": esReact,
- "vi-VN": viReact,
-};
-
-const projectMembersKindKeys = [
- "ddl-warning",
- "ddl-current-all",
- "ddl-current-some",
- "ddl-current-none",
-] as const;
-
-describe("DDLWarningCallout locale strings", () => {
- for (const [locale, data] of Object.entries(locales)) {
- describe(locale, () => {
- test.each(projectMembersKindKeys)(
- "project.members.%s contains {{kind}} placeholder",
- (key) => {
- const value = (
- data.project.members as unknown as Record<string, string>
- )[key];
- expect(value).toBeDefined();
- expect(value).toContain("{{kind}}");
- }
- );
- });
- }
-});
diff --git a/frontend/src/components/sql-review/TemplateSelector.test.tsx b/frontend/src/components/sql-review/TemplateSelector.test.tsx
index 5f480d4ea3..c63a752390 100644
--- a/frontend/src/components/sql-review/TemplateSelector.test.tsx
+++ b/frontend/src/components/sql-review/TemplateSelector.test.tsx
@@ -55,9 +55,8 @@ vi.mock("@/types", () => ({
],
}));
-// The project getters that previously lived on the Pinia `useProjectV1Store`
-// now live on the Zustand app store, accessed via both the callable selector
-// form (`useAppStore((s) => s.projectsByName)`) and `useAppStore.getState()`.
+// TemplateSelector reads the app store through both the selector form
+// (`useAppStore((s) => s.projectsByName)`) and `useAppStore.getState()`.
const appStoreState = {
get getOrFetchProjectByName() {
return mocks.getOrFetchProjectByName;
diff --git a/frontend/src/components/task-run-log/TaskRunLogViewer.i18n.test.ts b/frontend/src/components/task-run-log/TaskRunLogViewer.i18n.test.ts
deleted file mode 100644
index 439f0652aa..0000000000
--- a/frontend/src/components/task-run-log/TaskRunLogViewer.i18n.test.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-// @vitest-environment node
-import i18next from "i18next";
-import { describe, expect, test } from "vitest";
-import enUS from "@/locales/en-US.json";
-import esES from "@/locales/es-ES.json";
-import jaJP from "@/locales/ja-JP.json";
-import viVN from "@/locales/vi-VN.json";
-import zhCN from "@/locales/zh-CN.json";
-
-const LOCALES = {
- "en-US": enUS,
- "zh-CN": zhCN,
- "es-ES": esES,
- "ja-JP": jaJP,
- "vi-VN": viVN,
-} as const;
-
-describe("TaskRunLogViewer locale interpolation", () => {
- test.each(Object.entries(LOCALES))(
- "interpolates summary and replica labels in %s",
- (locale, translation) => {
- const i18n = i18next.createInstance();
-
- void i18n.init({
- resources: {
- [locale]: { translation },
- },
- lng: locale,
- interpolation: {
- escapeValue: false,
- },
- initAsync: false,
- });
-
- expect(
- i18n.t("task-run.log-viewer.summary", { sections: 2, entries: 3 })
- ).not.toContain("{");
- expect(i18n.t("task-run.log-viewer.replica-n", { n: 2 })).not.toContain(
- "{"
- );
- }
- );
-});
diff --git a/frontend/src/components/ui/feature-modal.tsx b/frontend/src/components/ui/feature-modal.tsx
index 86f7ce199d..07e03d02b7 100644
--- a/frontend/src/components/ui/feature-modal.tsx
+++ b/frontend/src/components/ui/feature-modal.tsx
@@ -113,10 +113,9 @@ export function FeatureModal({ open, feature, instance, onOpenChange }: Props) {
<div>
<div className="flex items-center justify-between border-b pb-2 mb-4">
<DialogTitle className="text-base font-medium">{title}</DialogTitle>
- {/* Vue's BBModal had a built-in X close affordance; the React
- Dialog primitive does not, so render one explicitly so
- users can dismiss the paywall regardless of which CTA path
- renders below. */}
+ {/* The Dialog primitive has no built-in close button; render one
+ explicitly so users can dismiss the paywall regardless of
+ which CTA path renders below. */}
<DialogClose
aria-label={t("common.close")}
className="rounded-xs p-1 text-control hover:bg-control-bg focus:outline-hidden focus-visible:ring-2 focus-visible:ring-accent cursor-pointer"
@@ -170,8 +169,7 @@ export function FeatureModal({ open, feature, instance, onOpenChange }: Props) {
variant="default"
onClick={() => {
window.open(ENTERPRISE_INQUIRE_LINK, "_blank");
- // Vue's BBModal default-closes after a CTA click; mirror
- // that so the paywall doesn't linger after the inquiry
+ // Close so the paywall doesn't linger after the inquiry
// tab opens.
close();
}}
diff --git a/frontend/src/components/ui/form.test.tsx b/frontend/src/components/ui/form.test.tsx
index dba028285b..42ba97b0ff 100644
--- a/frontend/src/components/ui/form.test.tsx
+++ b/frontend/src/components/ui/form.test.tsx
@@ -1,5 +1,3 @@
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
import * as stylex from "@stylexjs/stylex";
import { act, createElement, type ReactElement } from "react";
import { createRoot } from "react-dom/client";
@@ -24,8 +22,6 @@ import {
formSectionStyle,
} from "./styles.stylex";
-const formSource = readFileSync(join(import.meta.dirname, "form.tsx"), "utf8");
-
(
globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
).IS_REACT_ACT_ENVIRONMENT = true;
@@ -226,41 +222,6 @@ describe("Form section layouts", () => {
unmount();
});
-
- test("does not expose legacy header composition primitives", () => {
- expect(formSource).not.toContain("function FormSectionHeader");
- expect(formSource).not.toContain("function FormSectionTitle");
- expect(formSource).not.toContain("function FormSectionContent");
- expect(formSource).not.toContain("function FormFieldHeader");
- expect(formSource).not.toContain("function FormFieldTitle");
- expect(formSource).not.toContain("function FormFieldSubtitle");
- expect(formSource).not.toContain("function FormHelperText");
- expect(formSource).not.toContain("function FormMessage");
- expect(formSource).not.toContain("function FormControlAffix");
- expect(formSource).not.toContain("function FormInlineAffix");
- expect(formSource).not.toContain("function FormFieldRow");
- });
-
- test("documents every exposed API with a usage example", () => {
- const exportedApis = [
- "FormControlGroup",
- "FormControlRow",
- "FormError",
- "FormField",
- "FormFieldGroup",
- "FormLabel",
- "FormSection",
- "FormTitle",
- ];
-
- for (const api of exportedApis) {
- expect(formSource, api).toMatch(
- new RegExp(
- String.raw`/\*\*[\s\S]*?@example[\s\S]*?\*/\nfunction ${api}\b`
- )
- );
- }
- });
});
describe("responsive form fields", () => {
diff --git a/frontend/src/components/ui/sheet.test.tsx b/frontend/src/components/ui/sheet.test.tsx
deleted file mode 100644
index 95f2b0decf..0000000000
--- a/frontend/src/components/ui/sheet.test.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-describe("Sheet layering policy", () => {
- test("does not keep stale raw z-index tokens in the shared sheet surface", () => {
- const source = readFileSync(
- join(process.cwd(), "src/components/ui/sheet.tsx"),
- "utf8"
- );
-
- expect(source).not.toMatch(/\bz-50\b/);
- });
-});
diff --git a/frontend/src/components/ui/styles.stylex.test.tsx b/frontend/src/components/ui/styles.stylex.test.tsx
index ad16fbc56d..ef2b62e797 100644
--- a/frontend/src/components/ui/styles.stylex.test.tsx
+++ b/frontend/src/components/ui/styles.stylex.test.tsx
@@ -1,4 +1,3 @@
-import { readFileSync } from "node:fs";
import * as stylex from "@stylexjs/stylex";
import { act, createElement, type ReactElement } from "react";
import { createRoot } from "react-dom/client";
@@ -77,19 +76,6 @@ const expectClasses = (className: string | undefined, expected: string) => {
}
};
-const styleSource = readFileSync(
- "src/components/ui/styles.stylex.ts",
- "utf8"
-);
-
-const extractStyleBlock = (styleName: string) => {
- const match = styleSource.match(
- new RegExp(`\\n ${styleName}: \\{([\\s\\S]*?)\\n \\},`)
- );
- expect(match, `${styleName} style block should exist`).not.toBeNull();
- return match?.[1] ?? "";
-};
-
describe("StyleX common UI style contracts", () => {
afterEach(() => {
document.body.innerHTML = "";
@@ -128,15 +114,6 @@ describe("StyleX common UI style contracts", () => {
);
});
- test("keeps form labels visually distinct from field titles", () => {
- const labelStyle = extractStyleBlock("label");
-
- expect(labelStyle).toContain('color: "rgb(var(--color-control))"');
- expect(labelStyle).toContain("fontSize: 14");
- expect(labelStyle).toContain("fontWeight: 500");
- expect(labelStyle).toContain('lineHeight: "20px"');
- });
-
test("keeps list row state separate from menu row state", () => {
expectClasses(
listRowStateClassName,
diff --git a/frontend/src/components/useCommonSearchScopeOptions.tsx b/frontend/src/components/useCommonSearchScopeOptions.tsx
index eb1651fc76..955a19d058 100644
--- a/frontend/src/components/useCommonSearchScopeOptions.tsx
+++ b/frontend/src/components/useCommonSearchScopeOptions.tsx
@@ -17,12 +17,9 @@ import {
} from "@/utils";
/**
- * React port of `useCommonSearchScopeOptions` from
- * frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts.
- * Initial scope: what SQL Editor ConnectionPane uses — `instance`, `label`,
- * and `engine`. Other scope ids (project, environment, state, etc.) remain
- * to be ported when a consumer needs them; the `scopeCreators` switch
- * short-circuits unknown ids rather than inventing a scope.
+ * Supports the scope ids SQL Editor ConnectionPane uses — `instance`,
+ * `label`, and `engine`. The `scopeCreators` switch short-circuits unknown
+ * ids rather than inventing a scope.
*/
export function useCommonSearchScopeOptions(
supportOptionIdList: SearchScopeId[],
diff --git a/frontend/src/hooks/useAppDatabase.ts b/frontend/src/hooks/useAppDatabase.ts
index a044bfb845..4c31c8da5a 100644
--- a/frontend/src/hooks/useAppDatabase.ts
+++ b/frontend/src/hooks/useAppDatabase.ts
@@ -7,9 +7,8 @@ import { isValidDatabaseName } from "@/types/v1/database";
* Reactively reads a database from the Zustand app store, self-fetching when
* the current route hasn't preloaded it (the SQL editor route does not mount
* the dashboard shells that hydrate the app store). Returns the
- * Pinia-compatible `unknownDatabase` fallback so callers can read
- * `.project` / `.instanceResource` without null checks — mirroring the legacy
- * `useDatabaseV1Store().getDatabaseByName`.
+ * `unknownDatabase` fallback so callers can read `.project` /
+ * `.instanceResource` without null checks.
*/
export const useAppDatabase = (name: string): Database => {
const getDatabaseByName = useAppStore((s) => s.getDatabaseByName);
diff --git a/frontend/src/hooks/useAppProject.ts b/frontend/src/hooks/useAppProject.ts
index fb5c419c0d..5f03ed7639 100644
--- a/frontend/src/hooks/useAppProject.ts
+++ b/frontend/src/hooks/useAppProject.ts
@@ -7,9 +7,8 @@ import type { Project } from "@/types/proto-es/v1/project_service_pb";
* Reactively reads a project from the Zustand app store, self-fetching
* when the current route hasn't preloaded it (the SQL editor route does
* not mount the dashboard shells that hydrate the app store). Returns the
- * Pinia-compatible fallback (`unknownProject` / default project) so
- * callers can read `.title` etc. without null checks — mirroring the
- * legacy `useProjectV1Store().getProjectByName`.
+ * `getProjectByName` fallback (`unknownProject` / default project) so
+ * callers can read `.title` etc. without null checks.
*/
export const useAppProject = (name: string): Project => {
const getProjectByName = useAppStore((s) => s.getProjectByName);
diff --git a/frontend/src/hooks/useDatabaseCatalog.ts b/frontend/src/hooks/useDatabaseCatalog.ts
index 46d305a268..c776adfe98 100644
--- a/frontend/src/hooks/useDatabaseCatalog.ts
+++ b/frontend/src/hooks/useDatabaseCatalog.ts
@@ -12,9 +12,8 @@ import {
hasProjectPermissionV2,
} from "@/utils";
-// React port of the legacy Pinia `useDatabaseCatalog` composable: fetches the
-// catalog (gated by permission) and reactively returns the cached entry,
-// falling back to a stable empty catalog so the selector never loops.
+// Fetches the catalog (gated by permission) and reactively returns the cached
+// entry, falling back to a stable empty catalog so the selector never loops.
export function useDatabaseCatalog(
database: string,
skipCache: boolean
diff --git a/frontend/src/hooks/useDelayedValue.ts b/frontend/src/hooks/useDelayedValue.ts
index 5379a08ace..90012b622f 100644
--- a/frontend/src/hooks/useDelayedValue.ts
+++ b/frontend/src/hooks/useDelayedValue.ts
@@ -18,8 +18,6 @@ export type UseDelayedValueResult<T> = {
};
/**
- * React port of `src/composables/useDelayedValue.ts`.
- *
* Schedules transitions to a value after a configurable delay; commits
* immediately when delay is 0. The "before"/"after" direction lets the
* caller use a longer open delay (e.g. 1000ms before showing a hover
diff --git a/frontend/src/hooks/useEnsureWorkspaceCommonData.ts b/frontend/src/hooks/useEnsureWorkspaceCommonData.ts
index 43c91cfc86..21faab1661 100644
--- a/frontend/src/hooks/useEnsureWorkspaceCommonData.ts
+++ b/frontend/src/hooks/useEnsureWorkspaceCommonData.ts
@@ -4,7 +4,7 @@ import { useAppStore } from "@/stores/app";
/**
* Workspace-scope common data bootstrap.
*
- * Every top-level React shell (DashboardFrameShell, SQLEditorLayout, and any
+ * Every top-level shell (DashboardFrameShell, SQLEditorLayout, and any
* future scope shell) calls this once. All loaders are idempotent (they
* dedupe via in-flight request refs in the app store), so wiring this hook
* up at multiple shells does not produce duplicate gRPC calls — it just
diff --git a/frontend/src/hooks/useExecuteSQL.ts b/frontend/src/hooks/useExecuteSQL.ts
index 8cbc3a0aac..a52657115f 100644
--- a/frontend/src/hooks/useExecuteSQL.ts
+++ b/frontend/src/hooks/useExecuteSQL.ts
@@ -7,7 +7,7 @@ import { v4 as uuidv4 } from "uuid";
import { isConnectedSQLEditorTab } from "@/lib/sqlEditorConnection";
import { getValidDataSourceByPolicy } from "@/lib/sqlEditorDataSource";
import { sqlEditorEvents } from "@/modules/sql-editor/model/events";
-import { useSQLEditorStore as useSQLEditorReactStore } from "@/modules/sql-editor/store";
+import { useSQLEditorStore } from "@/modules/sql-editor/store";
import { getSQLEditorEditorState } from "@/modules/sql-editor/store/editor";
import {
getDatabaseQueryContext,
@@ -371,7 +371,7 @@ export const useExecuteSQL = () => {
// the HistoryPane re-renders from it (store reactivity alone
// doesn't reliably propagate into the React subscriber, so we
// trigger the re-render explicitly).
- useSQLEditorReactStore
+ useSQLEditorStore
.getState()
.mergeLatest({
project: getSQLEditorEditorState().project,
diff --git a/frontend/src/hooks/useRecentVisit.ts b/frontend/src/hooks/useRecentVisit.ts
index 81d75b47ff..9ab2136f47 100644
--- a/frontend/src/hooks/useRecentVisit.ts
+++ b/frontend/src/hooks/useRecentVisit.ts
@@ -11,10 +11,8 @@ function getPath(url: string): string {
return url.replace(/[?#].*$/, "");
}
-// React port of the Vue `@/router/useRecentVisit` composable. Maintains the
-// per-user recent-visit list in localStorage under the same scoped key + JSON
-// array format as the Vue version (`@vueuse` useStorage), so the two remain
-// interoperable during the migration.
+// Maintains the per-user recent-visit list in localStorage under a scoped key
+// as a JSON array.
export function useRecentVisit() {
const isSaaSMode = useAppStore((s) => s.isSaaSMode());
const currentUser = useAppStore((s) => s.currentUser);
diff --git a/frontend/src/hooks/useSavedQueryAndTab.ts b/frontend/src/hooks/useSavedQueryAndTab.ts
index bdccbe2f7f..b3ba00fa86 100644
--- a/frontend/src/hooks/useSavedQueryAndTab.ts
+++ b/frontend/src/hooks/useSavedQueryAndTab.ts
@@ -16,11 +16,10 @@ export interface SavedQueryAndTab {
}
/**
- * React replacement for the Pinia `useWorkSheetAndTabStore`. Derives the
- * saved query bound to the current SQL editor tab plus creator / read-only
- * flags. The tab comes from the Zustand tab store; the saved query is read
- * from the Zustand saved query slice via `useAppStore` so cache hydration
- * and in-place edits re-render.
+ * Derives the saved query bound to the current SQL editor tab plus creator /
+ * read-only flags. The tab comes from the Zustand tab store; the saved query
+ * is read from the Zustand saved query slice via `useAppStore` so cache
+ * hydration and in-place edits re-render.
*/
export const useSavedQueryAndTab = (): SavedQueryAndTab => {
const currentTab = useCurrentSQLEditorTab();
diff --git a/frontend/src/lib/databaseFilter.ts b/frontend/src/lib/databaseFilter.ts
index 04b039c102..5d6d994860 100644
--- a/frontend/src/lib/databaseFilter.ts
+++ b/frontend/src/lib/databaseFilter.ts
@@ -1,10 +1,7 @@
import type { Engine } from "@/types/proto-es/v1/common_pb";
/**
- * Structured filter consumed by the app store's `fetchDatabases` and the
- * Pinia `useDatabaseV1Store.fetchDatabases`. Lives under `@/lib/` so
- * React code can import it without reaching into `@/stores/modules/v1/`.
- * The Pinia store re-exports this type for back-compat.
+ * Structured filter consumed by the app store's `fetchDatabases`.
*/
export interface DatabaseFilter {
project?: string;
diff --git a/frontend/src/lib/highlight.ts b/frontend/src/lib/highlight.ts
index 16564ab515..54cd9ce04e 100644
--- a/frontend/src/lib/highlight.ts
+++ b/frontend/src/lib/highlight.ts
@@ -3,7 +3,3 @@ import sql from "highlight.js/lib/languages/sql";
import "highlight.js/styles/github.css";
hljs.registerLanguage("sql", sql);
-
-export default {
- install() {},
-};
diff --git a/frontend/src/lib/i18n/canonical-locales.test.ts b/frontend/src/lib/i18n/canonical-locales.test.ts
deleted file mode 100644
index eb713a149a..0000000000
--- a/frontend/src/lib/i18n/canonical-locales.test.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-// @vitest-environment node
-import { existsSync, readdirSync, readFileSync } from "node:fs";
-import { dirname, resolve } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const __dirname = dirname(fileURLToPath(import.meta.url));
-const srcDir = resolve(__dirname, "../..");
-const sourceFilePattern = /\.(?:ts|tsx|vue)$/;
-
-function listSourceFiles(dir: string): string[] {
- return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
- const path = resolve(dir, entry.name);
- if (entry.isDirectory()) {
- if (entry.name === "locales" || entry.name === "proto-es") {
- return [];
- }
- return listSourceFiles(path);
- }
- return sourceFilePattern.test(entry.name) ? [path] : [];
- });
-}
-
-describe("canonical locale resources", () => {
- test("keeps app locale JSON under src/locales only", () => {
- expect(existsSync(resolve(srcDir, "locales"))).toBe(true);
- expect(existsSync(resolve(srcDir, "react/locales"))).toBe(false);
- });
-
- test("loads React i18n resources from the canonical locale root", () => {
- const source = readFileSync(resolve(srcDir, "lib/i18n/index.ts"), "utf-8");
-
- expect(source).toContain("@/locales/");
- });
-
- test("keeps SQL Review messages in the SQL Review locale slice only", () => {
- const localesDir = resolve(srcDir, "locales");
- const localeFiles = readdirSync(localesDir).filter((file) =>
- file.endsWith(".json")
- );
-
- for (const file of localeFiles) {
- const content = JSON.parse(
- readFileSync(resolve(localesDir, file), "utf-8")
- ) as Record<string, unknown>;
- expect(content["sql-review"], file).toBeUndefined();
- }
- });
-
- test("uses the React i18n module as the single runtime entrypoint", () => {
- expect(existsSync(resolve(srcDir, "plugins/i18n.ts"))).toBe(false);
-
- const legacyEntrypoint = ["@", "plugins", "i18n"].join("/");
- const violations = listSourceFiles(srcDir).filter((file) =>
- readFileSync(file, "utf-8").includes(legacyEntrypoint)
- );
- expect(violations).toEqual([]);
- });
-
- test("checks i18n keys across shared non-React callers", () => {
- const source = readFileSync(
- resolve(srcDir, "../scripts/check-react-i18n.mjs"),
- "utf-8"
- );
-
- expect(source).toContain('const SOURCE_DIR = resolve(ROOT, "src")');
- expect(source).toContain("SOURCE_SCAN_DIRS");
- expect(source).not.toContain(
- 'const REACT_DIR = resolve(ROOT, "src/react")'
- );
- });
-});
diff --git a/frontend/src/lib/i18n/messages.test.ts b/frontend/src/lib/i18n/messages.test.ts
deleted file mode 100644
index 6959e77e82..0000000000
--- a/frontend/src/lib/i18n/messages.test.ts
+++ /dev/null
@@ -1,273 +0,0 @@
-// @vitest-environment node
-import { readdirSync, readFileSync } from "fs";
-import { isEqual } from "lodash-es";
-import { dirname, resolve } from "path";
-import { fileURLToPath } from "url";
-import { describe, expect, test } from "vitest";
-import { Engine } from "@/types/proto-es/v1/common_pb";
-import { SQLReviewRule_Level } from "@/types/proto-es/v1/review_config_service_pb";
-import {
- getRuleLocalizationKey,
- ruleTypeToString,
- TEMPLATE_LIST_V2,
-} from "@/types/sqlReview";
-import { type LocaleMessageObject, mergedLocalMessage } from "./messages";
-
-// Helper to safely access nested locale objects
-const getNestedObject = (
- obj: LocaleMessageObject,
- key: string
-): LocaleMessageObject => {
- const value = obj[key];
- if (typeof value === "string") {
- throw new Error(`Expected object at key "${key}", got string`);
- }
- return value;
-};
-
-describe("Test i18n messages", () => {
- for (const keyA of Object.keys(mergedLocalMessage)) {
- for (const keyB of Object.keys(mergedLocalMessage)) {
- if (keyA === keyB) {
- continue;
- }
- if (
- typeof mergedLocalMessage[keyA] === "string" ||
- typeof mergedLocalMessage[keyB] === "string"
- ) {
- if (!isEqual(mergedLocalMessage[keyA], mergedLocalMessage[keyB])) {
- throw Error(`${keyA} and ${keyB} not match`);
- }
- continue;
- }
-
- test(`i18n message for ${keyA} and ${keyB}`, () => {
- const missMatchKey = compareMessages(
- mergedLocalMessage[keyA] as LocaleMessageObject,
- mergedLocalMessage[keyB] as LocaleMessageObject
- );
- let message = "";
- if (missMatchKey !== "") {
- message = `${missMatchKey} not match in ${keyA} and ${keyB}`;
- console.error(message);
- }
- expect(missMatchKey).toBe("");
- });
- }
- }
-});
-
-describe("Test i18n for SQL review", () => {
- expect(Object.keys(mergedLocalMessage).length).greaterThan(0);
- const i18nMessage = Object.values(
- mergedLocalMessage
- )[0] as LocaleMessageObject;
- expect(!!i18nMessage["sql-review"]).toBe(true);
-
- const i18nForSQLReview = getNestedObject(i18nMessage, "sql-review");
- const templateMessages = getNestedObject(i18nForSQLReview, "template");
- const ruleMessages = getNestedObject(i18nForSQLReview, "rule");
- const categoryMessages = getNestedObject(i18nForSQLReview, "category");
- const levelMessages = getNestedObject(i18nForSQLReview, "level");
- const engineMessages = getNestedObject(i18nForSQLReview, "engine");
-
- expect(!!templateMessages).toBe(true);
- expect(!!ruleMessages).toBe(true);
- expect(!!engineMessages).toBe(true);
- expect(!!categoryMessages).toBe(true);
-
- for (const template of TEMPLATE_LIST_V2) {
- describe(`check i18n for template ${template.id}`, () => {
- const key = `${template.id.split(".").join("-")}`;
- expect(!!templateMessages[key]).toBe(true);
- expect(!!templateMessages[`${key}-desc`]).toBe(true);
-
- if (template.ruleList.length === 0) {
- test("has template localization even without rules", () => {
- expect(!!templateMessages[key]).toBe(true);
- expect(!!templateMessages[`${key}-desc`]).toBe(true);
- });
- }
-
- for (const rule of template.ruleList) {
- test(`check i18n for rule ${ruleTypeToString(rule.type)}`, () => {
- const key = getRuleLocalizationKey(ruleTypeToString(rule.type));
- const ruleMessage = getNestedObject(ruleMessages, key);
- expect(!!ruleMessage, "rule-key").toBe(true);
- expect("title" in ruleMessage, "rule-key-title").toBe(true);
- expect("description" in ruleMessage, "rule-key-description").toBe(
- true
- );
- expect(
- rule.category.toLowerCase() in categoryMessages,
- "category-rule.category"
- );
- expect(
- sqlReviewRuleLevelToString(rule.level).toLowerCase() in
- levelMessages,
- "level-rule.level"
- ).toBe(true);
-
- expect(
- Engine[rule.engine].toLowerCase() in engineMessages,
- "engine.rule-engine"
- ).toBe(true);
-
- for (const component of rule.componentList) {
- const componentMessages = getNestedObject(ruleMessage, "component");
- expect(!!componentMessages, "rule-key-component").toBe(true);
- expect(
- component.key in componentMessages,
- "rule-key-component-component.key"
- ).toBe(true);
- }
- });
- }
- });
- }
-});
-
-// Helper function to convert SQLReviewRule_Level to string
-const sqlReviewRuleLevelToString = (level: SQLReviewRule_Level): string => {
- switch (level) {
- case SQLReviewRule_Level.LEVEL_UNSPECIFIED:
- return "LEVEL_UNSPECIFIED";
- case SQLReviewRule_Level.ERROR:
- return "ERROR";
- case SQLReviewRule_Level.WARNING:
- return "WARNING";
- default:
- return "UNKNOWN";
- }
-};
-
-const __dirname = dirname(fileURLToPath(import.meta.url));
-
-const checkKeysSorted = (
- obj: Record<string, unknown>,
- path: string
-): string[] => {
- const keys = Object.keys(obj);
- const sorted = [...keys].sort();
- const errors: string[] = [];
- for (let i = 0; i < keys.length; i++) {
- if (keys[i] !== sorted[i]) {
- errors.push(
- `${path}: key "${keys[i]}" is out of order (expected "${sorted[i]}")`
- );
- break;
- }
- }
- for (const key of keys) {
- const val = obj[key];
- if (val && typeof val === "object" && !Array.isArray(val)) {
- errors.push(
- ...checkKeysSorted(val as Record<string, unknown>, `${path}.${key}`)
- );
- }
- }
- return errors;
-};
-
-describe("Locale keys are sorted alphabetically", () => {
- const localesDirs = [resolve(__dirname, "../../locales")];
-
- for (const dir of localesDirs) {
- const files = readdirSync(dir).filter((f) => f.endsWith(".json"));
- for (const file of files) {
- test(`locales/${file}`, () => {
- const content = JSON.parse(readFileSync(resolve(dir, file), "utf-8"));
- const errors = checkKeysSorted(content, file);
- expect(errors, errors.join("\n")).toHaveLength(0);
- });
- }
- }
-});
-
-const dig = (messages: LocaleMessageObject, path: string): string => {
- let cur: string | LocaleMessageObject = messages;
- for (const part of path.split(".")) {
- expect(typeof cur, path).toBe("object");
- cur = (cur as LocaleMessageObject)[part];
- }
- expect(typeof cur, path).toBe("string");
- return cur as string;
-};
-
-// The workspace data-export setting's description quotes the "Request
-// export" button label verbatim so admins can connect the policy to the
-// affordance users see. Nothing else ties the two strings together, and
-// the label has a history of renames (#21081, #21200) — assert the quote
-// tracks the label in every locale. Scoped to these two keys on purpose:
-// a repo-wide grep would false-positive on prose that coincidentally
-// contains the label (e.g. ja role.project-viewer.description).
-describe("data-export description quotes the Request export label", () => {
- for (const [locale, messages] of Object.entries(mergedLocalMessage)) {
- test(locale, () => {
- const label = dig(
- messages as LocaleMessageObject,
- "sql-editor.request-export"
- );
- const description = dig(
- messages as LocaleMessageObject,
- "settings.general.workspace.data-export.description"
- );
- expect(description).toContain(label);
- });
- }
-});
-
-// The Masking Exemptions FEATURE (admin-granted, resource-scoped policy on
-// the project's Masking Exemptions page) and the access-grant "unmask"
-// capability (user-requested, statement-bound) are different mechanisms.
-// zh once shipped the feature's name (脱敏豁免) on the capability's CTA,
-// sending users into the wrong mental model in the largest zh market —
-// lock the separation in every locale: the capability strings must never
-// reuse the feature's name.
-describe("unmask capability wording stays distinct from the Masking Exemptions feature", () => {
- for (const [locale, messages] of Object.entries(mergedLocalMessage)) {
- test(locale, () => {
- const featureName = dig(
- messages as LocaleMessageObject,
- "project.masking-exemption.self"
- );
- for (const key of [
- "sql-editor.request-unmask",
- "sql-editor.grant-type-unmask",
- ]) {
- const value = dig(messages as LocaleMessageObject, key);
- expect(
- value.toLowerCase().includes(featureName.toLowerCase()),
- `${locale} ${key} ("${value}") must not reuse the Masking Exemptions feature name ("${featureName}")`
- ).toBe(false);
- }
- });
- }
-});
-
-const compareMessages = (
- localA: LocaleMessageObject,
- localB: LocaleMessageObject
-): string => {
- for (const [key, valA] of Object.entries(localA)) {
- const valB = localB[key];
- if (!(key in localB)) {
- return key;
- }
- if (typeof valA === "object") {
- if (typeof valB !== "object") {
- return key;
- }
- // i18n v4 has special body for locale message string.
- if ("type" in valA && "start" in valA && "end" in valA) {
- continue;
- }
- const missMatch = compareMessages(valA, valB);
- if (missMatch) {
- return `${key}.${missMatch}`;
- }
- }
- }
-
- return "";
-};
diff --git a/frontend/src/lib/i18n/messages.ts b/frontend/src/lib/i18n/messages.ts
deleted file mode 100644
index c28abcf5d0..0000000000
--- a/frontend/src/lib/i18n/messages.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { merge } from "lodash-es";
-
-const localPathPrefix = "../../locales/";
-type LocaleModule = { default: Record<string, unknown> };
-
-export type LocaleMessageObject = {
- [key: string]: string | LocaleMessageObject;
-};
-
-const localeModules = import.meta.glob("../../locales/**/*.json", {
- eager: true,
-});
-const rootMessages: Record<string, Record<string, unknown>> = {};
-const sectionMessages: Record<string, Record<string, unknown>> = {};
-
-// import i18n resources
-// https://vitejs.dev/guide/features.html#glob-import
-for (const [key, value] of Object.entries(localeModules)) {
- const name = key.slice(localPathPrefix.length, -5);
- const sections = name.split("/");
- const messages = (value as LocaleModule).default;
- if (sections.length === 1) {
- rootMessages[name] = messages;
- } else {
- const file = sections.at(-1) ?? "";
- const sectionsName = sections[0];
- sectionMessages[file] = sectionMessages[file] ?? {};
- sectionMessages[file][sectionsName] = merge(
- sectionMessages[file][sectionsName] ?? {},
- messages
- );
- }
-}
-
-export const mergedLocalMessage = Object.fromEntries(
- Object.keys({ ...sectionMessages, ...rootMessages }).map((locale) => [
- locale,
- merge({}, sectionMessages[locale] ?? {}, rootMessages[locale] ?? {}),
- ])
-) as LocaleMessageObject;
diff --git a/frontend/src/lib/issue/issueListRefresh.ts b/frontend/src/lib/issue/issueListRefresh.ts
index ad50561a73..496650fe8e 100644
--- a/frontend/src/lib/issue/issueListRefresh.ts
+++ b/frontend/src/lib/issue/issueListRefresh.ts
@@ -1,8 +1,6 @@
import { useEffect } from "react";
-// Global "refresh the issue list" signal, relocated from the legacy Pinia
-// `issue` module (which used a Vue ref + watch). Plain module-level listener
-// set so callers don't pull Vue reactivity into React feature code.
+// Global "refresh the issue list" signal.
const listeners = new Set<() => void>();
export const refreshIssueList = (): void => {
diff --git a/frontend/src/lib/memberBindings.ts b/frontend/src/lib/memberBindings.ts
index d6a1d3c45a..f5a4469f54 100644
--- a/frontend/src/lib/memberBindings.ts
+++ b/frontend/src/lib/memberBindings.ts
@@ -24,7 +24,6 @@ import { convertMemberToFullname, hasWorkspacePermissionV2 } from "@/utils";
// Lives under `@/lib/` (not `@/utils/`) so the app-store reads don't
// drag `@/stores/app` into the `@/utils` import graph — that would
// recreate the static ESM cycle the SQL editor connection move fixed.
-// Members surfaces are React-only, so a React-side location is natural.
export const getMemberBinding = (
member: string,
diff --git a/frontend/src/lib/plan/title.ts b/frontend/src/lib/plan/title.ts
index 3e43d49ec6..d3472f0ca8 100644
--- a/frontend/src/lib/plan/title.ts
+++ b/frontend/src/lib/plan/title.ts
@@ -6,8 +6,8 @@ import type { Project } from "@/types/proto-es/v1/project_service_pb";
* Returns the auto-generated title for the plan-create route's `query.name`,
* or `undefined` when the project has `enforceIssueTitle=true` ("Require manual
* title"). Leaving `query.name` undefined forces the plan-create page to open
- * with an empty title; `CreateButton.vue` then blocks submit until the user
- * types a deliberate title that will appear in the audit log.
+ * with an empty title; `getCreatePlanBlockers` then blocks creation until the
+ * user types a deliberate title that will appear in the audit log.
*
* DO NOT inline this gate away. It is the load-bearing check that makes an
* audited project's setting mean what it says. Removing it silently reintroduces
@@ -25,7 +25,7 @@ export const planQueryNameForProject = (
* Writes the auto-generated plan title into `query.name` unless the project
* enforces manual titles. When `enforceIssueTitle` is true, leaves `query.name`
* unset so the plan-create page opens with an empty title — the user must type
- * a deliberate title before `CreateButton.vue` allows submit.
+ * a deliberate title before `getCreatePlanBlockers` allows creation.
*
* If `query.name` is already set by the caller, this helper clears it when
* enforcement is on, to prevent a stale pre-fill from reaching an enforced
diff --git a/frontend/src/lib/productIntro.test.ts b/frontend/src/lib/productIntro.test.ts
index f5be4faa38..e56786ce31 100644
--- a/frontend/src/lib/productIntro.test.ts
+++ b/frontend/src/lib/productIntro.test.ts
@@ -1,7 +1,3 @@
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-
import { act, createElement } from "react";
import { createRoot } from "react-dom/client";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
@@ -54,8 +50,6 @@ const ProductIntroHost = () => {
return null;
};
-const libDir = dirname(fileURLToPath(import.meta.url));
-
describe("showProductIntro", () => {
beforeEach(() => {
vi.useFakeTimers();
@@ -367,11 +361,4 @@ describe("showProductIntro", () => {
expect(window.location.search).toBe("?tab=workspace");
expect(window.location.hash).toBe("#ai-assistant");
});
-
- test("keeps the page cover light enough to preserve context", () => {
- const css = readFileSync(join(libDir, "productIntro.css"), "utf8");
-
- expect(css).toContain("0 0 0 9999px rgb(var(--color-overlay) / 38%)");
- expect(css).not.toContain("0 0 0 9999px rgb(var(--color-overlay) / 62%)");
- });
});
diff --git a/frontend/src/lib/sensitive-data/exemptionDataUtils.ts b/frontend/src/lib/sensitive-data/exemptionDataUtils.ts
index 24180b9154..9b82a25c37 100644
--- a/frontend/src/lib/sensitive-data/exemptionDataUtils.ts
+++ b/frontend/src/lib/sensitive-data/exemptionDataUtils.ts
@@ -40,8 +40,8 @@ export function parseExpirationTimestamp(
}
// Keep a local extraction function instead of importing extractDatabaseResourceName
-// from @/utils. That utility transitively pulls in store dependencies (Pinia, etc.)
-// which break vitest when this file is imported from unit tests.
+// from @/utils. That utility transitively pulls in store dependencies, which
+// break vitest when this file is imported from unit tests.
const databaseResourcePattern =
/(?:^|\/)instances\/(?<instanceName>[^/]+)\/databases\/(?<databaseName>[^/]+)(?:$|\/)/;
diff --git a/frontend/src/lib/sqlEditorConnection.ts b/frontend/src/lib/sqlEditorConnection.ts
index baa503d991..7412de3f9e 100644
--- a/frontend/src/lib/sqlEditorConnection.ts
+++ b/frontend/src/lib/sqlEditorConnection.ts
@@ -12,8 +12,7 @@ import { instanceV1AllowsCrossDatabaseQuery } from "@/utils/v1/instance";
* connection. Lives under `@/lib/` (not `@/utils/`) because the lookup
* goes through the React app store — putting it under `@/utils/` would
* create a static ESM cycle: `@/utils` → `@/stores/app` → ...slices...
- * → `@/types` → ... → back into `@/utils`. Hosting on the React side breaks
- * the import graph cleanly while keeping the migration off Pinia.
+ * → `@/types` → ... → back into `@/utils`.
*/
export const getConnectionForSQLEditorTab = (tab?: SQLEditorTab) => {
const target: {
diff --git a/frontend/src/lib/sqlEditorDataSource.ts b/frontend/src/lib/sqlEditorDataSource.ts
index 5f794770c1..541365571b 100644
--- a/frontend/src/lib/sqlEditorDataSource.ts
+++ b/frontend/src/lib/sqlEditorDataSource.ts
@@ -7,11 +7,8 @@ import { PolicyType } from "@/types/proto-es/v1/org_policy_service_pb";
import { getInstanceResource } from "@/utils/v1/database";
// Picks the data-source id for a query, honoring the workspace DATA_QUERY
-// policy's `allowAdminDataSource`. Reads the React app store directly (the
-// legacy `@/utils/sqlEditor` version used the Pinia `useQueryDataPolicy`
-// composable, whose store is not populated in the React shell — so admin data
-// sources were never selectable). `allowAdminDataSource` is a workspace-level
-// flag (the legacy policy getter took it from the workspace policy only).
+// policy's `allowAdminDataSource`. That flag is workspace-level, so only the
+// workspace policy is read.
export const getValidDataSourceByPolicy = async (
database: Database,
type?: QueryDataSourceType
diff --git a/frontend/src/lib/toast.test.ts b/frontend/src/lib/toast.test.ts
index 9a3f6d657f..b103363748 100644
--- a/frontend/src/lib/toast.test.ts
+++ b/frontend/src/lib/toast.test.ts
@@ -8,7 +8,7 @@ vi.mock("@base-ui/react/toast", () => ({
},
}));
-import { mapNotificationToToast, pushReactNotification } from "./toast";
+import { mapNotificationToToast, pushNotification } from "./toast";
describe("mapNotificationToToast", () => {
test("SUCCESS maps to type=success, priority=low, timeout=6000", () => {
@@ -85,11 +85,11 @@ describe("mapNotificationToToast", () => {
});
});
-describe("pushReactNotification", () => {
+describe("pushNotification", () => {
beforeEach(() => addMock.mockReset());
test("calls toastManager.add with mapped options", () => {
- pushReactNotification({
+ pushNotification({
module: "bytebase",
style: "SUCCESS",
title: "Saved",
@@ -104,7 +104,7 @@ describe("pushReactNotification", () => {
});
test("ignores notifications with module !== 'bytebase'", () => {
- pushReactNotification({
+ pushNotification({
module: "other",
style: "INFO",
title: "ignored",
diff --git a/frontend/src/lib/toast.ts b/frontend/src/lib/toast.ts
index d49f5b45ac..e15d1b9e98 100644
--- a/frontend/src/lib/toast.ts
+++ b/frontend/src/lib/toast.ts
@@ -52,9 +52,9 @@ export function mapNotificationToToast(item: NotificationCreate): ToastOptions {
};
}
-// Filter mirrors the previous Vue NotificationContext: only the "bytebase"
-// module renders; other modules (e.g. agent) own their own UI surface.
-export function pushReactNotification(item: NotificationCreate): void {
+// Only the "bytebase" module renders here; other modules (e.g. agent) own
+// their own UI surface.
+export function pushNotification(item: NotificationCreate): void {
if (item.module !== "bytebase") return;
toastManager.add(mapNotificationToToast(item));
}
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 655f4e51cf..fab3c76d89 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -804,7 +804,6 @@
"unassign": "Unassign",
"unassign-alert-description": "The selected databases will be removed from the project",
"unassign-alert-title": "Unassign databases",
- "unassigned-databases": "Unassigned databases",
"unique": "Unique",
"visible": "Visible"
},
@@ -1319,9 +1318,6 @@
"host": {
"none-snowflake": "e.g. host.docker.internal | host IP | local socket",
"saas": "e.g. db.example.com | database IP"
- },
- "proxy": {
- "snowflake": "For proxy server, append @PROXY_HOST and specify PROXY_PORT in the port"
}
},
"show-how-to-create": "Show how to create",
@@ -2034,9 +2030,6 @@
},
"revoke-role-from-member": "Revoke '{{role}}' from '{{member}}'?"
},
- "overview": {
- "info-slot-content": "Bytebase periodically syncs the instance schema. Newly synced databases are first placed here. User should transfer them to the proper application project."
- },
"select": "Select project",
"settings": {
"confirm-archive-project": "Archiving \"{{name}}\" will make it read-only and hide it from active project lists. All issues, databases, and settings will be preserved. You can restore it later from the archived projects list.",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 5bed709f15..e5ca198d89 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -804,7 +804,6 @@
"unassign": "Desasignar",
"unassign-alert-description": "Las bases de datos seleccionadas serán eliminadas del proyecto",
"unassign-alert-title": "Desasignar bases de datos",
- "unassigned-databases": "Bases de datos no asignadas",
"unique": "Único",
"visible": "Visible"
},
@@ -1319,9 +1318,6 @@
"host": {
"none-snowflake": "por ejemplo, host.docker.internal | IP del host | socket local",
"saas": "por ejemplo, db.example.com | IP de la base de datos"
- },
- "proxy": {
- "snowflake": "Para el servidor proxy, agregue @PROXY_HOST y especifique PROXY_PORT en el puerto"
}
},
"show-how-to-create": "Mostrar cómo crear",
@@ -2034,9 +2030,6 @@
},
"revoke-role-from-member": "¿Revocar '{{role}}' de '{{member}}'?"
},
- "overview": {
- "info-slot-content": "Bytebase sincroniza periódicamente el esquema de la instancia. Las bases de datos recién sincronizadas se colocan aquí primero. El usuario debe transferirlas al proyecto de aplicación adecuado."
- },
"select": "Seleccionar proyecto",
"settings": {
"confirm-archive-project": "Archivar \"{{name}}\" lo hará de solo lectura y lo ocultará de las listas de proyectos activos. Se conservarán todos los issues, bases de datos y configuraciones. Puede restaurarlo más tarde desde la lista de proyectos archivados.",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index d24888ef9a..5761d66495 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -804,7 +804,6 @@
"unassign": "割り当てを解除する",
"unassign-alert-description": "選択したデータベースがプロジェクトから削除されます",
"unassign-alert-title": "データベースの割り当てを解除する",
- "unassigned-databases": "未割り当てのデータベース",
"unique": "唯一",
"visible": "見える"
},
@@ -1319,9 +1318,6 @@
"host": {
"none-snowflake": "例: host.docker.internal | ホスト IP | ローカルソケット",
"saas": "例: db.example.com | データベース IP"
- },
- "proxy": {
- "snowflake": "プロキシ サーバーの場合は、@PROXY_HOST を追加し、ポートに PROXY_PORT を指定します。"
}
},
"show-how-to-create": "作成方法",
@@ -2034,9 +2030,6 @@
},
"revoke-role-from-member": "'{{member}}' から '{{role}}' を取り消しますか?"
},
- "overview": {
- "info-slot-content": "Bytebase はインスタンスのスキーマを定期的に同期します。新しく同期されたデータベースは最初にここに配置され、その後、それらを適切なプロジェクトに転送できます。"
- },
"select": "プロジェクトを選択",
"settings": {
"confirm-archive-project": "\"{{name}}\" をアーカイブすると、読み取り専用になり、アクティブなプロジェクト一覧から非表示になります。すべての Issue、データベース、設定は保持されます。後でアーカイブ済みプロジェクト一覧から復元できます。",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index d8358c227c..8e38914602 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -804,7 +804,6 @@
"unassign": "Hủy gán",
"unassign-alert-description": "Các cơ sở dữ liệu đã chọn sẽ bị xóa khỏi dự án",
"unassign-alert-title": "Hủy gán cơ sở dữ liệu",
- "unassigned-databases": "Cơ sở dữ liệu chưa được gán",
"unique": "Duy nhất",
"visible": "Hiển thị"
},
@@ -1319,9 +1318,6 @@
"host": {
"none-snowflake": "ví dụ: host.docker.internal | IP máy chủ | local socket",
"saas": "ví dụ: db.example.com | IP cơ sở dữ liệu"
- },
- "proxy": {
- "snowflake": "Đối với máy chủ proxy, thêm @PROXY_HOST và chỉ định PROXY_PORT trong cổng"
}
},
"show-how-to-create": "Hiển thị cách tạo",
@@ -2034,9 +2030,6 @@
},
"revoke-role-from-member": "Thu hồi '{{role}}' từ '{{member}}'?"
},
- "overview": {
- "info-slot-content": "Bytebase định kỳ đồng bộ hóa lược đồ phiên bản. Các cơ sở dữ liệu mới được đồng bộ hóa trước tiên được đặt ở đây. Người dùng nên chuyển chúng đến dự án ứng dụng thích hợp."
- },
"select": "Chọn dự án",
"settings": {
"confirm-archive-project": "Việc lưu trữ \"{{name}}\" sẽ khiến nó trở thành chỉ đọc và ẩn khỏi danh sách dự án đang hoạt động. Tất cả issue, cơ sở dữ liệu và cài đặt sẽ được giữ lại. Bạn có thể khôi phục lại sau từ danh sách dự án đã lưu trữ.",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 3c4f62fa1f..62ceb172cd 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -804,7 +804,6 @@
"unassign": "取消分配",
"unassign-alert-description": "选定的数据库将从项目中移除",
"unassign-alert-title": "取消分配数据库",
- "unassigned-databases": "未分配的数据库",
"unique": "唯一",
"visible": "可见"
},
@@ -1319,9 +1318,6 @@
"host": {
"none-snowflake": "例如 host.docker.internal | 主机 IP | 本地 Socket",
"saas": "例如 db.example.com | 数据库 IP"
- },
- "proxy": {
- "snowflake": "对于代理服务器,加上 @PROXY_HOST,并在端口里指定 PROXY_PORT"
}
},
"show-how-to-create": "如何创建",
@@ -2034,9 +2030,6 @@
},
"revoke-role-from-member": "从 '{{member}}' 撤销 '{{role}}' 角色?"
},
- "overview": {
- "info-slot-content": "Bytebase 会定时同步实例的 schema,新同步的数据库会首先被置于这里,之后您可以再将他们转移到适当的项目中。"
- },
"select": "选择项目",
"settings": {
"confirm-archive-project": "归档「{{name}}」将使其变为只读并从活跃项目列表中隐藏。所有工单、数据库和设置将被保留。您可以稍后从已归档项目列表中恢复。",
diff --git a/frontend/src/modules/access-control/RequestRoleSheet.test.tsx b/frontend/src/modules/access-control/RequestRoleSheet.test.tsx
index ff97b700fc..c56309bacf 100644
--- a/frontend/src/modules/access-control/RequestRoleSheet.test.tsx
+++ b/frontend/src/modules/access-control/RequestRoleSheet.test.tsx
@@ -13,8 +13,8 @@ import type { Permission } from "@/types";
).IS_REACT_ACT_ENVIRONMENT = true;
// ---------------------------------------------------------------------------
-// Stub EnvironmentSelect — the real component mounts Pinia-backed
-// environment state that's not worth wiring up for these tests.
+// Stub EnvironmentSelect — the real component loads the environment list
+// from the app store, which is not worth wiring up for these tests.
// ---------------------------------------------------------------------------
vi.mock("@/components/EnvironmentSelect", () => ({
@@ -195,7 +195,7 @@ vi.mock("@/types", () => ({
}));
// ---------------------------------------------------------------------------
-// Store / connect mocks — stable singletons for Pinia-adjacent bridges.
+// Store / connect mocks — stable singletons.
// ---------------------------------------------------------------------------
const mocks = vi.hoisted(() => ({
@@ -231,7 +231,6 @@ vi.mock("@/stores/app", () => ({
? ["bb.projects.get", "bb.databases.get"]
: [],
}),
- // Migrated off the Pinia useSettingV1Store mock.
getWorkspaceProfile: () => ({
maximumRoleExpiration:
mocks.maximumRoleExpirationSeconds === undefined
diff --git a/frontend/src/modules/access-control/RequestRoleSheet.tsx b/frontend/src/modules/access-control/RequestRoleSheet.tsx
index be8108c79d..c443a2866a 100644
--- a/frontend/src/modules/access-control/RequestRoleSheet.tsx
+++ b/frontend/src/modules/access-control/RequestRoleSheet.tsx
@@ -190,7 +190,7 @@ function RequestRoleForm({
DatabaseResource[]
>(initialDatabaseResources);
// CEL expression for EXPRESSION mode is held as a structured group so it
- // can render in ExprEditor (matching the old Vue DatabaseResourceForm).
+ // can render in ExprEditor.
const [exprGroup, setExprGroup] = useState<ConditionGroupExpr>(() =>
wrapAsGroup(emptySimpleExpr())
);
@@ -219,10 +219,9 @@ function RequestRoleForm({
const selectedRoleMatchesRequiredPermissions =
roleMatchesRequiredPermissions(selectedRole);
- // Workspace-configured maximum role expiration, in days. Matches the old
- // Vue ExpirationSelector: PROJECT_OWNER grants are exempted (project
- // owners can request unbounded expirations), otherwise the workspace cap
- // applies. Returns undefined when no cap is set.
+ // Workspace-configured maximum role expiration, in days. PROJECT_OWNER
+ // grants are exempted (project owners can request unbounded expirations),
+ // otherwise the workspace cap applies. Returns undefined when no cap is set.
const workspaceProfile = useAppStore((state) => state.getWorkspaceProfile());
const maximumRoleExpirationDays = useMemo(() => {
if (role === PresetRoleType.PROJECT_OWNER) return undefined;
@@ -231,8 +230,7 @@ function RequestRoleForm({
return Math.floor(Number(seconds) / (60 * 60 * 24));
}, [workspaceProfile, role]);
- // ExprEditor factor/option config — mirrors the old Vue
- // DatabaseResourceForm config for role-grant requests.
+ // ExprEditor factor/option config for role-grant requests.
const factorList = useMemo<Factor[]>(
() => [
CEL_ATTRIBUTE_RESOURCE_DATABASE,
@@ -276,8 +274,7 @@ function RequestRoleForm({
dayjs(expirationTimestamp).unix() <= dayjs().unix();
// Workspace policy may cap role expiration; block submit when the picked
- // timestamp would exceed that cap (matches Vue ExpirationSelector which
- // disables over-cap dates in its picker).
+ // timestamp would exceed that cap.
const expirationExceedsMax =
!!expirationTimestamp &&
!!maximumRoleExpirationDays &&
@@ -288,9 +285,9 @@ function RequestRoleForm({
const labelsMisconfigured =
project.forceIssueLabels && project.issueLabels.length === 0;
- // Match the old Vue AddProjectMemberForm behavior: reason is only required
- // when the project enforces issue titles (where the reason becomes the
- // title). Otherwise the title is auto-generated and the reason is optional.
+ // Reason is only required when the project enforces issue titles (where
+ // the reason becomes the title). Otherwise the title is auto-generated and
+ // the reason is optional.
const reasonRequired = project.enforceIssueTitle;
// SQL-permission roles need a database scope (and sometimes an environment
@@ -415,17 +412,17 @@ function RequestRoleForm({
});
// Collect the scoped database names so the auto-generated title shows
- // `[db1]` / `[N databases]` instead of defaulting to `[All databases]`
- // — matches the old Vue RoleGrantPanel behavior. EXPRESSION mode
- // currently falls through to `[All databases]` since parsing CEL back
- // into concrete database names would require an async round-trip.
+ // `[db1]` / `[N databases]` instead of defaulting to `[All databases]`.
+ // EXPRESSION mode currently falls through to `[All databases]` since
+ // parsing CEL back into concrete database names would require an async
+ // round-trip.
const titleDatabaseNames =
scopedDatabaseResources && scopedDatabaseResources.length > 0
? [...new Set(scopedDatabaseResources.map((r) => r.databaseFullName))]
: undefined;
// When the project enforces issue titles, the user-provided reason is
- // treated as the title (matching the old Vue RoleGrantPanel behavior).
+ // treated as the title.
const title = project.enforceIssueTitle
? `[${t("issue.title.request-role")}] ${trimmedReason}`
: formatIssueTitle(
diff --git a/frontend/src/modules/access-control/requestRoleButton.ts b/frontend/src/modules/access-control/requestRoleButton.ts
index 29e4b10347..474b97ed06 100644
--- a/frontend/src/modules/access-control/requestRoleButton.ts
+++ b/frontend/src/modules/access-control/requestRoleButton.ts
@@ -12,8 +12,8 @@ interface RequestRoleButtonStateArgs {
readonly allowRequestRole: boolean;
// True when the current user already holds every PROJECT_OWNER permission
// (workspace- or project-scoped), so they can grant access directly and have
- // no reason to request a role. Mirrors the Vue `hasMissingPermission` gate,
- // which checks the full owner permission set rather than `setIamPolicy` alone.
+ // no reason to request a role. The check covers the full owner permission
+ // set, not `setIamPolicy` alone.
readonly hasFullProjectAccess: boolean;
readonly hasRequestRoleFeature: boolean;
}
diff --git a/frontend/src/modules/agent/components/AgentInput.tsx b/frontend/src/modules/agent/components/AgentInput.tsx
index 018adfecc2..73b6bdcbc2 100644
--- a/frontend/src/modules/agent/components/AgentInput.tsx
+++ b/frontend/src/modules/agent/components/AgentInput.tsx
@@ -29,7 +29,7 @@ import {
useAgentStore,
} from "../store/agent";
-// Module-level map — survives across renders, same as Vue version.
+// Module-level map — survives across renders.
const runTokens = new Map<string, number>();
// Module-level request token for dom ref suggestion loading.
@@ -38,7 +38,7 @@ let domRefRequestToken = 0;
const tokenFormatter = new Intl.NumberFormat();
// ---------------------------------------------------------------------------
-// Helper functions (same logic as the Vue version)
+// Helper functions
// ---------------------------------------------------------------------------
const normalizeSearchText = (value?: string) =>
@@ -349,7 +349,7 @@ export function AgentInput() {
}, []);
// ---------------------------------------------------------------------------
- // Agent loop execution (same logic as Vue version)
+ // Agent loop execution
// ---------------------------------------------------------------------------
const buildChatHistory = useCallback(
diff --git a/frontend/src/modules/agent/dom/actions.ts b/frontend/src/modules/agent/dom/actions.ts
index 5c0b670ec2..636a792848 100644
--- a/frontend/src/modules/agent/dom/actions.ts
+++ b/frontend/src/modules/agent/dom/actions.ts
@@ -144,7 +144,6 @@ async function handleInput(
if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
target = el;
} else {
- // Naive UI wraps inputs — find the inner element
target = findInnerInput(el);
}
@@ -175,31 +174,10 @@ async function handleSelect(
return { success: true, message: `Selected "${value}"` };
}
- // Naive UI select — click to open, then pick option
- dispatchClick(el);
-
- return new Promise<DomActionResult>((resolve) => {
- setTimeout(() => {
- const options = document.querySelectorAll(".n-base-select-option");
- for (const opt of Array.from(options)) {
- const text = opt.textContent?.trim();
- if (text === value) {
- dispatchClick(opt);
- resolve({ success: true, message: `Selected "${value}"` });
- return;
- }
- }
- resolve({
- success: false,
- message: `Option "${value}" not found. Available options: ${Array.from(
- options
- )
- .map((o) => o.textContent?.trim())
- .filter(Boolean)
- .join(", ")}`,
- });
- }, 200);
- });
+ return {
+ success: false,
+ message: `[${el.tagName.toLowerCase()}] is not a native <select>; click it to open the options, then click the option`,
+ };
}
async function handleRead(el: Element): Promise<DomActionResult> {
diff --git a/frontend/src/modules/agent/dom/domTree.test.ts b/frontend/src/modules/agent/dom/domTree.test.ts
index b00eea10db..36b15f8973 100644
--- a/frontend/src/modules/agent/dom/domTree.test.ts
+++ b/frontend/src/modules/agent/dom/domTree.test.ts
@@ -286,9 +286,7 @@ describe("extractDomTree", () => {
<tr style="cursor: pointer">
<td><div><span>Prod Primary</span></div></td>
<td>
- <div class="n-switch n-switch--active">
- <div class="n-switch__rail"></div>
- </div>
+ <button role="switch" aria-checked="true"></button>
</td>
<td>
<div>
@@ -307,10 +305,9 @@ describe("extractDomTree", () => {
expect(count).toBe(3);
expect(tree).toContain("<thead>Name | Enabled | Actions</thead>");
expect(tree).toContain("[e1]<tr>Prod Primary | switch</tr>");
- expect(tree).toContain('[e2]<div value="checked">switch</div>');
+ expect(tree).toContain("[e2]<button>switch</button>");
expect(tree).toContain("[e3]<button>Actions</button>");
expect(tree).not.toContain("More actions");
- expect(tree).not.toContain("n-switch__rail");
expect(tree).not.toContain("Prod PrimaryProd Primary");
expect(suggestions).toEqual([
{
@@ -322,10 +319,10 @@ describe("extractDomTree", () => {
},
{
ref: "e2",
- tag: "div",
- role: undefined,
+ tag: "button",
+ role: "switch",
label: "switch",
- value: "checked",
+ value: undefined,
},
{
ref: "e3",
@@ -384,66 +381,6 @@ describe("extractDomTree", () => {
]);
});
- test("suppresses Naive input prefix text while preserving the textbox ref", () => {
- document.body.innerHTML = `
- <main>
- <div class="n-input">
- <div class="n-input-prefix">
- <span>Filter</span>
- </div>
- <div class="n-input-wrapper">
- <input placeholder="Search instances" />
- </div>
- </div>
- </main>
- `;
-
- const { tree, count } = extractDomTree();
- const suggestions = extractDomRefSuggestions();
-
- expect(count).toBe(1);
- expect(tree).toContain("[e1]<input>Search instances</input>");
- expect(tree).not.toContain("Filter");
- expect(suggestions).toEqual([
- {
- ref: "e1",
- tag: "input",
- role: undefined,
- label: "Search instances",
- value: undefined,
- },
- ]);
- });
-
- test("serializes Naive select controls with sibling labels and selected values", () => {
- document.body.innerHTML = `
- <main>
- <div class="flex items-center gap-x-2">
- <div class="textinfolabel">Rows per page</div>
- <div class="n-base-selection" role="combobox">
- <div class="n-base-selection-label">50</div>
- </div>
- </div>
- </main>
- `;
-
- const { tree, count } = extractDomTree();
- const suggestions = extractDomRefSuggestions();
-
- expect(count).toBe(1);
- expect(tree).toContain('[e1]<select value="50">Rows per page</select>');
- expect(tree).not.toContain("<div>50</div>");
- expect(suggestions).toEqual([
- {
- ref: "e1",
- tag: "select",
- role: "combobox",
- label: "Rows per page",
- value: "50",
- },
- ]);
- });
-
test("prefers clickable list items over nested wrapper clones with the same label", () => {
document.body.innerHTML = `
<main>
@@ -641,7 +578,7 @@ describe("extractDomTree", () => {
</tbody>
</table>
</main>
- <div class="n-drawer" role="dialog" aria-modal="true">
+ <div role="dialog" aria-modal="true">
${drawerButtons}
</div>
</div>
diff --git a/frontend/src/modules/agent/dom/domTree.ts b/frontend/src/modules/agent/dom/domTree.ts
index 629124fe04..4f4c470c61 100644
--- a/frontend/src/modules/agent/dom/domTree.ts
+++ b/frontend/src/modules/agent/dom/domTree.ts
@@ -35,13 +35,6 @@ const INTERACTIVE_ROLES = new Set([
"slider",
]);
-const NAIVE_INTERACTIVE_CLASSES = [
- "n-button",
- "n-switch",
- "n-checkbox",
- "n-base-selection",
-];
-
const TERMINAL_INTERACTIVE_TAGS = new Set([
"A",
"BUTTON",
@@ -97,17 +90,6 @@ const ACTION_LIKE_HEADERS = new Set([
"operations",
"menu",
]);
-const NAIVE_CONTROL_TEXT_SELECTORS = [
- ".n-input-prefix",
- ".n-input-suffix",
- ".n-input__placeholder",
- ".n-base-selection-label",
- ".n-base-selection-placeholder",
- ".n-base-selection-tags",
- ".n-base-selection-input",
- ".n-base-suffix",
- ".n-base-loading",
-].join(",");
const MAIN_CONTENT_SELECTOR = [
"main",
@@ -127,16 +109,9 @@ const SHELL_REGION_SELECTOR = [
'[data-label="bb-dashboard-static-sidebar"]',
'[data-label="bb-dashboard-header"]',
].join(",");
-const OVERLAY_REGION_SELECTOR = [
- '[role="dialog"]',
- '[aria-modal="true"]',
- ".n-drawer",
- ".n-modal",
- ".n-popover",
- ".n-dropdown-menu",
- ".n-base-select-menu",
- ".n-dialog",
-].join(",");
+const OVERLAY_REGION_SELECTOR = ['[role="dialog"]', '[aria-modal="true"]'].join(
+ ","
+);
const SECONDARY_REGION_CAPS: Partial<
Record<LineRegion, { lines: number; chars: number }>
> = {
@@ -220,7 +195,7 @@ interface DomLine {
semanticTag?: string;
}
-type InteractiveReason = "native" | "role" | "class" | "editable" | "pointer";
+type InteractiveReason = "native" | "role" | "editable" | "pointer";
interface WalkContext {
lines: DomLine[];
@@ -291,14 +266,6 @@ function hasPointerCursor(el: Element): boolean {
return !parent || window.getComputedStyle(parent).cursor !== "pointer";
}
-function isNaiveSelectElement(el: Element): boolean {
- return el.classList.contains("n-base-selection");
-}
-
-function isNaiveControlTextElement(el: Element): boolean {
- return Boolean(el.closest(NAIVE_CONTROL_TEXT_SELECTORS));
-}
-
function isMonacoEditor(el: Element): boolean {
return el.classList.contains("monaco-editor");
}
@@ -323,10 +290,6 @@ function getInteractiveReason(el: Element): InteractiveReason | undefined {
const role = el.getAttribute("role");
if (role && INTERACTIVE_ROLES.has(role)) return "role";
- for (const cls of NAIVE_INTERACTIVE_CLASSES) {
- if (el.classList.contains(cls)) return "class";
- }
-
if (isContentEditableElement(el)) return "editable";
if (hasPointerCursor(el)) return "pointer";
@@ -435,15 +398,6 @@ function extractLabel(el: Element): string {
if (placeholder) return truncateText(placeholder, MAX_LABEL_LENGTH);
}
- // Naive UI form-item label
- const formItem = el.closest(".n-form-item");
- if (formItem) {
- const label = normalizeTextContent(
- formItem.querySelector(".n-form-item-label__text")?.textContent ?? ""
- );
- if (label) return truncateText(label, MAX_LABEL_LENGTH);
- }
-
if (el instanceof HTMLInputElement && BUTTON_LIKE_INPUT_TYPES.has(el.type)) {
const buttonValue = normalizeTextContent(el.value);
if (buttonValue) return truncateText(buttonValue, MAX_LABEL_LENGTH);
@@ -456,8 +410,7 @@ function extractLabel(el: Element): string {
if (
el instanceof HTMLInputElement ||
el instanceof HTMLTextAreaElement ||
- el instanceof HTMLSelectElement ||
- isNaiveSelectElement(el)
+ el instanceof HTMLSelectElement
) {
const siblingLabel = getSiblingControlLabel(el);
if (siblingLabel) return siblingLabel;
@@ -495,25 +448,6 @@ function extractValue(el: Element): string | undefined {
return value ? truncateText(value, MAX_LABEL_LENGTH) : undefined;
}
- // Naive UI select
- if (el.classList.contains("n-base-selection")) {
- const value = normalizeTextContent(
- el.querySelector(".n-base-selection-label")?.textContent ?? ""
- );
- return value ? truncateText(value, MAX_LABEL_LENGTH) : undefined;
- }
-
- // Naive UI checkbox/switch
- if (
- el.classList.contains("n-checkbox") ||
- el.classList.contains("n-switch")
- ) {
- const isChecked =
- el.classList.contains("n-checkbox--checked") ||
- el.classList.contains("n-switch--active");
- return isChecked ? "checked" : "unchecked";
- }
-
return undefined;
}
function hasInteractiveState(el: Element): boolean {
@@ -523,7 +457,7 @@ function hasInteractiveState(el: Element): boolean {
});
}
-function getFallbackLabel(el: Element, reason: InteractiveReason): string {
+function getFallbackLabel(el: Element): string {
if (el instanceof HTMLInputElement) {
if (CHECKABLE_INPUT_TYPES.has(el.type)) return el.type;
if (TEXTBOX_INPUT_TYPES.has(el.type)) return "textbox";
@@ -533,18 +467,10 @@ function getFallbackLabel(el: Element, reason: InteractiveReason): string {
}
if (el instanceof HTMLTextAreaElement) return "textbox";
- if (el instanceof HTMLSelectElement || isNaiveSelectElement(el)) {
- return "select";
- }
+ if (el instanceof HTMLSelectElement) return "select";
const role = el.getAttribute("role") ?? "";
if (STATEFUL_INTERACTIVE_ROLES.has(role)) return role;
- if (
- reason === "class" &&
- (el.classList.contains("n-checkbox") || el.classList.contains("n-switch"))
- ) {
- return el.classList.contains("n-switch") ? "switch" : "checkbox";
- }
return "";
}
@@ -643,7 +569,6 @@ function classifyTextLine(
function pushTextLine(node: Text, depth: number, context: WalkContext): void {
if (!node.parentElement || !isPerceivable(node.parentElement)) return;
- if (isNaiveControlTextElement(node.parentElement)) return;
const text = normalizeTextContent(node.textContent ?? "");
if (!text) return;
if (context.interactiveLabels.includes(text)) return;
@@ -717,9 +642,7 @@ function collectSemanticTextSegments(node: Node, segments: string[]): void {
if (node instanceof HTMLInputElement) {
const text =
- extractLabel(node) ||
- extractValue(node) ||
- getFallbackLabel(node, "native");
+ extractLabel(node) || extractValue(node) || getFallbackLabel(node);
if (text) segments.push(text);
return;
}
@@ -729,9 +652,7 @@ function collectSemanticTextSegments(node: Node, segments: string[]): void {
node instanceof HTMLSelectElement
) {
const text =
- extractLabel(node) ||
- extractValue(node) ||
- getFallbackLabel(node, "native");
+ extractLabel(node) || extractValue(node) || getFallbackLabel(node);
if (text) segments.push(text);
return;
}
@@ -754,9 +675,7 @@ function collectSemanticTextSegments(node: Node, segments: string[]): void {
if (!interactiveReason) return;
const text =
- extractLabel(node) ||
- getFallbackLabel(node, interactiveReason) ||
- extractValue(node);
+ extractLabel(node) || getFallbackLabel(node) || extractValue(node);
if (text) segments.push(text);
}
@@ -776,7 +695,6 @@ function collectNonInteractiveTextSegments(
if (node.hasAttribute("data-agent-window")) return;
if (!isPerceivable(node)) return;
if (!isRoot && getInteractiveReason(node)) return;
- if (isNaiveControlTextElement(node)) return;
Array.from(node.childNodes).forEach((child) => {
collectNonInteractiveTextSegments(child, segments);
@@ -804,8 +722,7 @@ function extractSemanticText(node: Node): string | undefined {
if (node instanceof Element && uniqueSegments.length === 0) {
const interactiveReason = getInteractiveReason(node);
if (interactiveReason) {
- const label =
- extractLabel(node) || getFallbackLabel(node, interactiveReason);
+ const label = extractLabel(node) || getFallbackLabel(node);
const value = extractValue(node);
const semanticText = normalizeTextContent(label || value || "");
if (semanticText) return semanticText;
@@ -849,8 +766,7 @@ function walkTableActionableDescendants(
const interactiveReason = getInteractiveReason(node);
if (interactiveReason) {
const value = extractValue(node);
- const label =
- extractLabel(node) || getFallbackLabel(node, interactiveReason);
+ const label = extractLabel(node) || getFallbackLabel(node);
if (
shouldIndexInteractiveNode(node, interactiveReason, label, value, context)
) {
@@ -881,11 +797,7 @@ function isUtilityTableCell(
return false;
}
- if (
- !cell.querySelector(
- "a, button, input, select, textarea, .n-button, .n-switch, .n-checkbox, .n-base-selection"
- )
- ) {
+ if (!cell.querySelector("a, button, input, select, textarea")) {
return false;
}
@@ -976,10 +888,7 @@ function walkTableNode(
let childContext = context;
if (interactiveReason) {
const value = extractValue(row);
- const label =
- rowLabel ||
- extractLabel(row) ||
- getFallbackLabel(row, interactiveReason);
+ const label = rowLabel || extractLabel(row) || getFallbackLabel(row);
if (
shouldIndexInteractiveNode(
row,
@@ -1074,12 +983,10 @@ function walkDomNode(
let nextInteractiveLabels = context.interactiveLabels;
let hasInteractiveAncestor = context.hasInteractiveAncestor;
if (interactiveReason) {
- const tag = isNaiveSelectElement(node)
- ? "select"
- : node.tagName.toLowerCase();
+ const tag = node.tagName.toLowerCase();
const value = extractValue(node);
const rawLabel = extractLabel(node);
- const label = rawLabel || getFallbackLabel(node, interactiveReason);
+ const label = rawLabel || getFallbackLabel(node);
if (
shouldIndexInteractiveNode(node, interactiveReason, label, value, context)
diff --git a/frontend/src/modules/agent/logic/tools/gen/.gitignore b/frontend/src/modules/agent/logic/tools/gen/.gitignore
index 14e1e2ca87..0d4391dd4f 100644
--- a/frontend/src/modules/agent/logic/tools/gen/.gitignore
+++ b/frontend/src/modules/agent/logic/tools/gen/.gitignore
@@ -1,2 +1,2 @@
-# Generated by scripts/generate_openapi_index.js
+# Generated by scripts/generate-openapi-index.js
openapi-index.ts
diff --git a/frontend/src/modules/agent/logic/tools/index.ts b/frontend/src/modules/agent/logic/tools/index.ts
index 8841c24acd..39b916ed09 100644
--- a/frontend/src/modules/agent/logic/tools/index.ts
+++ b/frontend/src/modules/agent/logic/tools/index.ts
@@ -213,7 +213,7 @@ call_api(operationId="SQLService/Query", body={"name": "instances/i/databases/db
| Mode | Result |
|------|--------|
-| semantic (default) | Route path, params, title + context from Pinia stores (project, database, issue, user info when available) |
+| semantic (default) | Route path, params, title + context from the app store (project, database, issue, user info when available) |
| dom | Above + ref-labeled DOM tree of interactive elements |
Use mode="dom" before dom_action to get element refs like [e1]. Use semantic mode (default) to understand the current page context.`,
diff --git a/frontend/src/modules/agent/logic/tools/pageState.ts b/frontend/src/modules/agent/logic/tools/pageState.ts
index d5759864d9..c143b3de4e 100644
--- a/frontend/src/modules/agent/logic/tools/pageState.ts
+++ b/frontend/src/modules/agent/logic/tools/pageState.ts
@@ -17,7 +17,7 @@ export function createPageStateTool(router: AppRouterInstance) {
title: document.title,
};
- // Enrich with Pinia store data
+ // Enrich with app store data
const ctx = await extractRouteContext(route);
if (Object.keys(ctx).length > 0) {
base.context = ctx;
diff --git a/frontend/src/modules/agent/store/agent.ts b/frontend/src/modules/agent/store/agent.ts
index 0788c3aa0e..2f95056242 100644
--- a/frontend/src/modules/agent/store/agent.ts
+++ b/frontend/src/modules/agent/store/agent.ts
@@ -40,7 +40,7 @@ interface AddMessageOptions extends Message {
const DEFAULT_CHAT_STATUS: AgentChatStatus = "idle";
-// --- Pure helper functions (copied verbatim from Pinia store) ---
+// --- Pure helper functions ---
const createChatRecord = (options: CreateChatOptions = {}): AgentChat => {
const now = Date.now();
diff --git a/frontend/src/modules/ai/components/AIChatToSQL.tsx b/frontend/src/modules/ai/components/AIChatToSQL.tsx
index 9cab8462dd..d88472341d 100644
--- a/frontend/src/modules/ai/components/AIChatToSQL.tsx
+++ b/frontend/src/modules/ai/components/AIChatToSQL.tsx
@@ -4,15 +4,12 @@ import { useAIContext } from "./context";
// `ChatPanel` pulls in the markdown parser (`unified`, `remark-parse`,
// `remark-gfm`) and the React `MonacoEditor` — both heavy enough that
// gating them behind `lazy()` keeps the initial SQL Editor bundle slim
-// when the AI side pane is collapsed. Matches the Vue version's
-// `await import("./ChatPanel.vue")` deferred-import pattern.
+// when the AI side pane is collapsed.
const ChatPanel = lazy(() =>
import("./ChatPanel").then((m) => ({ default: m.ChatPanel }))
);
/**
- * React port of `plugins/ai/components/AIChatToSQL.vue`.
- *
* Top-level entry point for the AI chat side pane. Must be rendered
* inside `<AIContextProvider>`. Returns `null` when the workspace's AI
* setting is disabled (the host shows nothing).
diff --git a/frontend/src/modules/ai/components/ActionBar.tsx b/frontend/src/modules/ai/components/ActionBar.tsx
index 00caad73bc..bf9157cdd0 100644
--- a/frontend/src/modules/ai/components/ActionBar.tsx
+++ b/frontend/src/modules/ai/components/ActionBar.tsx
@@ -5,7 +5,6 @@ import { Tooltip } from "@/components/ui/tooltip";
import { useAIContext } from "./context";
/**
- * React port of `plugins/ai/components/ActionBar.vue`.
* Top bar above the chat: "AI Assistant" heading on the left,
* History + New-conversation buttons on the right.
*/
diff --git a/frontend/src/modules/ai/components/ChatPanel.tsx b/frontend/src/modules/ai/components/ChatPanel.tsx
index 1cdaa2ccba..dd552bfe70 100644
--- a/frontend/src/modules/ai/components/ChatPanel.tsx
+++ b/frontend/src/modules/ai/components/ChatPanel.tsx
@@ -22,8 +22,6 @@ import { HistoryPanel } from "./HistoryPanel/HistoryPanel";
import { PromptInput } from "./PromptInput";
/**
- * React port of `plugins/ai/components/ChatPanel.vue`.
- *
* The chat surface: ActionBar on top, ChatView in the middle (or a
* spinner while the per-tab fetch lands), DynamicSuggestions +
* PromptInput at the bottom, and the HistoryPanel drawer mounted once.
@@ -38,8 +36,7 @@ import { PromptInput } from "./PromptInput";
* 5. On FAILED, emit `error` on `aiContextEvents` for the host to
* surface (e.g. toast).
*
- * Two `flush: "post"` watch blocks from the Vue version translate to
- * `useEffect` + rAF in React:
+ * Two effects react to provider state:
* - Auto-create an empty conversation when the per-tab fetch resolves
* to an empty list.
* - Fire `requestAI` when the `send-chat` event handler in the
@@ -161,10 +158,7 @@ export function ChatPanel() {
requestAIRef.current = requestAI;
// Auto-create an empty conversation when the per-tab fetch resolves
- // to an empty list. Mirrors the Vue `watch([ready, conversationList],
- // ..., { immediate: true })` — `requestAnimationFrame` defers to the
- // next paint so any concurrent provider-side `new-conversation` flow
- // gets a chance to claim the slot first.
+ // to an empty list.
useEffect(() => {
if (!ready) return;
if (conversationList.length > 0) return;
@@ -175,15 +169,13 @@ export function ChatPanel() {
database: tab?.connection.database ?? "",
});
// We intentionally watch only the boolean transition + the empty
- // condition, not the full `conversationList` reference — Vue's
- // version reacts on identity; the React version reacts on the
- // length so we don't fire each time a new message arrives.
+ // condition, not the full `conversationList` reference, so we don't
+ // fire each time a new message arrives.
}, [ready, conversationList.length, store]);
- // Fire `requestAI` when a pending send-chat lands. The Vue version
- // used `watch(..., { flush: "post" })` — we approximate by waiting
- // for the next animation frame so the conversation creation in the
- // provider's `send-chat` handler has settled.
+ // Fire `requestAI` when a pending send-chat lands. Wait for the next
+ // animation frame so the conversation creation in the provider's
+ // `send-chat` handler has settled.
useEffect(() => {
if (!ready) return;
if (!pendingSendChat) return;
diff --git a/frontend/src/modules/ai/components/ChatView/AIMessageView.test.tsx b/frontend/src/modules/ai/components/ChatView/AIMessageView.test.tsx
new file mode 100644
index 0000000000..6078678a98
--- /dev/null
+++ b/frontend/src/modules/ai/components/ChatView/AIMessageView.test.tsx
@@ -0,0 +1,68 @@
+import { render } from "@testing-library/react";
+import { describe, expect, test, vi } from "vitest";
+import type { Conversation, Message } from "../../types";
+import { AIMessageView } from "./AIMessageView";
+
+vi.mock("./Markdown/CodeBlock", () => ({
+ CodeBlock: () => <div data-testid="code-block" />,
+}));
+
+const longContent =
+ "https://example.com/" + "unbroken-path-segment".repeat(20);
+
+function createMessage(
+ author: Message["author"],
+ status: Message["status"],
+ overrides: Partial<Message> = {}
+): Message {
+ const conversation: Conversation = {
+ id: "conversation-1",
+ created_ts: 1,
+ name: "Test",
+ instance: "instances/test",
+ database: "instances/test/databases/test",
+ messageList: [],
+ };
+ const message: Message = {
+ id: "message-1",
+ created_ts: 1,
+ author,
+ content: longContent,
+ status,
+ error: "",
+ conversation,
+ ...overrides,
+ };
+ conversation.messageList.push(message);
+ return message;
+}
+
+describe("AIMessageView", () => {
+ test("keeps long AI content inside the message bubble", () => {
+ const message = createMessage("AI", "DONE");
+ const { container } = render(<AIMessageView message={message} />);
+
+ const bubble = container.firstElementChild;
+ const markdown = container.querySelector(".markdown");
+ expect(bubble?.className).toContain("min-w-0");
+ expect(bubble?.className).toContain("max-w-full");
+ expect(markdown?.className).toContain("wrap-anywhere");
+ expect(markdown?.className).toContain("min-w-0");
+ expect(markdown?.className).toContain("text-sm");
+ expect(markdown?.className).toContain("leading-5");
+ expect(markdown?.textContent).toContain(longContent);
+ });
+
+ test("wraps long provider errors inside the failed message bubble", () => {
+ const message = createMessage("AI", "FAILED", { error: longContent });
+ const { container } = render(<AIMessageView message={message} />);
+
+ const bubble = container.firstElementChild;
+ const error = container.querySelector("span");
+ expect(bubble?.className).toContain("min-w-0");
+ expect(bubble?.className).toContain("max-w-[80%]");
+ expect(error?.className).toContain("min-w-0");
+ expect(error?.className).toContain("wrap-anywhere");
+ expect(error?.textContent).toBe(longContent);
+ });
+});
diff --git a/frontend/src/modules/ai/components/ChatView/AIMessageView.tsx b/frontend/src/modules/ai/components/ChatView/AIMessageView.tsx
index c2e1b46347..53d0631432 100644
--- a/frontend/src/modules/ai/components/ChatView/AIMessageView.tsx
+++ b/frontend/src/modules/ai/components/ChatView/AIMessageView.tsx
@@ -8,12 +8,10 @@ type Props = {
};
/**
- * React port of `plugins/ai/components/ChatView/AIMessageView.vue`.
- *
* Three render states keyed off `message.status`:
* - DONE → `<Markdown>` of `message.content`, full-width bubble.
* - LOADING → small spinner, content-width bubble.
- * - FAILED → warning icon + error text, capped at 40% width.
+ * - FAILED → warning icon + error text, capped at 80% width.
*
* `codeBlockProps.width: 1.0` because the AI bubble already spans the
* row, so an embedded code card uses 100% of the bubble width.
diff --git a/frontend/src/modules/ai/components/ChatView/ChatView.test.tsx b/frontend/src/modules/ai/components/ChatView/ChatView.test.tsx
new file mode 100644
index 0000000000..bd330da1f9
--- /dev/null
+++ b/frontend/src/modules/ai/components/ChatView/ChatView.test.tsx
@@ -0,0 +1,62 @@
+import { render } from "@testing-library/react";
+import { describe, expect, test, vi } from "vitest";
+import type { Conversation, Message } from "../../types";
+import { ChatView } from "./ChatView";
+
+vi.mock("./Markdown/CodeBlock", () => ({
+ CodeBlock: () => <div data-testid="code-block" />,
+}));
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+vi.mock("../context", () => ({
+ useAIContext: () => ({ events: { emit: vi.fn() } }),
+}));
+
+const longContent =
+ "https://example.com/" + "unbroken-path-segment".repeat(20);
+
+function createMessage(
+ author: Message["author"],
+ status: Message["status"],
+ overrides: Partial<Message> = {}
+): Message {
+ const conversation: Conversation = {
+ id: "conversation-1",
+ created_ts: 1,
+ name: "Test",
+ instance: "instances/test",
+ database: "instances/test/databases/test",
+ messageList: [],
+ };
+ const message: Message = {
+ id: "message-1",
+ created_ts: 1,
+ author,
+ content: longContent,
+ status,
+ error: "",
+ conversation,
+ ...overrides,
+ };
+ conversation.messageList.push(message);
+ return message;
+}
+
+describe("ChatView", () => {
+ test("keeps the first message separated from the panel header", () => {
+ const message = createMessage("AI", "LOADING");
+ const scrollTo = vi.fn();
+ HTMLElement.prototype.scrollTo = scrollTo;
+
+ const { container } = render(
+ <ChatView conversation={message.conversation} />
+ );
+
+ expect(container.querySelector(".message")?.parentElement).toHaveClass(
+ "pt-2"
+ );
+ });
+});
diff --git a/frontend/src/modules/ai/components/ChatView/ChatView.tsx b/frontend/src/modules/ai/components/ChatView/ChatView.tsx
index 901328f17d..b82f07fcab 100644
--- a/frontend/src/modules/ai/components/ChatView/ChatView.tsx
+++ b/frontend/src/modules/ai/components/ChatView/ChatView.tsx
@@ -13,21 +13,17 @@ type Props = {
};
/**
- * React port of `plugins/ai/components/ChatView/ChatView.vue`.
- *
- * Scrollable message list. Auto-scrolls to the bottom whenever the
- * inner container's height changes (a new message arrives, an AI
- * response streams in, etc.) — same `useElementSize` trigger as the
- * Vue version, ported to a `ResizeObserver`.
+ * Scrollable message list. A `ResizeObserver` auto-scrolls to the bottom
+ * whenever the inner container's height changes (a new message arrives, an
+ * AI response streams in, etc.).
*
* Two empty paths:
* - `mode="VIEW"` with a conversation that has no messages → `<EmptyView>`.
* - `mode="CHAT"` with no conversation at all → "select or create"
* prompt with a clickable Create. The `select-or-create` i18n
- * string uses a `{create}` interpolation slot; we split manually
+ * string uses a `{{create}}` interpolation slot; we split manually
* because `react-i18next`'s `Trans` v17 wipes child slots on
- * empty placeholder tags (see SelectionCopyTooltips for the same
- * fix in Stage 20).
+ * empty placeholder tags (see SelectionCopyTooltips for the same fix).
*/
export function ChatView({ mode = "CHAT", conversation }: Props) {
const { t } = useTranslation();
diff --git a/frontend/src/modules/ai/components/ChatView/Markdown/AstToReact.tsx b/frontend/src/modules/ai/components/ChatView/Markdown/AstToReact.tsx
index 51a10e7707..02a7dc41d2 100644
--- a/frontend/src/modules/ai/components/ChatView/Markdown/AstToReact.tsx
+++ b/frontend/src/modules/ai/components/ChatView/Markdown/AstToReact.tsx
@@ -7,11 +7,9 @@ type Props = {
};
/**
- * React port of `plugins/ai/components/ChatView/Markdown/AstToVNode.vue`.
* Walks the mdast root via `mdastToReact[node.type]` and returns the
* React tree. `slots` overrides the default renderer for specific node
- * types (`code`, `inlineCode`, `image`) — same hook the Vue version
- * exposed via `defineSlots`.
+ * types (`code`, `inlineCode`, `image`).
*/
export function AstToReact({ ast, slots = {} }: Props) {
const state: State = {
diff --git a/frontend/src/modules/ai/components/ChatView/Markdown/CodeBlock.tsx b/frontend/src/modules/ai/components/ChatView/Markdown/CodeBlock.tsx
index 7d95ab882f..f81ebd0f38 100644
--- a/frontend/src/modules/ai/components/ChatView/Markdown/CodeBlock.tsx
+++ b/frontend/src/modules/ai/components/ChatView/Markdown/CodeBlock.tsx
@@ -19,12 +19,10 @@ type Props = CodeBlockProps & {
code: string;
};
-const MIN_WIDTH_PX = 8 * 16; // 8rem — same minimum as the Vue source.
+const MIN_WIDTH_PX = 8 * 16; // 8rem
const PADDING_PX = 8;
/**
- * React port of `plugins/ai/components/ChatView/Markdown/CodeBlock.vue`.
- *
* Renders a SQL snippet inside a read-only `MonacoEditor` with three
* actions:
* - Run: `aiContextEvents.emit("run-statement", { statement })`
@@ -35,7 +33,7 @@ const PADDING_PX = 8;
* Width is adaptive: measure the nearest `.message` ancestor (set by
* `ChatView`) via ResizeObserver and clamp to `[MIN_WIDTH_PX, ...]`.
* `width` is the fraction of the message bubble this card occupies —
- * `AIMessageView` passes `0.85`.
+ * `AIMessageView` passes `1.0`, `UserMessageView` passes `0.6`.
*/
export function CodeBlock({ code, width }: Props) {
const { t } = useTranslation();
diff --git a/frontend/src/modules/ai/components/ChatView/Markdown/InsertAtCaretIcon.tsx b/frontend/src/modules/ai/components/ChatView/Markdown/InsertAtCaretIcon.tsx
index 14b6b0c98d..b598b38158 100644
--- a/frontend/src/modules/ai/components/ChatView/Markdown/InsertAtCaretIcon.tsx
+++ b/frontend/src/modules/ai/components/ChatView/Markdown/InsertAtCaretIcon.tsx
@@ -5,8 +5,6 @@ type Props = {
};
/**
- * React port of `plugins/ai/components/ChatView/Markdown/InsertAtCaretIcon.vue`.
- *
* Composite icon = `AlignLeftIcon` (paragraph lines) with an accent-colored
* `ArrowLeftIcon` overlaid in the bottom-right. Visualizes "insert this
* snippet at the editor's caret position".
diff --git a/frontend/src/modules/ai/components/ChatView/Markdown/Markdown.tsx b/frontend/src/modules/ai/components/ChatView/Markdown/Markdown.tsx
index 717b3adb8d..3b37031ec4 100644
--- a/frontend/src/modules/ai/components/ChatView/Markdown/Markdown.tsx
+++ b/frontend/src/modules/ai/components/ChatView/Markdown/Markdown.tsx
@@ -14,15 +14,12 @@ type Props = {
};
/**
- * React port of `plugins/ai/components/ChatView/Markdown/Markdown.vue`.
- *
* Parses the message content with `remark-parse` + `remark-gfm` and
* walks the AST via `AstToReact`. Three slots customize rendering:
* - `code` (block-level fenced code) → `<CodeBlock>` (interactive,
* SQL editor with Run/Insert/Copy)
- * - `inlineCode` → plain styled `<code>` (the Vue version used
- * `HighlightCodeBlock`; for parity we render the same gray pill
- * without syntax highlighting — short snippets rarely benefit)
+ * - `inlineCode` → plain styled `<code>` without syntax highlighting
+ * (short snippets rarely benefit)
* - `image` → unstyled `<img>`
*/
export function Markdown({ content, codeBlockProps }: Props) {
diff --git a/frontend/src/modules/ai/components/ChatView/Markdown/utils.ts b/frontend/src/modules/ai/components/ChatView/Markdown/utils.ts
index 5403b68d17..56c694d79b 100644
--- a/frontend/src/modules/ai/components/ChatView/Markdown/utils.ts
+++ b/frontend/src/modules/ai/components/ChatView/Markdown/utils.ts
@@ -10,22 +10,6 @@ import { normalizeUri } from "micromark-util-sanitize-uri";
import type { ReactNode } from "react";
import { createElement, Fragment } from "react";
-/**
- * React port of `plugins/ai/components/ChatView/Markdown/utils.ts`.
- *
- * Same mdast walker as the Vue version; `h(...)` is swapped for
- * `React.createElement(...)`. Differences from the Vue source:
- *
- * - `class` becomes `className`; HTML attributes use React's
- * camelCased form (`htmlFor`, `tabIndex`, etc. — none of those
- * actually appear here).
- * - `style` props use a CSS object instead of a string.
- * - Arrays of children get explicit `key`s (React warns when keys are
- * missing; Vue auto-keys by index).
- * - `slots` is a plain mapped object (`{ code?, inlineCode?, image? }`)
- * instead of Vue's `defineSlots<CustomRender>`.
- */
-
export type CustomSlotRenderer<K extends keyof RootContentMap> = (
node: RootContentMap[K],
state: State
@@ -146,9 +130,8 @@ function emphasisToReact(
function footnoteDefinitionToReact(
node: RootContentMap["footnoteDefinition"]
): ReactNode {
- // Same shape as the Vue source — render the first text child inside a
- // `<div class="footnote-definition">`. The richer footnote-numbering
- // path was commented out in Vue and isn't needed for LLM output.
+ // Render the first text child inside a `<div class="footnote-definition">`.
+ // Richer footnote numbering isn't needed for LLM output.
const text = node.children[0] as unknown as Text;
return createElement("div", { className: "footnote-definition" }, text.value);
}
@@ -324,8 +307,8 @@ function paragraphToReact(
node: RootContentMap["paragraph"],
state: State
): ReactNode {
- // Match the Vue version's `<div class="paragraph">` (avoids `<p>` inside
- // surrounding `<p>` when host components nest markdown).
+ // `<div class="paragraph">` instead of `<p>` avoids `<p>` inside a
+ // surrounding `<p>` when host components nest markdown.
return createElement(
"div",
{ className: "paragraph" },
diff --git a/frontend/src/modules/ai/components/ChatView/MessageWrapping.test.tsx b/frontend/src/modules/ai/components/ChatView/UserMessageView.test.tsx
similarity index 57%
rename from frontend/src/modules/ai/components/ChatView/MessageWrapping.test.tsx
rename to frontend/src/modules/ai/components/ChatView/UserMessageView.test.tsx
index af0651901d..c7f3220684 100644
--- a/frontend/src/modules/ai/components/ChatView/MessageWrapping.test.tsx
+++ b/frontend/src/modules/ai/components/ChatView/UserMessageView.test.tsx
@@ -1,22 +1,12 @@
import { render } from "@testing-library/react";
import { describe, expect, test, vi } from "vitest";
import type { Conversation, Message } from "../../types";
-import { AIMessageView } from "./AIMessageView";
-import { ChatView } from "./ChatView";
import { UserMessageView } from "./UserMessageView";
vi.mock("./Markdown/CodeBlock", () => ({
CodeBlock: () => <div data-testid="code-block" />,
}));
-vi.mock("react-i18next", () => ({
- useTranslation: () => ({ t: (key: string) => key }),
-}));
-
-vi.mock("../context", () => ({
- useAIContext: () => ({ events: { emit: vi.fn() } }),
-}));
-
const longContent =
"https://example.com/" + "unbroken-path-segment".repeat(20);
@@ -47,37 +37,15 @@ function createMessage(
return message;
}
-describe("AI chat message wrapping", () => {
- test("keeps the first message separated from the panel header", () => {
- const message = createMessage("AI", "LOADING");
- const scrollTo = vi.fn();
- HTMLElement.prototype.scrollTo = scrollTo;
-
- const { container } = render(
- <ChatView conversation={message.conversation} />
- );
-
- expect(container.querySelector(".message")?.parentElement).toHaveClass(
- "pt-2"
- );
- });
-
- test.each([
- ["AI", AIMessageView],
- ["USER", UserMessageView],
- ] as const)("keeps long %s content inside the message bubble", (_, View) => {
- const message = createMessage(
- View === AIMessageView ? "AI" : "USER",
- "DONE"
- );
- const { container } = render(<View message={message} />);
+describe("UserMessageView", () => {
+ test("keeps long USER content inside the message bubble", () => {
+ const message = createMessage("USER", "DONE");
+ const { container } = render(<UserMessageView message={message} />);
const bubble = container.firstElementChild;
const markdown = container.querySelector(".markdown");
expect(bubble?.className).toContain("min-w-0");
- expect(bubble?.className).toContain(
- View === AIMessageView ? "max-w-full" : "max-w-[60%]"
- );
+ expect(bubble?.className).toContain("max-w-[60%]");
expect(markdown?.className).toContain("wrap-anywhere");
expect(markdown?.className).toContain("min-w-0");
expect(markdown?.className).toContain("text-sm");
@@ -85,19 +53,6 @@ describe("AI chat message wrapping", () => {
expect(markdown?.textContent).toContain(longContent);
});
- test("wraps long provider errors inside the failed message bubble", () => {
- const message = createMessage("AI", "FAILED", { error: longContent });
- const { container } = render(<AIMessageView message={message} />);
-
- const bubble = container.firstElementChild;
- const error = container.querySelector("span");
- expect(bubble?.className).toContain("min-w-0");
- expect(bubble?.className).toContain("max-w-[80%]");
- expect(error?.className).toContain("min-w-0");
- expect(error?.className).toContain("wrap-anywhere");
- expect(error?.textContent).toBe(longContent);
- });
-
test("constrains inline code, images, and tables to the message width", () => {
const content = [
`\`${longContent}\``,
diff --git a/frontend/src/modules/ai/components/ChatView/UserMessageView.tsx b/frontend/src/modules/ai/components/ChatView/UserMessageView.tsx
index c181dba7c0..7a2ea8affd 100644
--- a/frontend/src/modules/ai/components/ChatView/UserMessageView.tsx
+++ b/frontend/src/modules/ai/components/ChatView/UserMessageView.tsx
@@ -6,7 +6,6 @@ type Props = {
};
/**
- * React port of `plugins/ai/components/ChatView/UserMessageView.vue`.
* User-authored message bubble. Width clamped to 60% of the row so an
* AI response (`w-full`) and a user prompt visually contrast.
*/
diff --git a/frontend/src/modules/ai/components/DynamicSuggestions.tsx b/frontend/src/modules/ai/components/DynamicSuggestions.tsx
index 8399346c8d..4b2e55d8e0 100644
--- a/frontend/src/modules/ai/components/DynamicSuggestions.tsx
+++ b/frontend/src/modules/ai/components/DynamicSuggestions.tsx
@@ -21,8 +21,6 @@ function loadShowSuggestion(key: string): boolean {
}
/**
- * React port of `plugins/ai/components/DynamicSuggestions.vue`.
- *
* Shows up to one "suggested prompt" pill (LLM-generated) with refresh
* / dismiss controls. Clicking the pill emits the suggestion to the
* parent (`ChatPanel`) which submits it via `requestAI(query)`.
@@ -47,11 +45,9 @@ export function DynamicSuggestions({ onEnter }: Props) {
const suggestionsCount = suggestion?.suggestions.length ?? 0;
const current = suggestion?.current();
- // Kick off the initial fetch when the component mounts and the cache
- // is empty — matches the Vue `onMounted` block. `useDynamicSuggestions`
- // returns a fresh `computed(...)` each render, so this effect re-runs on
- // every render — gate by `state` so we don't pile concurrent `fetch()`s
- // on top of an in-flight one (each fetch is a paid AI completion).
+ // Kick off the initial fetch when the cache is empty. Gate by `state` so
+ // we don't pile concurrent `fetch()`s on top of an in-flight one (each
+ // fetch is a paid AI completion).
useEffect(() => {
if (
suggestion &&
@@ -63,9 +59,8 @@ export function DynamicSuggestions({ onEnter }: Props) {
}, [suggestion, state]);
// Per-user dismissable flag persisted to localStorage. Defaults to
- // visible. Same storage key the Vue version used (`useDynamicLocalStorage`
- // backed by `vueuse.useStorage`); we keep the key compatible so a user
- // who dismissed in Vue stays dismissed in React.
+ // visible. Vue-era releases wrote the same key; keep it unchanged so a user
+ // who dismissed the suggestion before upgrading stays dismissed.
const storageKey = useMemo(
() => storageKeySqlEditorAiSuggestion(currentUserEmail),
[currentUserEmail]
diff --git a/frontend/src/modules/ai/components/HistoryPanel/ConversationList.tsx b/frontend/src/modules/ai/components/HistoryPanel/ConversationList.tsx
index 246d3bf43d..1aa571a9e7 100644
--- a/frontend/src/modules/ai/components/HistoryPanel/ConversationList.tsx
+++ b/frontend/src/modules/ai/components/HistoryPanel/ConversationList.tsx
@@ -22,12 +22,10 @@ const resizeTextarea = (textarea: HTMLTextAreaElement) => {
};
/**
- * React port of `plugins/ai/components/HistoryPanel/ConversationList.vue`.
- *
* Per-tab list of historical conversations with select / rename / delete
* actions and a sticky "New conversation" footer.
*
- * Behavioural pitfalls preserved from the Vue source:
+ * Behavioral pitfalls:
* - On tab switch (`(instance, database)` change) the inline rename is
* dismissed — a half-completed rename for a previous tab's
* conversation shouldn't survive a context change.
@@ -35,9 +33,9 @@ const resizeTextarea = (textarea: HTMLTextAreaElement) => {
* (`scrollIntoView({ scrollMode: "if-needed" })`) so the user can
* spot the active conversation in a long list. rAF defers to the
* next paint so the freshly-inserted node is measurable.
- * - On delete, the next-selected conversation matches the Vue
- * `list[index]` heuristic (try to keep the cursor near where it
- * was). Falls back to undefined when the list empties.
+ * - On delete, the next-selected conversation is the one now at the
+ * deleted index, else the one before it (keeps the cursor near where
+ * it was). Falls back to undefined when the list empties.
*/
export function ConversationList() {
const { t } = useTranslation();
diff --git a/frontend/src/modules/ai/components/HistoryPanel/HistoryPanel.tsx b/frontend/src/modules/ai/components/HistoryPanel/HistoryPanel.tsx
index 53279a21af..0008a10a29 100644
--- a/frontend/src/modules/ai/components/HistoryPanel/HistoryPanel.tsx
+++ b/frontend/src/modules/ai/components/HistoryPanel/HistoryPanel.tsx
@@ -11,8 +11,6 @@ import { useAIContext } from "../context";
import { ConversationList } from "./ConversationList";
/**
- * React port of `plugins/ai/components/HistoryPanel/HistoryPanel.vue`.
- *
* Side drawer with two columns: the conversation list on the left and
* the selected conversation rendered in `mode="VIEW"` on the right.
* The drawer is the only place wide enough to render the full history
diff --git a/frontend/src/modules/ai/components/HistoryPanel/HistoryPanelLayout.test.ts b/frontend/src/modules/ai/components/HistoryPanel/HistoryPanelLayout.test.ts
deleted file mode 100644
index 87ca14a36f..0000000000
--- a/frontend/src/modules/ai/components/HistoryPanel/HistoryPanelLayout.test.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const source = readFileSync(
- join(import.meta.dirname, "HistoryPanel.tsx"),
- "utf8"
-);
-
-describe("HistoryPanel sheet layout", () => {
- test("uses the shared sheet width and scrollable body contract", () => {
- expect(source).toContain('<SheetContent width="xlarge">');
- expect(source).toContain("<SheetHeader>");
- expect(source).toContain("<SheetBody");
- expect(source).not.toContain('className="w-[calc(100vw-8rem)]');
- expect(source).not.toContain("bg-gray-100");
- });
-});
diff --git a/frontend/src/modules/ai/components/PromptInput.tsx b/frontend/src/modules/ai/components/PromptInput.tsx
index 6d524d8cc1..5b34fafedd 100644
--- a/frontend/src/modules/ai/components/PromptInput.tsx
+++ b/frontend/src/modules/ai/components/PromptInput.tsx
@@ -18,16 +18,13 @@ const MAX_ROWS = 10;
const RESIZE_HANDLE_SIZE_PX = 16;
/**
- * React port of `plugins/ai/components/PromptInput.vue`.
- *
* Autosizing textarea (1-10 visible rows) bound to local state. Users can
* resize it vertically, after which their chosen height is preserved. Enter
* submits; Shift+Enter inserts a newline. The trailing button is a tooltipped
* ⏎ that submits when clicked.
*
- * Naive UI's `NInput type="textarea" autosize` isn't available; we
- * hand-roll the autosize by measuring `scrollHeight` after each value
- * change and clamping to `[MIN_ROWS, MAX_ROWS] * lineHeight`. Adding a
+ * The autosize is hand-rolled: measure `scrollHeight` after each value
+ * change and clamp to `[MIN_ROWS, MAX_ROWS] * lineHeight`. Adding a
* runtime dep (`react-textarea-autosize`) just for this surface isn't
* worth it — the hand-rolled version is ~10 lines and behaves
* identically for plain text input.
@@ -61,9 +58,8 @@ export function PromptInput({ disabled = false, onEnter }: Props) {
}, [events]);
// Consume `pendingPreInput`: when the provider sets it, copy into
- // local state and clear the trigger. rAF mirrors the Vue version's
- // `flush: "post"` watch — defers to the next paint so any conversation
- // creation that triggered the seed has landed first.
+ // local state and clear the trigger. rAF defers to the next paint so any
+ // conversation creation that triggered the seed has landed first.
useEffect(() => {
if (!pendingPreInput) return;
const raf = requestAnimationFrame(() => {
diff --git a/frontend/src/modules/ai/components/context.tsx b/frontend/src/modules/ai/components/context.tsx
index 51f684d67d..534739e985 100644
--- a/frontend/src/modules/ai/components/context.tsx
+++ b/frontend/src/modules/ai/components/context.tsx
@@ -29,11 +29,10 @@ import { conversationListByConnection, useConversationStore } from "../store";
import type { AIContextEvents, Conversation } from "../types";
/**
- * React-shaped slice of the AI plugin's per-tab state. Mirrors the Vue
- * `AIChatInfo` (refs) with plain values + an explicit setter so consumers
- * don't have to know about Vue's reactivity.
+ * Per-tab slice of the AI plugin's chat state, with an explicit setter for
+ * the selected conversation.
*/
-export type ReactAIChatInfo = {
+export type AIChatInfo = {
list: Conversation[];
ready: boolean;
selected: Conversation | undefined;
@@ -41,11 +40,9 @@ export type ReactAIChatInfo = {
};
/**
- * React-shaped AI plugin context. Replaces the Vue `AIContext` defined in
- * `plugins/ai/types/context.ts` for components under `plugins/ai/react/`.
- * Same fields, plain values, paired setters for mutable state.
+ * AI plugin context: plain values, with paired setters for mutable state.
*/
-export type ReactAIContext = {
+export type AIContextValue = {
aiSetting: AISetting;
engine: Engine | undefined;
databaseMetadata: DatabaseMetadata | undefined;
@@ -54,13 +51,13 @@ export type ReactAIContext = {
showHistoryDialog: boolean;
setShowHistoryDialog: (next: boolean) => void;
- chat: ReactAIChatInfo;
+ chat: AIChatInfo;
/**
* One-shot trigger written by the `send-chat` event handler — the
- * downstream `ChatPanel` effect reads this and dispatches the actual
- * AI chat request, then clears it via `setPendingSendChat(undefined)`.
- * Same pattern as the Vue `pendingSendChat` ref.
+ * downstream `ChatPanel` effect reads this, clears it via
+ * `setPendingSendChat(undefined)`, and dispatches the actual AI chat
+ * request.
*/
pendingSendChat: { content: string } | undefined;
setPendingSendChat: (next: { content: string } | undefined) => void;
@@ -76,10 +73,10 @@ export type ReactAIContext = {
events: AIContextEvents;
};
-const AIContextReactContext = createContext<ReactAIContext | null>(null);
+const AIContext = createContext<AIContextValue | null>(null);
-export function useAIContext(): ReactAIContext {
- const ctx = useContext(AIContextReactContext);
+export function useAIContext(): AIContextValue {
+ const ctx = useContext(AIContext);
if (!ctx) {
throw new Error(
"useAIContext (React) must be used inside <AIContextProvider>"
@@ -93,9 +90,8 @@ const EMPTY_AI_SETTING: AISetting = createProto(AISettingSchema, {});
export function AIContextProvider({ children }: { children: ReactNode }) {
// ---- AI setting --------------------------------------------------------
- // The original Vue ProvideAIContext fetched the AI setting on mount.
- // Mirror that here. `getOrFetchSettingByName` is idempotent; firing it
- // again on remount is cheap.
+ // Fetch the AI setting on mount. `getOrFetchSettingByName` is idempotent;
+ // firing it again on remount is cheap.
useEffect(() => {
void useAppStore
.getState()
@@ -133,7 +129,7 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
//
// Conversations live in the Zustand `useConversationStore`. We subscribe to
// the conversation map + per-connection ready flags and derive the current
- // tab's chat (list / ready / selected) with plain React state — no Vue refs.
+ // tab's chat (list / ready / selected) with plain React state.
const tabInstance = currentTab?.connection.instance;
const tabDatabase = currentTab?.connection.database;
const connKey =
@@ -162,7 +158,7 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
const chatReady = connKey ? !!readyByConnection[connKey] : false;
// Explicit per-connection selection; falls back to the last conversation
- // once the connection is ready (mirrors the Vue `watch` default).
+ // once the connection is ready.
const [selectedIdByConn, setSelectedIdByConn] = useState<
Record<string, string | undefined>
>({});
@@ -181,7 +177,7 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
},
[connKey]
);
- const chat = useMemo<ReactAIChatInfo>(
+ const chat = useMemo<AIChatInfo>(
() => ({
list: chatList,
ready: chatReady,
@@ -195,7 +191,7 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
const selectedIdByConnRef = useRef(selectedIdByConn);
selectedIdByConnRef.current = selectedIdByConn;
- // ---- React-side state --------------------------------------------------
+ // ---- Local state -------------------------------------------------------
const [showHistoryDialog, setShowHistoryDialog] = useState(false);
const [pendingSendChat, setPendingSendChat] = useState<
@@ -208,7 +204,7 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
// Stable reference to `aiContextEvents` — singleton, but keep typed.
const events: AIContextEvents = aiContextEvents;
- // ---- Event listeners (mirror ProvideAIContext.vue) ---------------------
+ // ---- Event listeners ---------------------------------------------------
// The listeners fire outside render. They read the live tab via
// `getCurrentSQLEditorTab()`, await the store's per-connection fetch (so a
@@ -247,9 +243,8 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
setSelectedIdByConn((prev) => ({ ...prev, [ck]: c.id }));
}
if (input) {
- // rAF mirrors the Vue version — gives `PromptInput`'s
- // pending-pre-input effect a frame to land after the conversation
- // creation settles.
+ // rAF gives `PromptInput`'s pending-pre-input effect a frame to
+ // land after the conversation creation settles.
requestAnimationFrame(() => {
setPendingPreInput(input);
});
@@ -292,7 +287,7 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
// ---- Memoized value bundle --------------------------------------------
- const value = useMemo<ReactAIContext>(
+ const value = useMemo<AIContextValue>(
() => ({
aiSetting,
engine,
@@ -320,9 +315,5 @@ export function AIContextProvider({ children }: { children: ReactNode }) {
]
);
- return (
- <AIContextReactContext.Provider value={value}>
- {children}
- </AIContextReactContext.Provider>
- );
+ return <AIContext.Provider value={value}>{children}</AIContext.Provider>;
}
diff --git a/frontend/src/modules/ai/components/index.ts b/frontend/src/modules/ai/components/index.ts
index 60ff901c33..f2bb52d44f 100644
--- a/frontend/src/modules/ai/components/index.ts
+++ b/frontend/src/modules/ai/components/index.ts
@@ -1,6 +1,4 @@
-// React-only barrel for the AI plugin. The plugin's root `index.ts`
-// keeps framework-agnostic re-exports (types) so the Vue tsconfig
-// doesn't have to traverse `.tsx` modules; React consumers import
-// from `@/modules/ai/components` instead.
+// Component entry points for the AI plugin; the plugin's root `index.ts`
+// re-exports types only.
export { AIChatToSQL } from "./AIChatToSQL";
export { AIContextProvider, useAIContext } from "./context";
diff --git a/frontend/src/modules/ai/components/useDynamicSuggestions.ts b/frontend/src/modules/ai/components/useDynamicSuggestions.ts
index 8cfc607f38..3d327c923c 100644
--- a/frontend/src/modules/ai/components/useDynamicSuggestions.ts
+++ b/frontend/src/modules/ai/components/useDynamicSuggestions.ts
@@ -50,9 +50,8 @@ function loadSuggestionCache(key: string): string[] {
const keyOf = (metadata: string) => String(hashCode(metadata));
// ---------------------------------------------------------------------------
-// Framework-agnostic module store (replaces the Vue `reactive` cache). Entries
-// are replaced IMMUTABLY on every mutation so React's `useSyncExternalStore`
-// snapshot comparison detects the change.
+// Module store. Entries are replaced IMMUTABLY on every mutation so React's
+// `useSyncExternalStore` snapshot comparison detects the change.
// ---------------------------------------------------------------------------
type Entry = {
metadata: string;
@@ -191,8 +190,6 @@ const subscribe = (onChange: () => void) => {
};
/**
- * React port of the former Vue `useDynamicSuggestions` composable.
- *
* Per-(database, engine, schema) cache of LLM-suggested prompt chips. The
* suggestion state lives in a module store updated immutably; this hook
* subscribes via `useSyncExternalStore` so the consumer re-renders when the
diff --git a/frontend/src/modules/ai/index.ts b/frontend/src/modules/ai/index.ts
index 3b403a5015..d8f88bef8c 100644
--- a/frontend/src/modules/ai/index.ts
+++ b/frontend/src/modules/ai/index.ts
@@ -1,5 +1,3 @@
-// Plugin-wide barrel. Only re-exports framework-agnostic surfaces here
-// so the Vue tsconfig (which still picks up this file) doesn't have to
-// pull in React `.tsx` modules through imports. React callers reach the
-// component entry points via `@/modules/ai/components` directly.
+// Plugin-wide barrel for types. Component entry points are imported from
+// `@/modules/ai/components` directly.
export * from "./types";
diff --git a/frontend/src/modules/ai/logic/events.ts b/frontend/src/modules/ai/logic/events.ts
index 16c488397a..0a2d3e72c7 100644
--- a/frontend/src/modules/ai/logic/events.ts
+++ b/frontend/src/modules/ai/logic/events.ts
@@ -2,9 +2,8 @@ import Emittery from "emittery";
import type { AIContextEvents } from "../types";
/**
- * Module-level AI event bus. Imported by both the Vue ProvideAIContext
- * (which wires it into the Vue-injected context) and React consumers that
- * can't participate in Vue's provide/inject. Single shared instance so
- * emit/on from either side reaches the other.
+ * Module-level AI event bus. `AIContextProvider` exposes it as `events`,
+ * and SQL Editor components outside the provider import it directly. Single
+ * shared instance so emit/on from either side reaches the other.
*/
export const aiContextEvents: AIContextEvents = new Emittery();
diff --git a/frontend/src/modules/ai/types/context.ts b/frontend/src/modules/ai/types/context.ts
index b4014332fe..d773180884 100644
--- a/frontend/src/modules/ai/types/context.ts
+++ b/frontend/src/modules/ai/types/context.ts
@@ -1,8 +1,7 @@
import type Emittery from "emittery";
-// The React-shaped AI plugin context lives in `react/context.tsx`
-// (`ReactAIContext`). This module now only carries the framework-agnostic
-// event bus type shared between the plugin's logic and React layers.
+// Event bus shared by the AI plugin's logic and its React context
+// (`src/modules/ai/components/context.tsx`).
export type AIContextEvents = Emittery<{
"run-statement": { statement: string };
error: string;
diff --git a/frontend/src/modules/schema-diagram/Canvas/Canvas.tsx b/frontend/src/modules/schema-diagram/Canvas/Canvas.tsx
index cd045bb298..5021e299c9 100644
--- a/frontend/src/modules/schema-diagram/Canvas/Canvas.tsx
+++ b/frontend/src/modules/schema-diagram/Canvas/Canvas.tsx
@@ -5,8 +5,8 @@ import { Button } from "@/components/ui/button";
import { Tooltip } from "@/components/ui/tooltip";
import { ZOOM_RANGE } from "../common/const";
import { useSchemaDiagramContext } from "../common/context";
-import { useDragCanvas, useFitView, useSetCenter } from "./composables";
-import { useScreenshot } from "./composables/useScreenshot";
+import { useDragCanvas, useFitView, useSetCenter } from "./hooks";
+import { useScreenshot } from "./hooks/useScreenshot";
import { ZoomButton } from "./ZoomButton";
interface CanvasProps {
@@ -25,9 +25,9 @@ interface CanvasProps {
}
/**
- * React port of `Canvas/Canvas.vue`. The viewport: applies a CSS
- * `transform: matrix(zoom, 0, 0, zoom, x, y)` to a desktop layer and
- * mounts the zoom + fit + screenshot button group at the bottom-right.
+ * The viewport: applies a CSS `transform: matrix(zoom, 0, 0, zoom, x, y)`
+ * to a desktop layer and mounts the zoom + fit + screenshot button group at
+ * the bottom-right.
*/
export function Canvas({
children,
diff --git a/frontend/src/modules/schema-diagram/Canvas/ZoomButton.tsx b/frontend/src/modules/schema-diagram/Canvas/ZoomButton.tsx
index ffe580f894..16310b7445 100644
--- a/frontend/src/modules/schema-diagram/Canvas/ZoomButton.tsx
+++ b/frontend/src/modules/schema-diagram/Canvas/ZoomButton.tsx
@@ -12,8 +12,7 @@ interface ZoomButtonProps {
}
/**
- * React port of `Canvas/ZoomButton.vue`. A three-button group: minus,
- * current zoom (read-only label), plus.
+ * A three-button group: minus, current zoom (read-only label), plus.
*/
export function ZoomButton({ min, max, onZoomIn, onZoomOut }: ZoomButtonProps) {
const { zoom } = useSchemaDiagramContext();
diff --git a/frontend/src/modules/schema-diagram/Canvas/composables/index.ts b/frontend/src/modules/schema-diagram/Canvas/hooks/index.ts
similarity index 100%
rename from frontend/src/modules/schema-diagram/Canvas/composables/index.ts
rename to frontend/src/modules/schema-diagram/Canvas/hooks/index.ts
diff --git a/frontend/src/modules/schema-diagram/Canvas/composables/useDragCanvas.tsx b/frontend/src/modules/schema-diagram/Canvas/hooks/useDragCanvas.tsx
similarity index 95%
rename from frontend/src/modules/schema-diagram/Canvas/composables/useDragCanvas.tsx
rename to frontend/src/modules/schema-diagram/Canvas/hooks/useDragCanvas.tsx
index 3005e83ee5..775c360979 100644
--- a/frontend/src/modules/schema-diagram/Canvas/composables/useDragCanvas.tsx
+++ b/frontend/src/modules/schema-diagram/Canvas/hooks/useDragCanvas.tsx
@@ -7,8 +7,6 @@ import { useDraggable } from "../../common/useDraggable";
import type { Point } from "../../types";
/**
- * React port of `Canvas/composables/useDragCanvas.ts`.
- *
* Wires the canvas element for drag-to-pan and wheel-to-zoom. Returns
* `handleZoom(delta, center?)` which the zoom button group calls
* imperatively.
@@ -56,7 +54,7 @@ export const useDragCanvas = (canvas: Element | null) => {
},
});
- // Wheel-to-zoom. Capture phase mirrors Vue's `useEventListener(..., true)`.
+ // Wheel-to-zoom.
useEffect(() => {
if (!canvas) return;
const handler = (e: WheelEvent) => {
diff --git a/frontend/src/modules/schema-diagram/Canvas/composables/useFitView.tsx b/frontend/src/modules/schema-diagram/Canvas/hooks/useFitView.tsx
similarity index 95%
rename from frontend/src/modules/schema-diagram/Canvas/composables/useFitView.tsx
rename to frontend/src/modules/schema-diagram/Canvas/hooks/useFitView.tsx
index cdd81136a4..9ae79579be 100644
--- a/frontend/src/modules/schema-diagram/Canvas/composables/useFitView.tsx
+++ b/frontend/src/modules/schema-diagram/Canvas/hooks/useFitView.tsx
@@ -4,8 +4,6 @@ import { useSchemaDiagramContext } from "../../common/context";
import { fitView } from "../libs/fitView";
/**
- * React port of `Canvas/composables/useFitView.ts`.
- *
* Returns a `handleFitView()` callback the zoom buttons / external code
* can invoke imperatively, AND subscribes to the context's `fit-view`
* Emittery channel so other parts of the diagram can request a fit
diff --git a/frontend/src/modules/schema-diagram/Canvas/composables/useScreenshot.tsx b/frontend/src/modules/schema-diagram/Canvas/hooks/useScreenshot.tsx
similarity index 100%
rename from frontend/src/modules/schema-diagram/Canvas/composables/useScreenshot.tsx
rename to frontend/src/modules/schema-diagram/Canvas/hooks/useScreenshot.tsx
diff --git a/frontend/src/modules/schema-diagram/Canvas/composables/useSetCenter.tsx b/frontend/src/modules/schema-diagram/Canvas/hooks/useSetCenter.tsx
similarity index 93%
rename from frontend/src/modules/schema-diagram/Canvas/composables/useSetCenter.tsx
rename to frontend/src/modules/schema-diagram/Canvas/hooks/useSetCenter.tsx
index b200051b0c..0551d745cc 100644
--- a/frontend/src/modules/schema-diagram/Canvas/composables/useSetCenter.tsx
+++ b/frontend/src/modules/schema-diagram/Canvas/hooks/useSetCenter.tsx
@@ -10,8 +10,7 @@ const isTypedCenterTarget = <T extends CenterTargetType>(
): e is CenterTarget<T> => e.type === type;
/**
- * React port of `Canvas/composables/useSetCenter.ts`. Subscribes to
- * `set-center` events and animates `(zoom, position)` onto the
+ * Subscribes to `set-center` events and animates `(zoom, position)` onto the
* target — a table, rect, or point.
*/
export const useSetCenter = (canvas: Element | null) => {
diff --git a/frontend/src/modules/schema-diagram/Canvas/index.ts b/frontend/src/modules/schema-diagram/Canvas/index.ts
index 8d4b9b0edf..26bb20c83c 100644
--- a/frontend/src/modules/schema-diagram/Canvas/index.ts
+++ b/frontend/src/modules/schema-diagram/Canvas/index.ts
@@ -1,4 +1,4 @@
export { Canvas } from "./Canvas";
export { ZoomButton } from "./ZoomButton";
-export * from "./composables";
+export * from "./hooks";
export * from "./libs/fitView";
diff --git a/frontend/src/modules/schema-diagram/ER/ForeignKeyLine.tsx b/frontend/src/modules/schema-diagram/ER/ForeignKeyLine.tsx
index defa2b23cd..27866782f1 100644
--- a/frontend/src/modules/schema-diagram/ER/ForeignKeyLine.tsx
+++ b/frontend/src/modules/schema-diagram/ER/ForeignKeyLine.tsx
@@ -16,10 +16,10 @@ interface ForeignKeyLineProps {
const ZERO_RECT: Rect = { x: 0, y: 0, width: 0, height: 0 };
/**
- * React port of `ER/ForeignKeyLine.vue`. Reads each endpoint's column
- * rect by querying the live DOM (via `data-bb-node-id` /
- * `data-bb-column-name`), picks anchor sides, builds the SVG path, and
- * registers it as a geometry so fit-view's bbox includes the FK line.
+ * Reads each endpoint's column rect by querying the live DOM (via
+ * `data-bb-node-id` / `data-bb-column-name`), picks anchor sides, builds
+ * the SVG path, and registers it as a geometry so fit-view's bbox includes
+ * the FK line.
*
* Recomputes when the context emits `render` (typically after layout
* resolves or when a table is dragged).
diff --git a/frontend/src/modules/schema-diagram/ER/TableNode.tsx b/frontend/src/modules/schema-diagram/ER/TableNode.tsx
index 0f886df446..87c343ea29 100644
--- a/frontend/src/modules/schema-diagram/ER/TableNode.tsx
+++ b/frontend/src/modules/schema-diagram/ER/TableNode.tsx
@@ -37,9 +37,9 @@ const COLOR_LIST = [
];
/**
- * React port of `ER/TableNode.vue`. One table card with title bar, FK
- * focus button, optional edit pencil, and a column list with PK / index
- * glyphs and edit-on-click affordances when `editable` is on.
+ * One table card with title bar, FK focus button, optional edit pencil, and
+ * a column list with PK / index glyphs and edit-on-click affordances when
+ * `editable` is on.
*/
export function TableNode({ schema, table }: TableNodeProps) {
const ctx = useSchemaDiagramContext();
diff --git a/frontend/src/modules/schema-diagram/ER/libs/SVGLine.tsx b/frontend/src/modules/schema-diagram/ER/libs/SVGLine.tsx
index 344a18465d..73a7e57587 100644
--- a/frontend/src/modules/schema-diagram/ER/libs/SVGLine.tsx
+++ b/frontend/src/modules/schema-diagram/ER/libs/SVGLine.tsx
@@ -24,8 +24,6 @@ interface SVGLineProps {
}
/**
- * React port of `frontend/src/components/SchemaDiagram/ER/libs/SVGLine.vue`.
- *
* Renders a polyline + optional decorator paths inside an absolutely
* positioned SVG. Hover (across both the visible line and a wider
* invisible "glow" track) flips the stroke color and width.
diff --git a/frontend/src/modules/schema-diagram/Navigator/Navigator.tsx b/frontend/src/modules/schema-diagram/Navigator/Navigator.tsx
index 168eb652c4..18912f439d 100644
--- a/frontend/src/modules/schema-diagram/Navigator/Navigator.tsx
+++ b/frontend/src/modules/schema-diagram/Navigator/Navigator.tsx
@@ -19,9 +19,8 @@ interface NavigatorProps {
const FALLBACK_TREE_HEIGHT = 480;
/**
- * React port of `Navigator/Navigator.vue`. Collapsible left sidebar
- * holding the schema selector (Postgres-style multi-schema only), a
- * search input, and the schema → table tree.
+ * Collapsible left sidebar holding the schema selector (Postgres-style
+ * multi-schema only), a search input, and the schema → table tree.
*/
export function Navigator({ treeHeight }: NavigatorProps) {
const ctx = useSchemaDiagramContext();
diff --git a/frontend/src/modules/schema-diagram/Navigator/SchemaSelector.tsx b/frontend/src/modules/schema-diagram/Navigator/SchemaSelector.tsx
index e448d0a003..1f7165ad9f 100644
--- a/frontend/src/modules/schema-diagram/Navigator/SchemaSelector.tsx
+++ b/frontend/src/modules/schema-diagram/Navigator/SchemaSelector.tsx
@@ -11,9 +11,8 @@ interface SchemaSelectorProps {
}
/**
- * React port of `Navigator/SchemaSelector.vue`. Multi-select for which
- * schemas to render in the diagram. Used only when the engine has a
- * `schema` property (e.g. Postgres).
+ * Multi-select for which schemas to render in the diagram. Used only when
+ * the engine has a `schema` property (e.g. Postgres).
*/
export function SchemaSelector({
schemas,
diff --git a/frontend/src/modules/schema-diagram/Navigator/Tree.tsx b/frontend/src/modules/schema-diagram/Navigator/Tree.tsx
index 2fc6b82cc5..46fae8b271 100644
--- a/frontend/src/modules/schema-diagram/Navigator/Tree.tsx
+++ b/frontend/src/modules/schema-diagram/Navigator/Tree.tsx
@@ -15,10 +15,9 @@ interface NavigatorTreeProps {
}
/**
- * React port of `Navigator/Tree.vue`. Reuses the shared `Tree` primitive
- * (react-arborist) and renders schema → table levels with prefix /
- * suffix slots. Clicking a table emits `set-center` so the canvas
- * recenters on it.
+ * Reuses the shared `Tree` primitive (react-arborist) and renders schema →
+ * table levels with prefix / suffix slots. Clicking a table emits
+ * `set-center` so the canvas recenters on it.
*/
export function NavigatorTree({
keyword = "",
@@ -55,16 +54,16 @@ export function NavigatorTree({
};
return node;
});
- // Mirror Vue: collapse the tree when there's a single, unnamed schema
- // (e.g. MySQL's default schema) — show only the table children.
+ // Collapse the tree when there's a single, unnamed schema (e.g. MySQL's
+ // default schema) — show only the table children.
if (schemaNodes.length === 1 && selectedSchemas[0].name === "") {
return schemaNodes[0].children ?? [];
}
return schemaNodes;
}, [selectedSchemas]);
- // Match Vue's `default-expand-all="true"` — every schema row opens
- // expanded so the table children are visible without manual clicking.
+ // Every schema row opens expanded so the table children are visible
+ // without manual clicking.
const expandedIds = useMemo(() => data.map((node) => node.id), [data]);
return (
diff --git a/frontend/src/modules/schema-diagram/Navigator/TreeNode/Label.tsx b/frontend/src/modules/schema-diagram/Navigator/TreeNode/Label.tsx
index e98e2ab710..e41f7ec4f9 100644
--- a/frontend/src/modules/schema-diagram/Navigator/TreeNode/Label.tsx
+++ b/frontend/src/modules/schema-diagram/Navigator/TreeNode/Label.tsx
@@ -10,8 +10,7 @@ interface LabelProps {
}
/**
- * React port of `Navigator/TreeNode/Label.vue`. Uses the shared
- * `HighlightLabelText` for keyword highlighting (per the
+ * Uses the shared `HighlightLabelText` for keyword highlighting (per the
* use-highlightlabeltext memory rule — never inline highlight HTML).
*/
export function Label({ node, keyword }: LabelProps) {
diff --git a/frontend/src/modules/schema-diagram/Navigator/TreeNode/Prefix.tsx b/frontend/src/modules/schema-diagram/Navigator/TreeNode/Prefix.tsx
index ed02d2adda..316755d8a2 100644
--- a/frontend/src/modules/schema-diagram/Navigator/TreeNode/Prefix.tsx
+++ b/frontend/src/modules/schema-diagram/Navigator/TreeNode/Prefix.tsx
@@ -5,7 +5,6 @@ interface PrefixProps {
node: NavigatorTreeNode;
}
-/** React port of `Navigator/TreeNode/Prefix.vue`. */
export function Prefix({ node }: PrefixProps) {
if (node.type === "schema") return <Layers className="size-4" />;
if (node.type === "table") return <Table2 className="size-4" />;
diff --git a/frontend/src/modules/schema-diagram/Navigator/TreeNode/Suffix.tsx b/frontend/src/modules/schema-diagram/Navigator/TreeNode/Suffix.tsx
index bca186ab03..f3c8bf8164 100644
--- a/frontend/src/modules/schema-diagram/Navigator/TreeNode/Suffix.tsx
+++ b/frontend/src/modules/schema-diagram/Navigator/TreeNode/Suffix.tsx
@@ -6,15 +6,12 @@ interface SuffixProps {
node: NavigatorTreeNode;
}
-/** React port of `Navigator/TreeNode/Suffix.vue`. */
export function Suffix({ node }: SuffixProps) {
if (isTypedNode(node, "table")) {
// `FocusButton` defaults to `invisible` for unfocused tables (the
- // canvas surface only shows it on per-table hover). The Vue tree
- // relied on a `.bb-schema-diagram-nav-tree .n-tree-node:hover
- // .focus-btn { visibility: visible }` rule that didn't survive the
- // port. Re-create the affordance with `group-hover:visible` — the
- // surrounding tree row in `Tree.tsx` sets `group`.
+ // canvas surface only shows it on per-table hover). Reveal it on row
+ // hover with `group-hover:visible` — the surrounding tree row in
+ // `Tree.tsx` sets `group`.
return (
<FocusButton
table={node.data}
diff --git a/frontend/src/modules/schema-diagram/SchemaDiagram.tsx b/frontend/src/modules/schema-diagram/SchemaDiagram.tsx
index 0cc0630cae..80eabc0833 100644
--- a/frontend/src/modules/schema-diagram/SchemaDiagram.tsx
+++ b/frontend/src/modules/schema-diagram/SchemaDiagram.tsx
@@ -39,7 +39,6 @@ interface SchemaDiagramProps {
}
/**
- * React port of `frontend/src/components/SchemaDiagram/SchemaDiagram.vue`.
* Composes Navigator + Canvas inside the per-instance React context;
* an inner `<Body>` component runs the ELK layout when metadata /
* selection changes.
@@ -93,9 +92,9 @@ function Body({ databaseName, onEditTable, onEditColumn }: BodyProps) {
databaseMetadata,
} = ctx;
- // Vue mirrors: pick the first schema as the initial selection, NOT all
- // of them. (Most diagrams target a single schema; users can opt into
- // others via the SchemaSelector.)
+ // Pick the first schema as the initial selection, NOT all of them. (Most
+ // diagrams target a single schema; users can opt into others via the
+ // SchemaSelector.)
const lastInitializedMetadataRef = useRef<DatabaseMetadata | null>(null);
useEffect(() => {
if (lastInitializedMetadataRef.current === databaseMetadata) return;
diff --git a/frontend/src/modules/schema-diagram/SchemaDiagramPage.tsx b/frontend/src/modules/schema-diagram/SchemaDiagramPage.tsx
deleted file mode 100644
index 7d17e00f22..0000000000
--- a/frontend/src/modules/schema-diagram/SchemaDiagramPage.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate the
- * `<SchemaDiagram>` root via `mount.ts`'s `pageDirs` lookup (it scans
- * for `<page>.tsx` files, not directories).
- *
- * Vue callers mount this with `<ReactPageMount page="SchemaDiagramPage"
- * :page-props="{ database, databaseMetadata, editable, onEditTable,
- * onEditColumn }">` to render the React diagram inside a still-Vue
- * surface (e.g. `SchemaEditorLite/Panels/DatabaseEditor.vue`).
- */
-export { SchemaDiagram as SchemaDiagramPage } from "./SchemaDiagram";
diff --git a/frontend/src/modules/schema-diagram/common/FocusButton.tsx b/frontend/src/modules/schema-diagram/common/FocusButton.tsx
index afbe6b5e62..841ccc9a16 100644
--- a/frontend/src/modules/schema-diagram/common/FocusButton.tsx
+++ b/frontend/src/modules/schema-diagram/common/FocusButton.tsx
@@ -16,8 +16,6 @@ interface FocusButtonProps {
}
/**
- * React port of `frontend/src/components/SchemaDiagram/common/FocusButton.vue`.
- *
* Toggles the `focusedTables` membership for the given table and (by
* default) emits `set-center` so the canvas re-centers + zooms onto it.
* Used inside Navigator tree node suffixes and on hover over each
diff --git a/frontend/src/modules/schema-diagram/common/context.tsx b/frontend/src/modules/schema-diagram/common/context.tsx
index f29f439632..cb1f7c4e0a 100644
--- a/frontend/src/modules/schema-diagram/common/context.tsx
+++ b/frontend/src/modules/schema-diagram/common/context.tsx
@@ -50,7 +50,7 @@ const DEFAULT_RECT: Rect = { x: 0, y: 0, width: 0, height: 0 };
/**
* Per-instance React context for SchemaDiagram. Owns the Emittery event
* bus + reactive state used by Navigator / Canvas / ER children. Mounted
- * once per `<SchemaDiagram>` instance — see Stage 19 design doc §4.
+ * once per `<SchemaDiagram>` instance.
*/
export function SchemaDiagramProvider({
database,
@@ -69,7 +69,6 @@ export function SchemaDiagramProvider({
// collected when the user switches databases or refreshes metadata.
// A regular `Map` would pin every table object ever seen for the
// lifetime of the page, leaking memory in long SQL editor sessions.
- // Matches the Vue implementation.
const tableIdsRef = useRef<WeakMap<TableMetadata, string>>(new WeakMap());
// Reactive state.
@@ -100,9 +99,9 @@ export function SchemaDiagramProvider({
const foreignKeys = useMemo<ForeignKey[]>(() => {
// Iterate ONLY `selectedSchemas` for both endpoints. If a user
- // deselects a schema, FK edges that reference it are dropped — same
- // semantics as Vue's `find()` helper. Otherwise ELK gets edges whose
- // endpoints aren't in the node list, which destabilizes layout.
+ // deselects a schema, FK edges that reference it are dropped.
+ // Otherwise ELK gets edges whose endpoints aren't in the node list,
+ // which destabilizes layout.
const out: ForeignKey[] = [];
for (const schema of selectedSchemas) {
for (const table of schema.tables) {
@@ -276,9 +275,8 @@ export function useSchemaDiagramContext(): SchemaDiagramContext {
/**
* Register a geometry with the parent SchemaDiagram so the canvas can
- * include it when computing the bbox for `fit-view`. Mirrors Vue's
- * `useGeometry(geometry)` composable. Skipped when the diagram is in
- * dummy (off-screen screenshot) mode.
+ * include it when computing the bbox for `fit-view`. Skipped when the
+ * diagram is in dummy (off-screen screenshot) mode.
*/
export function useGeometry(geometry: Geometry) {
const ctx = useSchemaDiagramContext();
diff --git a/frontend/src/modules/schema-diagram/common/useDraggable.tsx b/frontend/src/modules/schema-diagram/common/useDraggable.tsx
index bf7e09b032..f4fedd520f 100644
--- a/frontend/src/modules/schema-diagram/common/useDraggable.tsx
+++ b/frontend/src/modules/schema-diagram/common/useDraggable.tsx
@@ -9,13 +9,10 @@ export type DraggableOptions = {
};
/**
- * React port of `frontend/src/components/SchemaDiagram/common/useDraggable.ts`.
- *
* Pointer-driven drag listener. Attaches `pointerdown` to the given
- * element and `pointermove` / `pointerup` to `window`, mirroring the
- * Vue `vueuse` setup so a drag continues even if the pointer leaves
- * the element. `screenX`/`screenY` are used (matching Vue) so the
- * delta is independent of the element's position when it's the one
+ * element and `pointermove` / `pointerup` to `window` so a drag continues
+ * even if the pointer leaves the element. `screenX`/`screenY` are used so
+ * the delta is independent of the element's position when it's the one
* being dragged.
*
* Pass `null` while the element is unmounted; the hook re-attaches
diff --git a/frontend/src/modules/schema-diagram/types/context.ts b/frontend/src/modules/schema-diagram/types/context.ts
index 98c510feb1..e6f269217a 100644
--- a/frontend/src/modules/schema-diagram/types/context.ts
+++ b/frontend/src/modules/schema-diagram/types/context.ts
@@ -11,10 +11,8 @@ import type { Geometry, Point, Rect } from "./geometry";
import type { ForeignKey } from "./schema";
/**
- * React port of the Vue `SchemaDiagramContext`. Values are stored as plain
- * fields (held by React state inside the provider) instead of Vue `Ref<T>`,
- * matching the per-instance React-context pattern decided in the Stage 19
- * design doc.
+ * Per-instance context for `<SchemaDiagram>`. Values are stored as plain
+ * fields held by React state inside the provider.
*
* Mutators are exposed as methods rather than direct setters so the
* provider can scope updates inside `useState`/`useRef` correctly. Methods
diff --git a/frontend/src/modules/schema-editor/Modals/EditColumnForeignKeySheetLayout.test.ts b/frontend/src/modules/schema-editor/Modals/EditColumnForeignKeySheetLayout.test.ts
deleted file mode 100644
index 8301dd0de8..0000000000
--- a/frontend/src/modules/schema-editor/Modals/EditColumnForeignKeySheetLayout.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const source = readFileSync(
- join(import.meta.dirname, "EditColumnForeignKeySheet.tsx"),
- "utf8"
-);
-
-describe("EditColumnForeignKeySheet layout", () => {
- test("uses the standard sheet and shared form composition", () => {
- expect(source).toContain('<SheetContent width="standard">');
- expect(source).toContain("<SheetHeader>");
- expect(source).toContain("<SheetBody>");
- expect(source).toContain("<FormFieldGroup>");
- expect(source.match(/<FormField(?:\s|>)/g)).toHaveLength(4);
- expect(source).toContain("<SheetFooter");
- expect(source).not.toContain("<label");
- });
-});
diff --git a/frontend/src/modules/schema-editor/Panels/TableColumnEditor/inline-input.test.tsx b/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.test.tsx
similarity index 70%
rename from frontend/src/modules/schema-editor/Panels/TableColumnEditor/inline-input.test.tsx
rename to frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.test.tsx
index ec04dafd6c..5e400bc23f 100644
--- a/frontend/src/modules/schema-editor/Panels/TableColumnEditor/inline-input.test.tsx
+++ b/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.test.tsx
@@ -4,14 +4,12 @@ import { describe, expect, test, vi } from "vitest";
import { Engine } from "@/types/proto-es/v1/common_pb";
import { ColumnMetadataSchema } from "@/types/proto-es/v1/database_service_pb";
import { DataTypeCell } from "./DataTypeCell";
-import { DefaultValueCell } from "./DefaultValueCell";
vi.mock("react-i18next", () => ({
initReactI18next: {
type: "3rdParty",
init: vi.fn(),
},
- useTranslation: () => ({ t: (key: string) => key }),
}));
vi.mock("@/utils", async (importOriginal) => {
@@ -36,7 +34,7 @@ const column = (
...overrides,
});
-describe("SchemaEditorLite inline inputs", () => {
+describe("DataTypeCell", () => {
test("disables browser suggestions for the column type input", () => {
render(
<DataTypeCell
@@ -52,19 +50,4 @@ describe("SchemaEditorLite inline inputs", () => {
"off"
);
});
-
- test("disables browser suggestions for the default value input", () => {
- render(
- <DefaultValueCell
- column={column({ hasDefault: true, default: "0" })}
- disabled={false}
- onUpdate={vi.fn()}
- />
- );
-
- expect(screen.getByDisplayValue("0")).toHaveAttribute(
- "autocomplete",
- "off"
- );
- });
});
diff --git a/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.tsx b/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.tsx
index 21dfe5c74b..18f07a9a4f 100644
--- a/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.tsx
+++ b/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DataTypeCell.tsx
@@ -29,10 +29,10 @@ interface Props {
}
/**
- * Free-text type input with a clickable suggestion dropdown, mirroring the old
- * Vue `DropdownInput`: users can type any custom type (e.g. `varchar(255)`) or
- * pick one of the engine's known types from the dropdown. The native
- * `<input list>` it replaced never opened reliably on click.
+ * Free-text type input with a clickable suggestion dropdown: users can type
+ * any custom type (e.g. `varchar(255)`) or pick one of the engine's known
+ * types from the dropdown. A native `<input list>` doesn't open reliably on
+ * click.
*
* Focus/click handlers live on the wrapping container because Base UI's Input
* can swallow `onClick`/`onFocus`; React focus/click events still bubble there.
@@ -52,9 +52,9 @@ export function DataTypeCell({
const value = column.type ?? "";
// The type as first rendered. We only filter once the user edits the value
- // away from this; an unchanged value shows the full list (matches Vue's
- // `allowFilter`). Otherwise opening e.g. a `bigint` cell would filter to just
- // "bigint" while a `timestamp(...)` cell — matching nothing — shows them all.
+ // away from this; an unchanged value shows the full list. Otherwise opening
+ // e.g. a `bigint` cell would filter to just "bigint" while a `timestamp(...)`
+ // cell — matching nothing — shows them all.
const originalTypeRef = useRef(value);
const allSuggestions = useMemo(
diff --git a/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DefaultValueCell.test.tsx b/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DefaultValueCell.test.tsx
new file mode 100644
index 0000000000..3a65f56902
--- /dev/null
+++ b/frontend/src/modules/schema-editor/Panels/TableColumnEditor/DefaultValueCell.test.tsx
@@ -0,0 +1,40 @@
+import { create } from "@bufbuild/protobuf";
+import { render, screen } from "@testing-library/react";
+import { describe, expect, test, vi } from "vitest";
+import { ColumnMetadataSchema } from "@/types/proto-es/v1/database_service_pb";
+import { DefaultValueCell } from "./DefaultValueCell";
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+const column = (
+ overrides: {
+ name?: string;
+ type?: string;
+ hasDefault?: boolean;
+ default?: string;
+ } = {}
+) =>
+ create(ColumnMetadataSchema, {
+ name: "id",
+ type: "int",
+ ...overrides,
+ });
+
+describe("DefaultValueCell", () => {
+ test("disables browser suggestions for the default value input", () => {
+ render(
+ <DefaultValueCell
+ column={column({ hasDefault: true, default: "0" })}
+ disabled={false}
+ onUpdate={vi.fn()}
+ />
+ );
+
+ expect(screen.getByDisplayValue("0")).toHaveAttribute(
+ "autocomplete",
+ "off"
+ );
+ });
+});
diff --git a/frontend/src/modules/schema-editor/core/algorithm/diff-merge.ts b/frontend/src/modules/schema-editor/core/algorithm/diff-merge.ts
index e926005162..18c8952ca4 100644
--- a/frontend/src/modules/schema-editor/core/algorithm/diff-merge.ts
+++ b/frontend/src/modules/schema-editor/core/algorithm/diff-merge.ts
@@ -26,7 +26,6 @@ import type { EditStatus } from "../types";
/**
* Minimal context surface that DiffMerge depends on.
- * Both Vue and React adapters supply an object satisfying this shape.
*/
export interface DiffMergeContext {
markEditStatusByKey: (key: string, status: EditStatus) => void;
diff --git a/frontend/src/modules/schema-editor/useAlgorithm.ts b/frontend/src/modules/schema-editor/useAlgorithm.ts
index 633b1125d5..d741e933c9 100644
--- a/frontend/src/modules/schema-editor/useAlgorithm.ts
+++ b/frontend/src/modules/schema-editor/useAlgorithm.ts
@@ -37,7 +37,6 @@ export function useAlgorithm(
dm.merge();
dm.timer.printAll();
- // Replace Vue's nextTick with setTimeout(0) for deferred execution.
setTimeout(() => {
if (resets.includes("tabs")) {
callbacks.clearTabs();
diff --git a/frontend/src/modules/schema-editor/useScrollStatus.ts b/frontend/src/modules/schema-editor/useScrollStatus.ts
index 077be98c07..5a05b9c706 100644
--- a/frontend/src/modules/schema-editor/useScrollStatus.ts
+++ b/frontend/src/modules/schema-editor/useScrollStatus.ts
@@ -53,7 +53,6 @@ export function useScrollStatus(): ScrollStatusContext {
/**
* Hook to consume a pending scroll-to-table event when the condition matches.
- * Replaces the Vue `useConsumePendingScrollToTable` composable.
*/
export function useConsumePendingScrollToTable(
condition: RichMetadataWithDB<RichSchemaMetadata> | undefined,
@@ -83,7 +82,6 @@ export function useConsumePendingScrollToTable(
/**
* Hook to consume a pending scroll-to-column event when the condition matches.
- * Replaces the Vue `useConsumePendingScrollToColumn` composable.
*/
export function useConsumePendingScrollToColumn(
condition: RichMetadataWithDB<RichTableMetadata> | undefined,
diff --git a/frontend/src/modules/sql-editor/components/AccessGrantRequestDrawer.test.tsx b/frontend/src/modules/sql-editor/components/AccessGrantRequestDrawer.test.tsx
index db3c902fd9..0cad0386bd 100644
--- a/frontend/src/modules/sql-editor/components/AccessGrantRequestDrawer.test.tsx
+++ b/frontend/src/modules/sql-editor/components/AccessGrantRequestDrawer.test.tsx
@@ -15,7 +15,7 @@ const mocks = vi.hoisted(() => ({
currentTabDatabase: "instances/inst1/databases/db1" as string | undefined,
currentTabSchema: undefined as string | undefined,
currentTabTable: undefined as string | undefined,
- // New zustand setters.
+ // SQL Editor store setters.
setAsidePanelTab: vi.fn(),
setHighlightAccessGrantName: vi.fn(),
pushNotification: vi.fn(),
@@ -41,9 +41,6 @@ vi.mock("@/hooks/useAppState", () => ({
}));
vi.mock("@/stores/app", () => {
- // `notify` reuses the `pushNotification` vi.fn so the existing test
- // assertions on `mocks.pushNotification` keep working after the migration
- // from the Pinia helper to the app-store notification slice.
const state = () => ({
fetchDatabases: mocks.fetchDatabases,
notify: mocks.pushNotification,
diff --git a/frontend/src/modules/sql-editor/components/AccessPane.tsx b/frontend/src/modules/sql-editor/components/AccessPane.tsx
index 1d0127ea59..92ead383e4 100644
--- a/frontend/src/modules/sql-editor/components/AccessPane.tsx
+++ b/frontend/src/modules/sql-editor/components/AccessPane.tsx
@@ -82,7 +82,7 @@ export function AccessPane() {
const hasJITFeature = useSQLEditorFeature(PlanFeature.FEATURE_JIT);
- // Build scope options for AdvancedSearch (React-compatible, no Vue renderers)
+ // Build scope options for AdvancedSearch
const scopeOptions = useMemo((): ScopeOption[] => {
return [
{
diff --git a/frontend/src/modules/sql-editor/components/AdminModeButton.test.tsx b/frontend/src/modules/sql-editor/components/AdminModeButton.test.tsx
index 28a8e577ee..3cb14d20b8 100644
--- a/frontend/src/modules/sql-editor/components/AdminModeButton.test.tsx
+++ b/frontend/src/modules/sql-editor/components/AdminModeButton.test.tsx
@@ -9,7 +9,7 @@ import { beforeEach, describe, expect, test, vi } from "vitest";
const mocks = vi.hoisted(() => ({
useTranslation: vi.fn(() => ({ t: (key: string) => key })),
- // Per-test controllable state read by the migrated Zustand/bridge hooks.
+ // Per-test controllable state read by the mocked hooks.
state: {
project: "projects/test" as string,
allowAdmin: true,
@@ -50,7 +50,7 @@ vi.mock("@/modules/sql-editor/store/tab", () => ({
}),
}));
-// Pinia bridge hook that resolves the admin permission for the project.
+// Hook that resolves the admin permission for the project.
vi.mock("@/modules/sql-editor/hooks/useSQLEditorState", () => ({
useSQLEditorAllowAdmin: mocks.useSQLEditorAllowAdmin,
}));
diff --git a/frontend/src/modules/sql-editor/components/AdminModeButton.tsx b/frontend/src/modules/sql-editor/components/AdminModeButton.tsx
index 34ff93d80d..fbc3d83803 100644
--- a/frontend/src/modules/sql-editor/components/AdminModeButton.tsx
+++ b/frontend/src/modules/sql-editor/components/AdminModeButton.tsx
@@ -18,7 +18,6 @@ type AdminModeButtonProps = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/AdminModeButton.vue.
* Visible only when the user has admin permission AND the current tab is
* in SAVED_QUERY mode. Clicking switches the tab to ADMIN mode.
*/
diff --git a/frontend/src/modules/sql-editor/components/AsidePanel.tsx b/frontend/src/modules/sql-editor/components/AsidePanel.tsx
index d6e8cbfff9..230b835ea3 100644
--- a/frontend/src/modules/sql-editor/components/AsidePanel.tsx
+++ b/frontend/src/modules/sql-editor/components/AsidePanel.tsx
@@ -8,17 +8,11 @@ import { SavedQueryPane } from "./SavedQueryPane";
import { SchemaPane } from "./SchemaPane/SchemaPane";
/**
- * Replaces `frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue`.
- *
* Three-column shell:
* 1. GutterBar (vertical icon rail) — fixed.
* 2. ActionBar — only when `asidePanelTab === "SCHEMA"` and the tab is
* connected to a database. Vertical button column for view drill-downs.
* 3. Main column — active pane (SavedQuery / Schema / History / Access).
- *
- * Schema-viewer modal stays in `SQLEditorHomePage.vue` (Vue parent) since
- * the embedded `TableSchemaViewer` is Vue-only; the React side triggers
- * it via the `show-schema-viewer` event on `sqlEditorEvents`.
*/
export function AsidePanel() {
const asidePanelTab = useSQLEditorStore((s) => s.asidePanelTab);
diff --git a/frontend/src/modules/sql-editor/components/AsidePanel/ActionBar.tsx b/frontend/src/modules/sql-editor/components/AsidePanel/ActionBar.tsx
index 78ff02f22b..e5c5af01b4 100644
--- a/frontend/src/modules/sql-editor/components/AsidePanel/ActionBar.tsx
+++ b/frontend/src/modules/sql-editor/components/AsidePanel/ActionBar.tsx
@@ -2,8 +2,6 @@ import { useAvailableActions } from "../SchemaPane/availableActions";
import { ActionBarTabItem } from "./ActionBarTabItem";
/**
- * Replaces `frontend/src/views/sql-editor/AsidePanel/ActionBar/ActionBar.vue`.
- *
* Vertical column of one button per `viewState` action (Info / Tables /
* Views / Functions / Procedures / + engine-conditional Sequences /
* External Tables / Packages / Diagram). Rendered in the AsidePanel's
diff --git a/frontend/src/modules/sql-editor/components/AsidePanel/ActionBarTabItem.tsx b/frontend/src/modules/sql-editor/components/AsidePanel/ActionBarTabItem.tsx
index 199177f196..70ca851116 100644
--- a/frontend/src/modules/sql-editor/components/AsidePanel/ActionBarTabItem.tsx
+++ b/frontend/src/modules/sql-editor/components/AsidePanel/ActionBarTabItem.tsx
@@ -13,15 +13,12 @@ type Props = {
};
/**
- * Replaces `frontend/src/views/sql-editor/AsidePanel/ActionBar/TabItem.vue`.
- *
* One vertical-rail button per panel view. Active state lights up when
* the current tab's `viewState.view` equals the action's view. Click
* opens (or focuses) a tab for that view via
* `useSchemaPaneActions().openNewTab`.
*
- * The label rides in a right-aligned tooltip — same UX as Vue's
- * `<NTooltip placement="right">`.
+ * The label rides in a right-aligned tooltip.
*/
export function ActionBarTabItem({ action, disabled }: Props) {
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/modules/sql-editor/components/ChooserGroup.tsx b/frontend/src/modules/sql-editor/components/ChooserGroup.tsx
index 1f9296a3b2..9b3d0f21d0 100644
--- a/frontend/src/modules/sql-editor/components/ChooserGroup.tsx
+++ b/frontend/src/modules/sql-editor/components/ChooserGroup.tsx
@@ -2,11 +2,6 @@ import { ContainerChooser } from "./ContainerChooser";
import { DatabaseChooser } from "./DatabaseChooser";
import { SchemaChooser } from "./SchemaChooser";
-/**
- * Replaces the <NButtonGroup> wrapping the 3 connection choosers in
- * frontend/src/views/sql-editor/EditorCommon/EditorAction.vue (lines 125-129).
- * Mounted via <ReactPageMount page="ChooserGroup" /> from the Vue parent.
- */
export function ChooserGroup() {
return (
<div className="flex items-center">
diff --git a/frontend/src/modules/sql-editor/components/ConnectChooser.tsx b/frontend/src/modules/sql-editor/components/ConnectChooser.tsx
index 2bc8034e97..6c259d925c 100644
--- a/frontend/src/modules/sql-editor/components/ConnectChooser.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectChooser.tsx
@@ -38,10 +38,9 @@ type ConnectChooserProps = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/ConnectChooser.vue.
- * Schema/Container chooser button used inside the SQL Editor toolbar's
- * NButtonGroup. Renders a chosen value (truncated) or a placeholder hint;
- * clicking opens a dropdown popover for selection.
+ * Schema/Container chooser button used in the SQL Editor toolbar. Renders a
+ * chosen value (truncated) or a placeholder hint; clicking opens a dropdown
+ * popover for selection.
*
* Note: uses a custom trigger button + portal dropdown rather than the
* shared <Combobox> component, because <Combobox> does not expose a
diff --git a/frontend/src/modules/sql-editor/components/ConnectionHolder.tsx b/frontend/src/modules/sql-editor/components/ConnectionHolder.tsx
index 6983a55686..d619bf5e31 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionHolder.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionHolder.tsx
@@ -4,10 +4,9 @@ import { Button } from "@/components/ui/button";
import { useSQLEditorStore } from "@/modules/sql-editor/store";
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/ConnectionHolder.vue.
- * Rendered as the v-else fallback inside the admin-mode Terminal panel when
- * there is no active database connection. Click opens the connection panel
- * via the SQL Editor UI store.
+ * Rendered as the fallback inside the admin-mode Terminal panel when there
+ * is no active database connection. Click opens the connection panel via
+ * the SQL Editor UI store.
*/
export function ConnectionHolder() {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionContextMenu.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionContextMenu.tsx
index 9ac2724dff..25293ed136 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionContextMenu.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionContextMenu.tsx
@@ -21,8 +21,6 @@ type Target = {
};
/**
- * Replaces the `NDropdown placement="bottom-start" trigger="manual"` in
- * frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue.
* Mirrors the TabContextMenu pattern: a 0×0 position-fixed trigger at the
* cursor is programmatically .click()-ed so Base UI records a click-type
* open event and the popup stays open when the pointer moves onto items.
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionPane.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionPane.tsx
index 5c292c56a0..180511cdb8 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionPane.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/ConnectionPane.tsx
@@ -79,14 +79,11 @@ import { useSQLEditorTreeByEnvironment } from "./tree";
type Props = {
readonly show: boolean;
/**
- * Bubble paywall triggers up to the parent `ConnectionPanel`. The Vue
- * version owned the `<FeatureModal>` inside the same template as the
- * tree, but in React both Sheet and FeatureModal are Base UI dialogs
- * portaling to the same overlay layer — keeping the FeatureModal as a
- * descendant of the Sheet caused stacking-order bugs (its backdrop
- * could land below the Sheet's popup). The parent now hosts the modal
- * as a sibling of the Sheet, and `ConnectionPaneInner` notifies it via
- * this callback.
+ * Bubble paywall triggers up to the parent `ConnectionPanel`, which hosts
+ * the `<FeatureModal>` as a sibling of the Sheet. Both are Base UI dialogs
+ * portaling to the same overlay layer; keeping the FeatureModal as a
+ * descendant of the Sheet causes stacking-order bugs (its backdrop can
+ * land below the Sheet's popup).
*/
readonly onMissingFeature: (feature: PlanFeature | undefined) => void;
};
@@ -102,21 +99,13 @@ const getDataSourceTypeLabel = (
: t("sql-editor.batch-query.select-data-source.readonly");
/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue.
* Environment-grouped database tree + batch-mode batch-query selection +
- * database-group selection tab. Consumes every Phase 3/4a/4b/4c artifact:
- * - TreeNode/Label (Phase 3)
- * - DatabaseHoverPanel (Phase 3)
- * - DatabaseGroupTag (Phase 4a)
- * - tree.ts hook (Phase 4a)
- * - setConnection, useConnectionMenu, ConnectionContextMenu (Phase 4b)
- * - FeatureModal (Phase 4b)
- * - DatabaseGroupTable (Phase 4c)
+ * database-group selection tab.
*
- * Uses the shared React `AdvancedSearch` + `useCommonSearchScopeOptions`
- * for `instance` / `label` / `engine` scope chips. Filter fields are
- * derived from `params.scopes` and forwarded to the per-environment
- * `useSQLEditorTreeByEnvironment` hook, matching the Vue behavior.
+ * Uses the shared `AdvancedSearch` + `useCommonSearchScopeOptions` for
+ * `instance` / `label` / `engine` scope chips. Filter fields are derived
+ * from `params.scopes` and forwarded to the per-environment
+ * `useSQLEditorTreeByEnvironment` hook.
*/
export function ConnectionPane(props: Props) {
return <ConnectionPaneWithHoverState {...props} />;
@@ -177,10 +166,9 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
() => readShowMissingFromStorage(currentUserEmail)
);
- // The Vue version re-bound to a computed storage key whenever the user
- // email changed (initial hydration from anonymous → real email, or an
- // account switch). Mirror that here: when the email key changes, reload
- // from storage and skip the next write so we don't clobber the new
+ // The storage key is per user email, which can change (initial hydration
+ // from anonymous → real email, or an account switch). When it changes,
+ // reload from storage and skip the next write so we don't clobber the new
// user's saved preference with the previous user's value.
const loadedForEmailRef = useRef(currentUserEmail);
useEffect(() => {
@@ -194,11 +182,9 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
writeShowMissingToStorage(currentUserEmail, showMissingQueryDatabases);
}, [currentUserEmail, showMissingQueryDatabases]);
- // Local state, seeded `READ_ONLY` on every panel mount. Matches Vue's
- // `state.batchQueryDataSourceType: DataSourceType.READ_ONLY` initial +
- // `watch(..., { immediate: true })` that pushes the value into the tab
- // store on mount — i.e. the tab's saved data-source resets to READ_ONLY
- // each time the drawer opens.
+ // Local state, seeded `READ_ONLY` on every panel mount and pushed into the
+ // tab store by the effect below — i.e. the tab's saved data-source resets
+ // to READ_ONLY each time the drawer opens.
const [dataSourceType, setDataSourceType] = useState<QueryDataSourceType>(
DataSourceType.READ_ONLY
);
@@ -217,8 +203,7 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
}, [fetchDBGroup, selectedDatabaseGroupNames]);
// Map<databaseResourceName, groupTitle> for every database covered by
- // any currently-selected database group. Mirrors Vue's
- // `flattenSelectedDatabasesFromGroup` and drives the tree-row checkbox
+ // any currently-selected database group. Drives the tree-row checkbox
// so users can see which databases are already implicitly included via
// group selection (rendered as checked + disabled + tooltip in batch
// mode). `useShallow` over the Map keeps the snapshot stable (zustand's
@@ -262,9 +247,7 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
currentProject
);
- // Derive DatabaseFilter fields from the search scopes, matching the Vue
- // version's slicing of `state.params` into `instance`, `labels`, and
- // `engines`.
+ // Derive DatabaseFilter fields from the search scopes.
const selectedLabels = useMemo(
() => getValuesFromSearchParams(searchParams, "label"),
[searchParams]
@@ -294,11 +277,10 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
[queryText, selectedInstance, selectedLabels, selectedEngines]
);
- // Vue's `watch(() => props.show, ..., { immediate: true })` only fires
- // when `show` toggles, NOT when batch-mode selections change. Mirror
- // that — depend on `show` alone so toggling a checkbox inside the panel
- // doesn't yank the user back to the DATABASE tab. Read selection
- // lengths through refs so they don't widen the dep array.
+ // Sync the selection tab only when `show` toggles, NOT when batch-mode
+ // selections change — depend on `show` alone so toggling a checkbox
+ // inside the panel doesn't yank the user back to the DATABASE tab. Read
+ // selection lengths through refs so they don't widen the dep array.
const selectedDatabaseNamesRef = useRef(selectedDatabaseNames);
selectedDatabaseNamesRef.current = selectedDatabaseNames;
const selectedDatabaseGroupNamesRef = useRef(selectedDatabaseGroupNames);
@@ -326,11 +308,11 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
void batchGetOrFetchDatabases(selectedDatabaseNames);
}, [currentTab, batchGetOrFetchDatabases, selectedDatabaseNames]);
- // Drive treeStore.state transitions so the mask spinner lifts when the
+ // Drive `treeState` transitions so the mask spinner lifts when the
// project is ready and hides again when the project changes.
// `tree-ready` is NOT emitted here — at this point each env section is
// still asynchronously fetching+building its slice of the tree, and the
- // listener uses `treeStore.nodeKeysByTarget` which would return [] for
+ // listener uses `treeNodeKeysByTarget` which would return [] for
// the current connection. Each `EnvironmentTreeSection` emits
// `tree-ready` when its own buildTree resolves.
useEffect(() => {
@@ -342,10 +324,9 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
setTreeState("READY");
}, [projectName, projectContextReady, setTreeState]);
- // Highlight the current tab's connection node in the tree. Mirrors
- // Vue's `getSelectedKeys` + `tree-ready` event listener: when the tree
- // becomes ready, resolve the current connection (database, then
- // instance fallback) and ask `treeStore.nodeKeysByTarget` for the keys
+ // Highlight the current tab's connection node in the tree. When the tree
+ // becomes ready (`tree-ready`), resolve the current connection (database,
+ // then instance fallback) and ask `treeNodeKeysByTarget` for the keys
// that point to that target.
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
useEffect(() => {
@@ -409,10 +390,10 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
databases: [...new Set(batchQueryDatabases)],
},
});
- // Mirror the Vue ConnectionPane: clicking a row commits the
- // connection AND closes the drawer. Without this the drawer stays
- // open and the user can't see the schema panel underneath, so
- // subsequent re-clicks look like nothing happened.
+ // Clicking a row commits the connection AND closes the drawer.
+ // Without this the drawer stays open and the user can't see the
+ // schema panel underneath, so subsequent re-clicks look like nothing
+ // happened.
setShowConnectionPanel(false);
},
[selectedDatabaseGroupNames, currentTab?.mode, setShowConnectionPanel]
@@ -533,9 +514,8 @@ function ConnectionPaneInner({ show, onMissingFeature }: Props) {
]
);
- // Vue routes uncheck through `onDatabaseGroupSelectionUpdate`, which
- // performs the feature gate + notification. Mirror that here so feature
- // checks fire on remove too.
+ // Route uncheck through `handleSelectedGroupsChange`, which performs the
+ // feature gate + notification, so feature checks fire on remove too.
const handleUncheckDatabaseGroup = useCallback(
async (groupName: string) => {
const next = selectedDatabaseGroupNames.filter((n) => n !== groupName);
@@ -840,8 +820,7 @@ function EnvironmentTreeSection(props: {
* with `selectedDatabaseNames` and uses the title for the disabled-
* checkbox tooltip. */
groupCoveredDatabaseTitles: Map<string, string>;
- /** Tree-row keys to highlight as the current connection (1:1 with Vue
- * `selectedKeys` from `getSelectedKeys()`). */
+ /** Tree-row keys to highlight as the current connection. */
selectedKeys: string[];
switchingConnection: boolean;
onConnect: (node: SQLEditorTreeNode) => void;
@@ -884,7 +863,7 @@ function EnvironmentTreeSection(props: {
// treeByEnv identity is stable per-render via the hook's internals.
// After buildTree resolves we emit `tree-ready` so the parent's
// current-connection-highlight effect can recompute against the now-
- // populated `treeStore.nodeKeysByTarget`. Emitting here (per-env, after
+ // populated `treeNodeKeysByTarget`. Emitting here (per-env, after
// populate) instead of in the project-readiness effect avoids a race
// where the highlight is computed against an empty tree.
useEffect(() => {
@@ -900,11 +879,10 @@ function EnvironmentTreeSection(props: {
treeByEnv.buildTree(showMissingQueryDatabases);
}, [showMissingQueryDatabases]);
- // First-time default-expand. The Vue version did this by listening to the
- // `tree-ready` event and seeding `expandedKeys` from the global tree
- // store; in React each environment owns its own expand state, so we
- // expand from the per-env tree directly. After the user toggles anything
- // (`expandedState.initialized = true`), we leave their preference alone.
+ // First-time default-expand. Each environment owns its own expand state,
+ // so we expand from the per-env tree directly. After the user toggles
+ // anything (`expandedState.initialized = true`), we leave their preference
+ // alone.
useEffect(() => {
if (treeByEnv.expandedState.initialized) return;
if (treeByEnv.tree.length === 0) return;
@@ -937,9 +915,8 @@ function EnvironmentTreeSection(props: {
);
// Hide the env section entirely when it's the "unknown" bucket with no
- // children (matches Vue's `v-if="env !== UNKNOWN || !treeIsEmpty"` guard).
- // Keep this guard AFTER all hook calls — early-returning before useMemo
- // calls would change the hook order across renders and trigger the
+ // children. Keep this guard AFTER all hook calls — early-returning before
+ // useMemo calls would change the hook order across renders and trigger the
// "Rendered more hooks than during the previous render" runtime error.
if (isUnknownEnvironment && treeIsEmpty(treeByEnv.tree)) {
return null;
@@ -1216,7 +1193,7 @@ function treeIsEmpty(nodes: SQLEditorTreeNode[]): boolean {
/**
* Walks the tree and returns every node key. Used to seed `expandedKeys`
* the first time an environment subtree is rendered so the user sees a
- * fully-expanded list by default — matching the Vue ConnectionPane.
+ * fully-expanded list by default.
*/
function collectAllNodeKeys(nodes: SQLEditorTreeNode[]): string[] {
const out: string[] = [];
@@ -1229,12 +1206,12 @@ function collectAllNodeKeys(nodes: SQLEditorTreeNode[]): string[] {
}
/**
- * 1:1 port of `getQueryableDatabase` from the Vue ConnectionPane. Despite
- * the name, the original returns the *first* database in the group — it
- * does not filter for `isDatabaseV1Queryable`. The downstream
- * `setConnection` call attempts the connection regardless; the
- * "no-queriable-database" notification is only surfaced when the function
- * returns `undefined` (i.e. no databases at all in any picked group).
+ * Despite the name, returns the *first* selected database (or the first
+ * database of the first non-empty group) — it does not filter for
+ * `isDatabaseV1Queryable`. The downstream `setConnection` call attempts the
+ * connection regardless; the "no-queriable-database" notification is only
+ * surfaced when the function returns `undefined` (i.e. no databases at all
+ * in any picked group).
*/
async function getQueryableDatabase(ctx: BatchQueryContext) {
if (ctx.databases.length > 0) {
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseGroupTag.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseGroupTag.tsx
index 0eba1b325a..b32b967d6d 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseGroupTag.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseGroupTag.tsx
@@ -13,7 +13,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/DatabaseGroupTag.vue.
* Closable tag representing a selected database group. Fetches the group
* lazily on mount and hides itself until resolved.
*/
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.test.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.test.tsx
index dff6b9af2f..9c1d4a7097 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.test.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.test.tsx
@@ -29,10 +29,6 @@ vi.mock("./hover-state", () => ({
vi.mock("@/stores", () => ({}));
-vi.mock("@/modules/sql-editor/store/editor-vue-state", () => ({
- useSQLEditorVueState: () => ({ project: "" }),
-}));
-
vi.mock("@/utils", () => ({
getDatabaseProject: () => ({ name: "projects/p", title: "P" }),
getInstanceResource: () => ({
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.tsx
index f9795925f2..792a9194ec 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.tsx
@@ -23,7 +23,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/DatabaseHoverPanel/DatabaseHoverPanel.vue.
* Floating panel anchored at the hovered tree row showing database context
* (environment, instance, project, labels). Clamps the y coordinate so the
* panel stays fully within the viewport.
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/hover-state.ts b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/hover-state.ts
index c963d03982..dbc598a652 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/hover-state.ts
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/DatabaseHoverPanel/hover-state.ts
@@ -31,7 +31,6 @@ const DELAY_AFTER = 100;
const HoverStateContext = createContext<HoverStateContextValue | null>(null);
/**
- * React equivalent of the Vue `useHoverStateContext("connection-pane")`.
* Wraps a delayed-update `HoverState` plus the last cursor `Position` so the
* hover panel can render a database preview after the open-delay elapses.
*/
@@ -63,13 +62,11 @@ export function useProvideHoverState(): HoverStateContextValue {
[cancel]
);
- // Memoize the context value so an unrelated parent re-render (e.g.
- // a Pinia tick triggering a Vue-bridge update somewhere up the
- // tree) doesn't churn the `<HoverStateProvider value={…}>` reference.
- // Without this, every consumer of `useHoverState()` (every tree row
- // in `ConnectionPane`) re-renders, which can show up as the hover
- // panel rapidly toggling visibility / re-positioning while the user
- // holds the cursor over a row.
+ // Memoize the context value so an unrelated parent re-render doesn't
+ // churn the `<HoverStateProvider value={…}>` reference. Without this,
+ // every consumer of `useHoverState()` (every tree row in `ConnectionPane`)
+ // re-renders, which can show up as the hover panel rapidly toggling
+ // visibility / re-positioning while the user holds the cursor over a row.
return useMemo(
() => ({ state, position, setPosition, update }),
[state, position, setPosition, update]
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/DatabaseNode.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/DatabaseNode.tsx
index 72256740f1..538008a434 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/DatabaseNode.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/DatabaseNode.tsx
@@ -26,7 +26,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue.
* Shows an optional batch-mode checkbox, an inline "Instance → Database"
* breadcrumb (engine icon + instance name, chevron, database name), and a
* RequestQueryButton when the current user can't query this database.
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/InstanceNode.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/InstanceNode.tsx
index 7b2e27e857..b6a8982005 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/InstanceNode.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/InstanceNode.tsx
@@ -8,13 +8,6 @@ type Props = {
readonly keyword: string;
};
-/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/InstanceNode.vue.
- * The Vue version also supported an "environment prefix" path gated on
- * `hasEnvironmentContext`, which was hard-coded to `true` — so in practice
- * only the instance name + engine icon was ever rendered. We mirror that
- * reduced behavior.
- */
export function InstanceNode({ node, keyword }: Props) {
const target = (node as SQLEditorTreeNode<"instance">).meta.target;
const instance = {
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/Label.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/Label.tsx
index 044bda55ac..62f8ffbab0 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/Label.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/Label.tsx
@@ -16,7 +16,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/Label.vue.
* Dispatches on `node.meta.type` to render the right leaf component; only
* the `database` case consumes the checkbox/click callbacks.
*/
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/LabelNode.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/LabelNode.tsx
index 7ca0062615..eede41d345 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/LabelNode.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/TreeNode/LabelNode.tsx
@@ -7,7 +7,6 @@ type Props = {
readonly keyword: string;
};
-/** Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/LabelNode.vue. */
export function LabelNode({ node, keyword }: Props) {
const { t } = useTranslation();
const label = (node as SQLEditorTreeNode<"label">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPane/actions.tsx b/frontend/src/modules/sql-editor/components/ConnectionPane/actions.tsx
index ec285f4d44..aa2878cc2a 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPane/actions.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPane/actions.tsx
@@ -115,7 +115,6 @@ export function setConnection(options: {
}
/**
- * Replaces `useDropdown` from the Vue `actions.tsx`.
* Returns the dynamic menu items for a right-clicked tree node. Consumers
* render the resulting items in their own context menu UI.
*/
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPanel.test.tsx b/frontend/src/modules/sql-editor/components/ConnectionPanel.test.tsx
index a9c333ac7b..ab9ee55bf2 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPanel.test.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPanel.test.tsx
@@ -172,7 +172,7 @@ describe("ConnectionPanel", () => {
unmount();
});
- test("settings button navigates without closing the drawer (matches Vue)", () => {
+ test("settings button navigates without closing the drawer", () => {
mocks.state.showConnectionPanel = true;
const { container, render, unmount } = renderIntoContainer(
<ConnectionPanel />
diff --git a/frontend/src/modules/sql-editor/components/ConnectionPanel.tsx b/frontend/src/modules/sql-editor/components/ConnectionPanel.tsx
index b4937c9684..bb9c328253 100644
--- a/frontend/src/modules/sql-editor/components/ConnectionPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/ConnectionPanel.tsx
@@ -20,19 +20,7 @@ import { hasWorkspacePermissionV2 } from "@/utils";
import { ConnectionPane } from "./ConnectionPane/ConnectionPane";
/**
- * Replaces frontend/src/views/sql-editor/ConnectionPanel/ConnectionPanel.vue.
- * Right-side Sheet hosting the `ConnectionPane`. The open/close state is
- * read directly from `useSQLEditorStore(s => s.showConnectionPanel)`
- * rather than passed through `<ReactPageMount>` props —
- * funneling boolean state through Vue→React attrs proved brittle (Vue's
- * template compiler doesn't auto-translate `(v) => (ref = v)` into
- * `.value = v` outside of `v-model`, and concurrent renders can leave the
- * Sheet's `open` prop stale after a programmatic close).
- *
- * The outer Vue drawer used a dynamic `width` (50vw up to 800px, falling
- * back to `calc(100vw - 4rem)` on narrow viewports). The shadcn Sheet's
- * `wide` tier (832px) is the closest match; it clamps via max-w-[100vw]
- * so narrow viewports remain safe.
+ * Right-side Sheet hosting the `ConnectionPane`.
*/
export function ConnectionPanel() {
const { t } = useTranslation();
@@ -49,9 +37,9 @@ export function ConnectionPanel() {
undefined
);
- // Vue had `:close-on-esc="false"` (mask click still closed the drawer).
- // Mirror that by canceling Base UI's close handling when the reason is
- // `escapeKey`; outside-press (mask click) is allowed through.
+ // Escape doesn't close the drawer, but a mask click does: cancel Base UI's
+ // close handling when the reason is `escape-key`; outside-press (mask
+ // click) is allowed through.
const handleOpenChange = (
next: boolean,
eventDetails?: { reason?: string; cancel?: () => void }
@@ -77,9 +65,9 @@ export function ConnectionPanel() {
size="sm"
className={cn("w-7 p-1")}
aria-label={t("sql-editor.manage-connections")}
- // Match Vue: just navigate. The route change unmounts
- // the SQL editor; pre-closing the drawer added an
- // unnecessary close transition.
+ // Just navigate. The route change unmounts the SQL
+ // editor; pre-closing the drawer adds an unnecessary
+ // close transition.
onClick={() => {
void router.push({ name: INSTANCE_ROUTE_DASHBOARD });
}}
diff --git a/frontend/src/modules/sql-editor/components/ContainerChooser.tsx b/frontend/src/modules/sql-editor/components/ContainerChooser.tsx
index 373188bc51..59deade03c 100644
--- a/frontend/src/modules/sql-editor/components/ContainerChooser.tsx
+++ b/frontend/src/modules/sql-editor/components/ContainerChooser.tsx
@@ -19,7 +19,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/ContainerChooser.vue.
* Visible only for CosmosDB databases (container = table in CosmosDB).
* Selected container persists to the current tab's connection.table.
*/
@@ -35,8 +34,8 @@ export function ContainerChooser({
const tabTable = useSQLEditorTabState(
(s) => s.tabsById.get(s.currentTabId)?.connection.table
);
- // Parent SchemaPane (E4 migration) drives the metadata fetch; here we
- // only need the cached read.
+ // The ancestor `Panels` drives the metadata fetch; here we only need the
+ // cached read.
const { schemas } = useAppDatabaseMetadata(databaseName, {
autoFetch: false,
});
@@ -87,10 +86,8 @@ export function ContainerChooser({
);
// Seed from URL query parameter on mount and whenever the query param OR
- // the active tab changes. Mirrors Vue's watchEffect, which implicitly
- // tracked both `route.query.table` and `tab.value` (the latter via the
- // setter's reactive reads) so that switching to a new tab with the URL
- // query still present re-seeded the new tab's connection.table.
+ // the active tab changes, so that switching to a new tab with the URL
+ // query still present re-seeds the new tab's connection.table.
useEffect(() => {
if (!queryParam) {
ignoredRouteTableByTab.delete(currentTabId);
diff --git a/frontend/src/modules/sql-editor/components/DatabaseChooser.tsx b/frontend/src/modules/sql-editor/components/DatabaseChooser.tsx
index 143b4f07fa..9b2e7aa3ff 100644
--- a/frontend/src/modules/sql-editor/components/DatabaseChooser.tsx
+++ b/frontend/src/modules/sql-editor/components/DatabaseChooser.tsx
@@ -23,7 +23,6 @@ type DatabaseChooserProps = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue.
* Breadcrumb-style chooser showing the current connection
* (Environment > Instance > Database). Click opens the connection panel.
*/
diff --git a/frontend/src/modules/sql-editor/components/DatabaseQueryContextPage.tsx b/frontend/src/modules/sql-editor/components/DatabaseQueryContextPage.tsx
deleted file mode 100644
index 56dc131cba..0000000000
--- a/frontend/src/modules/sql-editor/components/DatabaseQueryContextPage.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate the
- * `<DatabaseQueryContext>` root via `mount.ts`'s `pageDirs` lookup
- * (it scans for `<page>.tsx` files at the registered roots, not
- * subdirectories).
- *
- * Vue caller mounts this with `<ReactPageMount page="DatabaseQueryContextPage"
- * :page-props="{ database, context }">`. Stage 21 deletes both this shim
- * and the Vue caller once `ResultPanel.vue` flips to React and imports
- * `DatabaseQueryContext` directly.
- */
-export { DatabaseQueryContext as DatabaseQueryContextPage } from "./ResultPanel/DatabaseQueryContext";
diff --git a/frontend/src/modules/sql-editor/components/DiagramPanel.tsx b/frontend/src/modules/sql-editor/components/DiagramPanel.tsx
index bd3b71420f..eca21b52e0 100644
--- a/frontend/src/modules/sql-editor/components/DiagramPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/DiagramPanel.tsx
@@ -3,11 +3,9 @@ import { SchemaDiagram } from "@/modules/schema-diagram";
import { useConnectionOfCurrentSQLEditorTab } from "@/modules/sql-editor/hooks/useSQLEditorState";
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/Panels/DiagramPanel/DiagramPanel.vue`.
- *
* Reads the current tab's database from the SQL Editor connection
* store + its metadata from the app store, and forwards both
- * to `<SchemaDiagram>`. Mounted by `Panels.vue` via `ReactPageMount`.
+ * to `<SchemaDiagram>`. Mounted by `Panels`.
*/
export function DiagramPanel() {
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/modules/sql-editor/components/EditorAction.tsx b/frontend/src/modules/sql-editor/components/EditorAction.tsx
index 33d0848fb6..8494380682 100644
--- a/frontend/src/modules/sql-editor/components/EditorAction.tsx
+++ b/frontend/src/modules/sql-editor/components/EditorAction.tsx
@@ -39,11 +39,10 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/EditorAction.vue.
* Top toolbar in the SQL editor: Run / QueryContextSettingPopover /
* AdminModeButton / Save / Share / ChooserGroup / OpenAIButton.
*
- * `onExecute` is optional because `TerminalPanel.vue` mounts the toolbar in
+ * `onExecute` is optional because `TerminalPanel` mounts the toolbar in
* ADMIN mode where the Run button is not rendered.
*/
export function EditorAction({ onExecute }: Props) {
diff --git a/frontend/src/modules/sql-editor/components/ExecuteHint.tsx b/frontend/src/modules/sql-editor/components/ExecuteHint.tsx
index eb65fecd5e..08475fec55 100644
--- a/frontend/src/modules/sql-editor/components/ExecuteHint.tsx
+++ b/frontend/src/modules/sql-editor/components/ExecuteHint.tsx
@@ -24,7 +24,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue.
* Body of the "DDL/DML requires a plan" confirmation surface.
*/
export function ExecuteHint({ database, onClose }: Props) {
diff --git a/frontend/src/modules/sql-editor/components/ExecutingHintModal.tsx b/frontend/src/modules/sql-editor/components/ExecutingHintModal.tsx
index 093addb961..03fe97fd35 100644
--- a/frontend/src/modules/sql-editor/components/ExecutingHintModal.tsx
+++ b/frontend/src/modules/sql-editor/components/ExecutingHintModal.tsx
@@ -7,7 +7,6 @@ import {
import { ExecuteHint } from "./ExecuteHint";
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/ExecutingHintModal.vue.
* Shows the ExecuteHint body inside a Dialog when the user attempts a DDL/DML
* against a database that requires a change plan.
*/
diff --git a/frontend/src/modules/sql-editor/components/FolderForm.test.tsx b/frontend/src/modules/sql-editor/components/FolderForm.test.tsx
index 752a373951..cd7b9e0755 100644
--- a/frontend/src/modules/sql-editor/components/FolderForm.test.tsx
+++ b/frontend/src/modules/sql-editor/components/FolderForm.test.tsx
@@ -182,9 +182,6 @@ const setupDefaultMocks = () => {
makeFolderNode("/my/bar"),
]);
- // The migrated `useSheetContextByView` returns plain values:
- // `folderTree` is a SavedQueryFolderNode (not a Vue ref) and
- // `folderContext.rootPath` is a plain string.
const viewContext = {
folderTree: rootNode,
folderContext: {
diff --git a/frontend/src/modules/sql-editor/components/GutterBar.tsx b/frontend/src/modules/sql-editor/components/GutterBar.tsx
index eafd0a6f65..b69582d6b6 100644
--- a/frontend/src/modules/sql-editor/components/GutterBar.tsx
+++ b/frontend/src/modules/sql-editor/components/GutterBar.tsx
@@ -9,8 +9,6 @@ import { TabItem } from "./TabItem";
* Left gutter of the SQL Editor aside panel. Shows 4 tab buttons
* (SAVED_QUERY, SCHEMA, HISTORY, and optionally ACCESS when the current
* project allows JIT).
- *
- * Replaces frontend/src/views/sql-editor/AsidePanel/GutterBar/GutterBar.vue.
*/
export function GutterBar() {
const asidePanelTab = useSQLEditorStore((s) => s.asidePanelTab);
diff --git a/frontend/src/modules/sql-editor/components/HistoryPane.tsx b/frontend/src/modules/sql-editor/components/HistoryPane.tsx
index 5550fbf038..c281ce18ac 100644
--- a/frontend/src/modules/sql-editor/components/HistoryPane.tsx
+++ b/frontend/src/modules/sql-editor/components/HistoryPane.tsx
@@ -33,7 +33,6 @@ import { extractProjectResourceName, extractQueryHistoryUID } from "@/utils";
import { HistorySearchInput } from "./HistorySearchInput";
/**
- * React migration of frontend/src/views/sql-editor/AsidePanel/HistoryPane/HistoryPane.vue.
* Displays the query history list with search, copy, and click-to-append features.
*/
export function HistoryPane() {
@@ -101,8 +100,8 @@ export function HistoryPane() {
// already up-to-date by the time the event fires (`useExecuteSQL` /
// `webTerminal` chain the emit in `.finally` after `mergeLatest`
// resolves). The bumped reducer state triggers a render, which
- // re-runs the Vue-bridge getter and reads the merged list —
- // preserving any pages the user had already loaded.
+ // re-runs the `selectQueryHistoryEntry` selector and reads the merged
+ // list — preserving any pages the user had already loaded.
useEffect(() => {
sqlEditorEvents.on("query-executed", bumpRefresh);
return () => {
diff --git a/frontend/src/modules/sql-editor/components/MaskingReasonPopover.test.tsx b/frontend/src/modules/sql-editor/components/MaskingReasonPopover.test.tsx
index 5d0f847b19..6dd5795cf2 100644
--- a/frontend/src/modules/sql-editor/components/MaskingReasonPopover.test.tsx
+++ b/frontend/src/modules/sql-editor/components/MaskingReasonPopover.test.tsx
@@ -13,7 +13,6 @@ const mocks = vi.hoisted(() => ({
name: string;
allowJustInTimeAccess: boolean;
},
- useSQLEditorVueState: vi.fn(),
hasFeature: vi.fn(() => true),
}));
@@ -35,10 +34,6 @@ vi.mock("@/hooks/useAppProject", () => ({
useAppProject: () => mocks.projectData,
}));
-vi.mock("@/modules/sql-editor/store/editor-vue-state", () => ({
- useSQLEditorVueState: mocks.useSQLEditorVueState,
-}));
-
vi.mock("@/types/proto-es/v1/subscription_service_pb", () => ({
PlanFeature: { FEATURE_JIT: 5 },
}));
@@ -156,7 +151,6 @@ const setupDefaultMocks = (allowJIT = false) => {
name: "projects/proj1",
allowJustInTimeAccess: allowJIT,
};
- mocks.useSQLEditorVueState.mockReturnValue({ project: "projects/proj1" });
mocks.hasFeature.mockReturnValue(true);
};
diff --git a/frontend/src/modules/sql-editor/components/OpenAIButton.test.tsx b/frontend/src/modules/sql-editor/components/OpenAIButton.test.tsx
index 1ac38ee250..f4d79c1859 100644
--- a/frontend/src/modules/sql-editor/components/OpenAIButton.test.tsx
+++ b/frontend/src/modules/sql-editor/components/OpenAIButton.test.tsx
@@ -167,15 +167,15 @@ const renderIntoContainer = (element: ReactElement) => {
};
// Default state: connected, saved query mode, AI enabled, showAIPanel=false
-type VueStateValues = {
+type StateValues = {
isDisconnected: boolean;
currentMode: string | undefined;
showAIPanel: boolean;
openAIEnabled: boolean;
};
-const setupDefaultMocks = (overrides: Partial<VueStateValues> = {}) => {
- const values: VueStateValues = {
+const setupDefaultMocks = (overrides: Partial<StateValues> = {}) => {
+ const values: StateValues = {
isDisconnected: false,
currentMode: "SAVED_QUERY",
showAIPanel: false,
diff --git a/frontend/src/modules/sql-editor/components/OpenAIButton.tsx b/frontend/src/modules/sql-editor/components/OpenAIButton.tsx
index f854e626ae..7a0ceafb85 100644
--- a/frontend/src/modules/sql-editor/components/OpenAIButton.tsx
+++ b/frontend/src/modules/sql-editor/components/OpenAIButton.tsx
@@ -30,7 +30,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/OpenAIButton/*.vue.
* Shows an AI-assistant toggle when the editor is connected + in saved query
* mode. Clicking the button toggles the AI panel. Statement-specific AI
* actions live in the editor context menu.
diff --git a/frontend/src/modules/sql-editor/components/Panels/ExternalTablesPanel/ExternalTablesPanel.tsx b/frontend/src/modules/sql-editor/components/Panels/ExternalTablesPanel/ExternalTablesPanel.tsx
index cf417c7a58..aad886135d 100644
--- a/frontend/src/modules/sql-editor/components/Panels/ExternalTablesPanel/ExternalTablesPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/ExternalTablesPanel/ExternalTablesPanel.tsx
@@ -9,9 +9,7 @@ import { useViewStateNav } from "../common/useViewStateNav";
import { ExternalTablesTable } from "./ExternalTablesTable";
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/Panels/ExternalTablesPanel/*`.
- * Single Columns detail tab — no viewer needed, fully unblocked from
- * the CodeViewer/AI carve-out that gates other panels.
+ * Single Columns detail tab — no viewer needed.
*/
export function ExternalTablesPanel() {
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/modules/sql-editor/components/Panels/Panels.tsx b/frontend/src/modules/sql-editor/components/Panels/Panels.tsx
index e86c38feb3..825474a48f 100644
--- a/frontend/src/modules/sql-editor/components/Panels/Panels.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/Panels.tsx
@@ -54,25 +54,16 @@ const AIPaneFallback = () => (
);
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue`.
- *
- * The host shell beneath `<EditorPanel>`. Two render modes:
+ * The host shell beneath the `<TabList>` in `SQLEditorHomePage`'s main
+ * column. Two render modes:
* - `viewState.view === "CODE"` (or no viewState) — shows the saved query
* editor (`<StandardPanel>`) or terminal (`<TerminalPanel>`) based on
- * the active tab's mode. The Vue version did this selection in
- * `EditorPanel.vue` and passed the result into `<Panels>` via a named
- * slot; React inlines it here since slots-as-children don't survive
- * the cross-framework boundary cleanly.
+ * the active tab's mode.
* - any other `viewState.view` — shows a metadata browser surface
* (info / tables / views / functions / etc.) with the schema-select
* toolbar above. The AI pane mounts to the right via a horizontal
* resizable split when the user has both the AI panel and a
- * "code-viewer" surface open (matches the Vue `isShowingCode`
- * gate that previously hoisted the AI pane up from `CodeViewer.vue`).
- *
- * The Vue version's `availableActions` computation lives in
- * `useAvailableActions` (already React-side); the schema-sync watchers
- * move into React `useEffect`s here.
+ * "code-viewer" surface open (`isShowingCode`).
*/
export function Panels() {
const { t } = useTranslation();
@@ -82,12 +73,6 @@ export function Panels() {
const { database } = useConnectionOfCurrentSQLEditorTab();
const tab = useCurrentSQLEditorTab();
- // Subscribe to `mode` as its own primitive — Pinia's tabStore mutates
- // the tab proxy in place via `Object.assign`, so `() => tabStore
- // .currentTab` only fires Vue's watch on tab-switches (proxy
- // reference changes), not on `mode` flipping between "SAVED_QUERY" and
- // "ADMIN" within the same tab. Without this, clicking the admin-mode
- // button doesn't swap to the `TerminalPanel`.
const tabMode = useSQLEditorTabState(
(s) => s.tabsById.get(s.currentTabId)?.mode
);
@@ -104,10 +89,7 @@ export function Panels() {
const { setSchema, updateViewState } = useViewStateNav();
const { execute } = useExecuteSQL();
- // AI plugin "run-statement" handler — mirrors Vue's
- // `useEmitteryEventListener(AIEvents, "run-statement", ...)`. The
- // event bus is a module-level singleton so we don't need to traverse
- // a Vue provide chain to access it.
+ // Run statements the AI chat sends via the "run-statement" event.
useEffect(() => {
const off = aiContextEvents.on(
"run-statement",
@@ -142,8 +124,7 @@ export function Panels() {
});
// Pin the active schema to a sensible default whenever the tab,
- // database metadata, or current schema changes (mirrors the Vue
- // immediate watcher).
+ // database metadata, or current schema changes.
const tabId = tab?.id;
const currentSchema = tab?.viewState?.schema;
useEffect(() => {
diff --git a/frontend/src/modules/sql-editor/components/Panels/SequencesPanel/SequencesPanel.tsx b/frontend/src/modules/sql-editor/components/Panels/SequencesPanel/SequencesPanel.tsx
index ba52248da4..9eb93ee0f0 100644
--- a/frontend/src/modules/sql-editor/components/Panels/SequencesPanel/SequencesPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/SequencesPanel/SequencesPanel.tsx
@@ -7,7 +7,6 @@ import { useViewStateNav } from "../common/useViewStateNav";
import { SequencesTable } from "./SequencesTable";
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/Panels/SequencesPanel/*`.
* List-only panel — clicking a row updates `viewState.detail.sequence`
* to scroll that row into view (no separate detail surface).
*/
diff --git a/frontend/src/modules/sql-editor/components/Panels/TablesPanel/TableDetail.tsx b/frontend/src/modules/sql-editor/components/Panels/TablesPanel/TableDetail.tsx
index bdda615406..8cf8f6069d 100644
--- a/frontend/src/modules/sql-editor/components/Panels/TablesPanel/TableDetail.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/TablesPanel/TableDetail.tsx
@@ -48,7 +48,7 @@ export function TableDetail({ db, database, schema, table }: TableDetailProps) {
const [keyword, setKeyword] = useState("");
// Sync the active tab with the detail anchor (column / index / FK /
- // partition / trigger). Mirrors the Vue watch in TableDetail.vue.
+ // partition / trigger).
useEffect(() => {
if (!detail?.table) return;
if (detail.column) {
diff --git a/frontend/src/modules/sql-editor/components/Panels/TriggersPanel/TriggersPanel.tsx b/frontend/src/modules/sql-editor/components/Panels/TriggersPanel/TriggersPanel.tsx
index 162366fd18..bbdcfb4aa0 100644
--- a/frontend/src/modules/sql-editor/components/Panels/TriggersPanel/TriggersPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/TriggersPanel/TriggersPanel.tsx
@@ -10,9 +10,8 @@ import { useViewStateNav } from "../common/useViewStateNav";
import { TriggersTable } from "./TriggersTable";
/**
- * Standalone TriggersPanel. The Vue version reads `viewState.table` to
- * scope the trigger list to a specific table; the React port preserves
- * that behavior.
+ * Standalone TriggersPanel. Reads `viewState.table` to scope the trigger
+ * list to a specific table.
*/
export function TriggersPanel() {
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/CodeViewer.tsx b/frontend/src/modules/sql-editor/components/Panels/common/CodeViewer.tsx
index 61575a7daf..f1fdc5288b 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/CodeViewer.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/common/CodeViewer.tsx
@@ -37,20 +37,19 @@ interface CodeViewerProps {
onBack?: () => void;
/** Replaces the default back-button + title row in the header. */
titlePrefix?: ReactNode;
- /** Slot above the Monaco editor; mirrors Vue's `content-prefix`. */
+ /** Slot above the Monaco editor. */
contentPrefix?: ReactNode;
headerClassName?: string;
}
/**
- * React port of the Vue `CodeViewer`. Renders header (back button +
- * format toggle + OpenAIButton) and a read-only Monaco editor.
+ * Renders header (back button + format toggle + OpenAIButton) and a
+ * read-only Monaco editor.
*
- * Note on AI integration: the AIChatToSQL side pane lives in
- * `Panels.vue` and is gated by `uiStore.showAIPanel && uiStore.isShowingCode`.
- * This component flips `isShowingCode` on mount so the host knows when
- * to render the AI pane next to it. Same parity as the Vue CodeViewer
- * NSplit, just hoisted one level up.
+ * Note on AI integration: the AIChatToSQL side pane lives in `Panels` and
+ * is gated by `showAIPanel && isShowingCode`. This component flips
+ * `isShowingCode` on mount so the host knows when to render the AI pane
+ * next to it.
*/
export function CodeViewer({
db,
@@ -113,9 +112,9 @@ export function CodeViewer({
[]
);
- // Tell Panels.vue to host the AIChatToSQL pane while a code surface is
+ // Tell `Panels` to host the AIChatToSQL pane while a code surface is
// mounted. Cleared on unmount so navigating back to the list view drops
- // the pane (matches Vue CodeViewer's auto-unmount on detail-clear).
+ // the pane.
useEffect(() => {
setIsShowingCode(true);
return () => {
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/DefinitionViewer.tsx b/frontend/src/modules/sql-editor/components/Panels/common/DefinitionViewer.tsx
index 647c24a257..4c97305d8b 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/DefinitionViewer.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/common/DefinitionViewer.tsx
@@ -21,10 +21,9 @@ interface DefinitionViewerProps {
}
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/Panels/ViewsPanel/DefinitionViewer.vue`.
* Bare Monaco read-only viewer; `format` is owned by the parent (the
- * ViewsPanel detail header has the toggle). Sets `uiStore.isShowingCode`
- * on mount so `Panels.vue` renders the AIChatToSQL pane next to it.
+ * ViewsPanel detail header has the toggle). Sets `isShowingCode` on mount
+ * so `Panels` renders the AIChatToSQL pane next to it.
*/
export function DefinitionViewer({ db, code, format }: DefinitionViewerProps) {
const setIsShowingCode = useSQLEditorStore((s) => s.setIsShowingCode);
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/EllipsisCell.tsx b/frontend/src/modules/sql-editor/components/Panels/common/EllipsisCell.tsx
index db49cb9779..6f14f469b7 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/EllipsisCell.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/common/EllipsisCell.tsx
@@ -12,7 +12,6 @@ interface EllipsisCellProps {
}
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/common/EllipsisCell.vue`.
* Renders truncated text with keyword highlighting; on hover, when the
* text is actually overflowing, a tooltip portals out the full content
* (also highlighted, or a custom `tooltip` string when provided).
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/PanelSearchBox.tsx b/frontend/src/modules/sql-editor/components/Panels/common/PanelSearchBox.tsx
index 45e4fe0235..9765c05950 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/PanelSearchBox.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/common/PanelSearchBox.tsx
@@ -12,14 +12,8 @@ interface PanelSearchBoxProps {
}
/**
- * 1:1 React port of `frontend/src/components/v2/Form/SearchBox.vue` for
- * the SQL Editor panels. Naive UI's NInput at `size="small"` renders at
- * 28px tall with a leading prefix icon and a clearable affordance —
- * this wrapper recreates that exactly so the panel toolbar matches the
- * pre-migration look.
- *
- * Width grows to fill the flex container, capped at 18rem (matching
- * the Vue SearchBox's `max-width: 18rem; flex: 1 1 0%`).
+ * Search box for the SQL Editor panels, with a leading search icon and a
+ * clear button. Width grows to fill the flex container, capped at 18rem.
*/
export function PanelSearchBox({
value,
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/SchemaSelectToolbar.tsx b/frontend/src/modules/sql-editor/components/Panels/common/SchemaSelectToolbar.tsx
index bfcceb526b..809e3d85b2 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/SchemaSelectToolbar.tsx
+++ b/frontend/src/modules/sql-editor/components/Panels/common/SchemaSelectToolbar.tsx
@@ -12,11 +12,7 @@ import { hasSchemaProperty } from "@/utils";
import { useViewStateNav } from "./useViewStateNav";
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/Panels/common/SchemaSelectToolbar.vue`
- * (`simple` mode — the only mode `Panels.vue` actually uses).
- *
- * Renders nothing for engines without a schema concept (matching Vue's
- * `v-if="showSchemaSelect"`).
+ * Renders nothing for engines without a schema concept.
*/
export function SchemaSelectToolbar() {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/useAIActions.ts b/frontend/src/modules/sql-editor/components/Panels/common/useAIActions.ts
index 3446c6e174..1c50d17588 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/useAIActions.ts
+++ b/frontend/src/modules/sql-editor/components/Panels/common/useAIActions.ts
@@ -18,10 +18,9 @@ interface UseAIActionsOptions {
}
/**
- * React port of `frontend/src/plugins/ai/components/editor-actions.ts`.
* Registers AI context-menu actions on the underlying Monaco editor.
- * Reads `aiSetting.enabled` from the same Pinia setting store the Vue
- * version uses, gating registration the same way.
+ * Registration is gated on the AI setting's `enabled` flag from the app
+ * store.
*/
export function useAIActions({
monaco,
@@ -33,7 +32,7 @@ export function useAIActions({
const getOrFetchSettingByName = useAppStore((s) => s.getOrFetchSettingByName);
// Subscribe to the AI setting so the registered Monaco actions re-register
// or unregister live when an admin toggles AI access while the editor is
- // mounted (matches the Vue `watchEffect` behavior in `editor-actions.ts`).
+ // mounted.
const aiEnabled = useAppStore((s) => {
const setting = s.getSettingByName(Setting_SettingName.AI);
return setting?.value?.value?.case === "ai"
diff --git a/frontend/src/modules/sql-editor/components/Panels/common/useViewStateNav.ts b/frontend/src/modules/sql-editor/components/Panels/common/useViewStateNav.ts
index e75b4af9e4..10c1f6db8d 100644
--- a/frontend/src/modules/sql-editor/components/Panels/common/useViewStateNav.ts
+++ b/frontend/src/modules/sql-editor/components/Panels/common/useViewStateNav.ts
@@ -7,11 +7,8 @@ import { defaultViewState } from "@/types";
import type { EditorPanelViewState } from "@/types/sqlEditor/tabViewState";
/**
- * React equivalent of Vue's `useCurrentTabViewStateContext` for the
- * read/write surface used by panels. Exposes the current tab's
- * `viewState` plus helpers to patch it. The bidirectional
- * connection.schema ↔ viewState.schema sync stays in `Panels.vue`
- * because that file remains the Vue host through Stage 16.
+ * Read/write surface used by panels. Exposes the current tab's
+ * `viewState` plus helpers to patch it.
*/
export function useViewStateNav() {
const viewState = useSQLEditorTabState(
diff --git a/frontend/src/modules/sql-editor/components/PanelsPage.tsx b/frontend/src/modules/sql-editor/components/PanelsPage.tsx
deleted file mode 100644
index eeead4ed4e..0000000000
--- a/frontend/src/modules/sql-editor/components/PanelsPage.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate `<Panels>` via
- * `mount.ts`'s `pageDirs` lookup (it scans for `<page>.tsx` files at
- * the registered roots, not subdirectories).
- *
- * Vue caller mounts this with `<ReactPageMount page="PanelsPage">`.
- * Removed when `EditorPanel.vue` flips to React in the next slice of
- * Stage 21 and imports `Panels` directly.
- */
-export { Panels as PanelsPage } from "./Panels/Panels";
diff --git a/frontend/src/modules/sql-editor/components/QueryContextSettingPopover.tsx b/frontend/src/modules/sql-editor/components/QueryContextSettingPopover.tsx
index c9da96f610..8d43164971 100644
--- a/frontend/src/modules/sql-editor/components/QueryContextSettingPopover.tsx
+++ b/frontend/src/modules/sql-editor/components/QueryContextSettingPopover.tsx
@@ -39,7 +39,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/QueryContextSettingPopover.vue.
* Popover for selecting query data source, Redis command mode, and max row count.
*/
export function QueryContextSettingPopover({
diff --git a/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.test.tsx b/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.test.tsx
index e68a1818d4..513bba83ac 100644
--- a/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.test.tsx
+++ b/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.test.tsx
@@ -29,9 +29,6 @@ vi.mock("react-i18next", () => ({
),
}));
-// `useConnectionOfCurrentSQLEditorTab` now lives on the Pinia bridge hook
-// (the deleted tab-vue-state shim re-exported it). It returns PLAIN values
-// `{ connection, database, instance, environment }` — no Vue refs.
vi.mock("@/modules/sql-editor/hooks/useSQLEditorState", () => ({
useConnectionOfCurrentSQLEditorTab: mocks.useConnectionOfCurrentSQLEditorTab,
}));
diff --git a/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.tsx b/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.tsx
index a73b2ebee9..147bf5dec2 100644
--- a/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.tsx
+++ b/frontend/src/modules/sql-editor/components/ReadonlyModeNotSupported.tsx
@@ -5,7 +5,6 @@ import { useConnectionOfCurrentSQLEditorTab } from "@/modules/sql-editor/hooks/u
import { AdminModeButton } from "./AdminModeButton";
/**
- * Replaces frontend/src/views/sql-editor/EditorPanel/ReadonlyModeNotSupported.vue.
* Shown when the current tab targets an instance without read-only mode —
* prompts the user to switch to admin mode instead.
*/
diff --git a/frontend/src/modules/sql-editor/components/RequestQueryButton.test.tsx b/frontend/src/modules/sql-editor/components/RequestQueryButton.test.tsx
index 36ad37faaf..a3b5db3530 100644
--- a/frontend/src/modules/sql-editor/components/RequestQueryButton.test.tsx
+++ b/frontend/src/modules/sql-editor/components/RequestQueryButton.test.tsx
@@ -19,8 +19,6 @@ const mocks = vi.hoisted(() => ({
allowRequestRole: boolean;
},
roleList: [] as Array<{ name: string; permissions: string[] }>,
- useSQLEditorVueState: vi.fn(),
- useSubscriptionV1Store: vi.fn(),
hasFeature: vi.fn(() => true),
loadSubscription: vi.fn(),
hasInstanceFeature: vi.fn(() => true),
@@ -49,7 +47,6 @@ vi.mock("./theme/useActiveSQLEditorTheme", () => ({
}));
vi.mock("@/stores", () => ({
- useSubscriptionV1Store: mocks.useSubscriptionV1Store,
hasFeature: mocks.hasFeature,
}));
@@ -76,10 +73,6 @@ vi.mock("@/stores/app", () => {
};
});
-vi.mock("@/modules/sql-editor/store/editor-vue-state", () => ({
- useSQLEditorVueState: mocks.useSQLEditorVueState,
-}));
-
vi.mock("@/utils/v1/databaseResource", () => ({
parseStringToResource: mocks.parseStringToResource,
}));
@@ -219,7 +212,6 @@ const setupDefaultMocks = (allowJIT = false, allowRequestRole = true) => {
permissions: ["bb.sql.select", "bb.sql.explain"],
},
];
- mocks.useSQLEditorVueState.mockReturnValue({ project: "projects/proj1" });
mocks.hasInstanceFeature.mockReturnValue(false);
mocks.appHasFeature.mockReturnValue(true);
};
diff --git a/frontend/src/modules/sql-editor/components/ResultPanel/BatchQuerySelect.tsx b/frontend/src/modules/sql-editor/components/ResultPanel/BatchQuerySelect.tsx
index 9eb8efe1fd..b9577b1d3a 100644
--- a/frontend/src/modules/sql-editor/components/ResultPanel/BatchQuerySelect.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultPanel/BatchQuerySelect.tsx
@@ -67,8 +67,6 @@ const isDatabaseQueryFailed = (item: BatchQueryItem) =>
);
/**
- * Replaces `frontend/src/views/sql-editor/EditorPanel/ResultPanel/BatchQuerySelect.vue`.
- *
* Renders the batch-query tab strip above the result panel: one tab per
* queried database, with environment-tinted backgrounds, an empty-results
* toggle, a batch-export drawer, and a right-click context menu (close /
@@ -129,8 +127,7 @@ export function BatchQuerySelect({
return items.filter((item) => !isEmptyQueryItem(item));
}, [items, showEmpty, showEmptySwitch]);
- // Auto-select a proper database when the items list changes (mirrors
- // the Vue `watch(filteredItems, ..., { immediate: true })`).
+ // Auto-select a proper database when the items list changes.
useEffect(() => {
if (
!selectedDatabase ||
diff --git a/frontend/src/modules/sql-editor/components/ResultPanel/ContextMenu.tsx b/frontend/src/modules/sql-editor/components/ResultPanel/ContextMenu.tsx
index 4c5fb0a21d..cce57add71 100644
--- a/frontend/src/modules/sql-editor/components/ResultPanel/ContextMenu.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultPanel/ContextMenu.tsx
@@ -34,7 +34,6 @@ const ACTION_I18N_KEYS: Record<CloseTabAction, string> = {
};
/**
- * Replaces `frontend/src/views/sql-editor/EditorPanel/ResultPanel/ContextMenu.vue`.
* Wraps a single tab button with a right-click context menu. Selecting an
* action emits `close-tab` on `resultTabEvents`; the parent
* `BatchQuerySelect` subscribes and performs the close.
diff --git a/frontend/src/modules/sql-editor/components/ResultPanel/DatabaseQueryContext.tsx b/frontend/src/modules/sql-editor/components/ResultPanel/DatabaseQueryContext.tsx
index 5fb4fb1251..856df843dd 100644
--- a/frontend/src/modules/sql-editor/components/ResultPanel/DatabaseQueryContext.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultPanel/DatabaseQueryContext.tsx
@@ -19,14 +19,13 @@ export interface DatabaseQueryContextProps {
}
/**
- * React port of `DatabaseQueryContext.vue`. Three render paths:
+ * Three render paths:
* - EXECUTING — spinner + elapsed-time + cancel button
* - CANCELLED — re-execute button
* - default — `<ResultView>` with the executed result set
*
- * Auto-runs the query when status flips to `PENDING`. Mirrors the Vue
- * watcher behavior — same `useExecuteSQL().runQuery` entrypoint that
- * `EditorMain.tsx` already uses from React.
+ * Auto-runs the query via `useExecuteSQL().runQuery` when status flips to
+ * `PENDING`.
*/
export function DatabaseQueryContext({
database,
@@ -37,8 +36,8 @@ export function DatabaseQueryContext({
const { runQuery } = useExecuteSQL();
const isExecuting = context.status === "EXECUTING";
- // Trigger run on status === PENDING. Pinia's reactivity already
- // surfaces context.status changes through props; the effect dep array
+ // Trigger run on status === PENDING. Tab store updates surface
+ // context.status changes through props; the effect dep array
// re-fires whenever the status flips back to PENDING (which the
// re-execute button below does).
const lastRanContextRef = useRef<string | null>(null);
diff --git a/frontend/src/modules/sql-editor/components/ResultPanel/ResultPanel.tsx b/frontend/src/modules/sql-editor/components/ResultPanel/ResultPanel.tsx
index 80c866b8aa..24867a6a4e 100644
--- a/frontend/src/modules/sql-editor/components/ResultPanel/ResultPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultPanel/ResultPanel.tsx
@@ -25,8 +25,6 @@ import { BatchQuerySelect } from "./BatchQuerySelect";
import { DatabaseQueryContext } from "./DatabaseQueryContext";
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/ResultPanel/ResultPanel.vue`.
- *
* Hosts the batch-query database selector at the top, then a card-style
* tab strip of query contexts for the currently selected database, with
* each tab rendering a `<DatabaseQueryContext>` (spinner / cancelled /
@@ -75,8 +73,7 @@ export function ResultPanel() {
const hasMultipleContexts = (queryContexts?.length ?? 0) > 1;
- // Mirror Vue's `watch(queryContexts.[0]?.id, ..., { immediate: true })`:
- // when the head of the contexts list changes, switch the active tab to
+ // When the head of the contexts list changes, switch the active tab to
// it (newest run becomes selected).
const headId = queryContexts?.[0]?.id;
useEffect(() => {
@@ -275,8 +272,8 @@ const CLOSE_ACTION_KEYS: Record<CloseAction, string> = {
/**
* Right-click context menu wrapper for a single tab. Local to ResultPanel
* so the close-tab handler is delivered directly via prop, sidestepping
- * the cross-component `resultTabEvents` channel that Stage 18's
- * `BatchQuerySelect` already owns for its database-strip tabs.
+ * the cross-component `resultTabEvents` channel that `BatchQuerySelect`
+ * owns for its database-strip tabs.
*/
function TabContextMenu({
children,
diff --git a/frontend/src/modules/sql-editor/components/ResultPanel/resultTabContext.ts b/frontend/src/modules/sql-editor/components/ResultPanel/resultTabContext.ts
index 69841744c3..02449b0578 100644
--- a/frontend/src/modules/sql-editor/components/ResultPanel/resultTabContext.ts
+++ b/frontend/src/modules/sql-editor/components/ResultPanel/resultTabContext.ts
@@ -11,7 +11,7 @@ export type CloseTabAction =
* right-click context menu (mounted once per database tab) to broadcast
* close-tab actions back to the parent. Lives outside any component so
* the menu's child trigger and the parent's listener can communicate
- * without a Vue/React provide chain.
+ * without a context provider.
*
* The emitter is *only* used by `BatchQuerySelect` for its database
* tabs. The inner per-query-context tabs in `ResultPanel.tsx` use a
diff --git a/frontend/src/modules/sql-editor/components/ResultPanelPage.tsx b/frontend/src/modules/sql-editor/components/ResultPanelPage.tsx
deleted file mode 100644
index aef6220bdc..0000000000
--- a/frontend/src/modules/sql-editor/components/ResultPanelPage.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate the React
- * `<ResultPanel>` via `mount.ts`'s `pageDirs` lookup (it scans for
- * `<page>.tsx` files at the registered roots, not subdirectories).
- *
- * Vue caller mounts this with `<ReactPageMount page="ResultPanelPage">`.
- * The shim is removed when `StandardPanel.vue` flips to React in the
- * next slice of Stage 21 and imports `ResultPanel` directly.
- */
-export { ResultPanel as ResultPanelPage } from "./ResultPanel/ResultPanel";
diff --git a/frontend/src/modules/sql-editor/components/ResultView/ColumnSortedIcon.tsx b/frontend/src/modules/sql-editor/components/ResultView/ColumnSortedIcon.tsx
index 014fab6e7d..8b1c05063e 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/ColumnSortedIcon.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/ColumnSortedIcon.tsx
@@ -10,7 +10,7 @@ export function ColumnSortedIcon({ isSorted }: ColumnSortedIconProps) {
const showAsc = isSorted === "asc";
// Explicit `size-3.5` on both wrapper and icon so Lucide's intrinsic
// `width="24" height="24"` SVG attributes can't beat the CSS in any
- // browser. Matches the Vue version's compact 14px sort glyph.
+ // browser.
return (
<span className="inline-flex size-3.5 opacity-80 shrink-0">
{showAsc ? (
diff --git a/frontend/src/modules/sql-editor/components/ResultView/DetailPanel.tsx b/frontend/src/modules/sql-editor/components/ResultView/DetailPanel.tsx
index 69f6ec134e..c1b9f7af89 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/DetailPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/DetailPanel.tsx
@@ -244,8 +244,7 @@ export function DetailPanel({
[matchCount]
);
- // Replicates Vue's onKeyStroke("ArrowUp"/"ArrowDown") row navigation while
- // the panel is open.
+ // ArrowUp / ArrowDown row navigation while the panel is open.
useEffect(() => {
if (!detail) return;
const handler = (e: KeyboardEvent) => {
diff --git a/frontend/src/modules/sql-editor/components/ResultView/ResultView.tsx b/frontend/src/modules/sql-editor/components/ResultView/ResultView.tsx
index 16e6589a77..f075620fc5 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/ResultView.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/ResultView.tsx
@@ -56,8 +56,7 @@ type ViewMode = "SINGLE-RESULT" | "MULTI-RESULT" | "EMPTY" | "ERROR";
* Top-level wrapper for one database's query result. Routes to a single
* `SingleResultView`, a multi-tab list of them, an empty placeholder, or
* a result-set-level error view (with optional access-request /
- * sync-database affordances). Phase 7's caller swap mounts this via
- * `<ReactPageMount page="ResultView" ...>`.
+ * sync-database affordances).
*/
export function ResultView({
executeParams,
@@ -81,8 +80,8 @@ export function ResultView({
const getOrFetchPolicyByParentAndType = useAppStore(
(s) => s.getOrFetchPolicyByParentAndType
);
- // Settings pages populate the env policy in Pinia, but the SQL editor
- // route doesn't fetch it on its own — self-fetch so the read above
+ // Settings pages populate the env policy in the app store, but the SQL
+ // editor route doesn't fetch it on its own — self-fetch so the read above
// resolves to a real policy (not the empty fallback) and copy-disable
// gates fire even on a fresh editor visit.
useEffect(() => {
@@ -381,8 +380,8 @@ export function ResultView({
}
// ---------------------------------------------------------------------------
-// Inline SyncDatabaseButton — replaces frontend/src/components/DatabaseDetail/SyncDatabaseButton.vue.
-// Only used by the result-set-level "resource not found" branch above.
+// Inline SyncDatabaseButton — only used by the result-set-level
+// "resource not found" branch above.
// ---------------------------------------------------------------------------
function SyncDatabaseButton({ database }: { database: Database }) {
diff --git a/frontend/src/modules/sql-editor/components/ResultView/SelectionCopyTooltips.tsx b/frontend/src/modules/sql-editor/components/ResultView/SelectionCopyTooltips.tsx
index 7ed7834a45..3301c0af4d 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/SelectionCopyTooltips.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/SelectionCopyTooltips.tsx
@@ -12,10 +12,9 @@ import { formatAsCSV, formatAsSQL, formatAsText } from "./copy-formats";
// react-i18next's `Trans` wipes children when placeholder tags are empty
// (`<action></action>` calls `React.cloneElement(component, {}, ...[])`,
-// which replaces the original children with nothing). The Vue `i18n-t`
-// preserved slot content; react-i18next doesn't. We split the localized
-// template manually at the placeholder positions so the React Buttons
-// keep their own children.
+// which replaces the original children with nothing). We split the localized
+// template manually at the placeholder positions so the Buttons keep their
+// own children.
function splitTemplate(template: string) {
const tokens: Array<string | "action" | "button"> = [];
const regex = /<action><\/action>|<button><\/button>/g;
diff --git a/frontend/src/modules/sql-editor/components/ResultView/SingleResultView.tsx b/frontend/src/modules/sql-editor/components/ResultView/SingleResultView.tsx
index 2689541754..9c5871fa7f 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/SingleResultView.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/SingleResultView.tsx
@@ -427,8 +427,7 @@ function SingleResultViewInner({
// `result.statement`. The backend may rewrite the result statement
// with an auto-appended LIMIT for non-admin reads — re-running that
// rewritten SQL on the export path silently caps the exported rows
- // even when the user asks for more. This matches the Vue
- // multi-result export, which already used `executeParams.statement`.
+ // even when the user asks for more.
onExport?.({ ...req, statement: params.statement });
};
diff --git a/frontend/src/modules/sql-editor/components/ResultView/TableCell.tsx b/frontend/src/modules/sql-editor/components/ResultView/TableCell.tsx
index 183bf99a7a..b60b250f53 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/TableCell.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/TableCell.tsx
@@ -58,7 +58,6 @@ export function TableCell({
[value, columnType, binaryFormat]
);
- // ResizeObserver replaces Vue's `useResizeObserver(cellRef, ...)`.
useEffect(() => {
const cell = cellRef.current;
const wrapper = wrapperRef.current;
diff --git a/frontend/src/modules/sql-editor/components/ResultView/VirtualDataTable.tsx b/frontend/src/modules/sql-editor/components/ResultView/VirtualDataTable.tsx
index d650a6bc55..6da5eaa272 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/VirtualDataTable.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/VirtualDataTable.tsx
@@ -66,11 +66,10 @@ export interface VirtualDataTableProps {
}
/**
- * Virtualized result-table grid. Replaces the Naive UI `NVirtualList` host
- * with `@tanstack/react-virtual`'s `useVirtualizer`. The header is a
- * separate sticky row outside the virtual scroller so it can stay fixed
- * during vertical scroll without fighting the virtualizer's internal
- * positioning.
+ * Virtualized result-table grid built on `@tanstack/react-virtual`'s
+ * `useVirtualizer`. The header is a separate sticky row outside the virtual
+ * scroller so it can stay fixed during vertical scroll without fighting the
+ * virtualizer's internal positioning.
*/
export const VirtualDataTable = forwardRef<
VirtualDataTableHandle,
@@ -503,9 +502,8 @@ export const VirtualDataTable = forwardRef<
className={cn(
"relative shrink-0 text-sm text-control leading-5 whitespace-nowrap break-all border-block-border border-b group-even:bg-control-bg/40",
!isLastCol && "border-r",
- // Match the Vue version: an active (search-matched) row
- // highlights every cell in that row, not just the index
- // column.
+ // An active (search-matched) row highlights every
+ // cell in that row, not just the index column.
// NOTE: opacity may need visual tuning on dark themes
isActive &&
(hasStrongActiveHighlight
diff --git a/frontend/src/modules/sql-editor/components/ResultView/context.tsx b/frontend/src/modules/sql-editor/components/ResultView/context.tsx
index 7c1428d413..558cdd2af2 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/context.tsx
+++ b/frontend/src/modules/sql-editor/components/ResultView/context.tsx
@@ -352,8 +352,7 @@ export function SQLResultViewProvider({
]
);
- // Click outside the result-scroll buttons → deselect (mirrors Vue
- // global click listener in `selection-logic.ts`).
+ // Click outside the result-scroll buttons → deselect.
useEffect(() => {
if (copying) return;
const handler = (e: MouseEvent) => {
diff --git a/frontend/src/modules/sql-editor/components/ResultView/useTableResize.ts b/frontend/src/modules/sql-editor/components/ResultView/useTableResize.ts
index 07d6125c2f..c8443eac70 100644
--- a/frontend/src/modules/sql-editor/components/ResultView/useTableResize.ts
+++ b/frontend/src/modules/sql-editor/components/ResultView/useTableResize.ts
@@ -43,8 +43,7 @@ const measureTextWidth = (text: string, font: string): number => {
/**
* Measures and tracks per-column widths for the virtualized result-table
- * grid. Replaces Vue's `useTableResize` composable. Returns widths inclusive
- * of the leading index column at slot 0.
+ * grid. Returns widths inclusive of the leading index column at slot 0.
*/
export function useTableResize({
columns,
@@ -96,8 +95,8 @@ export function useTableResize({
}, [computeInitialWidths]);
// Recompute when columns change identity OR window/container width changes.
- // We deliberately key on columns.length+col ids, not deep-watch, since the
- // Vue version did the same via `watchDebounced` of column references.
+ // We deliberately key on columns.length+col ids rather than deep-comparing
+ // the columns.
const columnsKey = useMemo(
() => `${columns.length}:${columns.map((c) => c.id).join(",")}`,
[columns]
diff --git a/frontend/src/modules/sql-editor/components/ResultViewPage.tsx b/frontend/src/modules/sql-editor/components/ResultViewPage.tsx
deleted file mode 100644
index 3df351e959..0000000000
--- a/frontend/src/modules/sql-editor/components/ResultViewPage.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate the `<ResultView>`
- * root via `mount.ts`'s `pageDirs` lookup (it scans for `<page>.tsx`
- * files at the registered roots, not subdirectories).
- *
- * Vue callers mount this with `<ReactPageMount page="ResultViewPage"
- * :page-props="{ executeParams, database, resultSet, loading, dark }">`
- * to render the React result-view stack inside the still-Vue
- * `DatabaseQueryContext.vue` and `TerminalPanel.vue` shells. Phase 21
- * flips those Vue hosts to React, after which this shim can be deleted.
- */
-export { ResultView as ResultViewPage } from "./ResultView/ResultView";
diff --git a/frontend/src/modules/sql-editor/components/SQLEditorChromeLayout.test.ts b/frontend/src/modules/sql-editor/components/SQLEditorChromeLayout.test.ts
deleted file mode 100644
index 30a31601ec..0000000000
--- a/frontend/src/modules/sql-editor/components/SQLEditorChromeLayout.test.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const componentsDir = join(process.cwd(), "src/modules/sql-editor/components");
-
-describe("SQL Editor chrome layout", () => {
- test("mounts the shared SQL Editor header above the split panels", () => {
- const source = readFileSync(
- join(componentsDir, "SQLEditorHomePage.tsx"),
- "utf-8"
- );
-
- expect(source).toContain("SQLEditorHeader");
- expect(source.indexOf("<SQLEditorHeader />")).toBeLessThan(
- source.indexOf("<PanelGroup")
- );
- });
-
- test("keeps project switching out of the aside panel", () => {
- const source = readFileSync(join(componentsDir, "AsidePanel.tsx"), "utf-8");
-
- expect(source).not.toContain("ProjectSelect");
- });
-});
diff --git a/frontend/src/modules/sql-editor/components/SQLEditorHomePage.tsx b/frontend/src/modules/sql-editor/components/SQLEditorHomePage.tsx
index 72dbda5299..c155cd6863 100644
--- a/frontend/src/modules/sql-editor/components/SQLEditorHomePage.tsx
+++ b/frontend/src/modules/sql-editor/components/SQLEditorHomePage.tsx
@@ -45,25 +45,18 @@ import {
} from "@/utils";
/**
- * React port of `frontend/src/views/sql-editor/SQLEditorHomePage.vue`.
- *
* Top-level shell of the SQL Editor route:
* - desktop: a horizontal split between `<AsidePanel>` (workspace
* tree, etc.) and the main column (`<TabList>` + `<Panels>`).
* - mobile (window width < 800px): the aside collapses behind a
* floating chevron + drawer.
*
- * Two emittery listeners survive from the Vue version:
+ * Two emittery listeners:
* - `alter-schema` opens a new tab to the plan editor with a
* pre-filled `ALTER TABLE` statement.
* - `insert-at-caret` flips back to the CODE view and stages the
- * content into `pendingInsertAtCaret`; the React `<SQLEditor>` reads
- * that ref and inserts at the cursor.
- *
- * The Vue Router route entry lives in `router/sqlEditor.ts` as a
- * tiny inline `defineComponent` whose sole job is to mount this
- * React tree via `<ReactPageMount page="SQLEditorHomePage">` — no
- * per-route `.vue` file remains.
+ * content into `pendingInsertAtCaret`; `<SQLEditor>` reads it and
+ * inserts at the cursor.
*/
export function SQLEditorHomePage() {
const { t } = useTranslation();
@@ -98,7 +91,7 @@ export function SQLEditorHomePage() {
const [sidebarExpanded, setSidebarExpanded] = useState(false);
// alter-schema: open a new tab to the plan editor with a pre-filled
- // ALTER TABLE template (mirrors Vue's `useEmitteryEventListener`).
+ // ALTER TABLE template.
useEffect(() => {
const off = sqlEditorEvents.on(
"alter-schema",
@@ -141,8 +134,8 @@ export function SQLEditorHomePage() {
}, [navigate, t]);
// insert-at-caret: flip view to CODE, stage content into
- // pendingInsertAtCaret. The React `<SQLEditor>` reads the same Pinia
- // ref and inserts at the cursor.
+ // pendingInsertAtCaret. `<SQLEditor>` reads it from the SQL Editor
+ // store and inserts at the cursor.
useEffect(() => {
const off = sqlEditorEvents.on(
"insert-at-caret",
@@ -250,10 +243,6 @@ export function SQLEditorHomePage() {
<ConnectionPanel />
- {/* Diagnostic teleport target — the Vue version reused
- `#sql-editor-debug`. Skipped here; the legacy markers
- (`isDisconnected`, `currentTab.id`, `currentTab.connection`)
- are still inspectable via Vue devtools on the Pinia store. */}
<DebugProbe
isDisconnected={isDisconnected}
tabId={tab?.id}
@@ -264,9 +253,8 @@ export function SQLEditorHomePage() {
}
/**
- * Renders the same `[Page]…` debug strings the Vue version teleported
- * into `#sql-editor-debug`. The portal is no-op when that target isn't
- * in the DOM (production builds), matching the legacy behavior.
+ * Renders the `[Page]…` debug strings into `#sql-editor-debug`. The
+ * portal is a no-op when that target isn't in the DOM.
*/
function DebugProbe({
isDisconnected,
diff --git a/frontend/src/modules/sql-editor/components/SQLEditorLayout.tsx b/frontend/src/modules/sql-editor/components/SQLEditorLayout.tsx
index 8ccb692213..e51f830689 100644
--- a/frontend/src/modules/sql-editor/components/SQLEditorLayout.tsx
+++ b/frontend/src/modules/sql-editor/components/SQLEditorLayout.tsx
@@ -28,17 +28,15 @@ function SQLEditorThemeRoot({ children }: Readonly<{ children: ReactNode }>) {
}
/**
- * React port of `frontend/src/layouts/SQLEditorLayout.vue`.
- *
* Top-level shell of the SQL Editor route. Wires up:
- * - the legacy `#sql-editor-debug` teleport target (kept hidden by
- * default, used by debug `<li>` strings the inner shells emit).
+ * - the `#sql-editor-debug` portal target (kept hidden by default, used
+ * by the debug `<li>` strings `SQLEditorHomePage` emits).
* - the React `<BannersWrapper>` at the top.
* - workspace-scope common data via `useEnsureWorkspaceCommonData()` —
* the same hook DashboardFrameShell uses. Idempotent loaders make it
* safe to call from every top-level shell.
* - `useSQLEditorAutoSave()` — the 2-second debounced saved query
- * auto-save extracted from the legacy `provideSQLEditorContext()`.
+ * auto-save.
* - the `<SQLEditorRouteShell>` once `ready` flips true.
*/
export function SQLEditorLayout() {
@@ -67,12 +65,11 @@ export function SQLEditorLayout() {
return (
<div className="relative h-screen overflow-hidden flex flex-col">
- {/* Hidden teleport target inherited from the Vue layout. The debug
- probes (Pinia connection, current tab, etc.) write `<li>`
- children into this list when manually unhidden via dev tools.
- The fixed positioning is enough to stack above the editor body
- on its own — the legacy `z-999999` was a layering escape hatch
- that the React layering policy now forbids. */}
+ {/* Hidden debug target. The debug probes (disconnected state, current
+ tab id and connection) write `<li>` children into this list;
+ unhide it via dev tools to inspect them. The fixed positioning is
+ enough to stack above the editor body on its own — the React
+ layering policy forbids a raw global `z-index` here. */}
<ul
id="sql-editor-debug"
className="hidden text-xs font-mono max-h-[33vh] max-w-[40vw] overflow-auto fixed bottom-0 right-0 p-2 bg-background/50 border border-control-border"
diff --git a/frontend/src/modules/sql-editor/components/SQLEditorRouteShell.tsx b/frontend/src/modules/sql-editor/components/SQLEditorRouteShell.tsx
index adc7805756..3996d91149 100644
--- a/frontend/src/modules/sql-editor/components/SQLEditorRouteShell.tsx
+++ b/frontend/src/modules/sql-editor/components/SQLEditorRouteShell.tsx
@@ -52,9 +52,9 @@ import {
} from "@/utils";
import { SQLEditorHomePage } from "./SQLEditorHomePage";
-// Route-name set for the unsaved-changes leave guard. Vue Router's
-// `beforeEach` is global, so this set scopes the prompt to navigations
-// that actually leave the SQL Editor — internal SQL Editor route sync
+// Route-name set for the unsaved-changes leave guard. `router.beforeEach`
+// is global, so this set scopes the prompt to navigations that actually
+// leave the SQL Editor — internal SQL Editor route sync
// (`navigate.replace(...)` between saved query/database/instance modules)
// must not trigger it.
const SQL_EDITOR_MODULES = new Set<string>([
@@ -87,30 +87,18 @@ const ASIDE_PANEL_TABS: readonly AsidePanelTab[] = [
];
/**
- * React port of `frontend/src/components/ProvideSQLEditorContext.vue`.
- *
* Owns the SQL Editor route bootstrap chain:
- * - on mount, resolves the active project from URL params/query and
- * `editorStore.storedLastViewedProject`, falling back to the first
- * accessible project, then sets up the per-project tab list.
+ * - on mount, resolves the active project from URL params/query or the
+ * persisted last-viewed project, then sets up the per-project tab list.
* - hydrates the active tab from the URL: opens the saved query for
* `/projects/:project/savedQueries/:savedQuery`, or opens an instance/database
* connection for the `instances/:instance/databases/:database` form.
- * - keeps the URL synced with the active tab's connection (Pinia →
- * `router.replace`), so reload restores the right surface.
+ * - keeps the URL synced with the active tab's connection (tab state →
+ * `navigate.replace`), so reload restores the right surface.
* - restores the sidebar tab from localStorage (or the `?panel=`
* override) once `editorStore.projectContextReady` flips true.
- * - mounts `<RoutePermissionGuardShell>` and portals the React
- * `<SQLEditorHomePage>` into its target div once the user has
- * permission for the matched route.
- *
- * The legacy Vue wrapper additionally rendered `<ProvideAIContext>`
- * around `<router-view>`. That outer provide is unused after Stage 21
- * — every consumer of `useAIContext()` lives inside the AI plugin tree,
- * which mounts via the React→Vue bridge with its own
- * `<AIChatToSQLBridgeHost>` re-establishing the provide locally. The
- * `aiContextEvents` emitter is a module-level singleton accessible
- * cross-framework.
+ * - renders `<SQLEditorHomePage>` once the user has permission for the
+ * matched route.
*/
export function SQLEditorRouteShell() {
const { t } = useTranslation();
@@ -136,14 +124,9 @@ export function SQLEditorRouteShell() {
const bootstrappedRef = useRef(false);
// Gate the URL ⇄ connection sync until the bootstrap chain completes.
- // The Vue version called `syncURLWithConnection()` *after* the chain;
- // wiring it as a plain `useEffect` would otherwise fire on first
- // render with empty Pinia values (no tab loaded yet), navigate the
- // route to `SQL_EDITOR_HOME_MODULE`, and clobber the user's
- // `/projects/.../databases/...` URL — which then remounts the whole
- // React tree (route-shell `setTarget(null)` on `route.fullPath`
- // change), blowing away the active tab and editor state. Result: Run
- // button disabled because the current tab ends up empty/disconnected.
+ // Otherwise it fires on first render with empty store values (no tab
+ // loaded yet), navigates the route to `SQL_EDITOR_HOME_MODULE`, and
+ // clobbers the user's `/projects/.../databases/...` URL.
const [bootstrapDone, setBootstrapDone] = useState(false);
useEffect(() => {
if (bootstrappedRef.current) return;
@@ -168,7 +151,7 @@ export function SQLEditorRouteShell() {
} else if (typeof projectInParams === "string" && projectInParams) {
project = `projects/${projectInParams}`;
} else {
- // storedLastViewedProject is an alias for project.
+ // `project` is the persisted last-viewed project.
project = getSQLEditorEditorState().project;
}
@@ -421,8 +404,7 @@ export function SQLEditorRouteShell() {
// ---- URL ⇄ connection sync (reactive) --------------------------------
// Subscribe to each Zustand field; the effect below fires whenever any
- // changes (mirrors Vue's `watch([...], ..., { immediate: true })`).
- // The dependency array does the multi-source coalescing.
+ // changes. The dependency array does the multi-source coalescing.
const projName = useSQLEditorEditorState((s) => s.project);
const sheetName = useSQLEditorTabState(
(s) => s.tabsById.get(s.currentTabId)?.savedQuery
@@ -441,10 +423,7 @@ export function SQLEditorRouteShell() {
);
useEffect(() => {
- // Skip until bootstrap is done — see `bootstrapDone` declaration
- // for why firing this on first render with empty Pinia values
- // breaks the editor (rounds the URL to HOME, remounts the React
- // tree, ends up with `currentTab` empty + Run button disabled).
+ // Skip until bootstrap is done — see the `bootstrapDone` declaration.
if (!bootstrapDone) return;
void syncURL({
projName: projName ?? "",
@@ -706,14 +685,12 @@ export function SQLEditorRouteShell() {
return e.returnValue;
};
window.addEventListener("beforeunload", handler);
- // `router.beforeEach` is a global hook — it fires on every Vue Router
- // navigation while the SQL Editor shell is mounted, including the
- // internal `navigate.replace(...)` calls used to sync the URL with
- // the current connection. Without scoping, every internal route
- // sync prompts the user when any tab is dirty, which is both an
- // annoying loop and a regression vs. the prior component-level leave
- // guard. Only prompt when the destination route is OUTSIDE the SQL
- // Editor module.
+ // `router.beforeEach` is a global hook — it fires on every navigation
+ // while the SQL Editor shell is mounted, including the internal
+ // `navigate.replace(...)` calls used to sync the URL with the current
+ // connection. Without scoping, every internal route sync would prompt
+ // the user when any tab is dirty, an annoying loop. Only prompt when
+ // the destination route is OUTSIDE the SQL Editor module.
const removeGuard = router.beforeEach((to, _from, next) => {
const stayingInSqlEditor = SQL_EDITOR_MODULES.has(to.name as string);
if (stayingInSqlEditor) {
diff --git a/frontend/src/modules/sql-editor/components/SavedQueryPane.tsx b/frontend/src/modules/sql-editor/components/SavedQueryPane.tsx
index 491de401af..1168b9ad13 100644
--- a/frontend/src/modules/sql-editor/components/SavedQueryPane.tsx
+++ b/frontend/src/modules/sql-editor/components/SavedQueryPane.tsx
@@ -1,6 +1,4 @@
/**
- * SavedQueryPane — React port of SavedQueryPane.vue (Stage 12, Phase 4).
- *
* Hosts the SQL editor's saved query sidebar: search, filter menu, multi-select
* toolbar, and one SheetTree per visible view.
*/
@@ -190,10 +188,10 @@ export function SavedQueryPane() {
/>
)}
{views.map((view) => (
- // Non-"my" trees intentionally omit multi-select callbacks. Vue
- // bound v-model only on the `my` tree; wiring them everywhere let
- // a shared/draft right-click populate the my tree's checkedNodes,
- // which the toolbar's Delete flow acts on.
+ // Non-"my" trees intentionally omit multi-select callbacks.
+ // Wiring them everywhere would let a shared/draft right-click
+ // populate the my tree's checkedNodes, which the toolbar's
+ // Delete flow acts on.
<SheetTree key={view} view={view} />
))}
{!hasAnyView && (
diff --git a/frontend/src/modules/sql-editor/components/SchemaChooser.tsx b/frontend/src/modules/sql-editor/components/SchemaChooser.tsx
index d8c4d014fa..ed0df75fde 100644
--- a/frontend/src/modules/sql-editor/components/SchemaChooser.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaChooser.tsx
@@ -13,7 +13,6 @@ import { ConnectChooser } from "./ConnectChooser";
const SchemaOptionValueUnspecified = "-1";
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/SchemaChooser.vue.
* Visible only for engines that support schema-scoped queries.
* Selected schema persists to the current tab's connection.schema.
*/
@@ -26,8 +25,8 @@ export function SchemaChooser() {
const tabSchema = useSQLEditorTabState(
(s) => s.tabsById.get(s.currentTabId)?.connection.schema
);
- // Parent SchemaPane (E4 migration) drives the metadata fetch; here we
- // only need the cached read.
+ // The ancestor `Panels` drives the metadata fetch; here we only need the
+ // cached read.
const { schemas } = useAppDatabaseMetadata(databaseName, {
autoFetch: false,
});
@@ -65,10 +64,8 @@ export function SchemaChooser() {
};
// Seed from URL query parameter on mount and whenever the query param OR
- // the active tab changes. Mirrors Vue's watchEffect, which implicitly
- // tracked both `route.query.schema` and `tab.value` (the latter via the
- // setter's reactive reads) so that switching to a new tab with the URL
- // query still present re-seeded the new tab's connection.schema.
+ // the active tab changes, so switching to a new tab with the URL query
+ // still present re-seeds the new tab's connection.schema.
const queryParam = useReactiveRoute().query.schema as string | undefined;
const currentTabId = useSQLEditorTabState((s) => s.currentTabId);
useEffect(() => {
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/FlatTableList.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/FlatTableList.tsx
index 06c70cabf4..13af8851de 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/FlatTableList.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/FlatTableList.tsx
@@ -11,15 +11,13 @@ import { findAncestor } from "@/utils/dom";
import { useHoverState } from "./hover-state";
import { ColumnIcon, IndexIcon } from "./TreeNode/icons";
-const PAGE_SIZE = 500;
/**
- * Hard cap matching Vue's PAGE_SIZE × default page count behavior. The
- * design risk note flagged that `react-window` isn't a dep yet and the
- * table-row count for FlatTableList mode is bounded — pure DOM rendering
- * with a load-more cursor keeps this within ~500 rows (28px × 500 = ~14k
- * px of DOM) per page, which modern browsers handle without
- * virtualization. Revisit only if the cap becomes a real bottleneck.
+ * Pure DOM rendering with a load-more cursor keeps the list within ~500
+ * rows (28px × 500 = ~14k px of DOM) per page, which modern browsers
+ * handle without virtualization. Revisit only if this cap becomes a real
+ * bottleneck.
*/
+const PAGE_SIZE = 500;
export interface FlatTableItem {
readonly key: string;
@@ -37,10 +35,9 @@ type Props = {
};
/**
- * Replaces `SchemaPane/FlatTableList.vue`. Flat list of tables with
- * inline expand-to-show-columns/indexes for large databases (Vue
- * threshold is >1000 tables). Search-filterable, paged at 500 rows
- * with a load-more button at the bottom.
+ * Flat list of tables with inline expand-to-show-columns/indexes for large
+ * databases (SchemaPane uses it above 1000 tables). Search-filterable,
+ * paged at 500 rows with a load-more button at the bottom.
*
* Hover sets the SchemaPane's hover state so the shared HoverPanel can
* preview the table — same wiring as the Tree mode.
@@ -108,8 +105,7 @@ export function FlatTableList({
const delay = hoverState.state ? 150 : undefined;
hoverState.update(target, "before", delay);
- // Microtask: position computed against the actual DOM bounding rect,
- // matching Vue's `await nextTick()` before reading getBoundingClientRect.
+ // Compute position from the row's bounding rect.
const wrapper = findAncestor(e.target as HTMLElement, ".bb-flat-table-row");
if (!wrapper) {
hoverState.update(undefined, "after", 150);
@@ -124,9 +120,6 @@ export function FlatTableList({
};
if (filteredTables.length === 0) {
- // Vue's source uses hardcoded English here; preserve verbatim for
- // 1:1 parity. If we ever i18n this, update the Vue side at the same
- // time so the two surfaces don't drift.
return (
<div className="flex flex-col items-center justify-center mt-16 text-control-light text-sm">
{search ? "No tables found" : "No tables in this database"}
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ColumnInfo.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ColumnInfo.tsx
index 3753617a33..f3a103d7f4 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ColumnInfo.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ColumnInfo.tsx
@@ -17,9 +17,9 @@ type Props = {
};
/**
- * Replaces `HoverPanel/ColumnInfo.vue`. Character set is shown only for
- * Postgres / ClickHouse / Snowflake; collation only for ClickHouse /
- * Snowflake (other engines surface these at the table level).
+ * Character set is shown only for Postgres / ClickHouse / Snowflake;
+ * collation only for ClickHouse / Snowflake (other engines surface these at
+ * the table level).
*/
export function ColumnInfo({ database, schema, table, column }: Props) {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/CommonText.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/CommonText.tsx
index 72590f3ff4..4f138606ea 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/CommonText.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/CommonText.tsx
@@ -2,7 +2,7 @@ type Props = {
readonly content: string;
};
-/** Replaces `HoverPanel/CommonText.vue`. Wraps long text to ~18rem. */
+/** Wraps long text to ~18rem. */
export function CommonText({ content }: Props) {
return (
<div className="max-w-[18rem] whitespace-pre-wrap break-all wrap-break-word">
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ExternalTableInfo.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ExternalTableInfo.tsx
index aa3f82d037..01b8391e5a 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ExternalTableInfo.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ExternalTableInfo.tsx
@@ -8,7 +8,6 @@ type Props = {
readonly externalTable: string;
};
-/** Replaces `HoverPanel/ExternalTableInfo.vue`. */
export function ExternalTableInfo({ database, schema, externalTable }: Props) {
const { t } = useTranslation();
const externalTableMetadata = useAppStore((s) =>
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/HoverPanel.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/HoverPanel.tsx
index 79a82409c7..f959e899d3 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/HoverPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/HoverPanel.tsx
@@ -19,9 +19,8 @@ type Props = {
};
/**
- * Replaces `HoverPanel/HoverPanel.vue`. Floating, cursor-anchored panel
- * that previews schema metadata for the hovered tree row. Mirrors Vue's
- * `v-if` chain — most-specific shape wins:
+ * Floating, cursor-anchored panel that previews schema metadata for the
+ * hovered tree row. Most-specific shape wins:
* column + table → ColumnInfo
* table + partition → TablePartitionInfo
* table → TableInfo
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/InfoItem.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/InfoItem.tsx
index c43af3542f..3c9d90dfa2 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/InfoItem.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/InfoItem.tsx
@@ -7,11 +7,11 @@ type Props = {
};
/**
- * Replaces `HoverPanel/InfoItem.vue`. A 2-column grid row: gray title on
- * the left, value (right-aligned, ellipsis on overflow) on the right.
+ * A 2-column grid row: gray title on the left, value (right-aligned,
+ * ellipsis on overflow) on the right.
*
- * Mirrors the Vue layout — `grid-template-columns: auto 1fr` + 16px gap
- * — so the title hugs its content and the value column truncates.
+ * `grid-template-columns: auto 1fr` + 16px gap so the title hugs its
+ * content and the value column truncates.
*/
export function InfoItem({ title, titleSlot, children }: Props) {
return (
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TableInfo.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TableInfo.tsx
index a5479d953a..91d0e17dfb 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TableInfo.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TableInfo.tsx
@@ -14,10 +14,9 @@ type Props = {
};
/**
- * Replaces `HoverPanel/TableInfo.vue`. Index size and collation are
- * hidden for ClickHouse + Snowflake; collation is also hidden for
- * Postgres because the engine reports it at the column level instead of
- * the table level. Comment is shown only when present.
+ * Index size and collation are hidden for ClickHouse + Snowflake; collation
+ * is also hidden for Postgres because the engine reports it at the column
+ * level instead of the table level. Comment is shown only when present.
*/
export function TableInfo({ database, schema, table }: Props) {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TablePartitionInfo.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TablePartitionInfo.tsx
index e95e0ddfe4..a4f5272e3a 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TablePartitionInfo.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/TablePartitionInfo.tsx
@@ -14,7 +14,6 @@ type Props = {
readonly partition: string;
};
-/** Replaces `HoverPanel/TablePartitionInfo.vue`. */
export function TablePartitionInfo({
database,
schema,
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ViewInfo.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ViewInfo.tsx
index 72f75e2ebc..c2d307d87d 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ViewInfo.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/HoverPanel/ViewInfo.tsx
@@ -7,7 +7,7 @@ type Props = {
readonly view: string;
};
-/** Replaces `HoverPanel/ViewInfo.vue`. Just the view's comment, wrapped. */
+/** Just the view's comment, wrapped. */
export function ViewInfo({ database, schema, view }: Props) {
const viewMetadata = useAppStore((s) =>
s.getViewMetadata({ database, schema, view })
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/SchemaContextMenu.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/SchemaContextMenu.tsx
index fc1994631e..e5f112bb42 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/SchemaContextMenu.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/SchemaContextMenu.tsx
@@ -30,14 +30,12 @@ type Target = {
type Props = SchemaMenuDeps;
/**
- * Replaces `SchemaPane/actions.tsx`'s NDropdown imperative use in
- * `SchemaPane.vue`. Mirrors the Stage 14 `ConnectionContextMenu` pattern:
- * a 0×0 fixed-position trigger at the cursor is programmatically clicked
- * so Base UI records a click-type open event and the popup stays open
- * while the pointer moves to a menu item.
+ * Schema tree right-click menu. Uses the same pattern as
+ * `ConnectionContextMenu`: a 0×0 fixed-position trigger at the cursor is
+ * programmatically clicked so Base UI records a click-type open event and
+ * the popup stays open while the pointer moves to a menu item.
*
- * `open` is controlled so `hide()` can dismiss the menu deterministically
- * (matches the same fix applied to TabContextMenu after the codex review).
+ * `open` is controlled so `hide()` can dismiss the menu deterministically.
*/
export const SchemaContextMenu = forwardRef<SchemaContextMenuHandle, Props>(
function SchemaContextMenu(deps, ref) {
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/SchemaPane.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/SchemaPane.tsx
index de9951393c..575226f09d 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/SchemaPane.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/SchemaPane.tsx
@@ -60,25 +60,6 @@ const FLAT_TABLE_THRESHOLD = 1000;
// store mutation.
const EMPTY_KEYS: readonly string[] = Object.freeze([]);
-/**
- * React port of `frontend/src/views/sql-editor/AsidePanel/SchemaPane/SchemaPane.vue`.
- *
- * Wires together every Phase 1–4 artifact:
- * - schemaTree.ts builder (Phase 1)
- * - useDelayedValue / useHoverState (Phase 1)
- * - leaf TreeNode/*.tsx (Phase 1)
- * - heavy nodes + Label dispatcher (Phase 2)
- * - HoverPanel + *Info cards (Phase 3)
- * - useSchemaPaneActions / ContextMenu (Phase 4a/4b)
- * - SyncSchemaButton (Phase 4c)
- * - FlatTableList (Phase 4d)
- *
- * The schema-viewer modal lives in the Vue parent (`AsidePanel.vue`)
- * since it embeds Vue-only `BBModal` + `TableSchemaViewer`. The menu's
- * "View schema text" action emits a `show-schema-viewer` event on
- * `sqlEditorEvents` which the Vue context provider listens for and
- * mirrors onto its inject ref.
- */
export function SchemaPane() {
return (
<HoverStateProvider>
@@ -108,8 +89,7 @@ function SchemaPaneInner() {
const [searchPattern, setSearchPattern] = useState("");
- // Reset the search box on every tab switch — matches Vue's
- // `watch(() => currentTab.value?.id, ...)`.
+ // Reset the search box on every tab switch.
useEffect(() => {
setSearchPattern("");
}, [currentTabId]);
@@ -156,8 +136,7 @@ function SchemaPaneInner() {
}, [metadata]);
// Build the tree via requestAnimationFrame so the heavy walk doesn't
- // block the metadata-fetch teardown's transition. Mirrors Vue's
- // `requestAnimationFrame(() => { tree.value = buildDatabaseSchemaTree(...) })`.
+ // block the metadata-fetch teardown's transition.
const [treeResult, setTreeResult] = useState<
{ database: string; tree: SchemaTreeNode[] } | undefined
>(undefined);
@@ -349,9 +328,8 @@ function SchemaPaneInner() {
// ---- Context menu (right-click) -----------------------------------------
const contextMenuRef = useRef<SchemaContextMenuHandle>(null);
- // Schema-viewer modal lives here now (was bridged through Vue parent
- // until the React TableSchemaViewer landed). Local state because the
- // SchemaPane right-click menu is the only trigger.
+ // Schema-viewer modal state is local because the SchemaPane right-click
+ // menu is the only trigger.
const [schemaViewer, setSchemaViewerState] = useState<
| {
schema?: string;
@@ -521,11 +499,6 @@ function SchemaPaneInner() {
setSchemaViewer={setSchemaViewer}
/>
- {/* Schema-viewer modal — Vue's BBModal+TableSchemaViewer used to
- live in the parent (`SQLEditorHomePage.vue`) bridged via the
- `show-schema-viewer` event because TableSchemaViewer was Vue.
- Now the React TableSchemaViewer ships, so the trigger and its
- modal home in the same place. */}
<Dialog
open={!!schemaViewer}
onOpenChange={(open) => {
@@ -572,8 +545,6 @@ const searchMatch = (
node: TreeDataNode<SchemaTreeNode>,
term: string
): boolean => {
- // Mirror Vue's NTree default: case-insensitive substring match against
- // the node's display label.
const label = node.data.label ?? "";
return label.toLowerCase().includes(term.toLowerCase());
};
@@ -616,10 +587,7 @@ function useSchemaActionsForClick() {
/**
* Minimal database breadcrumb for the schema-viewer modal title:
- * engine icon + instance name + chevron + database name. Replaces
- * Vue's `<RichDatabaseName>` for this single use site — full port
- * of `RichDatabaseName.vue` is deferred until another React surface
- * needs it.
+ * engine icon + instance name + chevron + database name.
*/
function DatabaseTitle({
database,
@@ -713,8 +681,7 @@ function SchemaTreeRow({
const delay = hoverHasState ? 150 : undefined;
hoverUpdate(state, "before", delay);
- // Compute position from the row's bounding rect, like Vue's
- // `findAncestor(.n-tree-node)` → getBoundingClientRect.
+ // Compute position from the row's bounding rect.
const wrapper = findAncestor(
e.target as HTMLElement,
".bb-schema-tree-row"
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/SyncSchemaButton.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/SyncSchemaButton.tsx
index d1222f6bd1..2276d3ca98 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/SyncSchemaButton.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/SyncSchemaButton.tsx
@@ -10,15 +10,15 @@ import { useAppStore } from "@/stores/app";
import { getDateForPbTimestampProtoEs, isValidDatabaseName } from "@/types";
/**
- * Replaces `SchemaPane/SyncSchemaButton.vue`. RefreshCcw button with a
- * hover popover showing the last sync time + click-to-sync hint.
+ * RefreshCcw button with a hover tooltip showing the last sync time +
+ * click-to-sync hint.
*
* - Disabled when the active tab has no valid database connection (no
* `database.name`) or while a sync is in flight.
- * - On click, calls `databaseStore.syncDatabase(name, refresh=true)`,
- * then `dbSchemaStore.getOrFetchDatabaseMetadata({ skipCache: true })`
- * so the SchemaPane reactively rebuilds with the fresh metadata.
- * - Spinner: same Vue rule — `animate-spin` while `isSyncing` is true.
+ * - On click, calls the app store's `syncDatabase(name, refresh=true)`,
+ * then `getOrFetchDatabaseMetadata({ skipCache: true })` so the
+ * SchemaPane reactively rebuilds with the fresh metadata.
+ * - Spinner: the icon spins while `isSyncing` is true.
*/
export function SyncSchemaButton({ className }: { className?: string }) {
const { t } = useTranslation();
@@ -68,8 +68,8 @@ export function SyncSchemaButton({ className }: { className?: string }) {
);
if (disabled) {
- // Vue disables the popover on disabled state — match that so we don't
- // surface a "last synced" tooltip with stale-looking placeholder data.
+ // No tooltip when disabled, so we don't surface a "last synced" tooltip
+ // with stale-looking placeholder data.
return button;
}
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CheckNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CheckNode.tsx
index ff27285010..3ef6241465 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CheckNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CheckNode.tsx
@@ -9,8 +9,8 @@ type Props = {
};
/**
- * Replaces `TreeNode/CheckNode.vue`. Renders the constraint name plus a
- * trailing tag with the resolved check expression (if metadata is loaded).
+ * Renders the constraint name plus a trailing tag with the resolved check
+ * expression (if metadata is loaded).
*/
export function CheckNode({ node, keyword }: Props) {
const target = (node as TreeNode<"check">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ColumnNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ColumnNode.tsx
index d0e7b30f55..663beb7fb8 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ColumnNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ColumnNode.tsx
@@ -13,11 +13,8 @@ type Props = {
// Per-table caches: each entry is a `Map<columnName, ColumnMetadata>` keyed
// by the table-like metadata object that owns the columns. Two reasons for
// the WeakMap-of-Maps pattern:
-// 1. The previous implementation did `tableMetadata.columns.find(...)`
-// from every ColumnNode, which is O(columns-per-table) per row. For a
-// 200-column table with ~30 virtualized rows, that's 6,000 reactive
-// proxy reads per expand — and every read goes through Vue's tracker
-// because the metadata is a Pinia/Vue reactive proxy.
+// 1. `tableMetadata.columns.find(...)` from every ColumnNode would be
+// O(columns-per-table) per row.
// 2. WeakMap keys (the parent metadata reference) drop their cache entry
// automatically when the metadata refreshes — no manual invalidation.
const tableColumnIndex = new WeakMap<object, Map<string, ColumnMetadata>>();
@@ -31,20 +28,13 @@ function findColumn(parent: { columns: ColumnMetadata[] }, name: string) {
}
/**
- * Replaces `TreeNode/ColumnNode.vue`. The icon and trailing type-tag both
- * depend on the column's resolved metadata:
+ * The icon and trailing type-tag both depend on the column's resolved
+ * metadata:
* - PrimaryKeyIcon when the column is part of the primary index.
* - IndexIcon when it's part of any other index (and not the PK).
* - ColumnIcon otherwise.
* - The trailing type-tag (`int`, `varchar(255)`, …) is rendered when
* the metadata fetch has resolved.
- *
- * Lookups use `useMemo`. The schema tree is rebuilt by `SchemaPane`
- * whenever the database metadata changes, which produces fresh `target`
- * objects and remounts these rows with current metadata — a per-row
- * subscription would be unnecessary overhead, and synchronous watch
- * setup was the dominant cost of expanding a Columns folder with
- * hundreds of children.
*/
export function ColumnNode({ node, keyword }: Props) {
const target = (node as TreeNode<"column">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CommonNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CommonNode.tsx
index 0dcd470b0b..4a3863f514 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CommonNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/CommonNode.tsx
@@ -15,20 +15,15 @@ type Props = {
*/
readonly fallbackText?: ReactNode;
/**
- * Override the default rendered children entirely. Mirrors Vue's
- * `<template #default>` slot — used by `TextNode` to inject custom
- * content when `node.meta.target.render` is set.
+ * Override the default rendered children entirely. Used by `TextNode` to
+ * inject custom content when `node.meta.target.render` is set.
*/
readonly children?: ReactNode;
readonly className?: string;
};
/**
- * Replaces `frontend/src/views/sql-editor/AsidePanel/SchemaPane/TreeNode/CommonNode.vue`.
- *
* Layout: [optional indent spacers] [icon] [text|highlight|fallback] [suffix].
- * Mirrors the Vue widths (20×20 indent + icon, 2px text padding) so rows
- * align across the Vue→React swap.
*/
export function CommonNode({
text,
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DatabaseNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DatabaseNode.tsx
index 3242394a18..09f7583d7d 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DatabaseNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DatabaseNode.tsx
@@ -10,8 +10,8 @@ type Props = {
};
/**
- * Replaces `TreeNode/DatabaseNode.vue`. The schema tree's root node:
- * engine icon + database display name (highlight-aware).
+ * The schema tree's root node: engine icon + database display name
+ * (highlight-aware).
*/
export function DatabaseNode({ node, keyword }: Props) {
const target = (node as TreeNode<"database">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DependencyColumnNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DependencyColumnNode.tsx
index abddc9022c..61e25abd41 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DependencyColumnNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DependencyColumnNode.tsx
@@ -8,8 +8,7 @@ type Props = {
};
/**
- * Replaces `TreeNode/DependencyColumnNode.vue`. Renders a view's
- * upstream column in `[schema.]table.column` form.
+ * Renders a view's upstream column in `[schema.]table.column` form.
*/
export function DependencyColumnNode({ node, keyword }: Props) {
const target = (node as TreeNode<"dependency-column">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DummyNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DummyNode.tsx
index 3a985cfb82..67aa4c218c 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DummyNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/DummyNode.tsx
@@ -8,9 +8,9 @@ type Props = {
};
/**
- * Replaces `TreeNode/DummyNode.vue`. Renders an "<Empty>" / "<Error>"
- * placeholder span; if the underlying target carries an `error`, the
- * span exposes that message via Tooltip on hover.
+ * Renders an "<Empty>" / "<Error>" placeholder span; if the underlying
+ * target carries an `error`, the span exposes that message via Tooltip on
+ * hover.
*/
export function DummyNode({ node }: Props) {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/FunctionNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/FunctionNode.tsx
index e12289e019..2b67b398c5 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/FunctionNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/FunctionNode.tsx
@@ -8,8 +8,7 @@ type Props = {
readonly keyword: string;
};
-/** Replaces `TreeNode/FunctionNode.vue`. Same signature-vs-name fallback
- * as ProcedureNode. */
+/** Same signature-vs-name fallback as ProcedureNode. */
export function FunctionNode({ node, keyword }: Props) {
const target = (node as TreeNode<"function">).meta.target;
const schemaMetadata = useAppStore((s) =>
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/IndexNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/IndexNode.tsx
index 0b7d48cedc..6a3d2e2b09 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/IndexNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/IndexNode.tsx
@@ -9,8 +9,7 @@ type Props = {
};
/**
- * Replaces `TreeNode/IndexNode.vue`. PrimaryKeyIcon when the index is
- * marked `primary`, IndexIcon otherwise.
+ * PrimaryKeyIcon when the index is marked `primary`, IndexIcon otherwise.
*/
export function IndexNode({ node, keyword }: Props) {
const target = (node as TreeNode<"index">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/Label.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/Label.tsx
index 122ed1582f..15e68f2174 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/Label.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/Label.tsx
@@ -24,9 +24,7 @@ type Props = {
};
/**
- * Replaces `TreeNode/Label.vue`. Renders the right per-type leaf
- * component for the given tree node. Mirrors the Vue dispatcher's order
- * exactly — the 18 branches map 1:1 to Vue's `<template v-if>` chain.
+ * Renders the right per-type leaf component for the given tree node.
*/
export function Label({ node, keyword }: Props) {
switch (node.meta.type) {
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ProcedureNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ProcedureNode.tsx
index 2749424976..07344e68bb 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ProcedureNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/ProcedureNode.tsx
@@ -9,9 +9,9 @@ type Props = {
};
/**
- * Replaces `TreeNode/ProcedureNode.vue`. Reads procedure metadata to
- * prefer the resolved `signature` over the bare `name` (engines like
- * Oracle expose overloads where signature is the disambiguator).
+ * Reads procedure metadata to prefer the resolved `signature` over the
+ * bare `name` (engines like Oracle expose overloads where signature is the
+ * disambiguator).
*/
export function ProcedureNode({ node, keyword }: Props) {
const target = (node as TreeNode<"procedure">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/SchemaNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/SchemaNode.tsx
index 68c73212e7..79a3a11da7 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/SchemaNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/SchemaNode.tsx
@@ -9,8 +9,8 @@ type Props = {
};
/**
- * Replaces `TreeNode/SchemaNode.vue`. Schema namespace node — falls
- * back to the i18n "default" label when the schema name is empty.
+ * Schema namespace node — falls back to the i18n "default" label when the
+ * schema name is empty.
*/
export function SchemaNode({ node, keyword }: Props) {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/TextNode.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/TextNode.tsx
index 173ecaf9da..f0e4bfb71d 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/TextNode.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/TextNode.tsx
@@ -8,10 +8,9 @@ type Props = {
};
/**
- * Replaces `TreeNode/TextNode.vue`. Folder-style row used for "Tables /
- * Views / Indexes / …" headers. If the target sets a `render` ReactNode,
- * we pass it through CommonNode's `children` slot to override the
- * default text+icon layout entirely.
+ * Folder-style row used for "Tables / Views / Indexes / …" headers. If the
+ * target sets a `render` ReactNode, we pass it through CommonNode's
+ * `children` to override the default text+icon layout entirely.
*/
export function TextNode({ node }: Props) {
const target = (node as TreeNode<"expandable-text">).meta.target;
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/icons.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/icons.tsx
index 65c8343e77..6d000b8dfc 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/icons.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/TreeNode/icons.tsx
@@ -14,15 +14,6 @@ import {
} from "lucide-react";
import { cn } from "@/lib/utils";
-/**
- * React equivalents of `frontend/src/components/Icon/*Icon.vue`. Kept
- * local to the SchemaPane port for now; will lift to a shared
- * `src/components/Icon/` directory if Stage 16+ surfaces need them.
- *
- * Each icon mirrors its Vue counterpart's tint / stroke choices so the
- * tree visually matches the Vue version 1:1.
- */
-
type IconProps = {
readonly className?: string;
};
@@ -67,8 +58,7 @@ export function FunctionIcon({ className }: IconProps) {
}
/**
- * Vue's SequenceIcon is a custom 3.5×3-rem framed "123" — there is no
- * lucide equivalent, so we replicate the markup verbatim.
+ * A custom framed "123" — there is no lucide equivalent.
*/
export function SequenceIcon({ className }: IconProps) {
return (
@@ -108,9 +98,6 @@ export function TablePartitionIcon({ className }: IconProps) {
);
}
-/**
- * Vue's PrimaryKeyIcon is heroicons/key in `text-amber-500`.
- */
export function PrimaryKeyIcon({ className }: IconProps) {
return (
<div className={cn("relative overflow-hidden", baseSize, className)}>
@@ -119,17 +106,10 @@ export function PrimaryKeyIcon({ className }: IconProps) {
);
}
-/**
- * Vue's IndexIcon is tabler/diamonds (a 3-diamond cluster) — lucide's
- * Diamond is a single diamond which is close enough at 12-14px.
- */
export function IndexIcon({ className }: IconProps) {
return <Diamond className={cn("w-3 h-3", className)} />;
}
-/**
- * Vue's CheckIcon is tabler/check at 12px in `text-control-light`.
- */
export function CheckConstraintIcon({ className }: IconProps) {
return <Check className={cn("size-3.5 text-control-light", className)} />;
}
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/actions.test.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/actions.test.tsx
index 669507a0cd..24e39221c5 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/actions.test.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/actions.test.tsx
@@ -89,8 +89,8 @@ vi.mock("@/modules/sql-editor/store/tab", () => ({
vi.mock("@/utils", () => ({
// Stub everything actions.tsx imports. We don't `importOriginal` here
- // because the real `@/utils` transitively pulls in monaco / vue
- // surfaces that vitest can't load.
+ // because the real `@/utils` transitively pulls in monaco surfaces that
+ // vitest can't load.
autoSQLEditorDatabaseRoute: () => ({
name: "sql-editor.database",
params: {
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/actions.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/actions.tsx
index e088cb7389..135e70b931 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/actions.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/actions.tsx
@@ -63,11 +63,10 @@ import {
const SELECT_ALL_LIMIT = 50;
/**
- * Schema-pane "view detail" panel actions. Mirrors Vue's
- * `useCurrentTabViewStateContext().availableActions` — the consumer
- * (SchemaPane.tsx) computes this from the active connection's instance
- * and passes it in. We don't recompute it here so the per-instance
- * support gating stays a single source of truth.
+ * Schema-pane "view detail" panel actions. The consumer (SchemaPane.tsx)
+ * computes this via `useAvailableActions()` from the active connection's
+ * instance and passes it in. We don't recompute it here so the
+ * per-instance support gating stays a single source of truth.
*/
export type AvailableAction = {
readonly view: EditorPanelView;
@@ -76,22 +75,17 @@ export type AvailableAction = {
};
/**
- * Replaces `SchemaPane/actions.tsx` Vue exports. Two factories:
- * - `useSchemaPaneActions()` — invokable handlers (selectAll, viewDetail,
- * openNewTab).
+ * Two factories:
+ * - `useSchemaPaneActions()` — invokable handlers (selectAllFromTableOrView,
+ * openDataExplorer, viewDetail, openNewTab).
* - `useSchemaPaneContextMenu(node, deps)` — nested menu items keyed by
- * `node.meta.type`, mirroring the Vue dropdown 1:1 (item order +
- * nesting + i18n keys).
+ * `node.meta.type`.
*
* The schema-viewer modal's lifecycle stays in SchemaPane.tsx (it owns
* the React state). The hook receives `setSchemaViewer` so menu items
* can ask the panel to open the viewer.
*/
-/**
- * Pure helper: resolve the engine for a target without standing up a
- * Vue reactive computed.
- */
const engineForDatabase = (database: string): Engine => {
const db = useAppStore.getState().getDatabaseByName(database);
return getInstanceResource(db).engine;
@@ -141,7 +135,7 @@ const copyToClipboard = async (
if (await writeTextToClipboard(content)) {
notify("common.copied");
} else {
- // Silent fail — matches Vue's `if (!isSupported.value) return` behavior.
+ // Silent fail.
}
};
@@ -178,7 +172,7 @@ const runQuery = async (
table: tableOrViewName,
};
// Yield once so any state updates above flush before execute reads
- // the tab — mirrors Vue's `await nextTick()` in the original.
+ // the tab.
await Promise.resolve();
execute({
statement,
@@ -420,10 +414,9 @@ const ITEM_ORDER = [
];
/**
- * Mirror Vue's `useDropdown().options` 1:1 — same item ordering, same
- * branching, same keys. Schema-typed nodes use the consumer-supplied
- * `availableActions` list (from `useCurrentTabViewStateContext` on the
- * Vue side) so per-instance support gating lives in one place.
+ * Schema-typed nodes use the consumer-supplied `availableActions` list
+ * (from `useAvailableActions`) so per-instance support gating lives in one
+ * place.
*
* Returns `[]` for disabled / unsupported nodes; callers should hide
* the popup in that case.
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/availableActions.tsx b/frontend/src/modules/sql-editor/components/SchemaPane/availableActions.tsx
index 7c84786f0d..950447f29f 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/availableActions.tsx
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/availableActions.tsx
@@ -19,14 +19,12 @@ import {
} from "./TreeNode/icons";
/**
- * React equivalent of Vue's
- * `useCurrentTabViewStateContext().availableActions`. Returns the same
- * ordered list, with the same per-instance support gating for
- * Sequences / External Tables / Packages, plus the trailing Diagram.
+ * Returns the ordered schema-view actions, with per-instance support
+ * gating for Sequences / External Tables / Packages, plus the trailing
+ * Diagram.
*
- * Lifted to its own module (out of `SchemaPane.tsx`) so the AsidePanel
- * `ActionBar` and the SchemaPane right-click menu can share a single
- * source of truth.
+ * Lives in its own module so the AsidePanel `ActionBar` and the SchemaPane
+ * right-click menu can share a single source of truth.
*/
export function useAvailableActions(): AvailableAction[] {
const { t } = useTranslation();
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/click.ts b/frontend/src/modules/sql-editor/components/SchemaPane/click.ts
index f28cd82576..b018a1e81e 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/click.ts
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/click.ts
@@ -24,11 +24,11 @@ export type UseClickEventsResult = {
* consumer subscribed via `useEffect`. Emittery's `emit` is async — its
* implementation `await resolvedPromise` before invoking listeners, so the
* actual `toggleNode` work was deferred to a microtask after every click.
- * Combined with the downstream Vue-watch / React-render / react-arborist
- * recompute, that microtask hop pushed the paint out far enough that
- * users saw "no response until I move the mouse" (the next input event
- * was what gave the browser a chance to flush). Plain callbacks invoked
- * synchronously from `handleClick` keep all the work in the same tick.
+ * Combined with the downstream React render / react-arborist recompute,
+ * that microtask hop pushed the paint out far enough that users saw "no
+ * response until I move the mouse" (the next input event was what gave
+ * the browser a chance to flush). Plain callbacks invoked synchronously
+ * from `handleClick` keep all the work in the same tick.
*
* The single-click handler ALWAYS fires immediately (instant expand),
* for every node type. Only `table` and `view` rows have a distinct
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.test.ts b/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.test.ts
index 4b01da786b..bb473a5621 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.test.ts
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.test.ts
@@ -557,8 +557,8 @@ describe("buildDatabaseSchemaTree", () => {
});
test("nested partitions recurse and reuse the table-level key prefix", () => {
- // Vue's keyForNodeTarget("partition-table", ...) always keys directly
- // under the table — not under the parent partition. Sub-partitions
+ // keyForNodeTarget("partition-table", ...) always keys directly under
+ // the table — not under the parent partition. Sub-partitions
// therefore share the same `<table>/partitionTables/<name>` prefix as
// top-level partitions; preserving this behavior keeps persisted
// treeState keys valid.
@@ -591,7 +591,7 @@ describe("buildDatabaseSchemaTree", () => {
expect(q1!.type).toBe("partition-table");
});
- test("empty Tables folder still emits an <Empty> child for parity", () => {
+ test("empty Tables folder still emits an <Empty> child", () => {
const md = makeMetadata([
makeSchema("public", {
tables: [],
diff --git a/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.ts b/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.ts
index 0d5b548041..926d59de20 100644
--- a/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.ts
+++ b/frontend/src/modules/sql-editor/components/SchemaPane/schemaTree.ts
@@ -14,18 +14,14 @@ import type {
TablePartitionMetadata,
} from "@/types/proto-es/v1/database_service_pb";
// Deep-import both helpers to avoid pulling barrels that transitively
-// reach monaco / Vue surfaces. Both files are framework-agnostic pure TS.
+// reach monaco. Both files are framework-agnostic pure TS.
import { keyForDependencyColumn } from "@/utils/v1/dbSchema";
/**
- * React port of `src/views/sql-editor/AsidePanel/SchemaPane/tree.ts`.
- *
* Pure type-driven tree builder: walks DatabaseMetadata and produces a
- * TreeNode tree with stable string keys that mirror the Vue version
- * byte-for-byte (so persisted `tab.treeState.keys` survives the migration).
- *
- * Renamed from `tree.ts` → `schemaTree.ts` to disambiguate from
- * `src/components/sql-editor/ConnectionPane/tree.ts`.
+ * TreeNode tree with stable string keys. Persisted `tab.treeState.keys`
+ * reference these keys, so changing the key format breaks stored expand
+ * state.
*/
export type NodeType =
@@ -725,9 +721,8 @@ const mapSequenceNodes = (
})
);
if (children.length === 0) {
- // Vue passes "function" here intentionally; preserve the bug for parity
- // so persisted treeState keys match. Fixing would silently break stored
- // expand state.
+ // Intentionally passes "function", not "sequence": persisted treeState
+ // keys depend on it, so fixing would silently break stored expand state.
return [createDummyNode("function", parentKey)];
}
return children;
@@ -742,8 +737,8 @@ const mapTriggerNodes = (
mapTreeNodeByType("trigger", { ...target, trigger: trigger.name, position })
);
if (children.length === 0) {
- // Same intentional Vue parity quirk as mapSequenceNodes — passes
- // "function" instead of "trigger". Preserve.
+ // Same intentional quirk as mapSequenceNodes — passes "function"
+ // instead of "trigger". Preserve.
return [createDummyNode("function", parentKey)];
}
return children;
diff --git a/frontend/src/modules/sql-editor/components/SharePopoverBody.test.tsx b/frontend/src/modules/sql-editor/components/SharePopoverBody.test.tsx
index d19ffcbf81..423861c99e 100644
--- a/frontend/src/modules/sql-editor/components/SharePopoverBody.test.tsx
+++ b/frontend/src/modules/sql-editor/components/SharePopoverBody.test.tsx
@@ -12,7 +12,7 @@ const mocks = vi.hoisted(() => ({
serverInfo: { externalUrl: "https://example.com" } as
| { externalUrl: string }
| undefined,
- pushNotification: vi.fn(),
+ notify: vi.fn(),
extractProjectResourceName: vi.fn(
(name: string) => name.split("/")[1] ?? name
),
@@ -30,12 +30,9 @@ vi.mock("react-i18next", () => ({
}));
vi.mock("@/stores/app", () => {
- // `notify` reuses the `pushNotification` vi.fn so the existing test
- // assertions on `mocks.pushNotification` keep working after the migration
- // from the Pinia helper to the app-store notification slice.
const state = () => ({
serverInfo: mocks.serverInfo,
- notify: mocks.pushNotification,
+ notify: mocks.notify,
currentUser: { email: "[email protected]" },
getProjectByName: mocks.getProjectByName,
});
@@ -184,7 +181,7 @@ describe("SharePopoverBody", () => {
});
expect(navigator.clipboard.writeText).toHaveBeenCalled();
- expect(mocks.pushNotification).toHaveBeenCalledTimes(1);
+ expect(mocks.notify).toHaveBeenCalledTimes(1);
unmount();
});
diff --git a/frontend/src/modules/sql-editor/components/SharePopoverBody.tsx b/frontend/src/modules/sql-editor/components/SharePopoverBody.tsx
index 0944bf63c6..6af2a17c45 100644
--- a/frontend/src/modules/sql-editor/components/SharePopoverBody.tsx
+++ b/frontend/src/modules/sql-editor/components/SharePopoverBody.tsx
@@ -21,7 +21,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/SharePopover.vue.
* Renders the share popover body: the saved query's grants, plus its deep
* link. The link carries location, not access — opening it still runs the
* same read check — so the two are shown together but do different work.
diff --git a/frontend/src/modules/sql-editor/components/SheetConnectionIcon.tsx b/frontend/src/modules/sql-editor/components/SheetConnectionIcon.tsx
index 35b1b4d6bc..6204b20f73 100644
--- a/frontend/src/modules/sql-editor/components/SheetConnectionIcon.tsx
+++ b/frontend/src/modules/sql-editor/components/SheetConnectionIcon.tsx
@@ -11,7 +11,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/EditorCommon/SheetConnectionIcon.vue.
* Renders the engine icon when the tab has a live connection, otherwise the
* "unlink" glyph.
*/
diff --git a/frontend/src/modules/sql-editor/components/SheetTree.test.tsx b/frontend/src/modules/sql-editor/components/SheetTree.test.tsx
index 6f6d4f7e21..ed6ab04b26 100644
--- a/frontend/src/modules/sql-editor/components/SheetTree.test.tsx
+++ b/frontend/src/modules/sql-editor/components/SheetTree.test.tsx
@@ -33,7 +33,7 @@ const mocks = vi.hoisted(() => ({
},
getSQLEditorTabsState: vi.fn(),
project: "projects/proj1",
- // The new zustand store mock — only `createSavedQuery` is used by SheetTree.
+ // SQL Editor store mock — only `createSavedQuery` is used by SheetTree.
createSavedQuery: vi.fn().mockResolvedValue({}),
useSheetContext: vi.fn(),
useSheetContextByView: vi.fn(),
@@ -396,11 +396,10 @@ const makeLoadMoreNode = (key: string): SavedQueryFolderNode => ({
children: [],
});
-// The migrated `useSheetContext()` exposes `expandedKeys` / `selectedKeys`
-// as plain values plus setters. We model the live state behind a `value`
-// holder (so the existing per-test assertions like
-// `expandedKeys.value.has(...)` keep working) and wire the component's
-// `setExpandedKeys` setter to mutate that same holder.
+// `useSheetContext()` exposes `expandedKeys` / `selectedKeys` as plain
+// values plus setters. We model the live state behind a `value` holder so
+// assertions like `expandedKeys.value.has(...)` can read it, and wire the
+// component's `setExpandedKeys` setter to mutate that same holder.
const makeExpandedKeysRef = (keys: string[] = []) => ({
value: new Set(keys),
});
@@ -674,7 +673,7 @@ describe("SheetTree", () => {
unmount();
});
- test("3. Click folder → toggles expand in Pinia store", () => {
+ test("3. Click folder → toggles expand in the sheet context", () => {
const defaultMocks = setupDefaultMocks();
const folder = makeFolderNode("/my/folder1", []);
const rootNode = makeFolderNode("/my", [folder]);
@@ -981,7 +980,7 @@ describe("SheetTree", () => {
unmount();
});
- test("6. Delete confirm → fires savedQueryV1Store.deleteSavedQueryByName", async () => {
+ test("6. Delete confirm → fires appStore.deleteSavedQueryByName", async () => {
const defaultMocks = setupDefaultMocks();
const wsNode = makeSavedQueryNode("/my/ws2", "savedQueries/ws2");
const rootNode = makeFolderNode("/my", [wsNode]);
diff --git a/frontend/src/modules/sql-editor/components/SheetTree.tsx b/frontend/src/modules/sql-editor/components/SheetTree.tsx
index 0208191f84..5377b629b6 100644
--- a/frontend/src/modules/sql-editor/components/SheetTree.tsx
+++ b/frontend/src/modules/sql-editor/components/SheetTree.tsx
@@ -1,7 +1,5 @@
/**
- * SheetTree — React port of SheetTree.vue (Stage 12, Phase 3)
- *
- * Full feature parity with the Vue source (850 lines):
+ * SheetTree features:
* 1. Tree display
* 2. Click saved query → open in editor
* 3. Click folder → expand/collapse
@@ -65,7 +63,7 @@ import {
useSheetContext,
useSheetContextByView,
} from "@/modules/sql-editor/model/Sheet";
-import { useSQLEditorStore as useSQLEditorReactStore } from "@/modules/sql-editor/store";
+import { useSQLEditorStore } from "@/modules/sql-editor/store";
import { useSQLEditorEditorState } from "@/modules/sql-editor/store/editor";
import { getSQLEditorTabsState } from "@/modules/sql-editor/store/tab";
import { useAppStore } from "@/stores/app";
@@ -89,10 +87,10 @@ export type SheetTreeHandle = {
type Props = {
readonly view: SheetViewMode;
- // Multi-select state is only wired on the "my" tree (matches the Vue
- // v-model binding). When the callbacks are absent, the context-menu
- // "Multi-select" action is hidden so shared/draft rows cannot populate
- // the `my` tree's checkedNodes (which feeds Delete + Move-to-folder).
+ // Multi-select state is only wired on the "my" tree. When the callbacks
+ // are absent, the context-menu "Multi-select" action is hidden so
+ // shared/draft rows cannot populate the `my` tree's checkedNodes (which
+ // feeds Delete + Move-to-folder).
readonly multiSelectMode?: boolean;
readonly checkedNodes?: SavedQueryFolderNode[];
readonly onMultiSelectModeChange?: (next: boolean) => void;
@@ -226,8 +224,8 @@ export function SheetTree({
}: Props) {
const { t } = useTranslation();
- // ---- Pinia stores (called at top level, not inside the Vue-bridge call) ----------
- const createSavedQuery = useSQLEditorReactStore((s) => s.createSavedQuery);
+ // ---- Stores ---------------------------------------------------------------
+ const createSavedQuery = useSQLEditorStore((s) => s.createSavedQuery);
// ---- Sheet contexts -------------------------------------------------------
const {
@@ -604,8 +602,6 @@ export function SheetTree({
}, []);
// ---- handleRenameNode (debounced via ref) ---------------------------------
- // We can't use useDebounceFn from @vueuse/core in React, so we implement
- // a simple debounce with useRef + setTimeout.
const renameTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const execRenameNode = useCallback(async () => {
@@ -613,7 +609,6 @@ export function SheetTree({
if (!editing) return;
const cleanup = () => {
- // Use setTimeout to mimic nextTick
setTimeout(() => {
setEditingNode(undefined);
}, 0);
@@ -987,7 +982,7 @@ export function SheetTree({
);
// ---- handleDuplicateFolderNameDrop: promise-based duplicate check for DnD --
- // Mirrors Vue's handleDuplicateFolderName: resolves true (merge) or false (cancel).
+ // Resolves true (merge) or false (cancel).
const handleDuplicateFolderNameDrop = useCallback(
(parentNode: SavedQueryFolderNode, newKey: string): Promise<boolean> => {
const sameNode = parentNode.children.find(
@@ -1008,9 +1003,9 @@ export function SheetTree({
);
// ---- handleMove (DnD via react-arborist) ---------------------------------
- // Mirrors Vue's handleDrop. react-arborist provides the destination parentNode
- // (always a folder — arborist resolves drop-on-leaf to its parent) and an
- // array of dragged nodes. Only single-drag is supported (matches Vue).
+ // react-arborist provides the destination parentNode (always a folder —
+ // arborist resolves drop-on-leaf to its parent) and an array of dragged
+ // nodes. Only single-drag is supported.
const handleMove: MoveHandler<TreeDataNode<SavedQueryFolderNode>> =
useCallback(
async ({ dragNodes, parentNode: arboristParent }) => {
@@ -1030,7 +1025,7 @@ export function SheetTree({
}
if (!parentFolderNode || parentFolderNode.loadMore) return;
- // Only handle single drag (matches Vue behaviour)
+ // Only handle single drag
const draggedTreeNode = dragNodes[0] as
| NodeApi<TreeDataNode<SavedQueryFolderNode>>
| undefined;
@@ -1072,7 +1067,7 @@ export function SheetTree({
rebuildTree();
}
- // Update expanded keys (nextTick equivalent: defer to next microtask)
+ // Update expanded keys
setTimeout(() => {
replaceExpandedKeys({ oldKey: draggedNode.key, newKey });
setExpandedKeys((prev) => {
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/EditorMain.tsx b/frontend/src/modules/sql-editor/components/StandardPanel/EditorMain.tsx
index f1b70d4c63..93dc89fb44 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/EditorMain.tsx
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/EditorMain.tsx
@@ -25,15 +25,12 @@ interface EditorMainProps {
}
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/StandardPanel/EditorMain.vue`.
- *
* SavedQuery shell:
- * - Top toolbar (`EditorAction`, already React)
+ * - Top toolbar (`EditorAction`)
* - Body: `SQLEditor` when there's a tab, `Welcome` otherwise
* - Two hidden React modal mounts (`ExecutingHintModal`, `SaveSheetModal`)
*
- * AI side pane has been hoisted to `StandardPanel.vue` (Vue host) so
- * the cross-framework boundary stays clean — see Stage 17 design.
+ * The AI side pane lives in `StandardPanel`.
*/
export function EditorMain({ onChangeConnection }: EditorMainProps) {
const { instance } = useConnectionOfCurrentSQLEditorTab();
@@ -62,8 +59,8 @@ export function EditorMain({ onChangeConnection }: EditorMainProps) {
[execute]
);
- // Run-from-toolbar: pull the active statement that the React
- // `SQLEditor` published to the shared shallowRef.
+ // Run-from-toolbar: pull the active statement that `SQLEditor`
+ // published to `activeStatementRef`.
const handleExecuteFromActionBar = useCallback(
(params: SQLEditorQueryParams) => {
const tabsState = getSQLEditorTabsState();
@@ -106,8 +103,7 @@ export function EditorMain({ onChangeConnection }: EditorMainProps) {
if (!isDisconnected && !allowReadonlyMode) {
// Connected to an instance without a read-only data source —
- // surface the admin-mode CTA, matching Vue `EditorMain.vue`'s
- // `<ReactPageMount v-else page="ReadonlyModeNotSupported" />` branch.
+ // surface the admin-mode CTA.
return <ReadonlyModeNotSupported />;
}
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/FileContentPreviewModal.tsx b/frontend/src/modules/sql-editor/components/StandardPanel/FileContentPreviewModal.tsx
index 11165c1d6b..e218eaff09 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/FileContentPreviewModal.tsx
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/FileContentPreviewModal.tsx
@@ -22,7 +22,6 @@ interface FileContentPreviewModalProps {
}
/**
- * React port of `frontend/src/components/FileContentPreviewModal.vue`.
* Decodes the file as bytes, exposes an encoding picker, renders the
* decoded text in a read-only Monaco preview, and emits the chosen
* statement back to the caller on confirm.
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/SQLEditor.tsx b/frontend/src/modules/sql-editor/components/StandardPanel/SQLEditor.tsx
index babaa46026..d50eaa0242 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/SQLEditor.tsx
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/SQLEditor.tsx
@@ -50,9 +50,7 @@ interface SQLEditorProps {
}
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/StandardPanel/SQLEditor.vue`.
- *
- * SavedQuery Monaco editor with full keybinding parity:
+ * SavedQuery Monaco editor with keybindings:
* - Cmd+Enter run / Cmd+Shift+Enter run-in-new-tab
* - Cmd+S save sheet
* - Cmd+E explain (or "Dry Run" for BigQuery)
@@ -63,10 +61,6 @@ interface SQLEditorProps {
* instance is published to `activeSQLEditorRef` (plain mutable
* singleton) so ResultView's ErrorView "Goto Error" action can
* imperatively focus the editor.
- *
- * Exposes `getActiveStatement` via `useImperativeHandle` so EditorMain
- * (parent) can read the active selection or full statement when a query
- * is run from the toolbar.
*/
export function SQLEditor({ onExecute }: SQLEditorProps) {
const { isReadOnly: readonly } = useSavedQueryAndTab();
@@ -127,8 +121,8 @@ export function SQLEditor({ onExecute }: SQLEditorProps) {
// Publish the live "active statement" — Monaco's delimited
// statement under the cursor, or the full content as fallback —
- // to the module-level shared ref so the Vue EditorMain toolbar
- // can read it without a React ref.
+ // to the module-level shared ref so the EditorMain toolbar can
+ // read it.
const handleActiveContentChange = useCallback((value: string) => {
activeStatementRef.value = value;
}, []);
@@ -154,7 +148,7 @@ export function SQLEditor({ onExecute }: SQLEditorProps) {
getSQLEditorTabsState().updateCurrentTab({ selectedStatement: value });
}, []);
- // Guard flag so the Vue→Monaco selection watcher below doesn't fire
+ // Guard flag so the tab→Monaco selection effect below doesn't fire
// when the change came from the editor itself (would interrupt
// mouse-drag word selection).
const selectionFromEditorRef = useRef(false);
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/SQLUploadButton.tsx b/frontend/src/modules/sql-editor/components/StandardPanel/SQLUploadButton.tsx
index e5fa6e8499..4d87edb073 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/SQLUploadButton.tsx
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/SQLUploadButton.tsx
@@ -15,8 +15,6 @@ interface SQLUploadButtonProps {
}
/**
- * React port of `frontend/src/components/misc/SQLUploadButton.vue`.
- *
* Hidden `<input type="file">` triggered by clicking the button. After
* the user picks a file, mounts a preview modal that decodes + shows
* the content; the parent receives the final text via `onUpdateSql`.
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/StandardPanel.tsx b/frontend/src/modules/sql-editor/components/StandardPanel/StandardPanel.tsx
index 358855ba6b..391fc2f968 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/StandardPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/StandardPanel.tsx
@@ -21,9 +21,6 @@ import {
import { instanceV1HasReadonlyMode } from "@/utils";
import { EditorMain } from "./EditorMain";
-// Lazy-load EditorMain ↔ Pane callback to keep parity with Vue's
-// async-imported `AIChatToSQL`. The original `<Suspense>` fallback is
-// the matrix-style spinner; we mirror that with `<Loader2 />`.
const AIPaneFallback = () => (
<div className="w-full h-full grow flex flex-col items-center justify-center">
<Loader2 className="size-6 animate-spin text-control-light" />
@@ -31,19 +28,15 @@ const AIPaneFallback = () => (
);
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/StandardPanel/StandardPanel.vue`.
- *
* SavedQuery-mode editor host. Layout, ordered top-to-bottom:
* 1. Optional outer vertical split — editor / `<ResultPanel>`.
- * Only rendered when the underlying instance supports read-only
- * queries (mirrors the Vue `showResultPanel` gate that prevents
- * the editor from being squeezed into an arbitrary top pane when
- * the result pane wouldn't render anyway).
+ * Only rendered when the tab is connected and the instance supports
+ * read-only queries (`showResultPanel`), so the editor isn't
+ * squeezed into an arbitrary top pane when the result pane wouldn't
+ * render anyway.
* 2. Inner horizontal split — `<EditorMain>` / `<AIChatToSQL>`.
- * The AI side pane is now a React tree (Stage 22 port). `<AIContextProvider>`
- * wraps the React `<AIChatToSQL>` to re-establish the per-tab AI
- * state — the Vue `<VueMount component={AIChatToSQLBridgeHost}>`
- * bridge is gone.
+ * `<AIContextProvider>` wraps `<AIChatToSQL>` to provide the per-tab
+ * AI state.
*
* State source: tab Zustand selectors for tab + disconnect state,
* `useConnectionOfCurrentSQLEditorTab` for the current instance,
@@ -73,7 +66,7 @@ export function StandardPanel() {
const handleAiPanelResize = (sizePct: number) => {
// react-resizable-panels reports a `PanelSize` struct
- // ({ asPercentage, inPixels }) on resize. Pinia stores a 0-1
+ // ({ asPercentage, inPixels }) on resize. The store keeps a 0-1
// fraction (`{size: 0.7, ...}`); convert and forward — the store's
// setter writes `1 - size` to localStorage.
if (!Number.isFinite(sizePct)) return;
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/UploadFileButton.tsx b/frontend/src/modules/sql-editor/components/StandardPanel/UploadFileButton.tsx
index 3bbb758ce4..1a8096a882 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/UploadFileButton.tsx
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/UploadFileButton.tsx
@@ -10,8 +10,6 @@ interface UploadFileButtonProps {
}
/**
- * React port of
- * `frontend/src/views/sql-editor/EditorPanel/StandardPanel/UploadFileButton.vue`.
* Tooltip-wrapped icon button that delegates to `SQLUploadButton`.
*/
export function UploadFileButton({ onUpload }: UploadFileButtonProps) {
diff --git a/frontend/src/modules/sql-editor/components/StandardPanel/state.ts b/frontend/src/modules/sql-editor/components/StandardPanel/state.ts
index 7640a54201..7cb6d08a91 100644
--- a/frontend/src/modules/sql-editor/components/StandardPanel/state.ts
+++ b/frontend/src/modules/sql-editor/components/StandardPanel/state.ts
@@ -1,9 +1,7 @@
import { type IStandaloneCodeEditor } from "@/components/monaco/types";
-// Plain mutable holders — only ever read/written imperatively from event
-// handlers (no `watch`, no React subscription), so a `{ value }` object
-// matches every call site's `.value` access without dragging Vue's
-// reactivity system in.
+// Plain mutable holders — only ever read/written imperatively (no React
+// subscription), so a `{ value }` object is enough.
export const activeSQLEditorRef: { value: IStandaloneCodeEditor | undefined } =
{
value: undefined,
diff --git a/frontend/src/modules/sql-editor/components/StandardPanelPage.tsx b/frontend/src/modules/sql-editor/components/StandardPanelPage.tsx
deleted file mode 100644
index bf4e1ce97f..0000000000
--- a/frontend/src/modules/sql-editor/components/StandardPanelPage.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate `<StandardPanel>`
- * via `mount.ts`'s `pageDirs` lookup (it scans for `<page>.tsx` files
- * at the registered roots, not subdirectories).
- *
- * Vue caller mounts this with `<ReactPageMount page="StandardPanelPage">`.
- * Removed when `EditorPanel.vue` flips to React in a later slice of
- * Stage 21 and imports `StandardPanel` directly.
- */
-export { StandardPanel as StandardPanelPage } from "./StandardPanel/StandardPanel";
diff --git a/frontend/src/modules/sql-editor/components/TabContextMenu.tsx b/frontend/src/modules/sql-editor/components/TabContextMenu.tsx
index 112b7c0765..942d89bd44 100644
--- a/frontend/src/modules/sql-editor/components/TabContextMenu.tsx
+++ b/frontend/src/modules/sql-editor/components/TabContextMenu.tsx
@@ -29,7 +29,6 @@ type Target = {
};
/**
- * Replaces frontend/src/views/sql-editor/TabList/ContextMenu.vue.
* Tab right-click menu. Uses the same invisible-trigger pattern as
* SheetTree's context menu: a 0x0 `position: fixed` MenuTrigger positioned
* at the cursor is `.click()`-ed programmatically so Base UI records a
diff --git a/frontend/src/modules/sql-editor/components/TabItem.tsx b/frontend/src/modules/sql-editor/components/TabItem.tsx
index 837aa3f01a..3c7e0a4386 100644
--- a/frontend/src/modules/sql-editor/components/TabItem.tsx
+++ b/frontend/src/modules/sql-editor/components/TabItem.tsx
@@ -20,7 +20,6 @@ const iconByTab = {
/**
* Single tab button in the SQL Editor aside panel's left gutter.
- * Replaces frontend/src/views/sql-editor/AsidePanel/GutterBar/TabItem.vue.
* Active state reflects `useSQLEditorStore().asidePanelTab`; click handler
* is supplied by the GutterBar parent (which writes the store).
*/
diff --git a/frontend/src/modules/sql-editor/components/TabItem/AdminLabel.tsx b/frontend/src/modules/sql-editor/components/TabItem/AdminLabel.tsx
index b668f5ef38..d05e7d4a2f 100644
--- a/frontend/src/modules/sql-editor/components/TabItem/AdminLabel.tsx
+++ b/frontend/src/modules/sql-editor/components/TabItem/AdminLabel.tsx
@@ -15,15 +15,14 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue.
* Breadcrumb shown in the tab title when a tab is in ADMIN mode:
* `environment > instance > database`. Hides the environment segment when
* the database has no environment (unknown).
*/
export function AdminLabel({ tab }: Props) {
const dbName = tab.connection.database;
- // Mirrors Vue's `useDatabaseV1ByName`: self-fetches on mount / name change
- // and reactively re-reads the cached database.
+ // Self-fetches on mount / name change and reactively re-reads the cached
+ // database.
const database = useAppDatabase(dbName);
const instance = getInstanceResource(database);
const environment = getDatabaseEnvironment(database);
diff --git a/frontend/src/modules/sql-editor/components/TabItem/Label.tsx b/frontend/src/modules/sql-editor/components/TabItem/Label.tsx
index 54086991ca..9ecbf8462f 100644
--- a/frontend/src/modules/sql-editor/components/TabItem/Label.tsx
+++ b/frontend/src/modules/sql-editor/components/TabItem/Label.tsx
@@ -14,11 +14,10 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/TabList/TabItem/Label.vue.
* Tab title with:
* - Double-click to enter in-place rename.
* - Listens for external `rename-tab` events (fired from the context menu)
- * so right-click → Rename still works during the Vue → React migration.
+ * so right-click → Rename works.
* - Ellipsis + native tooltip via EllipsisText.
*/
export function Label({ tab }: Props) {
@@ -87,8 +86,9 @@ export function Label({ tab }: Props) {
}, [tab.title, editing]);
// Respond to external rename-tab events (fired from the context menu).
- // `readonly` + `tab.id` are the only closure values we care about; the
- // other helpers are referentially stable via the Pinia store singletons.
+ // `tab.id`, `tab.title`, and `readonly` are the only closure values we care
+ // about; the other helpers (store accessor, state setters) are
+ // referentially stable.
useEffect(() => {
const unsubscribe = tabListEvents.on("rename-tab", ({ data: payload }) => {
if (payload.tab.id !== tab.id) return;
diff --git a/frontend/src/modules/sql-editor/components/TabItem/Prefix.tsx b/frontend/src/modules/sql-editor/components/TabItem/Prefix.tsx
index 214f9774f1..35d136aa36 100644
--- a/frontend/src/modules/sql-editor/components/TabItem/Prefix.tsx
+++ b/frontend/src/modules/sql-editor/components/TabItem/Prefix.tsx
@@ -9,7 +9,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/TabList/TabItem/Prefix.vue.
* Leading icons on a tab row:
* - Pencil for draft (no saved query yet).
* - Users glyph when viewing someone else's shared savedQuery.
diff --git a/frontend/src/modules/sql-editor/components/TabItem/Suffix.tsx b/frontend/src/modules/sql-editor/components/TabItem/Suffix.tsx
index 1f9a114d01..789009658b 100644
--- a/frontend/src/modules/sql-editor/components/TabItem/Suffix.tsx
+++ b/frontend/src/modules/sql-editor/components/TabItem/Suffix.tsx
@@ -11,7 +11,6 @@ type Props = {
type IconKind = "unsaved" | "saving" | "close" | "dummy";
/**
- * Replaces frontend/src/views/sql-editor/TabList/TabItem/Suffix.vue.
* Trailing affordance of a tab: close button (✕) or dirty/saving indicator
* depending on tab state + hover.
*/
diff --git a/frontend/src/modules/sql-editor/components/TabItem/TabItem.tsx b/frontend/src/modules/sql-editor/components/TabItem/TabItem.tsx
index bb83a5e7de..060075e161 100644
--- a/frontend/src/modules/sql-editor/components/TabItem/TabItem.tsx
+++ b/frontend/src/modules/sql-editor/components/TabItem/TabItem.tsx
@@ -27,7 +27,6 @@ type Props = {
};
/**
- * Replaces frontend/src/views/sql-editor/TabList/TabItem/TabItem.vue.
* One row in the tab bar. Composes Prefix + (Label|AdminLabel) + Suffix,
* handles left-click to select + contextmenu emit, and ties into @dnd-kit's
* sortable for drag-reorder inside TabList.
diff --git a/frontend/src/modules/sql-editor/components/TabList.tsx b/frontend/src/modules/sql-editor/components/TabList.tsx
index c3a7abcafb..22fdc4dace 100644
--- a/frontend/src/modules/sql-editor/components/TabList.tsx
+++ b/frontend/src/modules/sql-editor/components/TabList.tsx
@@ -55,7 +55,6 @@ type PendingClose = {
};
/**
- * Replaces frontend/src/views/sql-editor/TabList/TabList.vue.
* Horizontal tab bar at the top of the SQL editor. Drag-reorder via
* @dnd-kit, overflow-x scroll, "+" button to add a new saved query, and
* right-click context menu delegated to TabContextMenu.
@@ -321,10 +320,9 @@ export function TabList() {
<AlertDialog
open={pendingClose !== null}
- // Vue's confirm dialog used `closeOnEsc: false`, `maskClosable: false`,
- // `closable: false` — the user MUST click Cancel or "Close tab".
- // Cancel Base UI's close when the reason is Esc / outside-click so
- // the dialog stays open and forces an explicit choice.
+ // The user MUST click Cancel or "Close tab". Cancel Base UI's close
+ // when the reason is Esc / outside-click so the dialog stays open
+ // and forces an explicit choice.
onOpenChange={(
open: boolean,
eventDetails?: { reason?: string; cancel?: () => void }
diff --git a/frontend/src/modules/sql-editor/components/TerminalPanel/CompactSQLEditor.tsx b/frontend/src/modules/sql-editor/components/TerminalPanel/CompactSQLEditor.tsx
index 1a70958575..bbee196954 100644
--- a/frontend/src/modules/sql-editor/components/TerminalPanel/CompactSQLEditor.tsx
+++ b/frontend/src/modules/sql-editor/components/TerminalPanel/CompactSQLEditor.tsx
@@ -37,13 +37,11 @@ interface CompactSQLEditorProps {
}
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/TerminalPanel/CompactSQLEditor.vue`.
- *
* Terminal-style Monaco editor with a CLI-like prompt:
* SQL> first_line
* -> second_line
*
- * Wires up the same keybindings + context keys as the Vue version:
+ * Wires up keybindings + context keys:
* Cmd+Enter (run), Cmd+E (explain / dry-run for BigQuery), Alt+Shift+C
* (clear screen), Enter-when-statement-ends-with-`;` (run), and
* Up/Down arrow at top/bottom for history navigation.
@@ -214,7 +212,6 @@ export function CompactSQLEditor({
// Monaco commands don't return a disposable — they live with the
// editor instance and clean up when the editor is destroyed.
- // Match the Vue version's fire-and-forget pattern.
editor.addCommand(
monaco.KeyCode.Enter,
() => execute(false),
@@ -294,7 +291,7 @@ export function CompactSQLEditor({
};
}, [engine, editorState]);
- // Format-content event from useSQLEditorContext (Vue `editorEvents`).
+ // Format-content event from `sqlEditorEvents`.
useEffect(() => {
const off = sqlEditorEvents.on("format-content", () => {
const editor = editorRef.current;
diff --git a/frontend/src/modules/sql-editor/components/TerminalPanel/TerminalPanel.tsx b/frontend/src/modules/sql-editor/components/TerminalPanel/TerminalPanel.tsx
index a0cd7294db..6f092ce152 100644
--- a/frontend/src/modules/sql-editor/components/TerminalPanel/TerminalPanel.tsx
+++ b/frontend/src/modules/sql-editor/components/TerminalPanel/TerminalPanel.tsx
@@ -20,22 +20,18 @@ import { CompactSQLEditor } from "./CompactSQLEditor";
import { useHistory } from "./useHistory";
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue`.
- *
* Hosts the admin-mode terminal: a top action bar, then a vertically
* scrolling stack of `<CompactSQLEditor>` + `<ResultView>` rows (one per
* historical query). Tail row is editable; older rows are read-only.
- * When the underlying Pinia tab is disconnected we render
- * `<ConnectionHolder>` instead (mirrors the Vue `v-if`).
+ * When the tab is disconnected we render `<ConnectionHolder>` instead.
*
* State source:
- * - `webTerminalStore.getQueryStateByTab(currentTab).queryItemList` — the
+ * - `useSQLEditorStore`'s `webTerminalQueryItemsByTabId[currentTabId]` — the
* per-tab list of query items (statements + their result sets).
- * - `useHistory()` — the up/down arrow command-history Pinia composable.
+ * - `useHistory()` — the up/down arrow command history.
*
* Auto-scroll: a ResizeObserver on the inner stack scrolls the outer
- * container to the bottom whenever the stack grows (replacing Vue's
- * `useElementSize` + watch).
+ * container to the bottom whenever the stack grows.
*/
export function TerminalPanel() {
const { t } = useTranslation();
@@ -70,7 +66,7 @@ export function TerminalPanel() {
// Subscribe to the per-tab query items from the zustand slice — every
// mutation (push, status flip, resultSet attach) produces a new array
- // reference, so the component re-renders without any Vue `watch`.
+ // reference, so the component re-renders.
const queryList = useSQLEditorStore(
(s) =>
(currentTabId
@@ -164,8 +160,7 @@ export function TerminalPanel() {
};
// Auto-scroll the outer container to the bottom whenever the inner
- // stack resizes. ResizeObserver replaces `@vueuse/core`'s
- // `useElementSize` + `watch(queryListHeight, ...)`.
+ // stack resizes.
const containerRef = useRef<HTMLDivElement | null>(null);
const stackRef = useRef<HTMLDivElement | null>(null);
useEffect(() => {
diff --git a/frontend/src/modules/sql-editor/components/TerminalPanel/useHistory.ts b/frontend/src/modules/sql-editor/components/TerminalPanel/useHistory.ts
index 4606e6c1f8..ff504339ff 100644
--- a/frontend/src/modules/sql-editor/components/TerminalPanel/useHistory.ts
+++ b/frontend/src/modules/sql-editor/components/TerminalPanel/useHistory.ts
@@ -19,15 +19,11 @@ interface HistoryState {
}
/**
- * React port of `frontend/src/views/sql-editor/EditorPanel/TerminalPanel/useHistory.ts`.
- *
* Tracks an in-memory command history per ADMIN-mode tab so the up/down
- * arrow keys cycle through previously executed statements. Differs from the
- * Vue original in HOW it captures snapshots: Vue mutated reactive proxies in
- * place, so it could safely push the live tail at creation time and read its
- * statement later. zustand replaces items immutably on every patch, so we
- * push only when an item is *finalized* (a new tail just got appended,
- * meaning the prior tail's statement is locked in).
+ * arrow keys cycle through previously executed statements. zustand replaces
+ * items immutably on every patch, so we push only when an item is
+ * *finalized* (a new tail just got appended, meaning the prior tail's
+ * statement is locked in).
*/
export function useHistory() {
const updateWebTerminalQueryItem = useSQLEditorStore(
diff --git a/frontend/src/modules/sql-editor/components/TerminalPanelPage.tsx b/frontend/src/modules/sql-editor/components/TerminalPanelPage.tsx
deleted file mode 100644
index 2ab47031d6..0000000000
--- a/frontend/src/modules/sql-editor/components/TerminalPanelPage.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Top-level page shim so `ReactPageMount` can locate `<TerminalPanel>`
- * via `mount.ts`'s `pageDirs` lookup (it scans for `<page>.tsx` files at
- * the registered roots, not subdirectories).
- *
- * Vue caller mounts this with `<ReactPageMount page="TerminalPanelPage">`.
- * Removed when `EditorPanel.vue` flips to React in a later slice of
- * Stage 21 and imports `TerminalPanel` directly.
- */
-export { TerminalPanel as TerminalPanelPage } from "./TerminalPanel/TerminalPanel";
diff --git a/frontend/src/modules/sql-editor/components/Welcome.tsx b/frontend/src/modules/sql-editor/components/Welcome.tsx
index 991cec9cc2..a480d69118 100644
--- a/frontend/src/modules/sql-editor/components/Welcome.tsx
+++ b/frontend/src/modules/sql-editor/components/Welcome.tsx
@@ -34,9 +34,9 @@ import { WelcomeButton } from "./WelcomeButton";
export type WelcomeProps = {
/**
- * Called when the user clicks "Connect to a database". Vue parent
+ * Called when the user clicks "Connect to a database". `StandardPanel`
* passes a callback that sets `asidePanelTab = "SCHEMA"` and
- * `showConnectionPanel = true` on the Vue-side SQL Editor context.
+ * `showConnectionPanel = true` on the SQL Editor store.
*/
readonly onChangeConnection: () => void;
};
diff --git a/frontend/src/modules/sql-editor/components/theme/presets/presets.test.ts b/frontend/src/modules/sql-editor/components/theme/presets/index.test.ts
similarity index 100%
rename from frontend/src/modules/sql-editor/components/theme/presets/presets.test.ts
rename to frontend/src/modules/sql-editor/components/theme/presets/index.test.ts
diff --git a/frontend/src/modules/sql-editor/components/useDropdown.ts b/frontend/src/modules/sql-editor/components/useDropdown.ts
index dc1e168918..dd61184ab2 100644
--- a/frontend/src/modules/sql-editor/components/useDropdown.ts
+++ b/frontend/src/modules/sql-editor/components/useDropdown.ts
@@ -68,7 +68,7 @@ export function useDropdown(
const [showSharePanel, setShowSharePanel] = useState(false);
// ------------------------------------------------------------------
- // Reactive reads from Pinia / Vue stores
+ // Reactive reads from the app store
// ------------------------------------------------------------------
const savedQueryEntity = useAppStore((s) =>
viewMode === "draft" || !currentNode?.savedQuery
@@ -215,10 +215,7 @@ export function useDropdown(
setShowSharePanel(false);
};
- /**
- * Opens the share panel for `node`.
- * Mirrors Vue's handleSharePanelShow (but without x/y positioning).
- */
+ /** Opens the share panel for `node`. */
const handleSharePanelShow = (
e: React.MouseEvent,
node: SavedQueryFolderNode
diff --git a/frontend/src/modules/sql-editor/components/useSQLEditorAutoSave.ts b/frontend/src/modules/sql-editor/components/useSQLEditorAutoSave.ts
index 0ec8872709..dfc426c90e 100644
--- a/frontend/src/modules/sql-editor/components/useSQLEditorAutoSave.ts
+++ b/frontend/src/modules/sql-editor/components/useSQLEditorAutoSave.ts
@@ -10,14 +10,11 @@ import { isSavedQueryWritableV1 } from "@/utils";
const AUTO_SAVE_DEBOUNCE_MS = 2000;
/**
- * React port of the auto-save block previously embedded in
- * `views/sql-editor/context.ts`'s `provideSQLEditorContext()`.
- *
* Watches the active tab's `statement` and after a 2s debounce calls
- * `maybeUpdateSavedQuery` if the tab is dirty + writable. Mirrors the
- * Vue `watchDebounced` behavior: aborts any in-flight auto-save when a
- * newer one starts, reverts the tab to DIRTY on error (unless aborted),
- * and re-flags DIRTY when the statement keeps changing during the save.
+ * `maybeUpdateSavedQuery` if the tab is dirty + writable. Aborts any
+ * in-flight auto-save when a newer one starts, reverts the tab to DIRTY
+ * on error (unless aborted), and re-flags DIRTY when the statement keeps
+ * changing during the save.
*
* Mounted once at the SQL Editor layout level; safe to call from any
* component but should only be active while the SQL Editor route is.
@@ -50,8 +47,8 @@ export function useSQLEditorAutoSave() {
}
};
// We re-arm the debounce on every statement change. The save itself
- // reads tab.statement from Pinia at fire time, so capturing only the
- // change-trigger here is sufficient.
+ // reads tab.statement from the tab store at fire time, so capturing
+ // only the change-trigger here is sufficient.
}, [statement]);
const runAutoSave = async () => {
diff --git a/frontend/src/modules/sql-editor/model/Sheet/context.test.tsx b/frontend/src/modules/sql-editor/model/Sheet/context.test.tsx
index c9ec2c5fdf..973df5d45f 100644
--- a/frontend/src/modules/sql-editor/model/Sheet/context.test.tsx
+++ b/frontend/src/modules/sql-editor/model/Sheet/context.test.tsx
@@ -16,7 +16,6 @@ type AppState = {
savedQueriesByKey: Record<string, SavedQuery>;
isSaaSMode: () => boolean;
getSavedQueryByName: (name: string) => SavedQuery | undefined;
- savedQueryList: () => SavedQuery[];
patchSavedQueryFolderInCache: ReturnType<typeof vi.fn>;
searchSavedQueryFolders: ReturnType<typeof vi.fn>;
fetchSavedQueryList: ReturnType<typeof vi.fn>;
@@ -67,7 +66,6 @@ const mocks = vi.hoisted(() => {
isSaaSMode: () => false,
getSavedQueryByName: (name: string) =>
appState.savedQueriesByKey[keyForSavedQuery(name)],
- savedQueryList: () => Object.values(appState.savedQueriesByKey),
searchSavedQueryFolders: vi.fn(async () => []),
fetchSavedQueryList: vi.fn(async (_project, _filter, _params) => {
const savedQuery = create(SavedQuerySchema, {
diff --git a/frontend/src/modules/sql-editor/model/Sheet/context.ts b/frontend/src/modules/sql-editor/model/Sheet/context.ts
index f354087eeb..54f3f097ff 100644
--- a/frontend/src/modules/sql-editor/model/Sheet/context.ts
+++ b/frontend/src/modules/sql-editor/model/Sheet/context.ts
@@ -848,8 +848,7 @@ const cachedSavedQueriesForView = (view: SheetViewMode): SavedQuery[] => {
// SQLEditorLayout awaits `loadCurrentUser()` in its bootstrap, so by the
// time saved queries land here the app-store `currentUser` is populated.
// Empty `email` falls through to creator `"users/"`, which matches no
- // saved queries — they'd render as Shared rather than Mine, same fallback
- // the previous Pinia path had.
+ // saved queries — they'd render as Shared rather than Mine.
const email = useAppStore.getState().currentUser?.email ?? "";
const creator = `users/${email}`;
const appState = useAppStore.getState();
@@ -1417,8 +1416,7 @@ const bindWatchers = () => {
}
// Rebuild a view's tree when its folder set changes (add / remove /
- // move folder). Mirrors the Vue `watch(folderContext.folders,
- // rebuildTree)`. Debounced + idempotent `mergeFolders` inside the
+ // move folder). Debounced + idempotent `mergeFolders` inside the
// rebuild keeps this from looping: the rebuild only writes folders
// back when a saved query introduces a brand-new path, which settles
// after one extra pass.
@@ -1439,10 +1437,9 @@ const bindWatchers = () => {
}
// Draft-tab set / title change → rebuild the draft tree. The draft
- // view's `sheetLikeItemList` is derived from open tabs without a
- // saved query, so adding / closing / renaming a draft must refresh it.
- // Mirrors the Vue `watch(sheetLikeItemList, rebuildTree)` for the
- // draft view context.
+ // view's items (`sheetLikeItemsForView`) are derived from open tabs
+ // without a saved query, so adding / closing / renaming a draft must
+ // refresh it.
const draftSig = computeDraftSignature(tabsState);
if (draftSig !== _lastDraftSig) {
_lastDraftSig = draftSig;
@@ -1452,10 +1449,8 @@ const bindWatchers = () => {
// Rebuild the saved query-backed trees whenever the saved query cache
// mutates — a fetch, a title patch (e.g. renamed from the editor tab),
- // a star toggle, or a delete. Mirrors the Vue
- // `watch(sheetLikeItemList, rebuildTree)` that drove the tree off the
- // saved query list. The "draft" view is tab-derived, not saved query-
- // derived, so it doesn't need this. Debounced rebuilds coalesce the
+ // a star toggle, or a delete. The "draft" view is tab-derived, not saved
+ // query-derived, so it doesn't need this. Debounced rebuilds coalesce the
// burst of cache writes a single fetch produces.
useAppStore.subscribe((state, prev) => {
if (state.savedQueriesByKey === prev.savedQueriesByKey) return;
@@ -1640,19 +1635,13 @@ export function useSheetContextByView(view: SheetViewMode): ViewContext {
/**
* Eagerly initialize the sheet-state watchers + storage hydration so
- * the rest of the app sees a populated context on mount. Kept as a
- * no-op-shaped function for source compatibility with the Pinia-era
- * `provideSheetContext()` boot call.
+ * the rest of the app sees a populated context on mount.
*/
export function provideSheetContext(): void {
bindWatchers();
}
-// `KEY` was a Vue `InjectionKey`; kept exported as a Symbol for source
-// compatibility (no current consumers).
-export const KEY = Symbol("bb.sql-editor.sheet");
-
-// ---- tree helpers (unchanged) ----------------------------------------------
+// ---- tree helpers ----------------------------------------------------------
export const revealNodes = <T>(
node: SavedQueryFolderNode,
@@ -1679,7 +1668,7 @@ export const revealSavedQueries = <T>(
});
};
-// ---- openSavedQueryByName (unchanged behavior) ------------------------------
+// ---- openSavedQueryByName --------------------------------------------------
export const openSavedQueryByName = async ({
savedQuery,
@@ -1736,6 +1725,6 @@ export const openSavedQueryByName = async ({
};
// Touch the editor store import so it's eagerly evaluated alongside the
-// tab store (matches the historical Pinia-era load order).
+// tab store.
void useSQLEditorEditorStore;
void useSQLEditorTabsStore;
diff --git a/frontend/src/modules/sql-editor/model/TabList/events.ts b/frontend/src/modules/sql-editor/model/TabList/events.ts
index 83968a575a..b950ba3ed1 100644
--- a/frontend/src/modules/sql-editor/model/TabList/events.ts
+++ b/frontend/src/modules/sql-editor/model/TabList/events.ts
@@ -14,10 +14,8 @@ export type TabListEventMap = {
};
/**
- * Module-level tab list event bus. Imported by both the Vue
- * `provideTabListContext` (via `./context`) and React consumers that can't
- * participate in Vue's provide/inject. Single shared instance so emit/on
- * from either side reaches the other — same pattern used for the AI events
- * singleton (see `src/plugins/ai/logic/events.ts`).
+ * Module-level tab list event bus. Single shared instance so emit/on from
+ * any component reaches the others — same pattern used for the AI events
+ * singleton (see `src/modules/ai/logic/events.ts`).
*/
export const tabListEvents: Emittery<TabListEventMap> = new Emittery();
diff --git a/frontend/src/modules/sql-editor/store/editor.ts b/frontend/src/modules/sql-editor/store/editor.ts
index 72969191c9..f1cff46b62 100644
--- a/frontend/src/modules/sql-editor/store/editor.ts
+++ b/frontend/src/modules/sql-editor/store/editor.ts
@@ -166,8 +166,8 @@ export const getSQLEditorEditorState = (): SQLEditorEditorState =>
useSQLEditorEditorStore.getState();
/**
- * Low-level subscription primitive for non-React consumers (Vue compat
- * shim, side-effect modules). Returns an unsubscribe function.
+ * Low-level subscription primitive for non-React consumers (e.g.
+ * side-effect modules). Returns an unsubscribe function.
*/
export const subscribeSQLEditorEditorState = (
listener: (state: SQLEditorEditorState) => void
diff --git a/frontend/src/modules/sql-editor/store/savedQuery.test.ts b/frontend/src/modules/sql-editor/store/savedQuery.test.ts
index 77d10d4560..775a35d272 100644
--- a/frontend/src/modules/sql-editor/store/savedQuery.test.ts
+++ b/frontend/src/modules/sql-editor/store/savedQuery.test.ts
@@ -13,9 +13,7 @@ import type {
} from "./types";
// Stub all the other slices so the composed store satisfies
-// `SQLEditorStoreState` without dragging in real implementations
-// (the saved query slice itself dynamic-imports the Pinia stores it
-// needs, so we only have to mock those via vi.mock below).
+// `SQLEditorStoreState` without dragging in real implementations.
const stubUIStateSlice = (): UIStateSlice => ({
asidePanelTab: "SAVED_QUERY",
showConnectionPanel: false,
@@ -62,21 +60,7 @@ const stubWebTerminalSlice = (): WebTerminalSlice => ({
updateWebTerminalQueryItem: vi.fn(),
});
-const piniaMocks = vi.hoisted(() => ({
- editorStore: {
- project: "projects/default",
- projectContextReady: true,
- setProject: vi.fn(),
- },
- projectStore: {
- getOrFetchProjectByName: vi.fn(),
- },
- projectIamPolicyStore: {
- getOrFetchProjectIamPolicy: vi.fn(),
- },
- tabStore: {
- updateTab: vi.fn(),
- },
+const mocks = vi.hoisted(() => ({
savedQueryStore: {
getSavedQueryByName: vi.fn(),
patchSavedQuery: vi.fn(),
@@ -86,24 +70,10 @@ const piniaMocks = vi.hoisted(() => ({
},
}));
-vi.mock("@/stores", () => ({
- useProjectV1Store: () => piniaMocks.projectStore,
-}));
+vi.mock("@/stores", () => ({}));
vi.mock("@/stores/app", () => ({
- useAppStore: { getState: () => piniaMocks.savedQueryStore },
-}));
-
-vi.mock("@/modules/sql-editor/store/tab-vue-state", () => ({
- useSQLEditorTabStore: () => piniaMocks.tabStore,
-}));
-
-vi.mock("./editor-vue-state", () => ({
- useSQLEditorVueState: () => piniaMocks.editorStore,
-}));
-
-vi.mock("@/stores/modules/v1/projectIamPolicy", () => ({
- useProjectIamPolicyStore: () => piniaMocks.projectIamPolicyStore,
+ useAppStore: { getState: () => mocks.savedQueryStore },
}));
vi.mock("@/modules/sql-editor/model/events", () => ({
@@ -133,15 +103,13 @@ const makeStore = (): StoreApi<SQLEditorStoreState> =>
}));
beforeEach(() => {
- Object.values(piniaMocks).forEach((store) => {
+ Object.values(mocks).forEach((store) => {
Object.values(store).forEach((v) => {
if (typeof v === "function" && "mockReset" in v) {
(v as { mockReset: () => void }).mockReset();
}
});
});
- piniaMocks.editorStore.project = "projects/default";
- piniaMocks.editorStore.projectContextReady = true;
getSQLEditorEditorState().setProject("");
getSQLEditorTabsState().reset();
});
@@ -189,12 +157,12 @@ describe("saved query save slice — maybeUpdateSavedQuery", () => {
statement: "select * from SUPPORDERS_VIS.items",
status: "DIRTY",
});
- piniaMocks.savedQueryStore.getSavedQueryByName.mockReturnValue({
+ mocks.savedQueryStore.getSavedQueryByName.mockReturnValue({
name: tab.savedQuery,
title: "Cosmos saved query",
database: tab.connection.database,
});
- piniaMocks.savedQueryStore.patchSavedQuery.mockResolvedValue({
+ mocks.savedQueryStore.patchSavedQuery.mockResolvedValue({
name: tab.savedQuery,
});
@@ -218,14 +186,14 @@ describe("saved query save slice — maybeSwitchProject", () => {
const store = makeStore();
const result = await store.getState().maybeSwitchProject("not-a-project");
expect(result).toBeUndefined();
- expect(piniaMocks.editorStore.setProject).not.toHaveBeenCalled();
+ expect(getSQLEditorEditorState().project).toBe("");
});
test("switches project even when project IAM policy preload fails", async () => {
- piniaMocks.savedQueryStore.fetchProject.mockResolvedValue({
+ mocks.savedQueryStore.fetchProject.mockResolvedValue({
name: "projects/aaa",
});
- piniaMocks.savedQueryStore.loadProjectIamPolicy.mockRejectedValue(
+ mocks.savedQueryStore.loadProjectIamPolicy.mockRejectedValue(
new Error("permission denied")
);
diff --git a/frontend/src/modules/sql-editor/store/savedQuery.ts b/frontend/src/modules/sql-editor/store/savedQuery.ts
index 50087d0d95..f8057bf9eb 100644
--- a/frontend/src/modules/sql-editor/store/savedQuery.ts
+++ b/frontend/src/modules/sql-editor/store/savedQuery.ts
@@ -38,10 +38,7 @@ export const createSavedQuerySaveSlice: SQLEditorSliceCreator<
if (!project) {
return;
}
- // Fetch IAM policy so `hasProjectPermissionV2` sees the bindings. The
- // Pinia permission store falls back to `app.projectPoliciesByName` when
- // its own cache is empty, so populating the app `iam` slice is enough
- // (see `src/store/modules/v1/permission.ts`).
+ // Fetch IAM policy so `hasProjectPermissionV2` sees the bindings.
await useAppStore
.getState()
.loadProjectIamPolicy(project.name)
diff --git a/frontend/src/modules/sql-editor/store/tab.ts b/frontend/src/modules/sql-editor/store/tab.ts
index 3a265baf76..db11304c67 100644
--- a/frontend/src/modules/sql-editor/store/tab.ts
+++ b/frontend/src/modules/sql-editor/store/tab.ts
@@ -392,10 +392,9 @@ export const useSQLEditorTabsStore: UseBoundStore<
updateDatabaseQueryContext({ database, contextId, context }) {
// Resolve the tab that OWNS this context by its globally-unique id
// rather than assuming `currentTabId`. A query that completes after
- // the user switches tabs must still update its own tab's context —
- // the Vue original mutated the reactive context object directly,
- // which had the same cross-tab effect; immer freezes store objects
- // so React must route through this action, hence the lookup.
+ // the user switches tabs must still update its own tab's context;
+ // immer freezes store objects, so callers can't mutate the context
+ // directly and must route through this action, hence the lookup.
const owner = locateDatabaseQueryContext(
get().tabsById,
database,
@@ -650,12 +649,10 @@ export function useSQLEditorTabState<T>(
return useSQLEditorTabsStore(selector);
}
-// Re-hydrate tabs whenever the active project changes. Mirrors the
-// historical `watch(() => project.value, initProject)` side effect of
-// the legacy Vue SQL editor tab store. Errors are intentionally swallowed —
-// explicit callers (e.g. SQLEditorRouteShell) own user-facing failure
-// reporting and may invoke `initProject` directly with full error
-// handling.
+// Re-hydrate tabs whenever the active project changes. Errors are
+// intentionally swallowed — explicit callers (e.g. SQLEditorRouteShell) own
+// user-facing failure reporting and may invoke `initProject` directly with
+// full error handling.
let _lastInitializedProject: string | undefined;
subscribeSQLEditorEditorState((state) => {
if (state.project === _lastInitializedProject) return;
diff --git a/frontend/src/modules/sql-editor/store/tree-utils.ts b/frontend/src/modules/sql-editor/store/tree-utils.ts
index fdbab91ae2..c135258711 100644
--- a/frontend/src/modules/sql-editor/store/tree-utils.ts
+++ b/frontend/src/modules/sql-editor/store/tree-utils.ts
@@ -106,8 +106,7 @@ const mapGroupNode = (
const appStore = useAppStore.getState();
// Best-effort: trigger a background fetch and render the cached
// instance (or an `unknownInstance` placeholder until the fetch
- // resolves). Matches the legacy Pinia `useInstanceResourceByName`
- // behavior — synchronous read with an async hydrate.
+ // resolves).
void appStore.fetchInstance(value);
const instance = appStore.instancesByName[value] ?? unknownInstance();
return mapTreeNodeByType("instance", instance, parent);
diff --git a/frontend/src/modules/sql-editor/store/uiState.test.ts b/frontend/src/modules/sql-editor/store/uiState.test.ts
index 3e36112fdc..80e256b403 100644
--- a/frontend/src/modules/sql-editor/store/uiState.test.ts
+++ b/frontend/src/modules/sql-editor/store/uiState.test.ts
@@ -31,9 +31,9 @@ const localStorageMock = {
// Inline stub for the queryHistory slice so this test stays decoupled
// from the real `./queryHistory` module — that module pulls in
-// `@/api` and (transitively) the Pinia store layout, which can
-// create circular-import issues during test load and isn't relevant
-// to validating uiState behavior.
+// `@/api` and (transitively) `@/stores`, which can create
+// circular-import issues during test load and isn't relevant to
+// validating uiState behavior.
const stubQueryHistorySlice = (): QueryHistorySlice => ({
queryHistoryByKey: {},
fetchQueryHistoryList: vi.fn().mockResolvedValue(undefined),
diff --git a/frontend/src/modules/sql-editor/store/webTerminal-service.ts b/frontend/src/modules/sql-editor/store/webTerminal-service.ts
index 2b3bbfe541..bae534947f 100644
--- a/frontend/src/modules/sql-editor/store/webTerminal-service.ts
+++ b/frontend/src/modules/sql-editor/store/webTerminal-service.ts
@@ -33,7 +33,7 @@ import {
getErrorCode as extractGrpcStatusCode,
} from "@/utils/connect";
import { getSQLEditorEditorState } from "./editor";
-import { useSQLEditorStore as useSQLEditorReactStore } from "./index";
+import { useSQLEditorStore } from "./index";
const ENDPOINT = "/v1:adminExecute";
const SIG_ABORT = 3000 + Code.Aborted;
@@ -44,7 +44,7 @@ const QUERY_TIMEOUT_MS = 5000;
* fields are framework-agnostic mutable services (Emittery / RxJS /
* `createCancelableTimer`); the query items themselves live in the zustand
* `webTerminalQueryItemsByTabId` slice so React consumers re-render via
- * selectors instead of a Vue-bridge call on a Vue ref.
+ * selectors.
*/
export interface WebTerminalQuerySession {
tab: SQLEditorTab;
@@ -65,14 +65,14 @@ export const getWebTerminalQuerySession = (
controller: createStreamingQueryController(),
};
sessions.set(tab.id, session);
- useSQLEditorReactStore.getState().ensureWebTerminalQueryState(tab.id);
+ useSQLEditorStore.getState().ensureWebTerminalQueryState(tab.id);
bindStreamingLogic(session);
return session;
};
export const disposeWebTerminalQuerySession = (tabId: string): void => {
sessions.delete(tabId);
- useSQLEditorReactStore.getState().clearWebTerminalQueryState(tabId);
+ useSQLEditorStore.getState().clearWebTerminalQueryState(tabId);
};
const createStreamingQueryController = () => {
@@ -88,8 +88,8 @@ const createStreamingQueryController = () => {
// Holds the active WebSocket reference. Only written, never read —
// the subscriptions inside `connect()` are what keep the socket alive
- // and reactive. Kept as a named binding to match the historical
- // pattern and make the lifecycle obvious to readers.
+ // and reactive. Kept as a named binding to make the lifecycle obvious to
+ // readers.
let _ws: WebSocket | undefined;
const controller: StreamingQueryController = {
@@ -230,8 +230,7 @@ const bindStreamingLogic = (session: WebTerminalQuerySession) => {
const activeItem = () => {
const list =
- useSQLEditorReactStore.getState().webTerminalQueryItemsByTabId[tabId] ??
- [];
+ useSQLEditorStore.getState().webTerminalQueryItemsByTabId[tabId] ?? [];
return list[list.length - 1];
};
@@ -239,12 +238,10 @@ const bindStreamingLogic = (session: WebTerminalQuerySession) => {
session.timer.start();
const tail = activeItem();
if (!tail) return;
- useSQLEditorReactStore
- .getState()
- .updateWebTerminalQueryItem(tabId, tail.id, {
- params: cloneDeep(input),
- status: "RUNNING",
- });
+ useSQLEditorStore.getState().updateWebTerminalQueryItem(tabId, tail.id, {
+ params: cloneDeep(input),
+ status: "RUNNING",
+ });
});
session.controller.events.on("result", ({ data: resultSet }) => {
@@ -256,7 +253,7 @@ const bindStreamingLogic = (session: WebTerminalQuerySession) => {
console.debug("event resultSet", resultSet);
const tail = activeItem();
if (tail) {
- useSQLEditorReactStore
+ useSQLEditorStore
.getState()
.updateWebTerminalQueryItem(tabId, tail.id, { resultSet });
}
@@ -276,7 +273,7 @@ const bindStreamingLogic = (session: WebTerminalQuerySession) => {
const database = tail?.params?.connection.database;
const project = getSQLEditorEditorState().project;
if (database) {
- useSQLEditorReactStore
+ useSQLEditorStore
.getState()
.mergeLatest({
project,
@@ -297,14 +294,14 @@ const bindStreamingLogic = (session: WebTerminalQuerySession) => {
// Finish the current item and append a fresh one for the next prompt.
const finishedTail = activeItem();
if (finishedTail) {
- useSQLEditorReactStore
+ useSQLEditorStore
.getState()
.updateWebTerminalQueryItem(tabId, finishedTail.id, {
status: "FINISHED",
});
}
session.timer.stop();
- useSQLEditorReactStore.getState().pushWebTerminalQueryItem(tabId);
+ useSQLEditorStore.getState().pushWebTerminalQueryItem(tabId);
});
};
diff --git a/frontend/src/routes/auth/MultiFactorPage.test.tsx b/frontend/src/routes/auth/MultiFactorPage.test.tsx
index d3b8d15f37..e95c15d6b3 100644
--- a/frontend/src/routes/auth/MultiFactorPage.test.tsx
+++ b/frontend/src/routes/auth/MultiFactorPage.test.tsx
@@ -40,7 +40,6 @@ vi.mock("@/app/router", async (importOriginal) => ({
query: mocks.currentRoute.value.query,
requiredPermissions: [],
overrideDocumentTitle: false,
- meta: {},
}),
}));
diff --git a/frontend/src/routes/auth/WorkspaceSetupPage.test.tsx b/frontend/src/routes/auth/WorkspaceSetupPage.test.tsx
index e1e6173342..5943d57e5c 100644
--- a/frontend/src/routes/auth/WorkspaceSetupPage.test.tsx
+++ b/frontend/src/routes/auth/WorkspaceSetupPage.test.tsx
@@ -1,6 +1,3 @@
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
import { fireEvent } from "@testing-library/react";
import type { ReactElement } from "react";
import { act } from "react";
@@ -14,8 +11,6 @@ import type { Workspace } from "@/types/proto-es/v1/workspace_service_pb";
globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
).IS_REACT_ACT_ENVIRONMENT = true;
-const componentDir = dirname(fileURLToPath(import.meta.url));
-
const mocks = vi.hoisted(() => ({
canUpdateWorkspace: true,
currentUser: {
@@ -653,20 +648,6 @@ describe("WorkspaceSetupPage", () => {
page.unmount();
});
- test("uses the shared product intro query key after creating a project", () => {
- const source = readFileSync(join(componentDir, "WorkspaceSetupPage.tsx"), {
- encoding: "utf8",
- });
-
- expect(source).toContain(
- "[PRODUCT_INTRO_QUERY_KEY]: CONNECT_DATABASE_PRODUCT_INTRO"
- );
- expect(source).toContain("PROJECT_INSTANCE_SYNCED_PRODUCT_INTRO");
- expect(source).toContain(
- "query: { [PRODUCT_INTRO_QUERY_KEY]: CREATE_PROJECT_PRODUCT_INTRO }"
- );
- });
-
test("shows workspace name when the sole member can update the workspace", () => {
const page = renderWorkspaceForm();
diff --git a/frontend/src/routes/project/ProjectDatabaseDetailPage.test.tsx b/frontend/src/routes/project/ProjectDatabaseDetailPage.test.tsx
index bb2e905582..7015514a26 100644
--- a/frontend/src/routes/project/ProjectDatabaseDetailPage.test.tsx
+++ b/frontend/src/routes/project/ProjectDatabaseDetailPage.test.tsx
@@ -118,12 +118,6 @@ const mocks = vi.hoisted(() => {
<div data-testid="component-permission-guard" />
)
),
- useProjectV1Store: vi.fn(() => ({
- getProjectByName: vi.fn(() => ({
- name: "projects/proj1",
- title: "Project 1",
- })),
- })),
databaseStore: vi.fn(() => ({
syncDatabase: vi.fn(),
batchUpdateDatabases: vi.fn(),
@@ -138,41 +132,9 @@ const mocks = vi.hoisted(() => {
getSchemaList: vi.fn(() => [] as unknown[]),
getTableList: vi.fn(() => [] as unknown[]),
})),
- usePermissionStore: vi.fn(() => ({
- currentPermissions: new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.plans.create",
- "bb.sheets.create",
- ]),
- currentPermissionsInProjectV1: vi.fn(
- () =>
- new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.plans.create",
- "bb.sheets.create",
- ])
- ),
- })),
getDatabaseSDLSchema: vi.fn(),
- schemaDiagram: vi.fn(() => <div data-testid="schema-diagram-vue" />),
preCreateIssue: vi.fn(),
- useActuatorV1Store: vi.fn(() => ({
- serverInfo: {
- defaultProject: "projects/default",
- },
- })),
- pinia: {
- install: vi.fn(),
- },
- highlightPlugin: {
- install: vi.fn(),
- },
i18nPlugin: {
- install: vi.fn(),
t: (key: string) => key,
},
routeNames: {
@@ -276,10 +238,7 @@ vi.mock("@/utils", async (importOriginal) => {
});
vi.mock("@/stores", () => ({
- pinia: mocks.pinia,
pushNotification: mocks.pushNotification,
- useProjectV1Store: mocks.useProjectV1Store,
- usePermissionStore: mocks.usePermissionStore,
}));
// Page composes child panels that now read dbSchema getters via the app
@@ -314,18 +273,10 @@ vi.mock("@/api", () => ({
},
}));
-vi.mock("@/lib/highlight", () => ({
- default: mocks.highlightPlugin,
-}));
-
vi.mock("@/lib/i18n", () => ({
default: mocks.i18nPlugin,
}));
-vi.mock("@/stores/modules/v1/actuator", () => ({
- useActuatorV1Store: mocks.useActuatorV1Store,
-}));
-
vi.mock("@/lib/plan/issue", () => ({
preCreateIssue: mocks.preCreateIssue,
}));
@@ -479,13 +430,6 @@ beforeEach(() => {
mocks.DatabaseRevisionPanel.mockClear();
mocks.DatabaseCatalogPanel.mockClear();
mocks.ComponentPermissionGuard.mockClear();
- mocks.useProjectV1Store.mockReset();
- mocks.useProjectV1Store.mockReturnValue({
- getProjectByName: vi.fn(() => ({
- name: "projects/proj1",
- title: "Project 1",
- })),
- });
mocks.databaseStore.mockReset();
mocks.databaseStore.mockReturnValue({
syncDatabase: vi.fn(),
@@ -502,38 +446,8 @@ beforeEach(() => {
getSchemaList: vi.fn(() => [] as unknown[]),
getTableList: vi.fn(() => [] as unknown[]),
});
- mocks.usePermissionStore.mockReset();
- mocks.usePermissionStore.mockReturnValue({
- currentPermissions: new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.plans.create",
- "bb.sheets.create",
- ]),
- currentPermissionsInProjectV1: vi.fn(
- () =>
- new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.plans.create",
- "bb.sheets.create",
- ])
- ),
- });
mocks.getDatabaseSDLSchema.mockReset();
- mocks.schemaDiagram.mockClear();
mocks.preCreateIssue.mockReset();
- mocks.pinia.install.mockReset();
- mocks.highlightPlugin.install.mockReset();
- mocks.i18nPlugin.install.mockReset();
- mocks.useActuatorV1Store.mockReset();
- mocks.useActuatorV1Store.mockReturnValue({
- serverInfo: {
- defaultProject: "projects/default",
- },
- });
mocks.windowOpen.mockReset();
latestTabsOnValueChange = undefined;
});
@@ -658,25 +572,6 @@ describe("ProjectDatabaseDetailPage", () => {
});
test("selects the tab from a valid hash and keeps the query when the tab changes", async () => {
- mocks.usePermissionStore.mockReturnValue({
- currentPermissions: new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.changelogs.list",
- "bb.revisions.list",
- ]),
- currentPermissionsInProjectV1: vi.fn(
- () =>
- new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.changelogs.list",
- "bb.revisions.list",
- ])
- ),
- });
mocks.useProjectDatabaseDetail.mockReturnValue({
database: {
name: "instances/inst1/databases/db1",
@@ -939,24 +834,7 @@ describe("ProjectDatabaseDetailPage", () => {
unmount();
});
- test("renders the tab panels only when the matching list permissions are present", async () => {
- mocks.usePermissionStore.mockReturnValue({
- currentPermissions: new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.changelogs.list",
- ]),
- currentPermissionsInProjectV1: vi.fn(
- () =>
- new Set([
- "bb.databases.sync",
- "bb.databases.getSchema",
- "bb.databases.update",
- "bb.changelogs.list",
- ])
- ),
- });
+ test("renders only the panel selected by the route hash", async () => {
mocks.useProjectDatabaseDetail.mockReturnValue({
database: {
name: "instances/inst1/databases/db1",
@@ -1116,10 +994,6 @@ describe("ProjectDatabaseDetailPage", () => {
});
test("renders action components for default-project databases", async () => {
- mocks.usePermissionStore.mockReturnValue({
- currentPermissions: new Set(),
- currentPermissionsInProjectV1: vi.fn(() => new Set()),
- });
mocks.useProjectDatabaseDetail.mockReturnValue({
database: {
name: "instances/inst1/databases/db1",
@@ -1159,11 +1033,7 @@ describe("ProjectDatabaseDetailPage", () => {
unmount();
});
- test("renders action components when project permissions are missing", async () => {
- mocks.usePermissionStore.mockReturnValue({
- currentPermissions: new Set(),
- currentPermissionsInProjectV1: vi.fn(() => new Set()),
- });
+ test("renders the database detail actions", async () => {
mocks.useProjectDatabaseDetail.mockReturnValue({
database: {
name: "instances/inst1/databases/db1",
diff --git a/frontend/src/routes/project/ProjectGitOpsPage.tsx b/frontend/src/routes/project/ProjectGitOpsPage.tsx
index aff71a1a8d..486956bfb6 100644
--- a/frontend/src/routes/project/ProjectGitOpsPage.tsx
+++ b/frontend/src/routes/project/ProjectGitOpsPage.tsx
@@ -561,8 +561,7 @@ function FileHintLabel({
repository?: string;
}) {
const { t } = useTranslation();
- // Split the translated template around placeholders to render bold spans,
- // matching the Vue <i18n-t> slot behavior.
+ // Split the translated template around placeholders to render bold spans.
const raw = t("gitops.workflow.file-hint", {
filePath: "\x00FP\x00",
repository: "\x00RP\x00",
diff --git a/frontend/src/routes/project/ProjectIssueDashboardPage.creators.test.ts b/frontend/src/routes/project/ProjectIssueDashboardPage.creators.test.ts
deleted file mode 100644
index ec0e86dd34..0000000000
--- a/frontend/src/routes/project/ProjectIssueDashboardPage.creators.test.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-import source from "./ProjectIssueDashboardPage.tsx?raw";
-
-describe("project issue list creator cache", () => {
- test("fetches listed issue creators before rendering fallback names", () => {
- expect(source).toMatch(
- /const batchGetOrFetchUsers = useAppStore\(\s*\(state\) => state\.batchGetOrFetchUsers\s*\)/
- );
- expect(source).toMatch(
- /batchGetOrFetchUsers\(paged\.dataList\.map\(\(issue\) => issue\.creator\)\)/
- );
- });
-
- test("keeps presets and rows in one bordered list surface", () => {
- expect(source.indexOf("<IssueListPanel")).toBeGreaterThan(
- source.indexOf("<ProjectPageContent>")
- );
- expect(source).toContain('<ProjectPageFooter className="px-2">');
- });
-});
diff --git a/frontend/src/routes/project/ProjectIssueDashboardPage.tsx b/frontend/src/routes/project/ProjectIssueDashboardPage.tsx
index f3fa6d08f2..ecdaece605 100644
--- a/frontend/src/routes/project/ProjectIssueDashboardPage.tsx
+++ b/frontend/src/routes/project/ProjectIssueDashboardPage.tsx
@@ -5,7 +5,7 @@ import {
useListScrollRestorationKey,
useListScrollRestorationLoadMore,
} from "@/app/router/NavigationScrollRestoration";
-import type { SearchParams } from "@/components/AdvancedSearch";
+import type { SearchParams, SearchScope } from "@/components/AdvancedSearch";
import {
BatchActionBar,
BatchIssueStatusActionDrawer,
@@ -33,7 +33,6 @@ import {
buildSearchParamsBySearchText,
buildSearchTextBySearchParams,
mergeSearchParams,
- type SearchScope as VueSearchScope,
} from "@/utils";
const serializeSearchParams = (params: SearchParams): string =>
@@ -57,7 +56,7 @@ export function ProjectIssueDashboardPage({
const projectName = `${projectNamePrefix}${projectId}`;
// Read-only scopes
- const readonlyScopes: VueSearchScope[] = useMemo(
+ const readonlyScopes: SearchScope[] = useMemo(
() => [{ id: "project", value: projectId, readonly: true }],
[projectId]
);
diff --git a/frontend/src/routes/project/ProjectIssueDetailPage.test.tsx b/frontend/src/routes/project/ProjectIssueDetailPage.test.tsx
index 3545ed0025..b632e45143 100644
--- a/frontend/src/routes/project/ProjectIssueDetailPage.test.tsx
+++ b/frontend/src/routes/project/ProjectIssueDetailPage.test.tsx
@@ -42,7 +42,6 @@ vi.mock("@/app/router", async (importOriginal) => ({
query: {},
requiredPermissions: [],
overrideDocumentTitle: false,
- meta: {},
}),
}));
diff --git a/frontend/src/routes/project/ProjectMaskingExemptionPage.tsx b/frontend/src/routes/project/ProjectMaskingExemptionPage.tsx
index 066e987d0a..b268506450 100644
--- a/frontend/src/routes/project/ProjectMaskingExemptionPage.tsx
+++ b/frontend/src/routes/project/ProjectMaskingExemptionPage.tsx
@@ -129,7 +129,7 @@ export function ProjectMaskingExemptionPage({
s.hasFeature(PlanFeature.FEATURE_DATA_MASKING)
);
- const membersFromVue = useExemptionDataReact(projectName);
+ const exemptionData = useExemptionData(projectName);
const [searchParams, setSearchParams] = useState<SearchParams>({
query: "",
@@ -168,7 +168,7 @@ export function ProjectMaskingExemptionPage({
);
const filteredMembers = useMemo(() => {
- let result = membersFromVue.members;
+ let result = exemptionData.members;
// Free-text query
const query = searchParams.query.trim().toLowerCase();
@@ -214,7 +214,7 @@ export function ProjectMaskingExemptionPage({
return result;
}, [
- membersFromVue.members,
+ exemptionData.members,
searchParams,
activeDatabaseFilter,
withFilteredGrants,
@@ -259,9 +259,9 @@ export function ProjectMaskingExemptionPage({
const confirmRevoke = useCallback(async () => {
if (!revokeConfirm) return;
- await membersFromVue.revokeGrant(revokeConfirm.member, revokeConfirm.grant);
+ await exemptionData.revokeGrant(revokeConfirm.member, revokeConfirm.grant);
setRevokeConfirm(null);
- }, [revokeConfirm, membersFromVue]);
+ }, [revokeConfirm, exemptionData]);
// Scope options for advanced search
const searchDatabases = useCallback(
@@ -436,13 +436,13 @@ export function ProjectMaskingExemptionPage({
className="w-[360px] shrink-0 border-r border-block-border overflow-y-auto"
members={filteredMembers}
disabled={!hasPermission}
- loading={membersFromVue.loading}
+ loading={exemptionData.loading}
selectedMemberKey={selectedMemberKey}
onSelect={setSelectedMemberKey}
onRevoke={handleRevoke}
/>
<div className="flex-1 min-w-0 overflow-y-auto">
- {!membersFromVue.loading && selectedMemberData ? (
+ {!exemptionData.loading && selectedMemberData ? (
<ExemptionDetailPanel
member={selectedMemberData}
disabled={!hasPermission}
@@ -450,7 +450,7 @@ export function ProjectMaskingExemptionPage({
databaseFilter={activeDatabaseFilter}
onRevoke={(grant) => handleRevoke(selectedMemberData, grant)}
/>
- ) : !membersFromVue.loading ? (
+ ) : !exemptionData.loading ? (
<div className="flex items-center justify-center h-full text-control-placeholder text-sm">
{t("project.masking-exemption.no-exemptions")}
</div>
@@ -462,7 +462,7 @@ export function ProjectMaskingExemptionPage({
<ExemptionMemberList
members={filteredMembers}
disabled={!hasPermission}
- loading={membersFromVue.loading}
+ loading={exemptionData.loading}
expandable
showDatabaseLink={showDatabaseLink}
databaseFilter={activeDatabaseFilter}
@@ -510,7 +510,7 @@ export function ProjectMaskingExemptionPage({
}
// ============================================================
-// useExemptionDataReact — reimplements useExemptionData for React
+// useExemptionData
// ============================================================
function getAccessUsers(
@@ -584,7 +584,7 @@ function rebuildExemptions(accessList: AccessUser[]) {
return exemptions;
}
-function useExemptionDataReact(projectName: string) {
+function useExemptionData(projectName: string) {
const { t } = useTranslation();
const batchGetOrFetchGroups = useAppStore(
(state) => state.batchGetOrFetchGroups
diff --git a/frontend/src/routes/project/ProjectPageLayout.test.ts b/frontend/src/routes/project/ProjectPageLayout.test.ts
deleted file mode 100644
index 9619ceaea3..0000000000
--- a/frontend/src/routes/project/ProjectPageLayout.test.ts
+++ /dev/null
@@ -1,226 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const projectDir = import.meta.dirname;
-const settingsDir = join(projectDir, "../workspace");
-const componentsDir = join(projectDir, "../../components");
-
-const projectListPages = [
- "ProjectAccessGrantsPage.tsx",
- "ProjectAuditLogPage.tsx",
- "ProjectDatabaseGroupsPage.tsx",
- "ProjectDatabasesPage.tsx",
- "ProjectGitOpsPage.tsx",
- "ProjectIssueDashboardPage.tsx",
- "ProjectInstancesPage.tsx",
- "ProjectPlanDashboardPage.tsx",
- "ProjectReleaseDashboardPage.tsx",
- "ProjectWebhooksPage.tsx",
-] as const;
-
-const projectInfoPages = [
- "ProjectIssueDashboardPage.tsx",
- "ProjectPlanDashboardPage.tsx",
- "ProjectReleaseDashboardPage.tsx",
- "ProjectSyncSchemaPage.tsx",
-] as const;
-
-const projectReusableSettingsPages = [
- "MembersPage.tsx",
- "ServiceAccountsPage.tsx",
- "WorkloadIdentitiesPage.tsx",
-] as const;
-
-function readProjectPage(
- file: (typeof projectListPages)[number] | (typeof projectInfoPages)[number]
-) {
- return readFileSync(join(projectDir, file), "utf8");
-}
-
-function readReusableSettingsPage(
- file: (typeof projectReusableSettingsPages)[number]
-) {
- return readFileSync(join(settingsDir, file), "utf8");
-}
-
-describe("project page layout", () => {
- test("keeps the project shell page rhythm", () => {
- const source = readFileSync(
- join(componentsDir, "ProjectPageLayout.tsx"),
- "utf8"
- );
-
- expect(source).toContain("paddingBlock: 16");
- expect(source).toContain("paddingInline: 16");
- expect(source).toContain("rowGap: 16");
- expect(source).toContain('<Alert role="note"');
- expect(source).toContain('overflowX: "clip"');
- expect(source).not.toContain('overflowX: "hidden"');
- expect(source).not.toContain("paddingBottom: 8");
- });
-
- test("uses the shared project layout shell instead of page-local padding", () => {
- for (const file of projectListPages) {
- const source = readProjectPage(file);
-
- expect(source, file).toContain("@/components/ProjectPageLayout");
- expect(source, file).toContain("<ProjectPageLayout");
- expect(source, file).not.toContain('className="py-4 flex flex-col"');
- expect(source, file).not.toContain(
- 'className="py-4 w-full flex flex-col"'
- );
- expect(source, file).not.toContain(
- 'className="w-full px-4 flex flex-col gap-y-1 py-4"'
- );
- }
- });
-
- test("uses project layout when project routes reuse settings pages", () => {
- for (const file of projectReusableSettingsPages) {
- const source = readReusableSettingsPage(file);
-
- expect(source, file).toContain("ProjectPageLayout");
- expect(source, file).toContain("ProjectPageToolbar");
- expect(source, file).toContain(
- "const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout"
- );
- expect(source, file).toContain(
- "const PageToolbar = projectName ? ProjectPageToolbar : WorkspacePageToolbar"
- );
- expect(source, file).toContain("<PageLayout>");
- }
- });
-
- test("does not reserve top gap for hidden access grants feature attention", () => {
- const source = readProjectPage("ProjectAccessGrantsPage.tsx");
-
- expect(source).toContain(
- "<FeatureAttention feature={PlanFeature.FEATURE_JIT} />"
- );
- expect(source).not.toContain('<div className="mb-2">');
- });
-
- test("access grants search exposes display status filters", () => {
- const source = readProjectPage("ProjectAccessGrantsPage.tsx");
-
- expect(source).toContain('value: "REJECTED"');
- expect(source).toContain('value: "CANCELED"');
- expect(source).toContain(
- 'render: () => <span>{t("common.rejected")}</span>'
- );
- expect(source).toContain(
- 'render: () => <span>{t("common.canceled")}</span>'
- );
- });
-
- test("access grants render display status from linked issue state", () => {
- const source = readProjectPage("ProjectAccessGrantsPage.tsx");
-
- expect(source).toContain("issue={issueByGrantName.get(grant.name)}");
- expect(source).toContain("getAccessGrantDisplayStatus(grant, issue)");
- expect(source).toContain("getAccessGrantDisplayStatusText(grant, issue)");
- });
-
- test("access grants status column reserves space for display badges", () => {
- const source = readProjectPage("ProjectAccessGrantsPage.tsx");
-
- expect(source).toContain(`key: "status",
- title: t("common.status"),
- defaultWidth: 160,
- minWidth: 128,`);
- });
-
- test("keeps database groups on the shared page vertical rhythm", () => {
- const source = readProjectPage("ProjectDatabaseGroupsPage.tsx");
- const databaseGroupTable = readFileSync(
- join(componentsDir, "DatabaseGroupTable.tsx"),
- "utf8"
- );
-
- expect(source).not.toContain('<ProjectPageLayout className="gap-y-');
- expect(source).toContain("<DatabaseGroupTable");
- expect(source).toContain('className="gap-y-4"');
- expect(databaseGroupTable).toContain("readonly className?: string");
- expect(databaseGroupTable).toContain(
- 'className={cn("flex flex-col gap-y-3", className)}'
- );
- });
-
- test("uses shared project info surfaces for persistent page descriptions", () => {
- for (const file of projectInfoPages) {
- const source = readProjectPage(file);
-
- expect(source, file).toContain("ProjectPageInfo");
- expect(source, file).not.toContain("onDismiss={dismissHint}");
- }
- });
-
- test("does not stack page-local spacing on top of shared page rhythm", () => {
- for (const file of [
- "ProjectIssueDashboardPage.tsx",
- "ProjectPlanDashboardPage.tsx",
- "ProjectReleaseDashboardPage.tsx",
- "ProjectSyncSchemaPage.tsx",
- ] as const) {
- const source = readProjectPage(file);
-
- expect(source, file).not.toContain(
- '<ProjectPageContent className="mt-2">'
- );
- expect(source, file).not.toContain("flex flex-col gap-y-2 pb-2");
- expect(source, file).not.toContain(
- 'className="pt-4 flex-1 overflow-hidden flex flex-col gap-y-4"'
- );
- }
- });
-
- test("uses explicit toolbar alignment instead of Tailwind overrides", () => {
- const webhooks = readProjectPage("ProjectWebhooksPage.tsx");
- const accessGrants = readProjectPage("ProjectAccessGrantsPage.tsx");
-
- expect(webhooks).toContain('<ProjectPageToolbar align="end">');
- expect(webhooks).not.toContain('className="justify-end"');
- expect(accessGrants).toContain('<ProjectPageToolbar align="start">');
- expect(accessGrants).not.toContain('className="justify-start"');
- });
-
- test("keeps audit log table free of page-level layout", () => {
- const projectAuditLogPage = readProjectPage("ProjectAuditLogPage.tsx");
- const auditLogTable = readFileSync(
- join(componentsDir, "AuditLogTable.tsx"),
- "utf8"
- );
-
- expect(projectAuditLogPage).toContain("ProjectPageContent");
- expect(auditLogTable).not.toContain("FeatureAttention");
- expect(auditLogTable).not.toContain('className="px-4 py-4');
- expect(auditLogTable).not.toContain('className="mx-4');
- expect(auditLogTable).not.toContain('className="mt-4 mx-2"');
- });
-
- test("uses bordered table surfaces inside padded project pages", () => {
- const projectPlanPage = readProjectPage("ProjectPlanDashboardPage.tsx");
- const projectIssuePage = readProjectPage("ProjectIssueDashboardPage.tsx");
- const issueTable = readFileSync(
- join(componentsDir, "IssueTable.tsx"),
- "utf8"
- );
- const auditLogTable = readFileSync(
- join(componentsDir, "AuditLogTable.tsx"),
- "utf8"
- );
-
- expect(projectPlanPage).toContain(
- 'className="overflow-x-auto rounded-sm border border-block-border"'
- );
- expect(projectIssuePage).toContain("<IssueListPanel");
- expect(issueTable).toContain(
- 'className="overflow-hidden rounded-sm border border-block-border"'
- );
- expect(auditLogTable).toContain(
- 'className="overflow-x-auto rounded-sm border border-block-border"'
- );
- });
-});
diff --git a/frontend/src/routes/project/ProjectPlanDashboardPage.columns.test.ts b/frontend/src/routes/project/ProjectPlanDashboardPage.columns.test.ts
deleted file mode 100644
index bda31976db..0000000000
--- a/frontend/src/routes/project/ProjectPlanDashboardPage.columns.test.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-import source from "./ProjectPlanDashboardPage.tsx?raw";
-
-// Capture every `key: "..."` object-literal occurrence in this file's source.
-// Only the columns array uses this syntax here, so the broad pattern forces any
-// new column entry to be reflected in the expected-order assertion below. If
-// the column definitions are ever extracted to a helper module, this test must
-// be rewritten against the runtime value (or the helper's source).
-const columnKeyOrder = (src: string): string[] => {
- return Array.from(src.matchAll(/key:\s*"(\w+)"/g), (m) => m[1]);
-};
-
-// Returns the slice of source bounded by `key: "<key>"` and the next column
-// entry, or the close of the columns array (the `],` immediately followed by
-// the `useMemo` deps `[`). Per-property assertions inside the slice are
-// independent of property declaration order. The `\],\s*\[` boundary is more
-// specific than a bare `\],` so it won't be cut short by an incidental inline
-// `],` in a render's JSX.
-const columnEntry = (src: string, key: string): string => {
- const re = new RegExp(`key:\\s*"${key}",[\\s\\S]*?(?=key:\\s*"|\\],\\s*\\[)`);
- const match = src.match(re);
- expect(match, `expected to find column entry for "${key}"`).not.toBeNull();
- return match?.[0] ?? "";
-};
-
-describe("plan list column composition", () => {
- test("composes the new-plan selectors from shared tables", () => {
- expect(source).toContain("<DatabaseTable");
- expect(source).toContain("<DatabaseGroupTable");
- expect(source).not.toContain("<table");
- });
-
- test("renders five columns in priority order", () => {
- expect(columnKeyOrder(source)).toEqual([
- "name",
- "creator",
- "review",
- "stages",
- "updated",
- ]);
- });
-
- test("drops the checks column from the navigation surface", () => {
- expect(source).not.toContain('key: "checks"');
- });
-
- test("name carries the tuned default width for plan titles", () => {
- // P0 column for the navigation surface: holds UID + title + optional
- // lifecycle badge. 400px (desktop) gives ~45 effective chars for the title
- // with a badge present. Phones use a fixed 200px and disable resizing so the
- // title column doesn't push the table wider than the viewport.
- const entry = columnEntry(source, "name");
- expect(entry).toMatch(/defaultWidth:\s*isMobile\s*\?\s*200\s*:\s*400/);
- expect(entry.match(/minWidth:\s*(\d+)/)?.[1]).toBe("200");
- expect(entry).toMatch(/resizable:\s*!isMobile/);
- });
-
- test("creator carries the tuned default width and min width", () => {
- const entry = columnEntry(source, "creator");
- expect(entry.match(/defaultWidth:\s*(\d+)/)?.[1]).toBe("160");
- expect(entry.match(/minWidth:\s*(\d+)/)?.[1]).toBe("100");
- });
-
- test("creator render truncates long titles on a block element", () => {
- // The full truncation contract: a block-level container fills the cell
- // width, then `truncate` clips with an ellipsis. If either piece is
- // missing, long creator names won't ellipsize cleanly. Anchor on `<span`
- // so the assertion stays on the truncating element even if a future
- // refactor wraps it with another element (e.g. a tooltip) that carries
- // its own `className`.
- const entry = columnEntry(source, "creator");
- const spanClass = entry.match(/<span\s+className="([^"]+)"/);
- expect(spanClass).not.toBeNull();
- expect(spanClass?.[1]).toContain("block");
- expect(spanClass?.[1]).toContain("truncate");
- });
-
- test("PlanRowContext does not carry check-summary plumbing", () => {
- // Once the column is gone, the per-row context shouldn't compute or carry
- // check summaries — that work is dead weight on the navigation surface.
- expect(source).not.toContain("checkSummary");
- expect(source).not.toContain("hasAnyCheck");
- });
-
- test("plan row creators are fetched before rendering fallback names", () => {
- expect(source).toMatch(
- /const batchGetOrFetchUsers = useAppStore\(\s*\(state\) => state\.batchGetOrFetchUsers\s*\)/
- );
- expect(source).toMatch(
- /batchGetOrFetchUsers\(paged\.dataList\.map\(\(plan\) => plan\.creator\)\)/
- );
- });
-});
diff --git a/frontend/src/routes/project/ProjectPlanDashboardPage.tsx b/frontend/src/routes/project/ProjectPlanDashboardPage.tsx
index a74789b548..552ae6de75 100644
--- a/frontend/src/routes/project/ProjectPlanDashboardPage.tsx
+++ b/frontend/src/routes/project/ProjectPlanDashboardPage.tsx
@@ -92,7 +92,6 @@ import {
extractPlanUID,
generatePlanTitle,
getDefaultPagination,
- type SearchParams as VueSearchParams,
} from "@/utils";
import {
extractStageUID,
@@ -207,7 +206,7 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {
// Build plan filter
const planFilter = useMemo(() => {
- const merged: VueSearchParams = {
+ const merged: SearchParams = {
query: searchParams.query.trim().toLowerCase(),
scopes: [
...searchParams.scopes.map((s) => ({ id: s.id, value: s.value })),
diff --git a/frontend/src/routes/project/ProjectSettingsPageLayout.test.ts b/frontend/src/routes/project/ProjectSettingsPageLayout.test.ts
deleted file mode 100644
index 6cc75cc7c8..0000000000
--- a/frontend/src/routes/project/ProjectSettingsPageLayout.test.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const pageSource = readFileSync(
- join(import.meta.dirname, "ProjectSettingsPage.tsx"),
- "utf8"
-);
-
-describe("ProjectSettingsPage layout", () => {
- test("uses shared form primitives for settings sections and fields", () => {
- expect(pageSource).toContain("@/components/ui/form");
- expect(pageSource).toContain("FormSection");
- expect(pageSource).toContain("FormFieldGroup");
- expect(pageSource).toContain("<FormField");
- expect(pageSource).toContain("FormControlRow");
- expect(pageSource).toContain('className="divide-y divide-block-border"');
- expect(pageSource).not.toContain('className="py-6 lg:flex"');
- expect(pageSource).not.toContain('className="pb-6 lg:flex"');
- expect(pageSource).not.toContain('className="flex-1 mt-4 lg:px-4 lg:mt-0"');
- });
-});
diff --git a/frontend/src/routes/project/ProjectSyncSchemaPage.tsx b/frontend/src/routes/project/ProjectSyncSchemaPage.tsx
index 1a0c43cefd..ddc1172ce3 100644
--- a/frontend/src/routes/project/ProjectSyncSchemaPage.tsx
+++ b/frontend/src/routes/project/ProjectSyncSchemaPage.tsx
@@ -188,7 +188,7 @@ export function ProjectSyncSchemaPage({ projectId }: { projectId: string }) {
};
window.addEventListener("beforeunload", beforeUnload);
- // Guard in-app Vue router navigation
+ // Guard in-app router navigation
const removeRouterGuard = router.beforeEach((_to, _from, next) => {
const answer = window.confirm(t("common.leave-without-saving"));
if (answer) {
diff --git a/frontend/src/routes/project/issue-detail/components/IssueDetailDatabaseChangeView.tsx b/frontend/src/routes/project/issue-detail/components/IssueDetailDatabaseChangeView.tsx
index cce416aa95..f3b6fe11a1 100644
--- a/frontend/src/routes/project/issue-detail/components/IssueDetailDatabaseChangeView.tsx
+++ b/frontend/src/routes/project/issue-detail/components/IssueDetailDatabaseChangeView.tsx
@@ -567,7 +567,7 @@ function IssueDetailDatabaseChangeTargets({
try {
await fetchTargets(visibleTargets);
} catch {
- // Ignore target loading failures to match the current Vue behavior.
+ // Ignore target loading failures.
} finally {
if (!canceled) {
setIsLoadingTargets(false);
@@ -595,7 +595,7 @@ function IssueDetailDatabaseChangeTargets({
try {
await fetchTargets(targets);
} catch {
- // Ignore target loading failures to match the current Vue behavior.
+ // Ignore target loading failures.
} finally {
if (!canceled) {
setIsLoadingAllTargets(false);
@@ -877,7 +877,7 @@ const fetchTargets = async (targets: string[]) => {
databaseTargets.add(database.name);
}
} catch {
- // Ignore target loading failures to match the current Vue behavior.
+ // Ignore target loading failures.
}
continue;
}
diff --git a/frontend/src/routes/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx b/frontend/src/routes/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx
index cfc0b71538..d46316fabb 100644
--- a/frontend/src/routes/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx
+++ b/frontend/src/routes/project/issue-detail/components/IssueDetailRoleGrantDetails.test.tsx
@@ -37,7 +37,8 @@ vi.mock("@/hooks/useAppState", () => ({
],
}));
-// Stub EnvironmentLabel — the real component pulls in Pinia stores + theme tokens.
+// Stub EnvironmentLabel — the real component pulls in app-store hooks and
+// theme tokens.
vi.mock("@/components/EnvironmentLabel", () => ({
EnvironmentLabel: ({
environmentName,
diff --git a/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.lifecycle.test.tsx b/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.lifecycle.test.tsx
deleted file mode 100644
index 8b7035065c..0000000000
--- a/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.lifecycle.test.tsx
+++ /dev/null
@@ -1,180 +0,0 @@
-import { act, render, screen, waitFor } from "@testing-library/react";
-import type { ReactNode } from "react";
-import { beforeEach, describe, expect, test, vi } from "vitest";
-import type { Task, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
-
-const mocks = vi.hoisted(() => ({
- previewTaskRunRollback: vi.fn(),
-}));
-
-vi.mock("react-i18next", () => ({
- useTranslation: () => ({ t: (key: string) => key }),
-}));
-
-vi.mock("@/api", () => ({
- issueServiceClientConnect: {},
- planServiceClientConnect: {},
- rolloutServiceClientConnect: {
- previewTaskRunRollback: mocks.previewTaskRunRollback,
- },
-}));
-
-vi.mock("@/components/monaco", () => ({
- ReadonlyMonaco: ({ content }: { content: string }) => (
- <div data-testid="rollback-statement">{content}</div>
- ),
-}));
-
-vi.mock("@/components/PermissionGuard", () => ({
- PermissionGuard: ({ children }: { children: ReactNode }) => <>{children}</>,
- usePermissionCheck: () => [true, undefined],
-}));
-
-vi.mock("@/components/ui/alert", () => ({
- Alert: ({ description }: { description: ReactNode }) => (
- <div role="alert">{description}</div>
- ),
-}));
-
-vi.mock("@/components/ui/badge", () => ({
- Badge: ({ children }: { children: ReactNode }) => <span>{children}</span>,
-}));
-
-vi.mock("@/components/ui/button", () => ({
- Button: ({
- children,
- ...props
- }: React.ButtonHTMLAttributes<HTMLButtonElement>) => (
- <button {...props}>{children}</button>
- ),
-}));
-
-vi.mock("@/components/ui/checkbox", () => ({
- Checkbox: () => <input type="checkbox" />,
-}));
-
-vi.mock("@/components/ui/sheet", () => ({
- Sheet: ({ children, open }: { children: ReactNode; open: boolean }) =>
- open ? <>{children}</> : null,
- SheetBody: ({ children }: { children: ReactNode }) => <div>{children}</div>,
- SheetContent: ({ children }: { children: ReactNode }) => (
- <div>{children}</div>
- ),
- SheetFooter: ({ children }: { children: ReactNode }) => <div>{children}</div>,
- SheetHeader: ({ children }: { children: ReactNode }) => <div>{children}</div>,
- SheetTitle: ({ children }: { children: ReactNode }) => <h2>{children}</h2>,
-}));
-
-vi.mock("@/hooks/useAppState", () => ({
- useCurrentUser: () => ({ name: "users/[email protected]" }),
-}));
-
-vi.mock("@/hooks/useProjectByName", () => ({
- useProjectByName: () => ({ name: "projects/p1" }),
-}));
-
-vi.mock("@/app/router", () => ({ router: { push: vi.fn() } }));
-
-vi.mock("@/stores/app", () => ({
- useAppStore: Object.assign(
- (selector: (state: unknown) => unknown) =>
- selector({ projectsByName: { "projects/p1": { name: "projects/p1" } } }),
- { getState: () => ({ createSheet: vi.fn() }) }
- ),
-}));
-
-vi.mock("@/stores", () => ({ pushNotification: vi.fn() }));
-
-vi.mock("@/utils", () => ({
- extractPlanUID: () => "1",
- extractProjectResourceName: () => "p1",
-}));
-
-vi.mock("./PlanTargetDisplay", () => ({
- PlanTargetDisplay: ({ target }: { target: string }) => <span>{target}</span>,
-}));
-
-vi.mock("./rollbackDraft", () => ({ createRollbackDraftReview: vi.fn() }));
-
-import { PlanDetailRollbackSheet } from "./PlanDetailRollbackSheet";
-
-type PreviewResult = { statement: string };
-
-function deferred<T>() {
- let resolve!: (value: T) => void;
- const promise = new Promise<T>((next) => {
- resolve = next;
- });
- return { promise, resolve };
-}
-
-const task = (name: string) =>
- ({ name: `tasks/${name}`, target: `instances/i/databases/${name}` }) as Task;
-const taskRun = (name: string) => ({ name: `taskRuns/${name}` }) as TaskRun;
-const itemsA = [{ task: task("a"), taskRun: taskRun("a") }];
-const itemsB = [{ task: task("b"), taskRun: taskRun("b") }];
-
-describe("PlanDetailRollbackSheet request lifecycle", () => {
- beforeEach(() => {
- vi.clearAllMocks();
- });
-
- test("ignores a preview response from a prior open entity", async () => {
- const previewA = deferred<PreviewResult>();
- const previewB = deferred<PreviewResult>();
- mocks.previewTaskRunRollback.mockImplementation(
- (request: { name: string }) =>
- request.name === "taskRuns/a" ? previewA.promise : previewB.promise
- );
- const onOpenChange = vi.fn();
- const { rerender } = render(
- <PlanDetailRollbackSheet
- items={itemsA}
- onOpenChange={onOpenChange}
- open
- projectName="projects/p1"
- rolloutName="projects/p1/plans/1/rollout"
- />
- );
- await waitFor(() =>
- expect(mocks.previewTaskRunRollback).toHaveBeenCalled()
- );
-
- rerender(
- <PlanDetailRollbackSheet
- items={itemsA}
- onOpenChange={onOpenChange}
- open={false}
- projectName="projects/p1"
- rolloutName="projects/p1/plans/1/rollout"
- />
- );
- rerender(
- <PlanDetailRollbackSheet
- items={itemsB}
- onOpenChange={onOpenChange}
- open
- projectName="projects/p1"
- rolloutName="projects/p1/plans/2/rollout"
- />
- );
-
- previewB.resolve({ statement: "ROLLBACK B" });
- await waitFor(() =>
- expect(screen.getByTestId("rollback-statement")).toHaveTextContent(
- "ROLLBACK B"
- )
- );
-
- await act(async () => {
- previewA.resolve({ statement: "ROLLBACK A" });
- await Promise.resolve();
- await Promise.resolve();
- });
-
- expect(screen.getByTestId("rollback-statement")).toHaveTextContent(
- "ROLLBACK B"
- );
- expect(screen.queryByText("ROLLBACK A")).toBeNull();
- });
-});
diff --git a/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.test.tsx b/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.test.tsx
index 31c82bd010..8b7035065c 100644
--- a/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.test.tsx
+++ b/frontend/src/routes/project/plan-detail/components/PlanDetailRollbackSheet.test.tsx
@@ -1,22 +1,180 @@
-import { describe, expect, test } from "vitest";
-
-import source from "./PlanDetailRollbackSheet.tsx?raw";
-
-const rollbackReadonlyMonacoProps = (src: string): string => {
- const match = src.match(
- /<ReadonlyMonaco[\s\S]*?content=\{preview\.statement\}[\s\S]*?\/>/
- );
- expect(match, "expected rollback preview ReadonlyMonaco").not.toBeNull();
- return match?.[0] ?? "";
-};
-
-describe("PlanDetailRollbackSheet statement preview", () => {
- test("lets Monaco own the compact preview viewport", () => {
- const props = rollbackReadonlyMonacoProps(source);
-
- expect(props).toContain("max={256}");
- expect(props).toContain("min={128}");
- expect(props).not.toContain("max-h-[320px]");
- expect(props).not.toContain("overflow-hidden");
+import { act, render, screen, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, test, vi } from "vitest";
+import type { Task, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
+
+const mocks = vi.hoisted(() => ({
+ previewTaskRunRollback: vi.fn(),
+}));
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+vi.mock("@/api", () => ({
+ issueServiceClientConnect: {},
+ planServiceClientConnect: {},
+ rolloutServiceClientConnect: {
+ previewTaskRunRollback: mocks.previewTaskRunRollback,
+ },
+}));
+
+vi.mock("@/components/monaco", () => ({
+ ReadonlyMonaco: ({ content }: { content: string }) => (
+ <div data-testid="rollback-statement">{content}</div>
+ ),
+}));
+
+vi.mock("@/components/PermissionGuard", () => ({
+ PermissionGuard: ({ children }: { children: ReactNode }) => <>{children}</>,
+ usePermissionCheck: () => [true, undefined],
+}));
+
+vi.mock("@/components/ui/alert", () => ({
+ Alert: ({ description }: { description: ReactNode }) => (
+ <div role="alert">{description}</div>
+ ),
+}));
+
+vi.mock("@/components/ui/badge", () => ({
+ Badge: ({ children }: { children: ReactNode }) => <span>{children}</span>,
+}));
+
+vi.mock("@/components/ui/button", () => ({
+ Button: ({
+ children,
+ ...props
+ }: React.ButtonHTMLAttributes<HTMLButtonElement>) => (
+ <button {...props}>{children}</button>
+ ),
+}));
+
+vi.mock("@/components/ui/checkbox", () => ({
+ Checkbox: () => <input type="checkbox" />,
+}));
+
+vi.mock("@/components/ui/sheet", () => ({
+ Sheet: ({ children, open }: { children: ReactNode; open: boolean }) =>
+ open ? <>{children}</> : null,
+ SheetBody: ({ children }: { children: ReactNode }) => <div>{children}</div>,
+ SheetContent: ({ children }: { children: ReactNode }) => (
+ <div>{children}</div>
+ ),
+ SheetFooter: ({ children }: { children: ReactNode }) => <div>{children}</div>,
+ SheetHeader: ({ children }: { children: ReactNode }) => <div>{children}</div>,
+ SheetTitle: ({ children }: { children: ReactNode }) => <h2>{children}</h2>,
+}));
+
+vi.mock("@/hooks/useAppState", () => ({
+ useCurrentUser: () => ({ name: "users/[email protected]" }),
+}));
+
+vi.mock("@/hooks/useProjectByName", () => ({
+ useProjectByName: () => ({ name: "projects/p1" }),
+}));
+
+vi.mock("@/app/router", () => ({ router: { push: vi.fn() } }));
+
+vi.mock("@/stores/app", () => ({
+ useAppStore: Object.assign(
+ (selector: (state: unknown) => unknown) =>
+ selector({ projectsByName: { "projects/p1": { name: "projects/p1" } } }),
+ { getState: () => ({ createSheet: vi.fn() }) }
+ ),
+}));
+
+vi.mock("@/stores", () => ({ pushNotification: vi.fn() }));
+
+vi.mock("@/utils", () => ({
+ extractPlanUID: () => "1",
+ extractProjectResourceName: () => "p1",
+}));
+
+vi.mock("./PlanTargetDisplay", () => ({
+ PlanTargetDisplay: ({ target }: { target: string }) => <span>{target}</span>,
+}));
+
+vi.mock("./rollbackDraft", () => ({ createRollbackDraftReview: vi.fn() }));
+
+import { PlanDetailRollbackSheet } from "./PlanDetailRollbackSheet";
+
+type PreviewResult = { statement: string };
+
+function deferred<T>() {
+ let resolve!: (value: T) => void;
+ const promise = new Promise<T>((next) => {
+ resolve = next;
+ });
+ return { promise, resolve };
+}
+
+const task = (name: string) =>
+ ({ name: `tasks/${name}`, target: `instances/i/databases/${name}` }) as Task;
+const taskRun = (name: string) => ({ name: `taskRuns/${name}` }) as TaskRun;
+const itemsA = [{ task: task("a"), taskRun: taskRun("a") }];
+const itemsB = [{ task: task("b"), taskRun: taskRun("b") }];
+
+describe("PlanDetailRollbackSheet request lifecycle", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ });
+
+ test("ignores a preview response from a prior open entity", async () => {
+ const previewA = deferred<PreviewResult>();
+ const previewB = deferred<PreviewResult>();
+ mocks.previewTaskRunRollback.mockImplementation(
+ (request: { name: string }) =>
+ request.name === "taskRuns/a" ? previewA.promise : previewB.promise
+ );
+ const onOpenChange = vi.fn();
+ const { rerender } = render(
+ <PlanDetailRollbackSheet
+ items={itemsA}
+ onOpenChange={onOpenChange}
+ open
+ projectName="projects/p1"
+ rolloutName="projects/p1/plans/1/rollout"
+ />
+ );
+ await waitFor(() =>
+ expect(mocks.previewTaskRunRollback).toHaveBeenCalled()
+ );
+
+ rerender(
+ <PlanDetailRollbackSheet
+ items={itemsA}
+ onOpenChange={onOpenChange}
+ open={false}
+ projectName="projects/p1"
+ rolloutName="projects/p1/plans/1/rollout"
+ />
+ );
+ rerender(
+ <PlanDetailRollbackSheet
+ items={itemsB}
+ onOpenChange={onOpenChange}
+ open
+ projectName="projects/p1"
+ rolloutName="projects/p1/plans/2/rollout"
+ />
+ );
+
+ previewB.resolve({ statement: "ROLLBACK B" });
+ await waitFor(() =>
+ expect(screen.getByTestId("rollback-statement")).toHaveTextContent(
+ "ROLLBACK B"
+ )
+ );
+
+ await act(async () => {
+ previewA.resolve({ statement: "ROLLBACK A" });
+ await Promise.resolve();
+ await Promise.resolve();
+ });
+
+ expect(screen.getByTestId("rollback-statement")).toHaveTextContent(
+ "ROLLBACK B"
+ );
+ expect(screen.queryByText("ROLLBACK A")).toBeNull();
});
});
diff --git a/frontend/src/routes/project/plan-detail/components/SchemaEditorSheetLayout.test.ts b/frontend/src/routes/project/plan-detail/components/SchemaEditorSheetLayout.test.ts
deleted file mode 100644
index 999327d591..0000000000
--- a/frontend/src/routes/project/plan-detail/components/SchemaEditorSheetLayout.test.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const source = readFileSync(
- join(import.meta.dirname, "SchemaEditorSheet.tsx"),
- "utf8"
-);
-
-describe("SchemaEditorSheet layout", () => {
- test("keeps the editor mounted through the sheet close animation", () => {
- expect(source).toContain("<SchemaEditorSheetBody");
- expect(source).not.toContain("{open && (");
- });
-
- test("uses the shared sheet regions and header actions", () => {
- expect(source).toContain("<SheetHeader");
- expect(source).toContain("actions={");
- expect(source).toContain("<SheetBody");
- expect(source).toContain("<SheetFooter>");
- expect(source).not.toContain("<SheetClose");
- });
-});
diff --git a/frontend/src/routes/project/plan-detail/components/deploy/DeployTaskBody.test.tsx b/frontend/src/routes/project/plan-detail/components/deploy/DeployTaskBody.test.tsx
deleted file mode 100644
index 3035b33dd9..0000000000
--- a/frontend/src/routes/project/plan-detail/components/deploy/DeployTaskBody.test.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { describe, expect, test } from "vitest";
-
-import source from "./DeployTaskBody.tsx?raw";
-
-const statementReadonlyMonacoProps = (src: string): string => {
- const match = src.match(
- /<ReadonlyMonaco[\s\S]*?content=\{statement\}[\s\S]*?\/>/
- );
- expect(match, "expected statement ReadonlyMonaco").not.toBeNull();
- return match?.[0] ?? "";
-};
-
-describe("DeployTaskBody statement editor", () => {
- test("lets Monaco own the compact statement viewport", () => {
- const props = statementReadonlyMonacoProps(source);
-
- expect(props).toContain("max={256}");
- expect(props).toContain("min={128}");
- expect(props).not.toContain("max-h-64");
- expect(props).not.toContain("overflow-hidden");
- });
-});
diff --git a/frontend/src/routes/project/plan-detail/shared/stores/__tests__/usePlanDetailStore.test.tsx b/frontend/src/routes/project/plan-detail/shared/stores/usePlanDetailStore.test.tsx
similarity index 92%
rename from frontend/src/routes/project/plan-detail/shared/stores/__tests__/usePlanDetailStore.test.tsx
rename to frontend/src/routes/project/plan-detail/shared/stores/usePlanDetailStore.test.tsx
index 0fbbd0bc6c..0c84b5d148 100644
--- a/frontend/src/routes/project/plan-detail/shared/stores/__tests__/usePlanDetailStore.test.tsx
+++ b/frontend/src/routes/project/plan-detail/shared/stores/usePlanDetailStore.test.tsx
@@ -1,8 +1,8 @@
import { act, renderHook } from "@testing-library/react";
import type { ReactNode } from "react";
import { describe, expect, test } from "vitest";
-import { PlanDetailStoreProvider } from "../PlanDetailStoreProvider";
-import { usePlanDetailStore } from "../usePlanDetailStore";
+import { PlanDetailStoreProvider } from "./PlanDetailStoreProvider";
+import { usePlanDetailStore } from "./usePlanDetailStore";
const wrapper = ({ children }: { children: ReactNode }) => (
<PlanDetailStoreProvider>{children}</PlanDetailStoreProvider>
diff --git a/frontend/src/routes/project/plan-detail/shell/__tests__/leaveGuard.test.ts b/frontend/src/routes/project/plan-detail/shell/leaveGuard.test.ts
similarity index 95%
rename from frontend/src/routes/project/plan-detail/shell/__tests__/leaveGuard.test.ts
rename to frontend/src/routes/project/plan-detail/shell/leaveGuard.test.ts
index 79cb40e1b4..e38ffb28d1 100644
--- a/frontend/src/routes/project/plan-detail/shell/__tests__/leaveGuard.test.ts
+++ b/frontend/src/routes/project/plan-detail/shell/leaveGuard.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import { describe, expect, test } from "vitest";
-import { decideLeaveAction } from "../leaveGuard";
+import { decideLeaveAction } from "./leaveGuard";
describe("decideLeaveAction", () => {
test("allows navigation when no scopes are editing", () => {
diff --git a/frontend/src/routes/workspace/EnvironmentsPageLayout.test.ts b/frontend/src/routes/workspace/EnvironmentsPageLayout.test.ts
deleted file mode 100644
index bb8e23186e..0000000000
--- a/frontend/src/routes/workspace/EnvironmentsPageLayout.test.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const settingsDir = dirname(fileURLToPath(import.meta.url));
-
-const readEnvironmentsPage = () =>
- readFileSync(join(settingsDir, "EnvironmentsPage.tsx"), "utf8");
-
-describe("EnvironmentsPage layout", () => {
- test("keeps the environment tier feature badge spaced from both titles", () => {
- const source = readEnvironmentsPage();
-
- expect(
- source.match(/<span className="inline-flex items-center gap-x-1">/g)
- ?.length
- ).toBeGreaterThanOrEqual(2);
- expect(source).toContain('{t("policy.environment-tier.name")}');
- expect(
- source.match(
- /<FeatureBadge\s+feature=\{PlanFeature\.FEATURE_ENVIRONMENT_TIERS\}\s*\/>/g
- )?.length
- ).toBeGreaterThanOrEqual(2);
- });
-});
diff --git a/frontend/src/routes/workspace/GroupsPage.test.tsx b/frontend/src/routes/workspace/GroupsPage.test.tsx
index 83d8dd4d46..0cc156c749 100644
--- a/frontend/src/routes/workspace/GroupsPage.test.tsx
+++ b/frontend/src/routes/workspace/GroupsPage.test.tsx
@@ -1,6 +1,3 @@
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
import type {
ButtonHTMLAttributes,
InputHTMLAttributes,
@@ -32,8 +29,6 @@ const mocks = vi.hoisted(() => ({
routerReplace: vi.fn(),
}));
-const pageDir = dirname(fileURLToPath(import.meta.url));
-
vi.mock("@/components/ComponentPermissionGuard", () => ({
ComponentPermissionGuard: ({ children }: { children: ReactNode }) =>
createElement("div", {}, children),
@@ -318,21 +313,6 @@ async function renderPage(): Promise<void> {
}
describe("GroupsPage create group sheet", () => {
- it("routes domain restriction configuration with intro highlight", () => {
- const source = readFileSync(join(pageDir, "GroupsPage.tsx"), "utf8");
- const domainRestrictionIndex = source.indexOf(
- 'hash: "#domain-restriction"'
- );
- const domainRestrictionRoute = source.slice(
- Math.max(0, domainRestrictionIndex - 300),
- domainRestrictionIndex + 300
- );
-
- expect(domainRestrictionIndex).toBeGreaterThan(0);
- expect(domainRestrictionRoute).toContain("DOMAIN_RESTRICTION_PRODUCT_INTRO");
- expect(domainRestrictionRoute).toContain("PRODUCT_INTRO_QUERY_KEY");
- });
-
it("renders the title-required error under the title field", async () => {
await renderPage();
diff --git a/frontend/src/routes/workspace/GroupsPage.tsx b/frontend/src/routes/workspace/GroupsPage.tsx
index b8029e7b32..e7083e191d 100644
--- a/frontend/src/routes/workspace/GroupsPage.tsx
+++ b/frontend/src/routes/workspace/GroupsPage.tsx
@@ -1188,7 +1188,7 @@ export function GroupsPage() {
};
// Run on mount
handleRouteChange();
- // Listen for in-app navigation via Vue router (pushState/replaceState)
+ // Listen for in-app router navigation (pushState/replaceState)
const unregister = router.afterEach(() => {
handleRouteChange();
});
diff --git a/frontend/src/routes/workspace/IDPsPageLayout.test.ts b/frontend/src/routes/workspace/IDPsPageLayout.test.ts
deleted file mode 100644
index 32843c4ce6..0000000000
--- a/frontend/src/routes/workspace/IDPsPageLayout.test.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const sectionDir = dirname(fileURLToPath(import.meta.url));
-
-const getFunctionSource = (source: string, name: string, nextMarker: string) =>
- source.slice(source.indexOf(`function ${name}`), source.indexOf(nextMarker));
-
-describe("IDPsPage create SSO layout", () => {
- test("uses shared form primitives in the create SSO form steps", () => {
- const source = readFileSync(join(sectionDir, "IDPsPage.tsx"), "utf8");
- const providerConfigSource = getFunctionSource(
- source,
- "ProviderConfigForm",
- "// ============================================================\n// FieldMappingForm"
- );
- const fieldMappingSource = getFunctionSource(
- source,
- "FieldMappingForm",
- "// ============================================================\n// CreateWizardDrawer"
- );
- const createWizardSource = getFunctionSource(
- source,
- "CreateWizardDrawer",
- "// ============================================================\n// IDPsPage"
- );
-
- for (const formSource of [
- providerConfigSource,
- fieldMappingSource,
- createWizardSource,
- ]) {
- expect(formSource).toContain("FormField");
- expect(formSource).not.toContain(
- 'className="block text-base font-semibold text-gray-800'
- );
- }
-
- expect(createWizardSource).toContain("<FormFieldGroup");
- expect(createWizardSource).toContain("FormTitle");
- expect(createWizardSource).not.toContain("FormLabel");
- expect(createWizardSource).toContain('id="sso-create-name"');
- expect(createWizardSource).toContain('id="sso-create-domain"');
- expect(providerConfigSource).toContain("FormFieldGroup");
- expect(providerConfigSource).toContain("FormTitle");
- expect(providerConfigSource).not.toContain("FormLabel");
- expect(fieldMappingSource).toContain("FormFieldGroup");
- expect(createWizardSource.match(/selectionCardVariants\(/g)).toHaveLength(
- 2
- );
- expect(createWizardSource).toContain('width="large"');
- expect(createWizardSource).toContain("<SheetHeader>");
- expect(createWizardSource).toContain("<SheetBody");
- expect(createWizardSource).toContain("<SheetFooter>");
- });
-});
diff --git a/frontend/src/routes/workspace/LandingPage.navigation.test.ts b/frontend/src/routes/workspace/LandingPage.navigation.test.ts
deleted file mode 100644
index b939eaf706..0000000000
--- a/frontend/src/routes/workspace/LandingPage.navigation.test.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-import source from "./LandingPage.tsx?raw";
-
-describe("LandingPage navigation", () => {
- test("routes the visit projects quick link to the projects page", () => {
- expect(source).toContain('id: "visit-projects"');
- expect(source).toContain("route: PROJECT_V1_ROUTE_DASHBOARD");
- expect(source).not.toContain("ProjectSwitchDialog");
- expect(source).not.toContain("setShowProjectSwitchDialog");
- });
-
- test("uses shared controls and semantic colors for quick-link interactions", () => {
- expect(source).toContain(
- 'import { QuickLinkButton, QuickLinkLink } from "@/components/ui/quick-link"'
- );
- expect(source).toContain("<QuickLinkButton");
- expect(source).toContain("<QuickLinkLink");
- expect(source).not.toContain("QUICK_LINK_TILE_CLASS");
- });
-});
diff --git a/frontend/src/routes/workspace/LandingPage.tsx b/frontend/src/routes/workspace/LandingPage.tsx
index d387744e39..fa6ae32203 100644
--- a/frontend/src/routes/workspace/LandingPage.tsx
+++ b/frontend/src/routes/workspace/LandingPage.tsx
@@ -78,7 +78,7 @@ interface QuickLinkDef {
}
// ---------------------------------------------------------------------------
-// Build the full quick-link catalogue (mirrors useDashboardSidebar + useQuickLink)
+// Build the full quick-link catalogue
// ---------------------------------------------------------------------------
function useFullQuickLinkList(): QuickLinkDef[] {
@@ -240,7 +240,7 @@ function useFullQuickLinkList(): QuickLinkDef[] {
}
// ---------------------------------------------------------------------------
-// localStorage-backed quick-access config (same keys as Vue version)
+// localStorage-backed quick-access config
// ---------------------------------------------------------------------------
const DEFAULT_CONFIG = [
diff --git a/frontend/src/routes/workspace/LearnMoreLinkLayout.test.ts b/frontend/src/routes/workspace/LearnMoreLinkLayout.test.ts
deleted file mode 100644
index 2c67dfd9f0..0000000000
--- a/frontend/src/routes/workspace/LearnMoreLinkLayout.test.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const settingsDir = dirname(fileURLToPath(import.meta.url));
-
-function readSettingsPage(filename: string) {
- return readFileSync(join(settingsDir, filename), "utf8");
-}
-
-describe("settings learn more links", () => {
- test("uses LearnMoreLink instead of hand-written common.learn-more anchors", () => {
- const migratedPages = [
- "EnvironmentsPage.tsx",
- "IMPage.tsx",
- "GlobalMaskingPage.tsx",
- ];
-
- for (const filename of migratedPages) {
- const source = readSettingsPage(filename);
-
- expect(source).toContain("LearnMoreLink");
- expect(source).not.toContain('{t("common.learn-more")}');
- expect(source).not.toContain('{t("common.learn-more")} &gt;');
- }
- });
-
- test("adds environment policy learn more links to both page and drawer", () => {
- const source = readSettingsPage("EnvironmentsPage.tsx");
-
- expect(source.match(/<LearnMoreLink/g)?.length).toBe(4);
- expect(
- source.match(
- /https:\/\/docs\.bytebase\.com\/change-database\/environment-policy\/overview\/\?source=console#environment-tier/g
- )?.length
- ).toBe(2);
- expect(
- source.match(
- /https:\/\/docs\.bytebase\.com\/change-database\/environment-policy\/rollout-policy\/\?source=console/g
- )?.length
- ).toBe(2);
- });
-});
diff --git a/frontend/src/routes/workspace/MCPPage.test.ts b/frontend/src/routes/workspace/MCPPage.test.ts
deleted file mode 100644
index d0c60d0666..0000000000
--- a/frontend/src/routes/workspace/MCPPage.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const sectionDir = dirname(fileURLToPath(import.meta.url));
-
-describe("MCPPage layout", () => {
- test("uses the CLI command input layout for the first prompt example", () => {
- const source = readFileSync(join(sectionDir, "MCPPage.tsx"), "utf8");
-
- const inputIndex = source.indexOf("value={firstPromptExample}");
- const copyIndex = source.indexOf("CopyButton content={firstPromptExample}");
-
- expect(inputIndex).toBeGreaterThan(-1);
- expect(copyIndex).toBeGreaterThan(inputIndex);
- expect(source).toContain('className="flex-1 font-mono"');
- expect(source).not.toContain("<code className=");
- });
-});
diff --git a/frontend/src/routes/workspace/MembersPage.test.tsx b/frontend/src/routes/workspace/MembersPage.test.tsx
index 98912e63d0..73a4b2a97d 100644
--- a/frontend/src/routes/workspace/MembersPage.test.tsx
+++ b/frontend/src/routes/workspace/MembersPage.test.tsx
@@ -317,7 +317,6 @@ vi.mock("@/stores/app", () => {
getProjectIamPolicy: () => projectIamPolicy,
updateProjectIamPolicy: mockUpdateProjectIamPolicy,
loadProjectIamPolicy: vi.fn(async () => undefined),
- // Project store methods, migrated off the Pinia useProjectV1Store mock.
projectsByName: {},
getProjectByName: (name: string) => ({
allowRequestRole: true,
@@ -325,7 +324,6 @@ vi.mock("@/stores/app", () => {
permissions: ["bb.projects.setIamPolicy"],
state: 1,
}),
- // Migrated off the Pinia actuator/setting/subscription store mocks.
isSaaSMode: () => false,
workspaceResourceName: () => "workspaces/default",
userCountInIam: () => 1,
diff --git a/frontend/src/routes/workspace/MembersPage.tsx b/frontend/src/routes/workspace/MembersPage.tsx
index 1a4d3645d2..6dcad81fda 100644
--- a/frontend/src/routes/workspace/MembersPage.tsx
+++ b/frontend/src/routes/workspace/MembersPage.tsx
@@ -2068,7 +2068,7 @@ export function MembersPage({ projectId }: { projectId?: string }) {
);
const roleList = useAppStore((state) => state.roleList);
- // IAM policy loads are owned by the parent shells: ProjectRouteShell
+ // IAM policy loads are owned by the parent shells: ProjectRouteGate
// loads project IAM on /projects/:projectId/members, and
// DashboardFrameShell's useEnsureWorkspaceCommonData loads workspace IAM
// (+ referenced groups) on /settings/members. This page just reads them.
@@ -2127,8 +2127,8 @@ export function MembersPage({ projectId }: { projectId?: string }) {
// Whether the current user already holds every PROJECT_OWNER permission
// (workspace- or project-scoped). hasProjectPermissionV2 falls back to
- // workspace permissions, so a single check covers both contexts. Mirrors the
- // Vue `hasMissingPermission` gate rather than checking `setIamPolicy` alone.
+ // workspace permissions, so a single check covers both contexts. It checks
+ // every owner permission rather than `setIamPolicy` alone.
// Computed inline (not memoized) so it tracks live IAM policy changes, the
// same way canSetIamPolicy above does — the permission check reads
// current-user state that isn't captured by [project, roleList] deps.
diff --git a/frontend/src/routes/workspace/MyIssuesPage.creators.test.ts b/frontend/src/routes/workspace/MyIssuesPage.creators.test.ts
deleted file mode 100644
index 5bf6227695..0000000000
--- a/frontend/src/routes/workspace/MyIssuesPage.creators.test.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-import source from "./MyIssuesPage.tsx?raw";
-
-describe("my issue list creator cache", () => {
- test("fetches listed issue creators before rendering fallback names", () => {
- expect(source).toMatch(
- /const batchGetOrFetchUsers = useAppStore\(\s*\(state\) => state\.batchGetOrFetchUsers\s*\)/
- );
- expect(source).toMatch(
- /batchGetOrFetchUsers\(paged\.dataList\.map\(\(issue\) => issue\.creator\)\)/
- );
- });
-
- test("shares the workspace layout and bordered issue-list surface", () => {
- expect(source).toContain("WorkspacePageLayout");
- expect(source).toContain("WorkspacePageContent");
- expect(source).toContain("<IssueListPanel");
- expect(source).toContain('<WorkspacePageFooter className="px-2">');
- });
-});
diff --git a/frontend/src/routes/workspace/ProjectsPage.navigation.test.ts b/frontend/src/routes/workspace/ProjectsPage.navigation.test.ts
deleted file mode 100644
index e48dc98846..0000000000
--- a/frontend/src/routes/workspace/ProjectsPage.navigation.test.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-
-import source from "./ProjectsPage.tsx?raw";
-
-describe("ProjectsPage navigation", () => {
- test("opens a newly created project on the databases page with the connect instance intro", () => {
- expect(source).toContain("PROJECT_V1_ROUTE_DATABASES");
- expect(source).toContain(
- "query: { [PRODUCT_INTRO_QUERY_KEY]: CONNECT_DATABASE_PRODUCT_INTRO }"
- );
- });
-
- test("opens projects from the table on the issues page", () => {
- expect(source).toContain("PROJECT_V1_ROUTE_ISSUES");
- expect(source).toContain("projectIssuesRoute(project)");
- expect(source).toContain("e.ctrlKey || e.metaKey");
- expect(source).toContain('window.open(route.fullPath, "_blank")');
- expect(source).toContain("markListScrollRestorationEntry();");
- expect(source).not.toContain("PROJECT_V1_ROUTE_DETAIL");
- expect(source).not.toContain("router.push({ path: `/${project.name}` })");
- });
-});
diff --git a/frontend/src/routes/workspace/PurchaseSection.tsx b/frontend/src/routes/workspace/PurchaseSection.tsx
index adf08cac26..6a5bfde29b 100644
--- a/frontend/src/routes/workspace/PurchaseSection.tsx
+++ b/frontend/src/routes/workspace/PurchaseSection.tsx
@@ -21,7 +21,6 @@ interface PurchaseSectionProps {
readonly onRequireEnterprise: () => void;
}
-// Data model matching the Vue PlanCardData interface.
interface PlanCardData {
type: PlanType;
title: string;
@@ -161,7 +160,6 @@ export function PurchaseSection({ onRequireEnterprise }: PurchaseSectionProps) {
[currentPlan, isExpired]
);
- // Helpers matching Vue computed functions.
const planTitle = (type: PlanType): string => {
switch (type) {
case PlanType.FREE:
@@ -196,7 +194,6 @@ export function PurchaseSection({ onRequireEnterprise }: PurchaseSectionProps) {
bold: key === "everything",
}));
- // Build planCards matching the Vue computed.
const planCards = useMemo((): PlanCardData[] => {
if (purchasePlans.length === 0) return [];
@@ -603,7 +600,6 @@ export function PurchaseSection({ onRequireEnterprise }: PurchaseSectionProps) {
);
}
-// Plan card component matching Vue's PlanCard.vue.
function PlanCard({
title,
description,
diff --git a/frontend/src/routes/workspace/RolesPageLayout.test.ts b/frontend/src/routes/workspace/RolesPageLayout.test.ts
deleted file mode 100644
index b452d311b5..0000000000
--- a/frontend/src/routes/workspace/RolesPageLayout.test.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const sectionDir = dirname(fileURLToPath(import.meta.url));
-
-describe("RolesPage drawer layout", () => {
- test("uses shared form primitives in the role sheet", () => {
- const source = readFileSync(join(sectionDir, "RolesPage.tsx"), "utf8");
- const roleSheetSource = source.slice(
- source.indexOf("function RoleSheet"),
- source.indexOf(
- "// ============================================================\n// RolesPage"
- )
- );
-
- expect(roleSheetSource).toContain("<FormFieldGroup>");
- expect(roleSheetSource).toContain("<FormField");
- expect(roleSheetSource).toContain("FormTitle");
- expect(roleSheetSource).toContain('id="role-sheet-title"');
- expect(roleSheetSource).toContain('id="role-sheet-description"');
- expect(roleSheetSource).not.toContain("FormLabel");
- expect(roleSheetSource).not.toContain('className="textlabel"');
- expect(roleSheetSource).not.toContain(
- 'className="text-sm font-medium text-main"'
- );
- expect(roleSheetSource).not.toContain('className="flex flex-col gap-y-5"');
- });
-});
diff --git a/frontend/src/routes/workspace/SubscriptionPageLayout.test.ts b/frontend/src/routes/workspace/SubscriptionPageLayout.test.ts
deleted file mode 100644
index 80f2861b65..0000000000
--- a/frontend/src/routes/workspace/SubscriptionPageLayout.test.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const sectionDir = dirname(fileURLToPath(import.meta.url));
-
-describe("SubscriptionPage layout", () => {
- test("uses shared form primitives for self-hosted subscription fields", () => {
- const source = readFileSync(
- join(sectionDir, "SubscriptionPage.tsx"),
- "utf8"
- );
-
- expect(source).toContain("FormFieldGroup");
- expect(source).toContain("<FormField");
- expect(source).toContain("LearnMoreLink");
- expect(source).toContain(
- 'href="https://www.bytebase.com/pricing?source=console"'
- );
- expect(source).toContain('htmlFor="subscription-workspace-id"');
- expect(source).toContain('id="subscription-workspace-id"');
- expect(source).toContain('htmlFor="subscription-license"');
- expect(source).toContain('id="subscription-license"');
- expect(source).not.toContain(
- '<label className="flex items-center gap-x-2">'
- );
- expect(source).not.toContain(
- 'className="mb-3 text-sm text-control-placeholder"'
- );
- expect(source).not.toContain('rel="noopener noreferrer"');
- expect(source).not.toContain('{t("common.learn-more")} &gt;');
- });
-});
diff --git a/frontend/src/routes/workspace/UsersPage.test.tsx b/frontend/src/routes/workspace/UsersPage.test.tsx
deleted file mode 100644
index 9d8e018ffc..0000000000
--- a/frontend/src/routes/workspace/UsersPage.test.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const componentDir = dirname(fileURLToPath(import.meta.url));
-
-describe("UsersPage onboarding intro", () => {
- test("binds the shared Create User intro to the existing create button", () => {
- const source = readFileSync(join(componentDir, "UsersPage.tsx"), "utf8");
-
- expect(source).toContain("useProductIntro({");
- expect(source).toContain("id: CREATE_USER_PRODUCT_INTRO");
- expect(source).toContain("disabled: !canCreateUser");
- expect(source).toContain(
- "data-product-intro-target={CREATE_USER_PRODUCT_INTRO}"
- );
- });
-});
diff --git a/frontend/src/routes/workspace/WorkspacePageLayout.test.ts b/frontend/src/routes/workspace/WorkspacePageLayout.test.ts
deleted file mode 100644
index 7a8e12d36e..0000000000
--- a/frontend/src/routes/workspace/WorkspacePageLayout.test.ts
+++ /dev/null
@@ -1,219 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { join } from "node:path";
-import { describe, expect, test } from "vitest";
-
-const settingsDir = import.meta.dirname;
-const componentsDir = join(settingsDir, "../../components");
-
-const workspaceListPages = [
- "AuditLogPage.tsx",
- "DatabasesPage.tsx",
- "GroupsPage.tsx",
- "InstancesPage.tsx",
- "MembersPage.tsx",
- "ProjectsPage.tsx",
- "SemanticTypesPage.tsx",
- "ServiceAccountsPage.tsx",
- "UsersPage.tsx",
- "WorkloadIdentitiesPage.tsx",
-] as const;
-
-const workspaceInfoPages = [
- "RolesPage.tsx",
- "IDPsPage.tsx",
- "IDPDetailPage.tsx",
- "SQLReviewPage.tsx",
- "RiskAssessmentPage.tsx",
- "CustomApprovalPage.tsx",
- "DataClassificationPage.tsx",
- "GlobalMaskingPage.tsx",
- "SemanticTypesPage.tsx",
- "IMPage.tsx",
-] as const;
-
-const workspaceRhythmPages = [
- "general/GeneralPage.tsx",
- "SubscriptionPage.tsx",
- "CustomApprovalPage.tsx",
-] as const;
-
-const adaptiveWorkspaceListPages = [
- "MembersPage.tsx",
- "ServiceAccountsPage.tsx",
- "WorkloadIdentitiesPage.tsx",
-] as const;
-
-const flushWorkspaceListPages = [
- "DatabasesPage.tsx",
- "InstancesPage.tsx",
- "ProjectsPage.tsx",
-] as const;
-
-function readSettingsPage(
- file:
- | (typeof workspaceListPages)[number]
- | (typeof workspaceInfoPages)[number]
- | (typeof workspaceRhythmPages)[number]
-) {
- return readFileSync(join(settingsDir, file), "utf8");
-}
-
-describe("workspace list page layout", () => {
- test("supports explicit workspace shell padding modes", () => {
- const source = readFileSync(
- join(componentsDir, "WorkspacePageLayout.tsx"),
- "utf8"
- );
-
- expect(source).toContain("paddingBlock: 16");
- expect(source).toContain("rowGap: 16");
- expect(source).toContain('overflowX: "clip"');
- expect(source).not.toContain('overflowX: "hidden"');
- expect(source).toContain("marginInline: 8");
- expect(source).toContain('padding?: "page" | "flush"');
- expect(source).toContain('padding = "page"');
- expect(source).toContain("pagePadding");
- expect(source).toContain("paddingInline: 16");
- expect(source).toContain('<Alert role="note"');
- expect(source).not.toContain("paddingBottom: 8");
- });
-
- test("uses the shared workspace layout shell instead of page-local padding", () => {
- for (const file of workspaceListPages) {
- const source = readSettingsPage(file);
-
- expect(source, file).toContain("@/components/WorkspacePageLayout");
- if (
- adaptiveWorkspaceListPages.includes(
- file as (typeof adaptiveWorkspaceListPages)[number]
- )
- ) {
- expect(source, file).toContain(
- "const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout"
- );
- expect(source, file).toContain("<PageLayout>");
- } else {
- expect(source, file).toContain("<WorkspacePageLayout");
- }
- if (
- flushWorkspaceListPages.includes(
- file as (typeof flushWorkspaceListPages)[number]
- )
- ) {
- expect(source, file).toContain('padding="flush"');
- const layoutSource =
- file === "InstancesPage.tsx"
- ? readFileSync(
- join(componentsDir, "instance/InstanceDashboard.tsx"),
- "utf8"
- )
- : source;
- if (file === "InstancesPage.tsx") {
- expect(layoutSource, file).toContain(
- 'layout === "workspace" && "px-4"'
- );
- } else {
- expect(layoutSource, file).toContain(
- '<WorkspacePageToolbar className="px-4'
- );
- }
- }
- expect(source, file).not.toContain(
- 'className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4"'
- );
- expect(source, file).not.toContain('className="py-4 flex flex-col"');
- expect(source, file).not.toContain(
- 'className="py-4 flex flex-col relative"'
- );
- }
- });
-
- test("keeps machine identity toolbars action-only", () => {
- for (const file of [
- "ServiceAccountsPage.tsx",
- "WorkloadIdentitiesPage.tsx",
- ] as const) {
- const source = readSettingsPage(file);
-
- expect(source, file).toContain('<PageToolbar align="end">');
- expect(source, file).not.toContain(
- 't("settings.members.service-accounts")'
- );
- expect(source, file).not.toContain(
- 't("settings.members.workload-identities")'
- );
- }
- });
-
- test("limits inactive account toggles to their checkbox and label", () => {
- for (const file of [
- "UsersPage.tsx",
- "ServiceAccountsPage.tsx",
- "WorkloadIdentitiesPage.tsx",
- ] as const) {
- const source = readSettingsPage(file);
-
- expect(source, file).not.toContain(
- '<label className="flex items-center gap-x-2 text-sm cursor-pointer">'
- );
- expect(source, file).toContain('htmlFor="show-inactive-');
- expect(source, file).toContain('id="show-inactive-');
- }
- });
-
- test("uses shared workspace info surfaces for persistent page descriptions", () => {
- for (const file of workspaceInfoPages) {
- const source = readSettingsPage(file);
-
- expect(source, file).toContain("WorkspacePageInfo");
- }
- });
-
- test("uses shared workspace shell instead of page-local top spacing", () => {
- for (const file of workspaceRhythmPages) {
- const source = readSettingsPage(file);
-
- expect(source, file).toContain("<WorkspacePageLayout");
- expect(source, file).not.toContain('className="w-full px-4 py-4');
- expect(source, file).not.toContain('className="px-4 py-4');
- }
- });
-
- test("labels the instances page create action as connect instance", () => {
- const source = readFileSync(
- join(componentsDir, "instance/InstanceDashboard.tsx"),
- "utf8"
- );
-
- expect(source).toContain('t("instance.connect-instance")');
- expect(source).not.toContain('{t("common.create")}');
- });
-
- test("does not stack page top padding with general settings form sections", () => {
- const source = readSettingsPage("general/GeneralPage.tsx");
-
- expect(source).toContain(
- '<WorkspacePageLayout className="py-0 divide-y divide-block-border">'
- );
- expect(source).not.toContain('className="-mb-4"');
- });
-
- test("does not reserve top gap for hidden custom approval feature attention", () => {
- const source = readSettingsPage("CustomApprovalPage.tsx");
-
- expect(source).toContain(
- '<div ref={featureAttentionRef} className="empty:hidden">'
- );
- });
-
- test("combines global masking info into one shared info surface", () => {
- const source = readSettingsPage("GlobalMaskingPage.tsx");
-
- expect(source).not.toContain("@/components/ui/alert");
- expect(source).toContain("custom-approval.rule.first-match-wins");
- expect(source).toContain(
- "settings.sensitive-data.global-rules.description"
- );
- });
-});
diff --git a/frontend/src/routes/workspace/general/AccountSection.tsx b/frontend/src/routes/workspace/general/AccountSection.tsx
index 39b6dd236e..d32d2740df 100644
--- a/frontend/src/routes/workspace/general/AccountSection.tsx
+++ b/frontend/src/routes/workspace/general/AccountSection.tsx
@@ -359,7 +359,7 @@ export const AccountSection = forwardRef<SectionHandle, AccountSectionProps>(
updateMask: create(FieldMaskSchema, { paths: updateMaskPaths }),
});
- // Reset local state from the (now-updated) Vue store so isDirty clears
+ // Reset local state from the (now-updated) app store so isDirty clears
// and the parent's bottom bar disappears.
setToggleState(getInitialToggleState());
setPasswordState(getInitialPasswordRestriction());
diff --git a/frontend/src/routes/workspace/general/GeneralPageLayout.test.ts b/frontend/src/routes/workspace/general/GeneralPageLayout.test.ts
deleted file mode 100644
index 0607791ce2..0000000000
--- a/frontend/src/routes/workspace/general/GeneralPageLayout.test.ts
+++ /dev/null
@@ -1,117 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const sectionDir = dirname(fileURLToPath(import.meta.url));
-
-const configurableSections = [
- "AccountSection.tsx",
- "AIAugmentationSection.tsx",
- "AnnouncementSection.tsx",
- "AuditLogSection.tsx",
- "BrandingSection.tsx",
- "GeneralSection.tsx",
- "ProductImprovementSection.tsx",
- "SecuritySection.tsx",
- "SQLEditorSection.tsx",
-] as const;
-
-describe("GeneralPage section layout", () => {
- test("uses merged form section layout for configurable sections", () => {
- for (const file of configurableSections) {
- const source = readFileSync(join(sectionDir, file), "utf8");
-
- expect(source, file).toContain("@/components/ui/form");
- expect(source, file).not.toContain("@/components/ui/form.v2");
- expect(source, file).toContain("FormSection");
- expect(source, file).toContain("FormFieldGroup");
- expect(source, file).not.toContain("FormSectionHeader");
- expect(source, file).not.toContain("FormSectionTitle");
- expect(source, file).not.toContain("FormSectionContent");
- expect(source, file).not.toContain(
- 'className="flex-1 mt-4 lg:px-4 lg:mt-0"'
- );
- expect(source, file).not.toContain('className="py-6 lg:flex"');
- }
- });
-
- test("uses the shared RadioGroup for AccountSection radio controls", () => {
- const source = readFileSync(join(sectionDir, "AccountSection.tsx"), "utf8");
-
- expect(source).toContain("RadioGroup");
- expect(source).toContain("RadioGroupItem");
- expect(source).not.toContain(`type=${JSON.stringify("radio")}`);
- });
-
- test("does not add top padding to the first general settings section", () => {
- const source = readFileSync(join(sectionDir, "GeneralSection.tsx"), "utf8");
-
- expect(source).toContain("style={{ paddingTop: 8 }}");
- });
-
- test("uses merged form field props for migrated field headings", () => {
- for (const file of configurableSections) {
- const source = readFileSync(join(sectionDir, file), "utf8");
-
- expect(source, file).toContain("<FormField");
- expect(source, file).not.toContain("FormFieldHeader");
- expect(source, file).not.toContain("FormFieldTitle");
- expect(source, file).not.toContain("FormFieldSubtitle");
- expect(source, file).not.toContain(
- '<FormLabel className="text-base font-semibold">'
- );
- expect(source, file).not.toContain("text-base font-semibold");
- expect(source, file).not.toContain("text-sm font-medium text-control");
- }
- });
-
- test("keeps domain restriction checkbox text wired to the checkbox", () => {
- const source = readFileSync(
- join(sectionDir, "SecuritySection.tsx"),
- "utf8"
- );
- const membersRestrictionIndex = source.indexOf(
- "settings.general.workspace.domain-restriction.members-restriction.self"
- );
- const membersRestrictionBlock = source.slice(
- Math.max(0, membersRestrictionIndex - 1400),
- membersRestrictionIndex + 800
- );
-
- expect(membersRestrictionIndex).toBeGreaterThan(0);
- expect(membersRestrictionBlock).toContain(
- '<div className="flex items-start gap-x-2">'
- );
- expect(membersRestrictionBlock).toContain("<Checkbox");
- expect(membersRestrictionBlock).toContain("aria-labelledby");
- expect(membersRestrictionBlock).toContain("aria-describedby");
- expect(membersRestrictionBlock).toContain("toggleDomainRestriction");
- expect(membersRestrictionBlock).toContain(
- "settings.general.workspace.domain-restriction.members-restriction.description"
- );
- expect(membersRestrictionBlock).not.toContain("<label");
- expect(membersRestrictionBlock).not.toContain(
- '<span className="flex items-start gap-x-2">'
- );
- });
-
- test("wires product intro targets for general settings deep links", () => {
- const aiSource = readFileSync(
- join(sectionDir, "AIAugmentationSection.tsx"),
- "utf8"
- );
- const securitySource = readFileSync(
- join(sectionDir, "SecuritySection.tsx"),
- "utf8"
- );
-
- expect(aiSource).toContain("AI_ASSISTANT_PRODUCT_INTRO");
- expect(aiSource).toContain("data-product-intro-target");
- expect(aiSource).toContain("useProductIntro");
- expect(securitySource).toContain("DOMAIN_RESTRICTION_PRODUCT_INTRO");
- expect(securitySource).toContain("data-product-intro-target");
- expect(securitySource).toContain("useProductIntro");
- });
-});
diff --git a/frontend/src/routes/workspace/general/SecuritySection.tsx b/frontend/src/routes/workspace/general/SecuritySection.tsx
index 79c7f2e435..d6332af5f2 100644
--- a/frontend/src/routes/workspace/general/SecuritySection.tsx
+++ b/frontend/src/routes/workspace/general/SecuritySection.tsx
@@ -206,10 +206,6 @@ export const SecuritySection = forwardRef<SectionHandle, SecuritySectionProps>(
});
}
- // Pinia and the React app store both cache the workspace profile.
- // Pinia's computed updates automatically; the React store is a
- // load-once cache, so we refresh it here so consumers like
- // <Watermark /> and <BannersWrapper /> pick up the new values.
await useAppStore.getState().loadWorkspaceProfile(true);
}, [state, domainInput, getInitialState]);
diff --git a/frontend/src/routes/workspace/users/UserFormSheetLayout.test.ts b/frontend/src/routes/workspace/users/UserFormSheetLayout.test.ts
deleted file mode 100644
index 62e1b63606..0000000000
--- a/frontend/src/routes/workspace/users/UserFormSheetLayout.test.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-// @vitest-environment node
-import { readFileSync } from "node:fs";
-import { dirname, join } from "node:path";
-import { fileURLToPath } from "node:url";
-import { describe, expect, test } from "vitest";
-
-const sectionDir = dirname(fileURLToPath(import.meta.url));
-
-describe("UserFormSheet drawer layout", () => {
- test("keeps the password hint aligned in the compact drawer field", () => {
- const source = readFileSync(join(sectionDir, "UserFormSheet.tsx"), "utf8");
-
- const passwordTitleIndex = source.indexOf('id="user-form-password-title"');
- const passwordHintIndex = source.indexOf(
- 't("settings.profile.password-hint")'
- );
- const hintRowIndex = source.indexOf("<span\n className");
- const hintRowClassIndex = source.indexOf(
- "flex items-center gap-x-1 text-sm text-control-placeholder",
- hintRowIndex
- );
- const hintErrorIndex = source.indexOf('passwordHint ? "text-error" : ""');
- const passwordInputIndex = source.indexOf(
- 'className="relative flex w-full items-center"'
- );
-
- expect(passwordTitleIndex).toBeGreaterThan(-1);
- expect(passwordHintIndex).toBeGreaterThan(-1);
- expect(passwordTitleIndex).toBeLessThan(passwordHintIndex);
- expect(hintRowIndex).toBeGreaterThan(-1);
- expect(hintRowClassIndex).toBeGreaterThan(hintRowIndex);
- expect(hintRowClassIndex).toBeLessThan(passwordHintIndex);
- expect(hintErrorIndex).toBeGreaterThan(hintRowClassIndex);
- expect(hintErrorIndex).toBeLessThan(passwordHintIndex);
- expect(passwordInputIndex).toBeGreaterThan(passwordHintIndex);
- expect(source).not.toContain(
- 'description={\n <>\n {t("settings.profile.password-hint")}'
- );
- expect(source).toContain("FormTitle");
- expect(source).not.toContain("FormLabel");
- expect(source).not.toContain("textlabel");
- expect(source).not.toContain("textinfolabel");
- });
-
- test("does not require password when creating a user", () => {
- const source = readFileSync(join(sectionDir, "UserFormSheet.tsx"), "utf8");
-
- expect(source).not.toContain("(isEditMode || password.length > 0)");
- expect(source).toContain("password,");
- expect(source).toContain("backend will generate a random password");
- });
-});
diff --git a/frontend/src/stores/app/accessGrant.test.ts b/frontend/src/stores/app/accessGrant.test.ts
index 1e13dd7b0c..6ef2964922 100644
--- a/frontend/src/stores/app/accessGrant.test.ts
+++ b/frontend/src/stores/app/accessGrant.test.ts
@@ -6,6 +6,9 @@ import {
MAX_CEL_FILTER_CODE_POINTS,
} from "./accessGrant";
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
+
describe("buildAccessGrantFilter", () => {
test("empty filter returns empty string", () => {
expect(buildAccessGrantFilter(undefined)).toBe("");
@@ -91,6 +94,18 @@ describe("buildAccessGrantFilter", () => {
).toBe(`query == "SELECT 'foo \\"bar\\"' FROM t\\nWHERE x = 1"`);
});
+ test("escapes a quote in the free-text statement", () => {
+ const filter = buildAccessGrantFilter({ statement: QUOTED }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+
+ test("keeps the escaped statement readable", () => {
+ expect(buildAccessGrantFilter({ statement: QUOTED })).toBe(
+ `query.contains("${ESCAPED}")`
+ );
+ });
+
test("statement and statementExact emit different predicates", () => {
expect(buildAccessGrantFilter({ statement: "SELECT 1" })).toBe(
`query.contains("SELECT 1")`
diff --git a/frontend/src/stores/app/auth.ts b/frontend/src/stores/app/auth.ts
index 070cec80cb..3b12658f06 100644
--- a/frontend/src/stores/app/auth.ts
+++ b/frontend/src/stores/app/auth.ts
@@ -129,8 +129,8 @@ export const createAuthSlice: AppSliceCreator<AuthSlice> = (set, get) => ({
return request;
},
- // Force re-fetch (mirrors the Pinia `fetchCurrentUser`, which always hits
- // the server — login/signup need the fresh authenticated user).
+ // Force re-fetch: always hits the server — login/signup need the fresh
+ // authenticated user.
fetchCurrentUser: async (silent = false) => {
try {
const user = await userServiceClientConnect.getCurrentUser(
diff --git a/frontend/src/stores/app/database.ts b/frontend/src/stores/app/database.ts
index 053bbb3301..261581a43f 100644
--- a/frontend/src/stores/app/database.ts
+++ b/frontend/src/stores/app/database.ts
@@ -28,8 +28,8 @@ import { createUnknownDatabase, setDatabaseAccess } from "./databaseAccess";
import type { AppSliceCreator, DatabaseSlice } from "./types";
import { buildDatabaseFilter, isMissingOrForbidden, toError } from "./utils";
-// Inlined to keep the app store's load graph free of the Pinia `@/stores`
-// barrel that `@/utils/v1/database` pulls in.
+// Inlined to keep the app store's load graph free of the `@/stores` barrel
+// that `@/utils/v1/database` pulls in.
function instanceResourceNameFromDatabase(databaseName: string): string {
const match = databaseName.match(
/^(?:(projects\/[^/]+)\/)?instances\/([^/]+)\/databases\//
@@ -50,9 +50,9 @@ export const createDatabaseSlice: AppSliceCreator<DatabaseSlice> = (
return unknownDatabase;
};
- // Mirrors the legacy Pinia `batchComposeDatabase`: pre-caches the owning
- // projects and guarantees `instanceResource` is populated (with a fallback)
- // so consumers can read engine / instance off any database.
+ // Pre-caches the owning projects and guarantees `instanceResource` is
+ // populated (with a fallback) so consumers can read engine / instance off
+ // any database.
const composeDatabases = async (
databases: Database[],
silent = false
diff --git a/frontend/src/stores/app/databaseCatalog.ts b/frontend/src/stores/app/databaseCatalog.ts
index a36ac1a662..433c0b6512 100644
--- a/frontend/src/stores/app/databaseCatalog.ts
+++ b/frontend/src/stores/app/databaseCatalog.ts
@@ -108,8 +108,7 @@ export const createDatabaseCatalogSlice: AppSliceCreator<
schemas: [],
});
// Drop schemas that no longer exist in the database metadata, but keep
- // them all if metadata can't be loaded (e.g. missing permission) —
- // mirrors the legacy Pinia behavior.
+ // them all if metadata can't be loaded (e.g. missing permission).
let metadata;
try {
metadata = await get().getOrFetchDatabaseMetadata({ database });
diff --git a/frontend/src/stores/app/dbSchema.ts b/frontend/src/stores/app/dbSchema.ts
index 6ecac3cc65..e518b186e6 100644
--- a/frontend/src/stores/app/dbSchema.ts
+++ b/frontend/src/stores/app/dbSchema.ts
@@ -33,9 +33,7 @@ const cacheKey = (metadataName: string, filter: string, limit: number) =>
// Module-level singleton placeholders for not-found lookups. Reusing the
// same reference keeps `useAppStore((s) => s.getXxxMetadata(...))`
// selectors stable across renders so React's `Object.is` check doesn't
-// fire on every unrelated store update. The legacy Pinia store created a
-// fresh proto each call, but its Vue-reactivity bridge papered over the
-// resulting instability.
+// fire on every unrelated store update.
const EMPTY_TABLE_METADATA: TableMetadata = createProto(
TableMetadataSchema,
{}
diff --git a/frontend/src/stores/app/filterEscaping.test.ts b/frontend/src/stores/app/filterEscaping.test.ts
deleted file mode 100644
index 08f778eefe..0000000000
--- a/frontend/src/stores/app/filterEscaping.test.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-// @vitest-environment node
-import { describe, expect, test } from "vitest";
-import { buildAccessGrantFilter } from "./accessGrant";
-import { buildGroupFilter } from "./group";
-import { getListInstanceFilter } from "./instance";
-import { buildPlanFilter } from "./plan";
-import { getListProjectFilter } from "./project";
-import { buildAccountListFilter } from "./serviceAccount";
-import { buildUserFilter } from "./user";
-import {
- buildDatabaseFilter,
- buildProjectFilter,
- getLabelFilter,
-} from "./utils";
-
-const QUOTED = 'SELECT * FROM "users"';
-const ESCAPED = 'SELECT * FROM \\"users\\"';
-
-// A `"` typed into any of these search boxes used to close the CEL string
-// literal early, and the backend rejected the whole filter with
-// InvalidArgument. SQL identifiers make this routine on the access-grant page.
-describe("free-text search filters escape the quote", () => {
- const cases: [string, () => string][] = [
- [
- "access grant statement",
- () => buildAccessGrantFilter({ statement: QUOTED }),
- ],
- ["group", () => buildGroupFilter({ query: QUOTED })],
- ["instance", () => getListInstanceFilter({ query: QUOTED })],
- ["plan", () => buildPlanFilter({ project: "projects/p", query: QUOTED })],
- ["project list", () => getListProjectFilter({ query: QUOTED })],
- ["project picker", () => buildProjectFilter(QUOTED)],
- ["service account", () => buildAccountListFilter({ query: QUOTED })],
- ["user", () => buildUserFilter({ query: QUOTED })],
- ["database", () => buildDatabaseFilter({ query: QUOTED })],
- ];
-
- test.each(cases)("%s", (_name, build) => {
- const filter = build().toLowerCase();
- expect(filter).not.toContain(QUOTED.toLowerCase());
- expect(filter).toContain(ESCAPED.toLowerCase());
- });
-
- test("access grant keeps the statement readable", () => {
- expect(buildAccessGrantFilter({ statement: QUOTED })).toBe(
- `query.contains("${ESCAPED}")`
- );
- });
-
- test("instance host and port are escaped too", () => {
- expect(getListInstanceFilter({ host: 'h"1', port: 'p"2' })).toBe(
- 'host.contains("h\\"1") && port.contains("p\\"2")'
- );
- });
-
- test("database table filter is escaped", () => {
- expect(buildDatabaseFilter({ table: 't"1' })).toBe(
- 'table.contains("t\\"1")'
- );
- });
-});
-
-describe("getLabelFilter", () => {
- // Label keys allow dashes. `labels.cost-center` parses as subtraction, so
- // the backend never saw the key and rejected the whole filter.
- test("uses index syntax so a dashed key survives CEL parsing", () => {
- expect(getLabelFilter(["cost-center:eng"])).toEqual([
- 'labels["cost-center"] == "eng"',
- ]);
- });
-
- test("uses index syntax for multi-value keys", () => {
- expect(getLabelFilter(["cost-center:eng,ops"])).toEqual([
- 'labels["cost-center"] in ["eng", "ops"]',
- ]);
- });
-});
diff --git a/frontend/src/stores/app/group.test.ts b/frontend/src/stores/app/group.test.ts
new file mode 100644
index 0000000000..b69fae80ed
--- /dev/null
+++ b/frontend/src/stores/app/group.test.ts
@@ -0,0 +1,14 @@
+// @vitest-environment node
+import { describe, expect, test } from "vitest";
+import { buildGroupFilter } from "./group";
+
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
+
+describe("buildGroupFilter", () => {
+ test("escapes a quote in the free-text query", () => {
+ const filter = buildGroupFilter({ query: QUOTED }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+});
diff --git a/frontend/src/stores/app/iam.ts b/frontend/src/stores/app/iam.ts
index 24be4a4f2b..89b74fb696 100644
--- a/frontend/src/stores/app/iam.ts
+++ b/frontend/src/stores/app/iam.ts
@@ -24,7 +24,7 @@ import { bindingMatchesUser, projectWideBindings } from "./utils";
// Merge a member's role set into a policy clone: drop the member from roles it
// no longer holds, add it to roles it gained, and append bindings for brand-new
-// roles. Mirrors the Vue workspace store's mergeBinding.
+// roles.
const mergeBinding = ({
member,
roles,
@@ -217,8 +217,7 @@ export const createIamSlice: AppSliceCreator<IamSlice> = (set, get) => ({
},
updateProjectIamPolicy: async (project, policy) => {
- // Dedupe members within each binding (mirrors the Pinia store's
- // pre-write normalization).
+ // Dedupe members within each binding before the write.
const deduped = cloneDeep(policy);
for (const binding of deduped.bindings) {
if (binding.members) {
diff --git a/frontend/src/stores/app/index.test.ts b/frontend/src/stores/app/index.test.ts
index 2143d35966..8e811bc627 100644
--- a/frontend/src/stores/app/index.test.ts
+++ b/frontend/src/stores/app/index.test.ts
@@ -3236,8 +3236,7 @@ describe("useAppStore", () => {
table: "users",
}).name
).toBe("users");
- // Unknown table falls back to an empty TableMetadata placeholder
- // (mirrors the legacy Pinia store's behavior).
+ // Unknown table falls back to an empty TableMetadata placeholder.
expect(
store.getState().getTableMetadata({
database: "instances/i1/databases/db1",
diff --git a/frontend/src/stores/app/index.ts b/frontend/src/stores/app/index.ts
index e9e8fc3eb7..1ebe4eac44 100644
--- a/frontend/src/stores/app/index.ts
+++ b/frontend/src/stores/app/index.ts
@@ -92,7 +92,7 @@ registerPermissionCheckers({
});
// Back the subscription / environment reads in shared `@/utils` helpers with
-// this store, replacing the legacy Pinia stores those helpers used to read.
+// this store.
registerAppStoreUtilBridge({
currentUser: () => useAppStore.getState().currentUser,
isLoggedIn: () => useAppStore.getState().isLoggedIn(),
diff --git a/frontend/src/stores/app/instance.test.ts b/frontend/src/stores/app/instance.test.ts
index 07d3b243ad..99a9a603d5 100644
--- a/frontend/src/stores/app/instance.test.ts
+++ b/frontend/src/stores/app/instance.test.ts
@@ -6,7 +6,7 @@ import {
type ListInstancesRequest,
} from "@/types/proto-es/v1/instance_service_pb";
import { ProjectSchema } from "@/types/proto-es/v1/project_service_pb";
-import { createInstanceSlice } from "./instance";
+import { createInstanceSlice, getListInstanceFilter } from "./instance";
const mocks = vi.hoisted(() => ({
getInstance: vi.fn(),
@@ -188,3 +188,20 @@ describe("instance store project parent", () => {
});
});
});
+
+describe("getListInstanceFilter", () => {
+ const QUOTED = 'SELECT * FROM "users"';
+ const ESCAPED = 'SELECT * FROM \\"users\\"';
+
+ test("escapes a quote in the free-text query", () => {
+ const filter = getListInstanceFilter({ query: QUOTED }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+
+ test("escapes a quote in the host and port", () => {
+ expect(getListInstanceFilter({ host: 'h"1', port: 'p"2' })).toBe(
+ 'host.contains("h\\"1") && port.contains("p\\"2")'
+ );
+ });
+});
diff --git a/frontend/src/stores/app/issue.ts b/frontend/src/stores/app/issue.ts
index 52bec30066..e2c61f853d 100644
--- a/frontend/src/stores/app/issue.ts
+++ b/frontend/src/stores/app/issue.ts
@@ -31,8 +31,7 @@ import { celString, celStringList } from "@/utils/v1/celLiteral";
import type { AppSliceCreator, IssueSlice } from "./types";
// Resource names are `projects/{project}/issues/{issue}` — yank the project
-// resource out of the head without importing the heavy `@/utils/v1/project`
-// barrel (which pulls the Pinia actuator chain into the app-store graph).
+// resource out of the head.
function projectResourceFromIssueName(issueName: string): string {
const match = issueName.match(/^(projects\/[^/]+)\//);
return match?.[1] ?? "";
@@ -88,8 +87,7 @@ export interface CreateIssueByPlanOptions {
/**
* Creates a plan, then an issue referencing it, and (unless skipped) a rollout.
- * Relocated from the legacy Pinia `experimental-issue` module — a stateless
- * orchestration helper over the plan/issue/rollout services.
+ * A stateless orchestration helper over the plan/issue/rollout services.
*/
export const experimentalCreateIssueByPlan = async (
project: Project,
@@ -128,9 +126,8 @@ export const experimentalCreateIssueByPlan = async (
};
/**
- * Port of the legacy Pinia `useIssueV1Store`. Stateless fetches (no per-issue
- * cache — callers consume the result once) that also prime the owning
- * project(s) in the app store, matching the Pinia behavior so downstream code
+ * Stateless fetches (no per-issue cache — callers consume the result once)
+ * that also prime the owning project(s) in the app store so downstream code
* that reads a project synchronously after the call sees it cached.
*/
export const createIssueSlice: AppSliceCreator<IssueSlice> = (_set, get) => ({
diff --git a/frontend/src/stores/app/notification.ts b/frontend/src/stores/app/notification.ts
index b0ee3fce75..70924a2962 100644
--- a/frontend/src/stores/app/notification.ts
+++ b/frontend/src/stores/app/notification.ts
@@ -1,10 +1,10 @@
-import { pushReactNotification } from "@/lib/toast";
+import { pushNotification } from "@/lib/toast";
import type { AppSliceCreator, NotificationSlice } from "./types";
export const createNotificationSlice: AppSliceCreator<
NotificationSlice
> = () => ({
notify: (notification) => {
- pushReactNotification(notification);
+ pushNotification(notification);
},
});
diff --git a/frontend/src/stores/app/plan.test.ts b/frontend/src/stores/app/plan.test.ts
new file mode 100644
index 0000000000..bd8e039bff
--- /dev/null
+++ b/frontend/src/stores/app/plan.test.ts
@@ -0,0 +1,17 @@
+// @vitest-environment node
+import { describe, expect, test } from "vitest";
+import { buildPlanFilter } from "./plan";
+
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
+
+describe("buildPlanFilter", () => {
+ test("escapes a quote in the free-text query", () => {
+ const filter = buildPlanFilter({
+ project: "projects/p",
+ query: QUOTED,
+ }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+});
diff --git a/frontend/src/stores/app/policy.ts b/frontend/src/stores/app/policy.ts
index ef2c3889b3..68da0bb071 100644
--- a/frontend/src/stores/app/policy.ts
+++ b/frontend/src/stores/app/policy.ts
@@ -16,7 +16,6 @@ import {
} from "@/types/proto-es/v1/org_policy_service_pb";
import type { AppSliceCreator, PolicySlice } from "./types";
-// Mirror of the Pinia `getUpdateMaskFromPolicyType`.
const getUpdateMaskFromPolicyType = (policyType: PolicyType): string[] => {
switch (policyType) {
case PolicyType.ROLLOUT_POLICY:
@@ -37,8 +36,8 @@ const getUpdateMaskFromPolicyType = (policyType: PolicyType): string[] => {
// Inlined to keep the app store's load graph free of `@/stores/modules/v1/common`.
const POLICY_NAME_PREFIX = "policies/";
-// Mirror of the Pinia helper — normalizes `policies/{TYPE}` segments to
-// lowercase so the cache key matches what the server returns.
+// Normalizes `policies/{TYPE}` segments to lowercase so the cache key matches
+// what the server returns.
const replacePolicyTypeNameToLowerCase = (name: string): string => {
const pattern = /(^|\/)policies\/([^/]+)($|\/)/;
const replaced = name.replace(
@@ -50,13 +49,12 @@ const replacePolicyTypeNameToLowerCase = (name: string): string => {
};
// Stable empty singleton — subscribers compare by reference, so we MUST NOT
-// build a fresh object on every call (mirrors the Pinia behavior).
+// build a fresh object on every call.
const EMPTY_QUERY_DATA_POLICY: QueryDataPolicy = createProto(
QueryDataPolicySchema,
{ maximumResultRows: -1 }
);
-// Pure helper relocated from the legacy Pinia policy module.
export const getEmptyRolloutPolicy = (
parentPath: string,
resourceType: PolicyResourceType
@@ -79,10 +77,7 @@ const policyResourceName = (parent: string, policyType: PolicyType) =>
);
/**
- * Port of the SQL-editor-used subset of the legacy Pinia `usePolicyV1Store`:
* `policyMapByName` cache + sync/async getters keyed by resource name.
- * Failures on `getOrFetchPolicyByName` cache an empty Policy under the
- * requested name (matches Pinia's "don't re-hit a missing policy" behavior).
*/
export const createPolicySlice: AppSliceCreator<PolicySlice> = (set, get) => ({
policyMapByName: {},
@@ -119,7 +114,7 @@ export const createPolicySlice: AppSliceCreator<PolicySlice> = (set, get) => ({
set((state) => {
const { [key]: _, ...policyRequests } = state.policyRequests;
// Cache an empty policy on NotFound so repeated lookups don't
- // hammer the backend (parity with Pinia).
+ // hammer the backend.
if (error instanceof ConnectError && error.code === Code.NotFound) {
return {
policyMapByName: {
diff --git a/frontend/src/stores/app/preferences.ts b/frontend/src/stores/app/preferences.ts
index fe804a204a..14b84c49b6 100644
--- a/frontend/src/stores/app/preferences.ts
+++ b/frontend/src/stores/app/preferences.ts
@@ -76,9 +76,8 @@ export const createPreferencesSlice: AppSliceCreator<PreferencesSlice> = (
set((state) => ({ introStateVersion: state.introStateVersion + 1 }));
},
- // Mirrors the Pinia `useUIStateStore.getIntroStateByKey`. Reads the per-user
- // localStorage map scoped to the current workspace. React callers should use
- // `useIntroStateByKey` so writes can trigger a fresh read.
+ // Reads the per-user localStorage map scoped to the current workspace. React
+ // callers should use `useIntroStateByKey` so writes can trigger a fresh read.
getIntroStateByKey: (key) => {
const email = getCurrentUserEmail(get);
if (!email) return false;
@@ -89,8 +88,7 @@ export const createPreferencesSlice: AppSliceCreator<PreferencesSlice> = (
return map[key] ?? false;
},
- // Mirrors the Pinia `useUIStateStore.saveIntroStateByKey`: persists a
- // single intro flag to the per-user localStorage map.
+ // Persists a single intro flag to the per-user localStorage map.
saveIntroStateByKey: ({ key, newState }) => {
const email = getCurrentUserEmail(get);
if (!email) return;
diff --git a/frontend/src/stores/app/project.test.ts b/frontend/src/stores/app/project.test.ts
new file mode 100644
index 0000000000..9f96695821
--- /dev/null
+++ b/frontend/src/stores/app/project.test.ts
@@ -0,0 +1,14 @@
+// @vitest-environment node
+import { describe, expect, test } from "vitest";
+import { getListProjectFilter } from "./project";
+
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
+
+describe("getListProjectFilter", () => {
+ test("escapes a quote in the free-text query", () => {
+ const filter = getListProjectFilter({ query: QUOTED }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+});
diff --git a/frontend/src/stores/app/project.ts b/frontend/src/stores/app/project.ts
index e67191aee7..542ec63439 100644
--- a/frontend/src/stores/app/project.ts
+++ b/frontend/src/stores/app/project.ts
@@ -51,9 +51,7 @@ export const getListProjectFilter = (params: ProjectFilter): string => {
const UNKNOWN_PROJECT_NAME = `projects/${UNKNOWN_ID}`;
-// The default project's feature gates. Inlined here (rather than reusing
-// the `@/types/v1/project` helpers) so the app store's load graph stays
-// free of the Pinia actuator store those helpers pull in.
+// The default project's feature gates.
const PROJECT_DEFAULTS = {
state: State.ACTIVE,
enforceIssueTitle: true,
@@ -110,8 +108,7 @@ export const createProjectSlice: AppSliceCreator<ProjectSlice> = (set, get) => {
set({ projectsByName: {}, projectRequests: {}, projectErrorsByName: {} });
},
- // Mirrors the Pinia `useProjectV1Store().getProjectByName`: always
- // returns a non-null Project, synthesizing the default-project or
+ // Always returns a non-null Project, synthesizing the default-project or
// unknown-project placeholder when the name is not in the cache.
getProjectByName: (name) => {
if (name === UNKNOWN_PROJECT_NAME) return unknownProject;
@@ -309,7 +306,7 @@ export const createProjectSlice: AppSliceCreator<ProjectSlice> = (set, get) => {
let pageToken = params.pageToken;
let result: { projects: Project[]; nextPageToken: string };
// The API can return an empty page with a non-empty next token; keep
- // paging until we get rows or run out (mirrors the legacy Pinia store).
+ // paging until we get rows or run out.
while (true) {
const request = {
pageSize: params.pageSize,
diff --git a/frontend/src/stores/app/savedQuery.ts b/frontend/src/stores/app/savedQuery.ts
index 48c6ad518a..a4ffcbbd70 100644
--- a/frontend/src/stores/app/savedQuery.ts
+++ b/frontend/src/stores/app/savedQuery.ts
@@ -1,6 +1,5 @@
import { clone, create as createProto } from "@bufbuild/protobuf";
import { createContextValues } from "@connectrpc/connect";
-import { uniqBy } from "lodash-es";
import { savedQueryServiceClientConnect } from "@/api";
import { silentContextKey } from "@/api/context-key";
import { UNKNOWN_ID } from "@/types";
@@ -27,11 +26,9 @@ import type { AppSliceCreator, SavedQuerySlice, SavedQueryView } from "./types";
const cacheKey = (uid: string, view: SavedQueryView) => `${uid}:${view}`;
/**
- * Zustand port of the legacy Pinia `useWorkSheetStore`. Saved queries are
- * keyed by `${uid}:${view}` so FULL (with statement) and BASIC (list)
- * views coexist, matching the old cache. Related resources (project,
- * database, creator) are hydrated through the sibling app slices rather
- * than the old Pinia stores.
+ * Saved queries are keyed by `${uid}:${view}` so FULL (with statement) and
+ * BASIC (list) views coexist. Related resources (project, database, creator)
+ * are hydrated through the sibling app slices.
*/
export const createSavedQuerySlice: AppSliceCreator<SavedQuerySlice> = (
set,
@@ -269,14 +266,6 @@ export const createSavedQuerySlice: AppSliceCreator<SavedQuerySlice> = (
}
},
- // The deduped full list. Callers split into "my" / "shared" using
- // their own current-user source — the SQL editor uses the Pinia
- // current user (reliably loaded before saved queries are fetched),
- // whereas the app store's `currentUser` can lag on routes that don't
- // load it eagerly.
- savedQueryList: () =>
- uniqBy(Object.values(get().savedQueriesByKey), (w) => w.name),
-
getSavedQueryPolicy: async (name) =>
await savedQueryServiceClientConnect.getSavedQueryPolicy(
createProto(GetSavedQueryPolicyRequestSchema, { resource: name })
diff --git a/frontend/src/stores/app/serviceAccount.test.ts b/frontend/src/stores/app/serviceAccount.test.ts
new file mode 100644
index 0000000000..4339c0946f
--- /dev/null
+++ b/frontend/src/stores/app/serviceAccount.test.ts
@@ -0,0 +1,14 @@
+// @vitest-environment node
+import { describe, expect, test } from "vitest";
+import { buildAccountListFilter } from "./serviceAccount";
+
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
+
+describe("buildAccountListFilter", () => {
+ test("escapes a quote in the free-text query", () => {
+ const filter = buildAccountListFilter({ query: QUOTED }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+});
diff --git a/frontend/src/stores/app/sheet.ts b/frontend/src/stores/app/sheet.ts
index b2ca90ddfe..b824a45b42 100644
--- a/frontend/src/stores/app/sheet.ts
+++ b/frontend/src/stores/app/sheet.ts
@@ -101,11 +101,10 @@ export const createSheetSlice: AppSliceCreator<SheetSlice> = (set, get) => ({
return response;
},
- // Synchronous cache read (undefined on miss) — mirrors the Pinia
- // `getSheetByName`.
+ // Synchronous cache read (undefined on miss).
getSheetByName: (name) => get().sheetsByName[name],
// Cache-first fetch by name — `fetchSheet` already checks the cache and
- // guards invalid names, so this is a thin alias matching the Pinia API.
+ // guards invalid names, so this is a thin alias.
getOrFetchSheetByName: (name) => get().fetchSheet(name),
});
diff --git a/frontend/src/stores/app/sql.ts b/frontend/src/stores/app/sql.ts
index 17ed820350..96dd37f607 100644
--- a/frontend/src/stores/app/sql.ts
+++ b/frontend/src/stores/app/sql.ts
@@ -5,11 +5,10 @@ import { extractGrpcErrorMessage } from "@/utils/connect";
import type { AppSliceCreator, SQLSlice } from "./types";
/**
- * Port of the legacy Pinia `useSQLStore`. Stateless — just RPC wrappers
- * around `query` / `export` with the SQL editor's permission-denied + silent
- * context conventions. Failures are swallowed into the returned
- * `SQLResultSetV1.error` (mirrors the Pinia behavior so the result table
- * can render the error inline instead of bubbling a thrown exception).
+ * Stateless — just RPC wrappers around `query` / `export` with the SQL
+ * editor's permission-denied + silent context conventions. Query failures are
+ * swallowed into the returned `SQLResultSetV1.error` so the result table can
+ * render the error inline instead of bubbling a thrown exception.
*/
export const createSQLSlice: AppSliceCreator<SQLSlice> = () => ({
query: async (params, signal) => {
diff --git a/frontend/src/stores/app/types.ts b/frontend/src/stores/app/types.ts
index c73d76812c..b545f26bba 100644
--- a/frontend/src/stores/app/types.ts
+++ b/frontend/src/stores/app/types.ts
@@ -188,8 +188,7 @@ export type AuthSlice = {
authenticationInfoRequest?: Promise<AuthenticationInfo | undefined>;
currentUser?: User;
currentUserRequest?: Promise<User | undefined>;
- // Resource name `users/{email}` of the signed-in user. Mirrors the legacy
- // Pinia auth store's `currentUserName`; drives `isLoggedIn`.
+ // Resource name `users/{email}` of the signed-in user; drives `isLoggedIn`.
currentUserName?: string;
unauthenticatedOccurred: boolean;
authSessionKey: string;
@@ -231,16 +230,14 @@ export type WorkspaceSlice = {
workspaceProfileRequest?: Promise<WorkspaceProfileSetting | undefined>;
environmentList: Environment[];
environmentRequest?: Promise<Environment[]>;
- // General-purpose setting cache, mirrors the legacy Pinia
- // `useSettingV1Store` API. Keyed by the setting's resource name
+ // General-purpose setting cache keyed by the setting's resource name
// (`settings/{Setting_SettingName}`).
settingsByName: Record<string, Setting>;
settingRequests: Record<string, Promise<Setting | undefined>>;
appFeatures: AppFeatures;
subscription?: Subscription;
subscriptionRequest?: Promise<Subscription | undefined>;
- // Subscription purchase metadata (SaaS). Mirrors the legacy Pinia
- // `useSubscriptionV1Store` `purchasePlans` / `paymentInfo` refs.
+ // Subscription purchase metadata (SaaS).
purchasePlans: PurchasePlan[];
paymentInfo?: PaymentInfo;
loadServerInfo: () => Promise<ActuatorInfo | undefined>;
@@ -268,12 +265,10 @@ export type WorkspaceSlice = {
name: Setting_SettingName,
silent?: boolean
) => Promise<Setting | undefined>;
- // Bridge: lets the legacy Pinia `useSettingV1Store.upsertSetting` push
- // updates into the app store after a save, so still-app-store consumers
- // (e.g. SQL editor's `OpenAIButton`) see fresh values without a refresh.
+ // Puts a saved setting into the cache so consumers see fresh values without
+ // a refresh.
setSettingByName: (setting: Setting) => void;
- // Writes a setting to the server and updates the cache. Mirrors the legacy
- // Pinia `useSettingV1Store().upsertSetting`.
+ // Writes a setting to the server and updates the cache.
upsertSetting: (params: {
name: Setting_SettingName;
value: SettingValue;
@@ -317,8 +312,8 @@ export type WorkspaceSlice = {
activeVcsUserCount: () => number;
enableOnboarding: () => boolean;
workspaceSetupGuideEnabled: (allowMultipleMembers?: boolean) => boolean;
- // Always returns a profile (never undefined), mirroring the Pinia
- // `workspaceProfile` getter so consumers read fields without null checks.
+ // Always returns a profile (never undefined) so consumers read fields
+ // without null checks.
getWorkspaceProfile: () => WorkspaceProfileSetting;
// Data-classification config from the DATA_CLASSIFICATION setting cache.
classification: () => DataClassificationSetting_DataClassificationConfig[];
@@ -519,7 +514,7 @@ export type DatabaseListParams = {
pageSize: number;
pageToken?: string;
// Either a pre-built CEL filter string or a structured `DatabaseFilter`
- // (built via `buildDatabaseFilter`), matching the legacy Pinia store.
+ // (built via `buildDatabaseFilter`).
filter?: string | DatabaseFilter;
orderBy?: string;
silent?: boolean;
@@ -634,9 +629,8 @@ export type SheetSlice = {
export type SavedQueryView = "FULL" | "BASIC";
export type SavedQuerySlice = {
- // Keyed by `${uid}:${view}` (mirrors the legacy Pinia cache, which kept
- // FULL and BASIC views separately — BASIC list entries omit the
- // statement, FULL entries carry it).
+ // Keyed by `${uid}:${view}` so FULL and BASIC views are kept separately —
+ // BASIC list entries omit the statement, FULL entries carry it.
savedQueriesByKey: Record<string, SavedQuery>;
savedQueryRequests: Record<string, Promise<SavedQuery | undefined>>;
getSavedQueryByName: (
@@ -686,7 +680,6 @@ export type SavedQuerySlice = {
* names the rows it already holds.
*/
patchSavedQueryFolderInCache: (names: string[], folder: string) => void;
- savedQueryList: () => SavedQuery[];
/**
* The calling user's grant level per saved query, keyed by resource name.
* Nothing caller-relative rides on the SavedQuery resource, so this is
@@ -964,10 +957,9 @@ export type PreferencesSlice = {
saveIntroStateByKey: (params: { key: string; newState: boolean }) => void;
};
-// Org policy slice (mirrors the SQL-editor-used subset of the Pinia
-// `usePolicyV1Store`): keyed by the policy resource name. Async fetchers
-// dedupe via `policyRequests`. `getQueryDataPolicyByParent` returns a stable
-// empty fallback when the policy isn't cached.
+// Org policy slice: keyed by the policy resource name. Async fetchers dedupe
+// via `policyRequests`. `getQueryDataPolicyByParent` returns a stable empty
+// fallback when the policy isn't cached.
export type PolicySlice = {
policyMapByName: Record<string, Policy>;
policyRequests: Record<string, Promise<Policy | undefined>>;
@@ -993,10 +985,10 @@ export type PolicySlice = {
deletePolicy: (name: string) => Promise<void>;
};
-// Stateless issue service slice (mirrors the legacy Pinia `useIssueV1Store`):
-// thin wrapper around `issueServiceClientConnect.getIssue`. Returns the
-// fresh issue (no cache) and pre-fetches the owning project into the app
-// store so downstream code can read it synchronously.
+// Stateless issue service slice: thin wrapper around
+// `issueServiceClientConnect.getIssue`. Returns the fresh issue (no cache) and
+// pre-fetches the owning project into the app store so downstream code can
+// read it synchronously.
export type ListIssueParams = {
find: IssueFilter;
pageSize?: number;
@@ -1010,9 +1002,9 @@ export type IssueSlice = {
) => Promise<{ nextPageToken: string; issues: Issue[] }>;
};
-// Stateless SQL service slice (mirrors the legacy Pinia `useSQLStore`):
-// thin wrappers around `sqlServiceClientConnect.query` / `.export` with the
-// SQL editor's permission-denied / silent context conventions.
+// Stateless SQL service slice: thin wrappers around
+// `sqlServiceClientConnect.query` / `.export` with the SQL editor's
+// permission-denied / silent context conventions.
export type SQLSlice = {
query: (params: QueryRequest, signal: AbortSignal) => Promise<SQLResultSetV1>;
exportData: (params: ExportRequest) => Promise<Uint8Array>;
@@ -1029,27 +1021,24 @@ export interface GetOrFetchDatabaseMetadataParams {
}
export type DBSchemaSlice = {
- // Cache key: `${metadataResourceName}::${filter}::${limit}` — mirrors the
- // Pinia store's `[name, filter, limit]` triple so filtered/sliced fetches
- // don't collide with full-metadata fetches.
+ // Cache key: `${metadataResourceName}::${filter}::${limit}`, so
+ // filtered/sliced fetches don't collide with full-metadata fetches.
metadataByName: Record<string, DatabaseMetadata>;
metadataRequests: Record<string, Promise<DatabaseMetadata>>;
getDatabaseMetadata: (database: string) => DatabaseMetadata;
// Returns the cached metadata reference (or undefined when uncached)
- // without the fresh-placeholder fallback `getDatabaseMetadata` adds.
- // Mirrors the legacy Pinia `getDatabaseMetadataWithoutDefault` — used by
- // consumers (e.g. SchemaPane) that need to distinguish "not loaded
- // yet" from "loaded but empty".
+ // without the fresh-placeholder fallback `getDatabaseMetadata` adds. Used by
+ // consumers (e.g. SchemaPane) that need to distinguish "not loaded yet" from
+ // "loaded but empty".
getCachedDatabaseMetadata: (database: string) => DatabaseMetadata | undefined;
getSchemaList: (database: string) => SchemaMetadata[];
getSchemaMetadata: (params: {
database: string;
schema: string;
}) => SchemaMetadata | undefined;
- // List getters mirror the legacy Pinia store API. Each composes from
- // the cached `DatabaseMetadata` and falls back to an empty array if
- // metadata isn't loaded yet (matching the legacy contract).
+ // List getters compose from the cached `DatabaseMetadata` and fall back to
+ // an empty array if metadata isn't loaded yet.
getTableList: (params: {
database: string;
schema?: string;
@@ -1069,7 +1058,7 @@ export type DBSchemaSlice = {
getExtensionList: (database: string) => ExtensionMetadata[];
// Invalidates all cache entries (across filter/limit variants) for a
// database. Used by list pages that want a fresh metadata fetch on
- // next access (mirrors Pinia `removeCache`).
+ // next access.
removeDatabaseMetadataCache: (database: string) => void;
getTableMetadata: (params: {
database: string;
diff --git a/frontend/src/stores/app/user.test.ts b/frontend/src/stores/app/user.test.ts
new file mode 100644
index 0000000000..293f3b1523
--- /dev/null
+++ b/frontend/src/stores/app/user.test.ts
@@ -0,0 +1,14 @@
+// @vitest-environment node
+import { describe, expect, test } from "vitest";
+import { buildUserFilter } from "./user";
+
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
+
+describe("buildUserFilter", () => {
+ test("escapes a quote in the free-text query", () => {
+ const filter = buildUserFilter({ query: QUOTED }).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+});
diff --git a/frontend/src/stores/app/utils.test.ts b/frontend/src/stores/app/utils.test.ts
index ae7c724b92..5aea761079 100644
--- a/frontend/src/stores/app/utils.test.ts
+++ b/frontend/src/stores/app/utils.test.ts
@@ -6,7 +6,15 @@ import {
IamPolicySchema,
} from "@/types/proto-es/v1/iam_policy_pb";
import { UserSchema } from "@/types/proto-es/v1/user_service_pb";
-import { buildDatabaseFilter, projectWideBindings } from "./utils";
+import {
+ buildDatabaseFilter,
+ buildProjectFilter,
+ getLabelFilter,
+ projectWideBindings,
+} from "./utils";
+
+const QUOTED = 'SELECT * FROM "users"';
+const ESCAPED = 'SELECT * FROM \\"users\\"';
describe("buildDatabaseFilter", () => {
test("escapes the database name query as a CEL string literal", () => {
@@ -14,6 +22,36 @@ describe("buildDatabaseFilter", () => {
'name.contains("payroll \\"q3\\"\\\\west\\narchive")'
);
});
+
+ test("escapes a quote in the table filter", () => {
+ expect(buildDatabaseFilter({ table: 't"1' })).toBe(
+ 'table.contains("t\\"1")'
+ );
+ });
+});
+
+describe("buildProjectFilter", () => {
+ test("escapes a quote in the free-text query", () => {
+ const filter = buildProjectFilter(QUOTED).toLowerCase();
+ expect(filter).not.toContain(QUOTED.toLowerCase());
+ expect(filter).toContain(ESCAPED.toLowerCase());
+ });
+});
+
+describe("getLabelFilter", () => {
+ // Label keys allow dashes. `labels.cost-center` parses as subtraction, so
+ // the backend never saw the key and rejected the whole filter.
+ test("uses index syntax so a dashed key survives CEL parsing", () => {
+ expect(getLabelFilter(["cost-center:eng"])).toEqual([
+ 'labels["cost-center"] == "eng"',
+ ]);
+ });
+
+ test("uses index syntax for multi-value keys", () => {
+ expect(getLabelFilter(["cost-center:eng,ops"])).toEqual([
+ 'labels["cost-center"] in ["eng", "ops"]',
+ ]);
+ });
});
describe("projectWideBindings", () => {
diff --git a/frontend/src/stores/app/utils.ts b/frontend/src/stores/app/utils.ts
index 74923d356e..632a96dce0 100644
--- a/frontend/src/stores/app/utils.ts
+++ b/frontend/src/stores/app/utils.ts
@@ -117,8 +117,7 @@ export function getLabelFilter(labels: string[]): string[] {
}
// Builds the CEL filter string for `listDatabases` from a structured
-// `DatabaseFilter`. Mirrors the legacy Pinia `getListDatabaseFilter` so the
-// app store lists databases identically to the old store.
+// `DatabaseFilter`.
export function buildDatabaseFilter(filter: DatabaseFilter): string {
const params: string[] = [];
if (isValidProjectName(filter.project)) {
diff --git a/frontend/src/stores/app/workspace.ts b/frontend/src/stores/app/workspace.ts
index 639356a80a..34cad61a45 100644
--- a/frontend/src/stores/app/workspace.ts
+++ b/frontend/src/stores/app/workspace.ts
@@ -86,7 +86,7 @@ const trialingDays = 14;
// Stable empty profile so `getWorkspaceProfile()` can return a non-null value
// without allocating a fresh object each call (which would break Zustand's
-// selector identity check). Mirrors the Pinia getter's default.
+// selector identity check).
const EMPTY_WORKSPACE_PROFILE = createProto(WorkspaceProfileSettingSchema, {});
function appFeaturesFromDatabaseChangeMode(mode: DatabaseChangeMode) {
@@ -145,11 +145,9 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (
set,
get
) => {
- // Listen on the shared cross-tab channel (see store/workspaceSwitchChannel.ts).
- // Using `addEventListener` rather than `onmessage = ...` allows the Vue-side
- // store to register its own handler on the same object, and source-object
- // exclusion correctly suppresses both handlers when a post originates from
- // this tab (e.g. the OAuth2 consent page's in-place switch).
+ // Listen on the shared cross-tab channel (`@/stores/workspaceSwitchChannel`).
+ // Source-object exclusion suppresses this handler when a post originates
+ // from this tab (e.g. the OAuth2 consent page's in-place switch).
if (!workspaceSwitchListenerRegistered) {
workspaceSwitchListenerRegistered = true;
workspaceSwitchChannel.addEventListener("message", (event) => {
@@ -174,7 +172,7 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (
};
// Persist the ENVIRONMENT setting and re-derive the cached environment list
- // from the server's response (mirrors the legacy Pinia env store).
+ // from the server's response.
const writeEnvironmentSetting = async (
environments: EnvironmentSetting_Environment[]
): Promise<Environment[]> => {
@@ -385,8 +383,7 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (
refreshEnvironmentList: async () => get().loadEnvironmentList(true),
- // Mirrors the Pinia `useEnvironmentV1Store().getEnvironmentByName`: maps
- // a resource name to its environment, falling back to a synthesized
+ // Maps a resource name to its environment, falling back to a synthesized
// entry (id-as-title) for unknown names when `fallback` is set.
getEnvironmentByName: (name, fallback = true) => {
if (name === NULL_ENVIRONMENT_NAME) {
@@ -404,9 +401,8 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (
return environment;
},
- // Mirrors the Pinia `useSettingV1Store`: general-purpose setting cache
- // keyed by resource name (`settings/{Setting_SettingName}`). Used for AI /
- // workspace-profile / etc.
+ // General-purpose setting cache keyed by resource name
+ // (`settings/{Setting_SettingName}`). Used for AI, workspace profile, etc.
getSettingByName: (name) => {
const resourceName = `${settingNamePrefix}${Setting_SettingName[name]}`;
return get().settingsByName[resourceName];
@@ -718,9 +714,8 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (
return info;
},
- // Always returns a profile (never undefined), mirroring the Pinia
- // `useSettingV1Store().workspaceProfile` getter, so consumers can read
- // fields without null checks. Reactive via Zustand's selector re-run.
+ // Always returns a profile (never undefined) so consumers can read fields
+ // without null checks. Reactive via Zustand's selector re-run.
getWorkspaceProfile: () =>
get().workspaceProfile ?? EMPTY_WORKSPACE_PROFILE,
@@ -761,7 +756,7 @@ export const createWorkspaceSlice: AppSliceCreator<WorkspaceSlice> = (
profile.databaseChangeMode
),
});
- // Refresh the latest server info (mirrors the Pinia store).
+ // Refresh the latest server info.
await get().fetchServerInfo();
},
diff --git a/frontend/src/stores/modules/index.ts b/frontend/src/stores/modules/index.ts
index 008d927d6c..b70afcd285 100644
--- a/frontend/src/stores/modules/index.ts
+++ b/frontend/src/stores/modules/index.ts
@@ -1,5 +1,3 @@
-// Pinia stores removed (migrated to the React app store at
-// `@/stores/app`). Only pinia-free helpers remain here.
export * from "./notification";
export * from "./utils";
export * from "./migration-helpers";
diff --git a/frontend/src/stores/modules/migration-helpers.ts b/frontend/src/stores/modules/migration-helpers.ts
index d87d61769c..dc464a796e 100644
--- a/frontend/src/stores/modules/migration-helpers.ts
+++ b/frontend/src/stores/modules/migration-helpers.ts
@@ -3,11 +3,8 @@ import type { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import type { User } from "@/types/proto-es/v1/user_service_pb";
import { appStoreUtilBridge } from "@/utils/app-store-bridge";
-// Pinia-free replacements for helpers that used to live in the deleted legacy
-// Pinia stores (`v1/auth`, `v1/subscription`). They read the React app store
-// (the single source of truth) via the util bridge — the old Pinia stores were
-// never populated in the React shell, so the previous implementations silently
-// returned unknownUser() / no features.
+// Non-hook helpers that read the app store (the single source of truth) via
+// the util bridge.
export const getCurrentUserV1 = (): User => {
return appStoreUtilBridge()?.currentUser() ?? unknownUser();
diff --git a/frontend/src/stores/modules/notification.ts b/frontend/src/stores/modules/notification.ts
index db613886c6..ed18c5afc4 100644
--- a/frontend/src/stores/modules/notification.ts
+++ b/frontend/src/stores/modules/notification.ts
@@ -1,6 +1 @@
-import { pushReactNotification } from "@/lib/toast";
-import type { NotificationCreate } from "@/types";
-
-export const pushNotification = (notification: NotificationCreate) => {
- pushReactNotification(notification);
-};
+export { pushNotification } from "@/lib/toast";
diff --git a/frontend/src/stores/modules/v1/index.ts b/frontend/src/stores/modules/v1/index.ts
index 3924ec39e8..6b57160892 100644
--- a/frontend/src/stores/modules/v1/index.ts
+++ b/frontend/src/stores/modules/v1/index.ts
@@ -1,4 +1 @@
-// The legacy Pinia v1 stores have been removed (migrated to the React app
-// store at `@/stores/app`). Only the pinia-free resource-name / helper
-// module remains.
export * from "./common";
diff --git a/frontend/src/stores/sqlReview.ts b/frontend/src/stores/sqlReview.ts
index 3c82dbf98f..d6cfa2ad6f 100644
--- a/frontend/src/stores/sqlReview.ts
+++ b/frontend/src/stores/sqlReview.ts
@@ -101,10 +101,7 @@ export type SQLReviewState = {
) => Promise<SQLReviewPolicy | undefined>;
};
-// Standalone Zustand port of the legacy Pinia `useSQLReviewStore`. Tag-policy
-// reads/writes go through the app store's policy slice (no Pinia dependency).
-// The Vue composables (useSQLReviewPolicyList etc.) had no consumers and are
-// dropped.
+// Tag-policy reads/writes go through the app store's policy slice.
export const useSQLReviewStore = create<SQLReviewState>()((set, get) => ({
reviewPolicyList: [],
diff --git a/frontend/src/stores/workspaceApprovalSetting.ts b/frontend/src/stores/workspaceApprovalSetting.ts
index 831f1d8318..19c17fcfd8 100644
--- a/frontend/src/stores/workspaceApprovalSetting.ts
+++ b/frontend/src/stores/workspaceApprovalSetting.ts
@@ -17,11 +17,9 @@ import {
resolveLocalApprovalConfig,
} from "@/utils";
-// Standalone Zustand port of the legacy Pinia `useWorkspaceApprovalSettingStore`.
-// Keeps the same surface (a reactive `config` + rule mutators) so consumers
-// only swap the import path. Reads/writes the WORKSPACE_APPROVAL setting through
-// the app store (fetch) and the setting service (upsert), then syncs the app
-// store cache — no Pinia dependency.
+// Workspace approval `config` + rule mutators. Reads/writes the
+// WORKSPACE_APPROVAL setting through the app store (fetch) and the setting
+// service (upsert), then syncs the app store cache.
export type WorkspaceApprovalSettingState = {
config: LocalApprovalConfig;
fetchConfig: () => Promise<void>;
@@ -56,7 +54,7 @@ export const useWorkspaceApprovalSettingStore =
allowMissing: true,
})
);
- // Keep the app-store setting cache in sync (mirrors the Pinia bridge).
+ // Keep the app-store setting cache in sync.
useAppStore.getState().setSettingByName(response);
};
diff --git a/frontend/src/stores/workspaceSwitchChannel.ts b/frontend/src/stores/workspaceSwitchChannel.ts
index a538ae319b..0b611498f3 100644
--- a/frontend/src/stores/workspaceSwitchChannel.ts
+++ b/frontend/src/stores/workspaceSwitchChannel.ts
@@ -1,14 +1,12 @@
-// Single BroadcastChannel instance shared by both the Vue and React workspace
-// stores for cross-tab "workspace switched" notifications.
+// Single BroadcastChannel instance for cross-tab "workspace switched"
+// notifications.
//
-// Centralizing this matters for BroadcastChannel's source-object exclusion
+// Sharing one instance matters for BroadcastChannel's source-object exclusion
// rule: a message posted via `channel.postMessage(...)` is NOT delivered to
// listeners attached to that same channel object — but IS delivered to any
-// other channel objects with the same name (even in the same tab). Before
-// this module existed, the Vue store and the React store each created their
-// own channel object, so a switch posted from one store reached the other's
-// listener in the same tab and could navigate the consent flow out from
-// underneath itself.
+// other channel objects with the same name (even in the same tab). A second
+// channel object in this tab would receive the tab's own switch and could
+// navigate the consent flow out from underneath itself.
//
// With a single shared instance, all in-tab listeners attached to it are
// correctly excluded when the consent page or any other caller broadcasts.
diff --git a/frontend/src/types/iam/permission-generated.ts b/frontend/src/types/iam/permission-generated.ts
index a1cc6e9fc2..8c51a9b79d 100644
--- a/frontend/src/types/iam/permission-generated.ts
+++ b/frontend/src/types/iam/permission-generated.ts
@@ -1,5 +1,5 @@
// This file is auto-generated from permission.yaml. DO NOT EDIT manually.
-// Run 'pnpm run generate:permissions' or 'sh scripts/copy_config_files.sh' to regenerate.
+// Run 'sh scripts/copy-config-files.sh' to regenerate.
export type Permission =
| "bb.accessGrants.activate"
diff --git a/frontend/src/types/sqlReview.test.ts b/frontend/src/types/sqlReview.test.ts
index 8417924267..4ad90acf7f 100644
--- a/frontend/src/types/sqlReview.test.ts
+++ b/frontend/src/types/sqlReview.test.ts
@@ -1,6 +1,7 @@
// @vitest-environment node
import { create } from "@bufbuild/protobuf";
import { describe, expect, test } from "vitest";
+import sqlReviewMessages from "@/locales/sql-review/en-US.json";
import { Engine } from "@/types/proto-es/v1/common_pb";
import {
SQLReviewRule_Level,
@@ -15,11 +16,15 @@ import sqlReviewSchema from "./sql-review-schema.yaml";
import {
convertPolicyRuleToRuleTemplate,
convertRuleMapToPolicyRuleList,
+ getRuleLocalizationKey,
type RuleTemplateV2,
+ ruleTypeToString,
TEMPLATE_LIST_V2,
validateRuleMapByEngine,
} from "./sqlReview";
+type LocaleMessages = { [key: string]: string | LocaleMessages };
+
// Type for template rule data loaded from YAML
interface TemplateRule {
type: string;
@@ -472,4 +477,37 @@ describe("TEMPLATE_LIST_V2", () => {
expect(template).toBeTruthy();
expect(template?.ruleList).toHaveLength(0);
});
+
+ // Rule messages are looked up by computed keys, which check-i18n.mjs cannot
+ // trace; locale parity with en-US is enforced there.
+ test("localizes every template and rule", () => {
+ const section = (name: string) =>
+ (sqlReviewMessages as LocaleMessages)[name] as LocaleMessages;
+ for (const template of TEMPLATE_LIST_V2) {
+ const key = template.id.split(".").join("-");
+ expect(section("template")).toHaveProperty([key]);
+ expect(section("template")).toHaveProperty([`${key}-desc`]);
+ for (const rule of template.ruleList) {
+ const type = ruleTypeToString(rule.type);
+ const ruleMessages = section("rule")[getRuleLocalizationKey(type)];
+ expect(ruleMessages, type).toHaveProperty("title");
+ expect(ruleMessages, type).toHaveProperty("description");
+ for (const component of rule.componentList) {
+ expect(ruleMessages, type).toHaveProperty([
+ "component",
+ component.key,
+ ]);
+ }
+ expect(section("category"), type).toHaveProperty([
+ rule.category.toLowerCase(),
+ ]);
+ expect(section("level"), type).toHaveProperty([
+ SQLReviewRule_Level[rule.level].toLowerCase(),
+ ]);
+ expect(section("engine"), type).toHaveProperty([
+ Engine[rule.engine].toLowerCase(),
+ ]);
+ }
+ }
+ });
});
diff --git a/frontend/src/types/v2-shared.ts b/frontend/src/types/v2-shared.ts
index eb3dcd6150..75b1c014a0 100644
--- a/frontend/src/types/v2-shared.ts
+++ b/frontend/src/types/v2-shared.ts
@@ -2,9 +2,6 @@ export type ResourceSelectOption<T> = {
resource?: T;
value: string;
label: string;
- // Allow arbitrary extra fields the Vue-side select components may set;
- // React consumers only read value/label/resource.
- [key: string]: unknown;
};
export type SelectSize = "tiny" | "small" | "medium" | "large";
diff --git a/frontend/src/utils/iam/permission.ts b/frontend/src/utils/iam/permission.ts
index 3a1bd639ef..d15cbe66f1 100644
--- a/frontend/src/utils/iam/permission.ts
+++ b/frontend/src/utils/iam/permission.ts
@@ -1,9 +1,8 @@
import type { Permission } from "@/types";
import type { Project } from "@/types/proto-es/v1/project_service_pb";
-// Permission checks resolve against the React app store (the single source of
-// truth for the current user, workspace IAM policy, and roles). The legacy
-// Pinia `usePermissionStore` is no longer populated and must not be used.
+// Permission checks resolve against the app store (the single source of truth
+// for the current user, workspace IAM policy, and roles).
//
// The app store *registers* its checkers here at init rather than this module
// importing the store directly: `@/utils` sits in the early barrel-import
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index 4359b78595..388960dca4 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -2,7 +2,6 @@ export * from "./css";
export * from "./collections";
export * from "./role";
export * from "./slug";
-export * from "./types";
export * from "./util";
export * from "./featureGates";
export * from "./datetime";
diff --git a/frontend/src/utils/migrate-user-storage.test.ts b/frontend/src/utils/migrate-user-storage.test.ts
deleted file mode 100644
index a8c5b0f8d0..0000000000
--- a/frontend/src/utils/migrate-user-storage.test.ts
+++ /dev/null
@@ -1,226 +0,0 @@
-// @vitest-environment node
-import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
-import { migrateUserStorage } from "./storage-migrate";
-
-function createMockStorage(): Storage {
- let store: Record<string, string> = {};
- return {
- get length() {
- return Object.keys(store).length;
- },
- key(index: number) {
- return Object.keys(store)[index] ?? null;
- },
- getItem(key: string) {
- return store[key] ?? null;
- },
- setItem(key: string, value: string) {
- store[key] = String(value);
- },
- removeItem(key: string) {
- delete store[key];
- },
- clear() {
- store = {};
- },
- };
-}
-
-let mockStorage: Storage;
-
-beforeEach(() => {
- mockStorage = createMockStorage();
- vi.stubGlobal("localStorage", mockStorage);
-});
-
-afterEach(() => {
- vi.unstubAllGlobals();
-});
-
-describe("migrateUserStorage", () => {
- test("migrates keys ending with old email to new email", () => {
- localStorage.setItem("[email protected]", '{"visits":[]}');
- localStorage.setItem("[email protected]", '["link1"]');
-
- migrateUserStorage("[email protected]", "[email protected]");
-
- expect(localStorage.getItem("[email protected]")).toBe(
- '{"visits":[]}'
- );
- expect(localStorage.getItem("[email protected]")).toBe(
- '["link1"]'
- );
- expect(localStorage.getItem("[email protected]")).toBeNull();
- expect(localStorage.getItem("[email protected]")).toBeNull();
- });
-
- test("migrates keys with variable middle segments", () => {
- localStorage.setItem(
- "bb.sql-editor.tabs.projects/[email protected]",
- '[{"id":"tab1"}]'
- );
- localStorage.setItem(
- "bb.sql-editor.conn-expanded.environments/[email protected]",
- '{"expanded":true}'
- );
-
- migrateUserStorage("[email protected]", "[email protected]");
-
- expect(
- localStorage.getItem(
- "bb.sql-editor.tabs.projects/[email protected]"
- )
- ).toBe('[{"id":"tab1"}]');
- expect(
- localStorage.getItem(
- "bb.sql-editor.conn-expanded.environments/[email protected]"
- )
- ).toBe('{"expanded":true}');
- });
-
- test("does not migrate keys not ending with old email", () => {
- localStorage.setItem("bb.language", '"en-US"');
- localStorage.setItem("bb.onboarding", '{"step":1}');
- localStorage.setItem("[email protected]", '{"x":1}');
-
- migrateUserStorage("[email protected]", "[email protected]");
-
- expect(localStorage.getItem("bb.language")).toBe('"en-US"');
- expect(localStorage.getItem("bb.onboarding")).toBe('{"step":1}');
- expect(localStorage.getItem("[email protected]")).toBe(
- '{"x":1}'
- );
- });
-
- test("overwrites existing keys at new location", () => {
- localStorage.setItem("[email protected]", '{"old":true}');
- localStorage.setItem("[email protected]", '{"new":true}');
-
- migrateUserStorage("[email protected]", "[email protected]");
-
- expect(localStorage.getItem("[email protected]")).toBe(
- '{"old":true}'
- );
- });
-
- test("returns early when oldEmail is empty", () => {
- localStorage.setItem("[email protected]", '{"x":1}');
-
- migrateUserStorage("", "[email protected]");
-
- expect(localStorage.getItem("[email protected]")).toBe(
- '{"x":1}'
- );
- });
-
- test("returns early when newEmail is empty", () => {
- localStorage.setItem("[email protected]", '{"x":1}');
-
- migrateUserStorage("[email protected]", "");
-
- expect(localStorage.getItem("[email protected]")).toBe(
- '{"x":1}'
- );
- });
-
- test("returns early when emails are the same", () => {
- localStorage.setItem("[email protected]", '{"x":1}');
-
- migrateUserStorage("[email protected]", "[email protected]");
-
- expect(localStorage.getItem("[email protected]")).toBe(
- '{"x":1}'
- );
- });
-
- test("handles empty localStorage gracefully", () => {
- migrateUserStorage("[email protected]", "[email protected]");
-
- expect(localStorage.length).toBe(0);
- });
-
- test("migrates all 17 key families", () => {
- const email = "[email protected]";
- const newEmail = "[email protected]";
-
- // Set up all key families
- localStorage.setItem(`bb.recent-visit.${email}`, "1");
- localStorage.setItem(`bb.recent-projects.${email}`, "2");
- localStorage.setItem(`bb.quick-access.${email}`, "3");
- localStorage.setItem(`bb.last-activity.${email}`, "4");
- localStorage.setItem(`bb.collapse-state.${email}`, "5");
- localStorage.setItem(`bb.intro-state.${email}`, "6");
- localStorage.setItem(`bb.iam-remind.${email}`, "7");
- localStorage.setItem(`bb.reset-password.${email}`, "8");
- localStorage.setItem(`bb.search./dashboard.${email}`, "9");
- localStorage.setItem(`bb.sql-editor.tabs.projects/p1.${email}`, "10");
- localStorage.setItem(
- `bb.sql-editor.current-tab.projects/p1.${email}`,
- "11"
- );
- localStorage.setItem(`bb.sql-editor.conn-expanded.env/prod.${email}`, "12");
- localStorage.setItem(`bb.sql-editor.conn-expanded-keys.${email}`, "13");
- localStorage.setItem(
- `bb.sql-editor.saved-query-filter.projects/p1.${email}`,
- "14"
- );
- localStorage.setItem(
- `bb.sql-editor.saved-query-tree.projects/p1.${email}`,
- "15"
- );
- localStorage.setItem(
- `bb.sql-editor.saved-query-folder.projects/p1.list.${email}`,
- "16"
- );
- localStorage.setItem(`bb.sql-editor.ai-suggestion.${email}`, "17");
-
- migrateUserStorage(email, newEmail);
-
- // Verify all migrated
- expect(localStorage.getItem(`bb.recent-visit.${newEmail}`)).toBe("1");
- expect(localStorage.getItem(`bb.recent-projects.${newEmail}`)).toBe("2");
- expect(localStorage.getItem(`bb.quick-access.${newEmail}`)).toBe("3");
- expect(localStorage.getItem(`bb.last-activity.${newEmail}`)).toBe("4");
- expect(localStorage.getItem(`bb.collapse-state.${newEmail}`)).toBe("5");
- expect(localStorage.getItem(`bb.intro-state.${newEmail}`)).toBe("6");
- expect(localStorage.getItem(`bb.iam-remind.${newEmail}`)).toBe("7");
- expect(localStorage.getItem(`bb.reset-password.${newEmail}`)).toBe("8");
- expect(localStorage.getItem(`bb.search./dashboard.${newEmail}`)).toBe("9");
- expect(
- localStorage.getItem(`bb.sql-editor.tabs.projects/p1.${newEmail}`)
- ).toBe("10");
- expect(
- localStorage.getItem(`bb.sql-editor.current-tab.projects/p1.${newEmail}`)
- ).toBe("11");
- expect(
- localStorage.getItem(`bb.sql-editor.conn-expanded.env/prod.${newEmail}`)
- ).toBe("12");
- expect(
- localStorage.getItem(`bb.sql-editor.conn-expanded-keys.${newEmail}`)
- ).toBe("13");
- expect(
- localStorage.getItem(
- `bb.sql-editor.saved-query-filter.projects/p1.${newEmail}`
- )
- ).toBe("14");
- expect(
- localStorage.getItem(
- `bb.sql-editor.saved-query-tree.projects/p1.${newEmail}`
- )
- ).toBe("15");
- expect(
- localStorage.getItem(
- `bb.sql-editor.saved-query-folder.projects/p1.list.${newEmail}`
- )
- ).toBe("16");
- expect(
- localStorage.getItem(`bb.sql-editor.ai-suggestion.${newEmail}`)
- ).toBe("17");
-
- // Verify old keys removed
- expect(localStorage.getItem(`bb.recent-visit.${email}`)).toBeNull();
- expect(
- localStorage.getItem(`bb.sql-editor.tabs.projects/p1.${email}`)
- ).toBeNull();
- });
-});
diff --git a/frontend/src/utils/storage-migrate.test.ts b/frontend/src/utils/storage-migrate.test.ts
index 60571bc750..1974f9327f 100644
--- a/frontend/src/utils/storage-migrate.test.ts
+++ b/frontend/src/utils/storage-migrate.test.ts
@@ -11,7 +11,7 @@ import {
STORAGE_KEY_SQL_EDITOR_RESULT_LIMIT,
storageKeySqlEditorLastProject,
} from "./storage-keys";
-import { migrateStorageKeys } from "./storage-migrate";
+import { migrateStorageKeys, migrateUserStorage } from "./storage-migrate";
const MIGRATION_MARKER = "bb.storage-migration-v1";
@@ -716,3 +716,191 @@ describe("v2: worksheet → saved query rename", () => {
).toBe("old");
});
});
+
+describe("migrateUserStorage", () => {
+ test("migrates keys ending with old email to new email", () => {
+ localStorage.setItem("[email protected]", '{"visits":[]}');
+ localStorage.setItem("[email protected]", '["link1"]');
+
+ migrateUserStorage("[email protected]", "[email protected]");
+
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '{"visits":[]}'
+ );
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '["link1"]'
+ );
+ expect(localStorage.getItem("[email protected]")).toBeNull();
+ expect(localStorage.getItem("[email protected]")).toBeNull();
+ });
+
+ test("migrates keys with variable middle segments", () => {
+ localStorage.setItem(
+ "bb.sql-editor.tabs.projects/[email protected]",
+ '[{"id":"tab1"}]'
+ );
+ localStorage.setItem(
+ "bb.sql-editor.conn-expanded.environments/[email protected]",
+ '{"expanded":true}'
+ );
+
+ migrateUserStorage("[email protected]", "[email protected]");
+
+ expect(
+ localStorage.getItem(
+ "bb.sql-editor.tabs.projects/[email protected]"
+ )
+ ).toBe('[{"id":"tab1"}]');
+ expect(
+ localStorage.getItem(
+ "bb.sql-editor.conn-expanded.environments/[email protected]"
+ )
+ ).toBe('{"expanded":true}');
+ });
+
+ test("does not migrate keys not ending with old email", () => {
+ localStorage.setItem("bb.language", '"en-US"');
+ localStorage.setItem("bb.onboarding", '{"step":1}');
+ localStorage.setItem("[email protected]", '{"x":1}');
+
+ migrateUserStorage("[email protected]", "[email protected]");
+
+ expect(localStorage.getItem("bb.language")).toBe('"en-US"');
+ expect(localStorage.getItem("bb.onboarding")).toBe('{"step":1}');
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '{"x":1}'
+ );
+ });
+
+ test("overwrites existing keys at new location", () => {
+ localStorage.setItem("[email protected]", '{"old":true}');
+ localStorage.setItem("[email protected]", '{"new":true}');
+
+ migrateUserStorage("[email protected]", "[email protected]");
+
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '{"old":true}'
+ );
+ });
+
+ test("returns early when oldEmail is empty", () => {
+ localStorage.setItem("[email protected]", '{"x":1}');
+
+ migrateUserStorage("", "[email protected]");
+
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '{"x":1}'
+ );
+ });
+
+ test("returns early when newEmail is empty", () => {
+ localStorage.setItem("[email protected]", '{"x":1}');
+
+ migrateUserStorage("[email protected]", "");
+
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '{"x":1}'
+ );
+ });
+
+ test("returns early when emails are the same", () => {
+ localStorage.setItem("[email protected]", '{"x":1}');
+
+ migrateUserStorage("[email protected]", "[email protected]");
+
+ expect(localStorage.getItem("[email protected]")).toBe(
+ '{"x":1}'
+ );
+ });
+
+ test("handles empty localStorage gracefully", () => {
+ migrateUserStorage("[email protected]", "[email protected]");
+
+ expect(localStorage.length).toBe(0);
+ });
+
+ test("migrates all 17 key families", () => {
+ const email = "[email protected]";
+ const newEmail = "[email protected]";
+
+ // Set up all key families
+ localStorage.setItem(`bb.recent-visit.${email}`, "1");
+ localStorage.setItem(`bb.recent-projects.${email}`, "2");
+ localStorage.setItem(`bb.quick-access.${email}`, "3");
+ localStorage.setItem(`bb.last-activity.${email}`, "4");
+ localStorage.setItem(`bb.collapse-state.${email}`, "5");
+ localStorage.setItem(`bb.intro-state.${email}`, "6");
+ localStorage.setItem(`bb.iam-remind.${email}`, "7");
+ localStorage.setItem(`bb.reset-password.${email}`, "8");
+ localStorage.setItem(`bb.search./dashboard.${email}`, "9");
+ localStorage.setItem(`bb.sql-editor.tabs.projects/p1.${email}`, "10");
+ localStorage.setItem(
+ `bb.sql-editor.current-tab.projects/p1.${email}`,
+ "11"
+ );
+ localStorage.setItem(`bb.sql-editor.conn-expanded.env/prod.${email}`, "12");
+ localStorage.setItem(`bb.sql-editor.conn-expanded-keys.${email}`, "13");
+ localStorage.setItem(
+ `bb.sql-editor.saved-query-filter.projects/p1.${email}`,
+ "14"
+ );
+ localStorage.setItem(
+ `bb.sql-editor.saved-query-tree.projects/p1.${email}`,
+ "15"
+ );
+ localStorage.setItem(
+ `bb.sql-editor.saved-query-folder.projects/p1.list.${email}`,
+ "16"
+ );
+ localStorage.setItem(`bb.sql-editor.ai-suggestion.${email}`, "17");
+
+ migrateUserStorage(email, newEmail);
+
+ // Verify all migrated
+ expect(localStorage.getItem(`bb.recent-visit.${newEmail}`)).toBe("1");
+ expect(localStorage.getItem(`bb.recent-projects.${newEmail}`)).toBe("2");
+ expect(localStorage.getItem(`bb.quick-access.${newEmail}`)).toBe("3");
+ expect(localStorage.getItem(`bb.last-activity.${newEmail}`)).toBe("4");
+ expect(localStorage.getItem(`bb.collapse-state.${newEmail}`)).toBe("5");
+ expect(localStorage.getItem(`bb.intro-state.${newEmail}`)).toBe("6");
+ expect(localStorage.getItem(`bb.iam-remind.${newEmail}`)).toBe("7");
+ expect(localStorage.getItem(`bb.reset-password.${newEmail}`)).toBe("8");
+ expect(localStorage.getItem(`bb.search./dashboard.${newEmail}`)).toBe("9");
+ expect(
+ localStorage.getItem(`bb.sql-editor.tabs.projects/p1.${newEmail}`)
+ ).toBe("10");
+ expect(
+ localStorage.getItem(`bb.sql-editor.current-tab.projects/p1.${newEmail}`)
+ ).toBe("11");
+ expect(
+ localStorage.getItem(`bb.sql-editor.conn-expanded.env/prod.${newEmail}`)
+ ).toBe("12");
+ expect(
+ localStorage.getItem(`bb.sql-editor.conn-expanded-keys.${newEmail}`)
+ ).toBe("13");
+ expect(
+ localStorage.getItem(
+ `bb.sql-editor.saved-query-filter.projects/p1.${newEmail}`
+ )
+ ).toBe("14");
+ expect(
+ localStorage.getItem(
+ `bb.sql-editor.saved-query-tree.projects/p1.${newEmail}`
+ )
+ ).toBe("15");
+ expect(
+ localStorage.getItem(
+ `bb.sql-editor.saved-query-folder.projects/p1.list.${newEmail}`
+ )
+ ).toBe("16");
+ expect(
+ localStorage.getItem(`bb.sql-editor.ai-suggestion.${newEmail}`)
+ ).toBe("17");
+
+ // Verify old keys removed
+ expect(localStorage.getItem(`bb.recent-visit.${email}`)).toBeNull();
+ expect(
+ localStorage.getItem(`bb.sql-editor.tabs.projects/p1.${email}`)
+ ).toBeNull();
+ });
+});
diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts
deleted file mode 100644
index 2b0b4c4f1b..0000000000
--- a/frontend/src/utils/types.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export type VueClass = string | Record<string, unknown> | Array<VueClass>;
-
-export type VueStyle =
- | string
- | Record<string, string | number | undefined>
- | Array<VueStyle>;
-
-export type ExtractPromiseType<T> = T extends Promise<infer U> ? U : unknown;
diff --git a/frontend/src/utils/v1/iam.ts b/frontend/src/utils/v1/iam.ts
index 846f70165a..9bbd3a0555 100644
--- a/frontend/src/utils/v1/iam.ts
+++ b/frontend/src/utils/v1/iam.ts
@@ -201,9 +201,8 @@ export const getUserListInBinding = ({
}: {
binding: Binding;
ignoreGroup: boolean;
- // Resolves a group from its binding member string. Defaults to the Pinia
- // group store; React callers pass a resolver backed by the app store so
- // group expansion reads from the same cache they populate.
+ // Resolves a group from its binding member string. Defaults to the app
+ // store's group cache via the util bridge.
getGroupByIdentifier?: (identifier: string) => Group | undefined;
}): string[] => {
if (isBindingPolicyExpired(binding)) {
@@ -309,9 +308,8 @@ export const filterBindingsByUserName = ({
});
};
-// Project-level IAM permission check. Reads the React app store (project IAM
-// policy + roles) via the util bridge — relocated from the deleted Pinia
-// `projectIamPolicy` store, whose data was never populated in the React shell.
+// Project-level IAM permission check. Reads the app store (project IAM policy +
+// roles) via the util bridge.
const checkProjectIAMPolicyWithExpr = (
user: User,
project: Project,
diff --git a/frontend/tests/e2e/workspace/workspace-general-settings.spec.ts b/frontend/tests/e2e/workspace/workspace-general-settings.spec.ts
index 9698dd66be..92166a013d 100644
--- a/frontend/tests/e2e/workspace/workspace-general-settings.spec.ts
+++ b/frontend/tests/e2e/workspace/workspace-general-settings.spec.ts
@@ -108,7 +108,7 @@ test.describe("data-export policy control wording and wiring", () => {
await gotoGeneralSettings();
// The description teaches the access-grant path and quotes the exact
- // "Request export" button label (coupling locked by messages.test.ts).
+ // "Request export" button label (coupling enforced by scripts/check-i18n.mjs).
await expect(
page.getByText(
/In projects that allow access grants, users can still click "Request export"/
diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json
index 00dc02a2ca..617e57d123 100644
--- a/frontend/tsconfig.app.json
+++ b/frontend/tsconfig.app.json
@@ -5,7 +5,6 @@
"src/**/*.tsx"
],
"exclude": [
- "src/**/__tests__/*",
"src/**/*.test.ts",
"src/**/*.test.tsx"
],
diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts
index 354b6de649..fc24aad9c5 100644
--- a/frontend/vitest.config.ts
+++ b/frontend/vitest.config.ts
@@ -34,7 +34,7 @@ export default mergeConfig(
// transform (skipping the plugin fails 82 files), so bound the wait
// instead: vitest force-exits either way, this just stops it idling.
teardownTimeout: 1000,
- exclude: [...configDefaults.exclude, "e2e/*", "tests/e2e/**"],
+ exclude: [...configDefaults.exclude, "tests/e2e/**"],
root: fileURLToPath(new URL("./", import.meta.url)),
setupFiles: ["./vitest.setup.ts"],
globalSetup: ["./vitest.globalSetup.ts"],
diff --git a/frontend/vitest.globalSetup.ts b/frontend/vitest.globalSetup.ts
index 4b6935faeb..2e1fc613d0 100644
--- a/frontend/vitest.globalSetup.ts
+++ b/frontend/vitest.globalSetup.ts
@@ -10,6 +10,6 @@ import { fileURLToPath } from "node:url";
// entry point self-sufficient without another package.json script.
export default function setup() {
const cwd = fileURLToPath(new URL("./", import.meta.url));
- execFileSync("sh", ["./scripts/copy_config_files.sh"], { cwd, stdio: "inherit" });
- execFileSync("node", ["scripts/generate_openapi_index.js"], { cwd, stdio: "inherit" });
+ execFileSync("sh", ["./scripts/copy-config-files.sh"], { cwd, stdio: "inherit" });
+ execFileSync("node", ["scripts/generate-openapi-index.js"], { cwd, stdio: "inherit" });
}