// Settings scene — identity, backend URL, polling cadence, theme. import { useState } from "react"; import { useApp } from "../state/store"; import { api } from "../lib/api"; import { User, Refresh, Cog, Pulse, Layers, Check } from "../components/icons"; const COMMON_EMAILS = [ "ceo-head@flow-master.ai", "hr-head@flow-master.ai", "it-head@flow-master.ai", ]; export default function Settings() { const userEmail = useApp((s) => s.userEmail); const actor = useApp((s) => s.actor); const userDisplayName = useApp((s) => s.userDisplayName); const loginAs = useApp((s) => s.loginAs); const pollEverySec = useApp((s) => s.pollEverySec); const setPollEverySec = useApp((s) => s.setPollEverySec); const theme = useApp((s) => s.theme); const setTheme = useApp((s) => s.setTheme); const consoleOpen = useApp((s) => s.consoleOpen); const setConsoleOpen = useApp((s) => s.setConsoleOpen); const mode = useApp((s) => s.mode); const setMode = useApp((s) => s.setMode); const refreshLive = useApp((s) => s.refreshLive); const pushToast = useApp((s) => s.pushToast); const [emailInput, setEmailInput] = useState(userEmail); const [signingIn, setSigningIn] = useState(false); const signIn = async (email: string) => { setSigningIn(true); try { await loginAs(email, undefined, { method: "dev" }); } finally { setSigningIn(false); } }; const clearToken = () => { api.clearToken(); pushToast("info", "Cleared bearer token. Next request will re-login."); }; return (
Settings

Identity, backend & UI

Everything here is persisted to localStorage and survives reloads.

Identity

Signed in {userDisplayName ?? userEmail.split("@")[0]}
Email {userEmail}
Status {actor?.user_id ? "active session" : "no session"}

Sign in as

setEmailInput(e.target.value)} />
{COMMON_EMAILS.map((e) => ( ))}

Data mode & polling

Current mode {mode === "live" ? "LIVE" : "SNAPSHOT"}
{mode === "live" && ( )}
Polling only runs in LIVE mode. Currently {mode === "live" ? "polling" : "paused"}.

Appearance

About

FlowMaster operator cockpit. Live at{" "} canvas.flow-master.ai . Every action writes to EA2 — open the live console (above) to see the API trail.

); }