Commit b1dbe6c
authored
fix(frontend): re-root federated Console router to avoid host __root collision (MF v2 dev) (#2508)
* fix(frontend): re-root federated Console router to avoid host __root collision
Embedded Console (MF v2) renders Cloud UI's root route instead of its own
in dev, because both apps compile a module with the identical id
./src/routes/__root.tsx and the shared rsbuild/MF dev runtime resolves the
host's. That substitutes Cloud UI's RootComponent (react NuqsAdapter,
Builder.io <Content>, <CommandPalette>/KBar) as Console's embedded root,
which: crashes on useKBar (no KBarProvider in this subtree) -> empty
sidebar; and leaves Console's useQueryState consumers without a matching
nuqs adapter context -> NUQS-404.
Re-root the federated router onto Console's own federatedRootRoute (a
Console-unique module path that can't collide), and give it RouterSync +
RequireAuth (RequireAuth triggers the user-data fetch that gates the
endpoint-compatibility fetch and the embedded sidebar items). Standalone
(app.tsx/__root.tsx) and prod are unaffected.
* fix(frontend): render DebugHelper in federated root (Cmd+Shift+D parity)
The embedded MF-v2 Console renders federatedRootRoute, not __root.tsx's
RootLayout, so it was missing <DebugHelper /> — the component that
registers the Cmd+Shift+D debug dialog (dev-only). Render it in the
federated root too, gated on NODE_ENV=development, mirroring __root.tsx.
* fix(frontend): restore Toaster + content padding in federated root
Mirror __root.tsx's embedded AppContent in the MF-v2 federated layout
(which now renders in prod where enable-console-mf-v2 is on):
- Render <Toaster> — sonner is not an MF-shared singleton, so the host's
Toaster can't surface Console's toasts; without this, toast() is silent
in embedded mode.
- Wrap <Outlet> in the pt-8 spacing div to match AppContent.
(Fullscreen-route branch is intentionally omitted — no route sets
staticData.fullscreen on master; it lands with the SQL workspace.)1 parent b816313 commit b1dbe6c
2 files changed
Lines changed: 61 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
48 | 78 | | |
49 | 79 | | |
50 | 80 | | |
| |||
255 | 285 | | |
256 | 286 | | |
257 | 287 | | |
258 | | - | |
| 288 | + | |
259 | 289 | | |
260 | 290 | | |
261 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
| |||
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
76 | 94 | | |
77 | 95 | | |
78 | 96 | | |
| |||
82 | 100 | | |
83 | 101 | | |
84 | 102 | | |
85 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
86 | 106 | | |
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
90 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
91 | 115 | | |
92 | 116 | | |
93 | 117 | | |
0 commit comments