Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Merge origin/main into perf/load-less

milind-soni0494c03e94e9
diff --cc src/main.tsx
index d2621c27d8,a152ca53ba..61a7ebd3ba
--- a/src/main.tsx
+++ b/src/main.tsx
@@@ -47,6 -53,6 +48,6 @@@ async function chooseRoot(): Promise<Re
return <App />;
}
-void Promise.all([bootstrapBrand(), chooseRoot()]).then(([, root]) => {
+void Promise.all([bootstrapBrand(), chooseRoot(), loadPageLanguage()]).then(([, root]) => {
- createRoot(document.getElementById("root")!).render(<StrictMode>{root}</StrictMode>);
+ createRoot(document.getElementById("root")!).render(<StrictMode><PageBoundary>{root}</PageBoundary></StrictMode>);
});
diff --cc src/rail.tsx
index d655eab622,0000000000..40c9b569cc
mode 100644,000000..100644
--- a/src/rail.tsx
+++ b/src/rail.tsx
@@@ -1,23 -1,0 +1,24 @@@
+import { StrictMode } from "react";
+import { createRoot } from "react-dom/client";
+import { ChromeRail } from "./components/ChromeRail";
++import { PageBoundary } from "./components/PageBoundary";
+import { bootstrapBrand } from "./lib/brand";
+import { applyFont, readFont } from "./lib/fonts";
+import { settleAdvancedModeDefault } from "./lib/interface-mode";
+import { loadPageLanguage } from "./lib/language-preference";
+import { applySkinChoice, readSkinChoice } from "./lib/skins";
+import "./styles.css";
+
+// The window's own rail of places (electron/chrome-rail.mjs): see-through but for the rail and its open sheets. Only
+// the desktop's preload gives this app's page a rail; anywhere else this address is the app.
+if (window.ogb?.rail?.expand) {
+ settleAdvancedModeDefault();
+ applySkinChoice(readSkinChoice());
+ applyFont(readFont());
+ document.documentElement.style.background = document.body.style.background = "transparent";
+ void Promise.all([bootstrapBrand(), loadPageLanguage()]).then(() => {
- createRoot(document.getElementById("root")!).render(<StrictMode><ChromeRail /></StrictMode>);
++ createRoot(document.getElementById("root")!).render(<StrictMode><PageBoundary><ChromeRail /></PageBoundary></StrictMode>);
+ });
+} else {
+ location.replace(`/${location.search}${location.hash}`);
+}