Database governance built for humans and agents — controlling changes and access across every major database.
Introduce React App + Empty frontend/src/components/ — Design
Date: 2026-05-14 Status: design (pre-implementation) Delivery: single PR
Context
frontend/src/components/ has been steadily emptied during the Vue→React migration. Only 10 files remain — a mix of three Vue files and seven non-component utility / type / constants files that ended up under components/ for historical reasons. The directory's name no longer reflects what lives in it.
Two of the three remaining Vue files — AgentWindowMount.vue and SessionExpiredSurfaceMount.vue — exist as Vue shims that own a <div> and call mountReactPage(container, ...) from src/react/mount.ts in onMounted. Both render React components (AgentWindow, SessionExpiredSurface) that already createPortal(..., getLayerRoot(...)) to document.body-level layer roots. Their visible DOM never lives inside the Vue subtree; the Vue mount is just a lifecycle anchor for the React root.
That means these shims are not load-bearing on their Vue parents. They are deletable today — if there is somewhere outside the Vue tree to hold the React root.
This design introduces that somewhere: a sibling React app, mounted at app boot alongside the existing Vue app, dedicated to React surfaces that already portal globally and don't need to be positioned inside the Vue layout DOM. Initial residents: AgentWindow and SessionExpiredSurface. The same PR also relocates the seven utility files to their natural homes and removes frontend/src/components/ entirely.
Goals
- Stand up a long-lived React root in
index.htmlat<div id="react-app">, mounted fromsrc/main.tsafter the Vue app mounts. - Move
AgentWindowandSessionExpiredSurfaceinto that React app. Delete both*Mount.vueshims. - Relocate every remaining file under
frontend/src/components/to a natural home. - Delete
frontend/src/components/entirely.
Non-goals
- No visual or behavioral change to
AgentWindoworSessionExpiredSurface. - No migration of
OverlayStackManager.vueto React — it remains Vue infrastructure forBBModal.vue(still Vue). It just relocates. - No migration of
BodyLayout.vueorAuthContext.vueto React. Both stay Vue; they just lose one child element each. - No changes to existing
ReactPageMount.vue/mountReactPageusage elsewhere. Those continue to be the right tool for React surfaces that must be positioned inside the Vue layout DOM.
React app
index.html
Add a sibling mount point:
<div id="app"></div>
<div id="react-app"></div> <!-- NEW -->
<div id="bb-toaster-root"></div>
#react-app has no visible DOM of its own — its children portal to getLayerRoot("agent") and getLayerRoot("critical"). Layout position is irrelevant.
src/react/app/
Three new files:
ReactApp.tsx — top-level tree:
export function ReactApp() {
return (
<I18nextProvider i18n={i18n}>
<AgentWindow />
<SessionExpiredSurfaceGate />
</I18nextProvider>
);
}
SessionExpiredSurfaceGate.tsx — the conditional + route-path wiring that previously lived in the Vue shim:
export function SessionExpiredSurfaceGate() {
const unauthenticatedOccurred = useVueState(
() => useAuthStore().unauthenticatedOccurred
);
const currentPath = useVueState(() => router.currentRoute.value.fullPath);
if (!unauthenticatedOccurred) return null;
return <SessionExpiredSurface currentPath={currentPath} />;
}
useAuthStore and router are imported directly per the codebase convention.
mount.tsx — boot + Vue→React i18n sync (.tsx because it renders JSX):
import { watch } from "vue";
import { createRoot } from "react-dom/client";
import { StrictMode } from "react";
import i18n, { i18nReady } from "@/react/i18n";
import { locale } from "@/plugins/i18n";
import { ReactApp } from "./ReactApp";
export async function mountReactApp(selector: string) {
const container = document.querySelector(selector);
if (!container) throw new Error(`Missing React app mount point: ${selector}`);
await i18nReady;
const root = createRoot(container);
root.render(
<StrictMode>
<ReactApp />
</StrictMode>
);
// One-time Vue→React locale sync. Replaces the per-shim watch(locale, ...).
watch(locale, async (next) => {
if (i18n.language !== next) await i18n.changeLanguage(next);
});
return root;
}
src/main.ts
After the existing createApp(App).mount("#app"):
const { mountReactApp } = await import("./react/app/mount");
void mountReactApp("#react-app"); // fire-and-forget; boot continues
Fire-and-forget is intentional — mountReactApp resolves only after i18nReady, and we don't want to delay any subsequent Vue boot steps on it. The React app initializing in the background is fine because both its initial residents (AgentWindow, SessionExpiredSurface) are user-triggered or auth-state-triggered, not boot-time-visible.
Dynamic import keeps the React bundle off the Vue boot critical path.
Knock-on edits
src/layouts/BodyLayout.vue:43— remove<AgentWindowMount />from template; remove theimport AgentWindowMount from "@/components/AgentWindowMount.vue".src/AuthContext.vue:8— remove<SessionExpiredSurfaceMount v-if="authStore.unauthenticatedOccurred" />; remove the import.src/layouts/layout-bridge.test.ts:118— drop thevi.mock("@/components/AgentWindowMount.vue", ...)block; the surface is no longer mounted byBodyLayout.src/react/components/auth/SessionExpiredSurface.test.tsx— update import path if it references the old shim (component itself is unchanged).src/react/mount.ts—pageLoadersno longer needsAgentWindow.tsxorSessionExpiredSurface.tsxfor themountReactPagepath. Verify and prune the glob entries if unused.
File relocations
| Source | Destination | Notes |
|---|---|---|
AdvancedSearch/types.ts |
🗑️ delete | 0 importers; orphan |
AgentWindowMount.vue |
🗑️ delete | Replaced by React app |
SessionExpiredSurfaceMount.vue |
🗑️ delete | Replaced by SessionExpiredSurfaceGate |
misc/OverlayStackManager.vue |
src/bbkit/OverlayStackManager.vue |
Vue infra for BBModal; one importer |
InstanceForm/constants.ts |
merge into src/utils/v1/instance.ts |
10 importers; engine port/icon helpers |
Member/utils.ts |
src/utils/v1/member.ts (new) |
1 importer (MembersPage.tsx) |
Member/projectRoleBindings.ts |
append to src/utils/v1/member.ts |
1 importer; combined for density |
Member/types.ts |
src/types/v1/member.ts (new) |
1 importer; matches existing src/types/v1/{database,project,user}.ts pattern (the existing top-level src/types/member.ts is unrelated — it holds DatabaseResource) |
RoleGrantPanel/DatabaseResourceForm/common.ts |
src/utils/v1/databaseResource.ts (new) |
2 importers; pure helpers |
RolloutV1/constants/task.ts |
src/utils/v1/issue/task.ts (new) |
1 importer; sibling rollout.ts exists |
All import sites are updated in the same PR. Total importer count across the seven .ts files: ~18 import statements to rewrite.
Destination rationale
src/utils/v1/instance.tsalready exists and containssupportedEngineV1Listand related helpers. The engine port / icon constants belong with them.src/types/v1/member.tsis new; matches the sibling pattern ofsrc/types/v1/{database,project,user}.ts. The existing top-levelsrc/types/member.tsonly holdsDatabaseResource(unrelated) — not extended in this PR.src/utils/v1/member.tsis new but mirrors the existing sibling pattern (src/utils/v1/{database,user,project}.ts).src/utils/v1/databaseResource.tsis new;parseStringToResourceand friends are pure DatabaseResource helpers with no UI dependency.src/utils/v1/issue/task.tsis new butsrc/utils/v1/issue/rollout.tsalready exists in the same folder; task-status constants belong alongside.src/bbkit/OverlayStackManager.vuesits with the otherBB*Vue primitives. The component's internalnameis alreadyBBOverlayStack.
Validation
pnpm --dir frontend check— ESLint + Biome + import sortpnpm --dir frontend type-check— both Vue (vue-tsc) and React (tsconfig.react.json)pnpm --dir frontend test— includinglayout-bridge.test.ts(updated),SessionExpiredSurface.test.tsx,no-react-to-vue-imports.test.ts,no-legacy-vue-deps.test.ts- Manual smoke: open the app, confirm AgentWindow toggles via
Cmd/Ctrl+Shift+A, confirm SessionExpired surface appears on forced 401 (e.g. revoke token in DevTools). - Confirm the
frontend/src/components/directory is absent at the end.
Risks
- Boot order race.
mountReactAppis awaited after Vue mounts; until it resolves,AgentWindowandSessionExpiredSurfaceare not present. AgentWindow is user-triggered so latency is invisible; SessionExpiredSurface only matters once an authenticated request fails, which happens long after boot. Acceptable. - Vue→React i18n sync coverage. The existing shims each ran their own
watch(locale, ...). The new app runs one. If a future React-app resident needs to react to locale beyondi18next.changeLanguage, it must subscribe viauseTranslation()(already standard). useVueStatere-render churn.SessionExpiredSurfaceGatesubscribes to two Vue reactive sources. Both update infrequently. No expected perf issue.- Layer ordering. The React app's residents continue using
getLayerRoot("agent" | "critical"). Layer ordering is unaffected because the layer roots live atdocument.body, not inside#react-appor#app.
Out of scope, but enabled
Future React surfaces that already portal globally can move into ReactApp.tsx and drop their Vue mount shims. Candidates to consider in follow-up work: any future agent-related panels, body-level toasts that don't depend on Vue notification state, global keyboard-shortcut overlays. None of these are in this PR.