[IMP] OneCAD rebrand: OneCAD wordmark + direct-to-workspace launch, no splash hold, no external links (docs/GitHub removed, local reports), all visible strings + locales OneCAD
This commit is contained in:
1 parent
ac05e26934
commit
a824c1eb75
33 files changed
+472
-461
No files matched your search
@@ -3,27 +3,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
<title>SolidCraft</title>
|
||||
<meta name="description" content="Open-source parametric CAD built in Rust. Desktop, browser, and MCP for AI agents.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="SolidCraft">
|
||||
<meta property="og:title" content="SolidCraft: try it in your browser">
|
||||
<meta property="og:description" content="Open-source parametric CAD built in Rust. Desktop, browser, and MCP for AI agents.">
|
||||
<meta property="og:url" content="https://solidcraft.ai/">
|
||||
<meta property="og:image" content="https://docs.solidcraft.io/og.png">
|
||||
<meta property="og:image:width" content="1280">
|
||||
<meta property="og:image:height" content="640">
|
||||
<meta property="og:image:alt" content="SolidCraft: open-source parametric CAD built in Rust">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="SolidCraft: try it in your browser">
|
||||
<meta name="twitter:description" content="Open-source parametric CAD built in Rust. Desktop, browser, and MCP for AI agents.">
|
||||
<meta name="twitter:image" content="https://docs.solidcraft.io/og.png">
|
||||
<meta name="twitter:image:alt" content="SolidCraft: open-source parametric CAD built in Rust">
|
||||
<title>OneCAD</title>
|
||||
<meta name="description" content="OneCAD — parametric CAD of the One B OS workspace, in Rust.">
|
||||
<!-- OneBSpace (OneCAD): upstream's social-card meta (solidcraft.ai / docs.solidcraft.io)
|
||||
and PWA manifest + icons are gone — this is our own app inside the Odoo iframe. -->
|
||||
<link data-trunk rel="rust" data-bin="solidcraft-web" data-wasm-opt="z" data-weak-refs />
|
||||
<link data-trunk rel="copy-file" href="../../assets/fonts/biz-udp-gothic/BIZUDPGothic-Regular.ttf" data-target-path="fonts" />
|
||||
<link data-trunk rel="copy-file" href="../../assets/fonts/biz-udp-gothic/OFL.txt" data-target-path="fonts" />
|
||||
<link data-trunk rel="css" href="../../assets/styles/web/loading.css" />
|
||||
<link data-trunk rel="copy-file" href="../../assets/styles/web/loading-logo.svg" />
|
||||
<!-- Installable as an app (manifest.webmanifest); the icons are the Linux exports of the app mark. -->
|
||||
<meta name="theme-color" content="#343840">
|
||||
<link rel="manifest" href="manifest.webmanifest">
|
||||
@@ -33,15 +20,31 @@
|
||||
<link data-trunk rel="copy-file" href="../../assets/icons/app/linux/exports/hicolor/32x32/apps/ai.storyteller.solidcraft.png" data-target-path="icons/32x32" />
|
||||
<link data-trunk rel="copy-file" href="../../assets/icons/app/linux/exports/hicolor/256x256/apps/ai.storyteller.solidcraft.png" data-target-path="icons/256x256" />
|
||||
<link data-trunk rel="copy-file" href="../../assets/icons/app/linux/exports/hicolor/512x512/apps/ai.storyteller.solidcraft.png" data-target-path="icons/512x512" />
|
||||
<!-- OneBSpace (OneCAD): the Odoo Documents host bridge. Copied verbatim
|
||||
(not hashed): the framework's bundleVersion ?v= on the iframe URL is
|
||||
the cache buster, like every other OneBSpace app bundle. The build
|
||||
script compiles the erasable-syntax TS (src/odoo/bridge.ts and
|
||||
src/odoo/index.ts) to odoo/bridge.js / odoo/index.js in dist;
|
||||
explorer.js is copied as-is (data-trunk copy-dir, same tag shape as
|
||||
every other entry above). -->
|
||||
<link data-trunk rel="copy-dir" href="src/odoo" data-target-path="odoo" />
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="solidcraft_canvas"></canvas>
|
||||
<div id="solidcraft_loading" role="status"><img src="loading-logo.svg" alt=""><span class="sr-only">Loading SolidCraft…</span></div>
|
||||
<div id="solidcraft_loading" role="status"><span class="wordmark">OneCAD</span><span class="sr-only">Loading OneCAD…</span></div>
|
||||
<script>
|
||||
// Offline use and updates (sw.js; written into release builds by `cargo xtask web-offline`).
|
||||
if ("serviceWorker" in navigator) {
|
||||
addEventListener("load", () => navigator.serviceWorker.register("sw.js").catch(() => {}));
|
||||
}
|
||||
// OneBSpace (OneCAD): boot the Odoo Documents bridge glue only inside a
|
||||
// frame (the wasm_app_framework shell). Standalone runs never import it.
|
||||
// odoo/index.js is src/odoo/index.ts compiled by the addon build script.
|
||||
try {
|
||||
if (window.parent !== window) {
|
||||
import("./odoo/index.js?v=20.0.1.0.6").catch((e) => console.warn("OneCAD odoo bridge:", e));
|
||||
}
|
||||
} catch (e) { /* cross-origin parent (standalone) — skip */ }
|
||||
// Install as an app: the browser's offer can come before the app runs, so it is kept here for
|
||||
// the app's File ▸ Install app… item (src/install.rs). Installed, the browser makes no more offers.
|
||||
addEventListener("beforeinstallprompt", (e) => { e.preventDefault(); window.solidcraftInstall = e; });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! SolidCraft in the browser.
|
||||
//! OneCAD in the browser.
|
||||
//!
|
||||
//! Runs the same [`solidcraft_ui_egui::SolveApp`] as the desktop app through eframe's web runner
|
||||
//! (wgpu: WebGPU where available, WebGL2 otherwise). Build with `trunk build --release` from this
|
||||
@@ -12,6 +12,10 @@ mod api;
|
||||
mod files;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod install;
|
||||
// OneBSpace (OneCAD): Odoo Documents host integration — Services overrides
|
||||
// (pickers → the JS bridge), VFS /odoo/ + /downloads/ drain, asset mirrors.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod services_odoo;
|
||||
#[cfg(any(target_arch = "wasm32", test))]
|
||||
mod space_mouse;
|
||||
|
||||
@@ -34,14 +38,15 @@ mod web {
|
||||
/// draws it with reversed depth, whose precision follows the distance from the eye (#1434).
|
||||
const DEPTH_BITS: u8 = 32;
|
||||
|
||||
/// The loading animation (assets/styles/web/loading-logo.svg) settles into the finished mark
|
||||
/// about 3.2 s after the page starts; this adds a short hold. The app doesn't land before it.
|
||||
const LOADING_MIN_MS: f64 = 3600.0;
|
||||
/// OneBSpace (OneCAD): upstream held the loading logo animation on screen for 3.6 s
|
||||
/// (LOADING_MIN_MS = 3600) — the "splash opener". The wordmark splash is dismissed as
|
||||
/// soon as the app is ready; the fade itself stays.
|
||||
const LOADING_MIN_MS: f64 = 0.0;
|
||||
/// The fade from the loading screen into the app.
|
||||
const LOADING_FADE_MS: i32 = 300;
|
||||
|
||||
/// Take the loading screen away once the animation has played to the finished mark: wait out
|
||||
/// what is left of `LOADING_MIN_MS`, fade it, then remove it.
|
||||
/// Take the loading screen away as soon as the app is ready (OneBSpace (OneCAD): no
|
||||
/// forced minimum hold): fade it, then remove it.
|
||||
fn dismiss_loading(el: web_sys::Element) {
|
||||
let Some(window) = web_sys::window() else {
|
||||
el.remove();
|
||||
@@ -120,6 +125,10 @@ mod web {
|
||||
for (text, error) in self.files.messages.borrow_mut().drain(..) {
|
||||
self.app.set_status(text, error);
|
||||
}
|
||||
// OneBSpace (OneCAD): CAD assets brought in from the computer are
|
||||
// mirrored into the Documents "Assets" folder in the Odoo host
|
||||
// (before the incoming queue is drained below).
|
||||
crate::services_odoo::mirror_imports(&self.files);
|
||||
let mut incoming: Vec<_> = self.files.incoming.borrow_mut().drain(..).collect();
|
||||
// A glTF file's buffers picked with it are kept next to it, not opened.
|
||||
incoming.retain_mut(|(name, bytes, _)| {
|
||||
@@ -523,6 +532,8 @@ mod web {
|
||||
install_app: Some(crate::install::service(&cc.egui_ctx)),
|
||||
..Default::default()
|
||||
};
|
||||
// OneBSpace (OneCAD): install odoo services on wasm
|
||||
let services = crate::services_odoo::install_odoo_services(services, cc.egui_ctx.clone());
|
||||
// Thumbnails of saves and start-page cards.
|
||||
solidcraft_ui_egui::gpu::install_cpu_picture_renderer();
|
||||
let (sender, receiver) = std::sync::mpsc::channel();
|
||||
@@ -544,11 +555,11 @@ mod web {
|
||||
if !query().contains("sample") {
|
||||
// The empty design takes Units of new designs (#1205). The sample
|
||||
// part is built in millimetres and is left that way.
|
||||
// OneBSpace (OneCAD): no start page — the app opens straight
|
||||
// into the workspace (the house button still shows Home).
|
||||
solidcraft_ui_egui::prefs::apply_new_design(&mut app);
|
||||
let rev = app.session.revision;
|
||||
app.home.show(rev);
|
||||
}
|
||||
let api = Api::install(sender, cc.egui_ctx.clone()).map_err(|e| format!("SolidCraft browser API: {e:?}"))?;
|
||||
let api = Api::install(sender, cc.egui_ctx.clone()).map_err(|e| format!("OneCAD browser API: {e:?}"))?;
|
||||
Ok(Box::new(Shell {
|
||||
app,
|
||||
api,
|
||||
@@ -569,7 +580,7 @@ mod web {
|
||||
match result {
|
||||
Ok(()) => dismiss_loading(el),
|
||||
Err(e) => {
|
||||
el.set_inner_html(&format!("<p>SolidCraft failed to start: {e:?}</p><p>A browser with WebGPU or WebGL2 is required.</p>"))
|
||||
el.set_inner_html(&format!("<p>OneCAD failed to start: {e:?}</p><p>A browser with WebGPU or WebGL2 is required.</p>"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user