From 456243c31c1cd534c70deef1fab4fd2ff5649aa1 Mon Sep 17 00:00:00 2001 From: shad Date: Sun, 14 Jun 2026 13:27:59 +0400 Subject: [PATCH] fix: gate unfinished surfaces honestly (oracle round 2) - Login.tsx: dev-login gated by VITE_ENABLE_DEV_LOGIN (defaults on, set to 'false' in production builds). SSO button probes /microsoft/login and shows 'NOT CONFIGURED' or 'NOT WIRED' state with disabled action instead of looking like a working primary login. - Hub.tsx: 'Queue'/'Selected work' renamed 'Available workflows' / 'Workflow detail' + footnote that a real work-item queue replaces it when the EA2 hub queue is wired. No more semantic overclaim. - Landing.tsx: Attendance Map chip gated by VITE_ENABLE_GEO_PREVIEW (default on) and labelled 'preview' so it can be hidden in prod builds. - flowCuration.ts: extend the dev-artefact filter to drop engineering names (EA2 *, SDX *, *runtime reference*, *demo*, *test*) so Pi and the hubs only ever expose buyer-appropriate flows. - All 29 unit tests + 26 dogfood QA assertions still green. --- src/lib/flowCuration.ts | 5 +++++ src/scenes/Hub.tsx | 9 +++++---- src/scenes/Landing.tsx | 4 +++- src/scenes/Login.tsx | 34 ++++++++++++++++++++++++++-------- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/lib/flowCuration.ts b/src/lib/flowCuration.ts index 80dd22e..4268888 100644 --- a/src/lib/flowCuration.ts +++ b/src/lib/flowCuration.ts @@ -21,6 +21,11 @@ const DEV_ARTEFACT_PATTERNS = [ /\bsmoke[_\s]?test\b/i, /\bprobe\b/i, /\bfixture\b/i, + /\bea2\b/i, + /\bsdx\b/i, + /\bruntime reference\b/i, + /\bdemo\b/i, + /\btest\b/i, ]; const NON_BUSINESS_SOURCE_CONTEXTS = new Set([ diff --git a/src/scenes/Hub.tsx b/src/scenes/Hub.tsx index eeac20d..aaf0cce 100644 --- a/src/scenes/Hub.tsx +++ b/src/scenes/Hub.tsx @@ -163,11 +163,11 @@ export default function Hub({ hub }: { hub: HubKey }) {
-
{spec.title.split(" ")[0].toUpperCase()} QUEUE
+
AVAILABLE WORKFLOWS
{flows === null &&
Loading…
} {flows !== null && visible.length === 0 && (
- Nothing in the queue yet. Open the to publish a process. + No workflows published for this function yet. Open the to add one.
)}
    @@ -183,11 +183,12 @@ export default function Hub({ hub }: { hub: HubKey }) { ))}
+

A live work-item queue will replace this list once the EA2 hub queue endpoint is wired.

-
SELECTED WORK
- {!selected &&
Select a row on the left.
} +
WORKFLOW DETAIL
+ {!selected &&
Select a workflow on the left.
} {selected && (
{selected.display_name}
diff --git a/src/scenes/Landing.tsx b/src/scenes/Landing.tsx index 09d712b..b965305 100644 --- a/src/scenes/Landing.tsx +++ b/src/scenes/Landing.tsx @@ -79,7 +79,9 @@ export default function Landing() { - + {(import.meta.env.VITE_ENABLE_GEO_PREVIEW ?? "true") !== "false" && ( + + )} diff --git a/src/scenes/Login.tsx b/src/scenes/Login.tsx index c83b4c8..abc2ff6 100644 --- a/src/scenes/Login.tsx +++ b/src/scenes/Login.tsx @@ -9,16 +9,28 @@ export default function Login() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [rememberMe, setRememberMe] = useState(false); - const [devLoginEnabled, setDevLoginEnabled] = useState(true); + const buildAllowsDev = (import.meta.env.VITE_ENABLE_DEV_LOGIN ?? "true") !== "false"; + const [devLoginEnabled, setDevLoginEnabled] = useState(buildAllowsDev); + const [ssoState, setSsoState] = useState<"unknown" | "ready" | "not-configured" | "not-wired">("unknown"); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); useEffect(() => { - // dev-login is on by default. Only the endpoint can flip it OFF. - api.devLoginConfig() - .then((cfg) => { if (cfg.enabled === false) setDevLoginEnabled(false); }) - .catch(() => { /* endpoint absent → keep ON */ }); - }, []); + if (!buildAllowsDev) { + setDevLoginEnabled(false); + } else { + api.devLoginConfig() + .then((cfg) => { if (cfg.enabled === false) setDevLoginEnabled(false); }) + .catch(() => { /* endpoint absent → keep state */ }); + } + fetch("/api/v1/auth/microsoft/login", { method: "GET", redirect: "manual" }) + .then((r) => { + if (r.status >= 300 && r.status < 400) setSsoState("ready"); + else if (r.status === 503) setSsoState("not-configured"); + else setSsoState("not-wired"); + }) + .catch(() => setSsoState("not-wired")); + }, [buildAllowsDev]); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); @@ -142,14 +154,20 @@ export default function Login() {
- {devLoginEnabled && (