Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
c731835
test(w3): add failing G1-01 public route and capability regressions (…
jamespatrickjackson-lang Nov 14, 2026
429549e
feat(w3): implement typed public-route and capability-denial contract
jamespatrickjackson-lang Nov 14, 2026
2f76044
feat(w3): add Utah curated public landing and non-authoring viewer shell
jamespatrickjackson-lang Nov 14, 2026
aee63e1
feat(w3): enforce public versus developer mounting and denied project…
jamespatrickjackson-lang Nov 14, 2026
670dd3f
test(w3): verify public save shortcut capture at App boundary
jamespatrickjackson-lang Nov 14, 2026
119e619
test(w3): verify live JSX mounts rather than documentation comments
jamespatrickjackson-lang Nov 14, 2026
1e8b5ae
test(w3): prevent public activation of developer layer diagnostics (RED)
jamespatrickjackson-lang Nov 14, 2026
a5642c5
fix(w3): deny developer layer diagnostics in public mode
jamespatrickjackson-lang Nov 14, 2026
1dfb493
test(w3): correct regex escapes discovered by full CI
jamespatrickjackson-lang Nov 14, 2026
6188f58
test(w3): reproduce G1-01 public keyboard, writer dispatch and URL re…
jamespatrickjackson-lang Nov 14, 2026
bb25a12
fix(w3): intercept public page/Save keys and normalize landing URL
jamespatrickjackson-lang Nov 14, 2026
206d869
fix(w3): guard public page keys and reconcile landing URL on open/back
jamespatrickjackson-lang Nov 14, 2026
524974e
refactor(w3): execute public camera reset via typed guarded action
jamespatrickjackson-lang Nov 14, 2026
831dd2d
test(w3): keep prior shortcut test aligned with guard extraction
jamespatrickjackson-lang Nov 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 57 additions & 11 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import {
type ProjectCatalogEntry,
} from "./projects/projectCatalogRuntime";
import { debugLog } from "./utils/debugLog";
import { CuratedPublicLanding, CuratedExplorerShell } from "./public/CuratedExplorerShell";
import {
attachPublicKeyboardGuard,
canOpenProject,
publicRouteUrl,
resolveGateAExperience,
} from "./public/gateAExperience";
import { SHAHBAZI_VIEWER_BACKGROUND } from "./projectModules/shahbazi/ui";
import "./App.css";

Expand Down Expand Up @@ -49,15 +56,30 @@ const EditorChrome = lazy(() =>
);

export function App() {
// Resolve once: direct public links and attempted editor deep-links fail closed.
const [experience] = useState(() =>
resolveGateAExperience(window.location.search, import.meta.env.DEV),
);
const containerRef = useRef<HTMLDivElement>(null);
const loadRequestRef = useRef(0);
const initialProjectOpenedRef = useRef(false);
const [project, setProject] = useState<LoadedProject | null>(null);
const [loadError, setLoadError] = useState<string | null>(null);
const [loadError, setLoadError] = useState<string | null>(experience.error);
const [loadState, setLoadState] = useState<LoadState>("landing");
const [sceneHandle, setSceneHandle] = useState<SceneHandle | null>(null);

const openProject = useCallback((projectSlug: string = DEFAULT_PROJECT_SLUG) => {
const openProject = useCallback((
projectSlug: string = DEFAULT_PROJECT_SLUG,
updatePublicUrl = true,
) => {
// Behavior-boundary enforcement, not just removal of landing controls.
if (!canOpenProject(experience, projectSlug)) {
setLoadError("This project is unavailable in the public explorer.");
return;
}
if (experience.mode === "public" && updatePublicUrl) {
window.history.replaceState(window.history.state, "", publicRouteUrl(window.location.href, projectSlug));
}
const requestId = loadRequestRef.current + 1;
loadRequestRef.current = requestId;
setLoadError(null);
Expand All @@ -78,22 +100,31 @@ export function App() {
setLoadError(message);
setLoadState("landing");
});
}, []);
}, [experience]);

const returnToLanding = useCallback(() => {
if (experience.mode === "public") {
window.history.replaceState(window.history.state, "", publicRouteUrl(window.location.href, null));
}
loadRequestRef.current += 1;
setLoadError(null);
setProject(null);
setSceneHandle(null);
setLoadState("landing");
}, []);
}, [experience.mode]);

