diff --git a/cuprum-ui/src/components/drill/DrillPlanInspector.tsx b/cuprum-ui/src/components/drill/DrillPlanInspector.tsx index 6d0ab120..55b75d07 100644 --- a/cuprum-ui/src/components/drill/DrillPlanInspector.tsx +++ b/cuprum-ui/src/components/drill/DrillPlanInspector.tsx @@ -27,6 +27,7 @@ import { SegmentedControl } from "@/components/ui/SegmentedControl"; import { formatXYViolations } from "@/lib/xyGate"; import { formatZReasons } from "@/lib/zGate"; import { useUnitFormat } from "@/i18n/useUnitFormat"; +import { useFlag } from "@/hooks/useFlag"; import { getRegistrationHoles } from "@/lib/fiducialRegistration"; export interface DrillPlanInspectorProps { @@ -168,13 +169,20 @@ export function DrillPlanInspector({ useEffect(() => { if (isRunActive) setPanelMode("plan"); }, [isRunActive]); - // Registration mode toggle: "corner" (classic datum bind) or "fiducial". // Persisted only for the session (ephemeral state). Defaults to "corner". const [registrationMode, setRegistrationMode] = useState<"corner" | "fiducial">("corner"); // Detect whether the panel has any registration holes so the toggle can be shown. const hasRegistrationHoles = getRegistrationHoles(toolingHoles).length > 0; + // Feature flag: fiducial registration is still rough — hide behind an explicit opt-in. + const fiducialRegistrationEnabled = useFlag("fiducialRegistration"); + + // When the fiducial-registration flag is turned off, reset any stale "fiducial" + // registrationMode so the corner-based flow is always used. + useEffect(() => { + if (!fiducialRegistrationEnabled) setRegistrationMode("corner"); + }, [fiducialRegistrationEnabled]); // Gate: the footer start button is disabled when any of these conditions hold. const startDisabled = @@ -344,8 +352,8 @@ export function DrillPlanInspector({ {/* Work zero — compact status card-button (opens the zero-binding mode). Shows a registration-mode toggle when the panel has registration holes. */}