useEffect(() => {
if (initialProjectOpenedRef.current) return;
initialProjectOpenedRef.current = true;
const slug = new URLSearchParams(window.location.search).get("project");
if (slug) openProject(slug);
}, [openProject]);
if (experience.initialProjectSlug) {
openProject(experience.initialProjectSlug, false);
}
}, [experience.initialProjectSlug, openProject]);

useEffect(() => {
if (experience.mode !== "public") return;
return attachPublicKeyboardGuard(window, Boolean(sceneHandle && project));
}, [experience.mode, sceneHandle, project]);

useEffect(() => {
if (!containerRef.current || !project) return;
Expand Down Expand Up @@ -148,17 +179,25 @@ export function App() {
}, [project]);

useEffect(() => {
if (!sceneHandle || !project || !import.meta.env.DEV) return;
if (!sceneHandle || !project || !import.meta.env.DEV ||
experience.mode !== "developer") return;
return installDevLayerDiagnostics(sceneHandle, {
projectSlug: project.projectSlug,
projectName: project.manifest.name,
});
}, [project, sceneHandle]);
}, [project, sceneHandle, experience.mode]);

return (
<div style={{ position: "absolute", inset: 0 }}>
<div ref={containerRef} style={{ position: "absolute", inset: 0 }} />
{loadState === "landing" && !project && (
{loadState === "landing" && !project && experience.mode === "public" && (
<CuratedPublicLanding
error={loadError}
developmentAvailable={import.meta.env.DEV}
onOpenUtah={() => openProject(UTAH_FORGE_PROJECT.slug)}
/>
)}
{loadState === "landing" && !project && experience.mode === "developer" && (
<ProjectLanding
error={loadError}
onOpenProject={openProject}
Expand All @@ -177,7 +216,14 @@ export function App() {
</div>
)}
<HoverTooltip />
{sceneHandle && project && (
{sceneHandle && project && experience.mode === "public" && (
<CuratedExplorerShell
sceneHandle={sceneHandle}
project={project}
onReturnHome={returnToLanding}
/>
)}
{sceneHandle && project && experience.mode === "developer" && (
<EditorProvider
projectSlug={project.projectSlug}
projectRoot={project.projectRoot}
Expand Down
228 changes: 228 additions & 0 deletions src/public/CuratedExplorerShell.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
import type { CSSProperties } from "react";
import type { SceneHandle } from "../scene";
import type { LoadedProject } from "../pages/loadPages";
import {
PageControllerProvider,
usePageController,
} from "../pages/PageController";
import {
GATE_A_CURATED_PROJECT_SLUG,
performGateAAction,
} from "./gateAExperience";

interface PublicLandingProps {
error: string | null;
onOpenUtah: () => void;
developmentAvailable: boolean;
}

/** An explicit, single supported example. Other projects remain in the dev editor. */
export function CuratedPublicLanding({
error,
onOpenUtah,
developmentAvailable,
}: PublicLandingProps) {
return (
<main aria-labelledby="public-landing-title" style={landing}>
<div style={panel}>
<p style={eyebrow}>GeoSee · Geoscience visualization</p>
<h1 id="public-landing-title" style={title}>
Explore Utah FORGE
</h1>
<p style={description}>
Explore a prepared geothermal and geophysical visualization in a
browser. This public preview supports camera navigation only;
creating a project, importing files, authoring and saving are not
available here.
</p>
<p style={caveat}>
Prepared source-derived layers may have unresolved survey registration
or datum limitations. Visualization is not validation of scientific
measurements or suitability for engineering decisions.
</p>
{error && <p role="alert" style={errorStyle}>{error}</p>}
<button
type="button"
style={primaryButton}
onClick={onOpenUtah}
data-public-project={GATE_A_CURATED_PROJECT_SLUG}
>
Open Utah FORGE
</button>
{developmentAvailable && (
<p style={developerNote}>
Working on GeoSee? <a href="?mode=developer">Open developer editor</a>
</p>
)}
</div>
</main>
);
}

interface PublicExplorerProps {
sceneHandle: SceneHandle;
project: LoadedProject;
onReturnHome: () => void;
}

/**
* The public viewer mounts the existing read-only scene/page-state application
* path, never EditorProvider, EditorChrome or the dev Save/Import actions.
* Pages may supply optional camera/display presets, not application capability.
*/
export function CuratedExplorerShell({
sceneHandle,
project,
onReturnHome,
}: PublicExplorerProps) {
return (
<PageControllerProvider
pages={project.pages}
environment={project.environment}
sceneHandle={sceneHandle}
allowPageCameraMarker={false}
>
<PublicExplorerControls onReturnHome={onReturnHome} />
</PageControllerProvider>
);
}

function PublicExplorerControls({ onReturnHome }: { onReturnHome: () => void }) {
const { resetToPose } = usePageController();

const handleReset = () =>
performGateAAction("public", "view.reset", resetToPose);

return (
<div style={viewerOverlay}>
<div style={viewerHeader}>
<button type="button" style={outlineButton} onClick={onReturnHome}>
Back to examples
</button>
<div style={viewerTitle}>Utah FORGE · Public viewer</div>
<button type="button" style={outlineButton} onClick={handleReset}>
Reset view
</button>
</div>
<p style={viewerFooter}>
Drag to orbit · Scroll to zoom · View-only. Scientific registration may
be unverified. Project editing, import, save and capture are unavailable.
</p>
</div>
);
}

const landing: CSSProperties = {
position: "absolute",
inset: 0,
display: "grid",
placeItems: "center",
background: "linear-gradient(145deg, #0b1823, #1a3040 65%, #0a141c)",
color: "#f0f4f6",
fontFamily: "system-ui, sans-serif",
overflowY: "auto",
zIndex: 8,
padding: 24,
boxSizing: "border-box",
};
const panel: CSSProperties = {
width: "min(640px, 100%)",
background: "rgba(13, 23, 31, 0.88)",
border: "1px solid rgba(190, 217, 226, 0.25)",
borderRadius: 18,
padding: "clamp(24px, 5vw, 48px)",
boxSizing: "border-box",
boxShadow: "0 24px 80px rgba(0,0,0,0.35)",
};
const eyebrow: CSSProperties = {
fontSize: 12,
letterSpacing: "0.12em",
textTransform: "uppercase",
color: "#9ec9d4",
margin: "0 0 18px",
};
const title: CSSProperties = {
fontSize: "clamp(34px, 5vw, 52px)",
lineHeight: 1.08,
fontWeight: 650,
margin: "0 0 22px",
};
const description: CSSProperties = {
fontSize: 16,
lineHeight: 1.65,
color: "#dae4e8",
};
const caveat: CSSProperties = {
fontSize: 13,
lineHeight: 1.6,
color: "#afc3cb",
};
const primaryButton: CSSProperties = {
marginTop: 24,
background: "#dbf0f5",
color: "#0c2530",
border: 0,
borderRadius: 9,
padding: "12px 20px",
cursor: "pointer",
font: "600 15px system-ui, sans-serif",
};
const errorStyle: CSSProperties = {
padding: 12,
color: "#ffe0df",
border: "1px solid #a95453",
borderRadius: 8,
};
const developerNote: CSSProperties = {
marginTop: 24,
color: "#bbd1db",
fontSize: 12,
};
const viewerOverlay: CSSProperties = {
position: "absolute",
inset: 0,
pointerEvents: "none",
zIndex: 12,
fontFamily: "system-ui, sans-serif",
color: "#f2f6f7",
};
const viewerHeader: CSSProperties = {
position: "absolute",
left: 20,
right: 20,
top: 18,
display: "flex",
alignItems: "center",
gap: 12,
justifyContent: "space-between",
};
const viewerTitle: CSSProperties = {
padding: "10px 14px",
background: "rgba(13,24,33,0.82)",
borderRadius: 9,
textAlign: "center",
fontSize: 14,
};
const outlineButton: CSSProperties = {
pointerEvents: "auto",
background: "rgba(13,24,33,0.87)",
color: "#fff",
border: "1px solid rgba(228,242,247,0.55)",
borderRadius: 9,
padding: "10px 14px",
font: "500 13px system-ui, sans-serif",
cursor: "pointer",
};
const viewerFooter: CSSProperties = {
position: "absolute",
bottom: 16,
left: "50%",
transform: "translateX(-50%)",
width: "min(720px, calc(100% - 32px))",
textAlign: "center",
background: "rgba(10,20,28,0.78)",
borderRadius: 9,
padding: "9px 12px",
fontSize: 12,
lineHeight: 1.5,
};
Loading
Loading