/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * HeightStrategyPanel — sub-panel shown when the Generate dialog's Height * strategy is selected. Exposes slice-height + subgroup mode. Extracted so * the parent dialog file focuses on strategy selection, primary fields, * and the preview. */ import { Ruler } from 'lucide-react'; import { Label } from '@/components/ui/label'; import type { GenerateScheduleOptions } from './generate-schedule'; export interface HeightStrategyPanelProps { heightTolerance: number; elementZSubgroup: GenerateScheduleOptions['elementZSubgroup']; onHeightToleranceChange: (next: number) => void; onSubgroupChange: (next: GenerateScheduleOptions['elementZSubgroup']) => void; } export function HeightStrategyPanel({ heightTolerance, elementZSubgroup, onHeightToleranceChange, onSubgroupChange, }: HeightStrategyPanelProps) { return (
Height-slice options Uses geometry, ignores spatial tree
{heightTolerance.toFixed(1)} m
onHeightToleranceChange(parseFloat(e.target.value))} className="w-full accent-primary" />

Elements whose geometry centroid Z falls inside the same band share a task. Typical storey heights are 3–4 m.

{([ { k: 'none', label: 'None' }, { k: 'class', label: 'Class' }, { k: 'type', label: 'Type' }, { k: 'name', label: 'Name' }, ] as const).map(opt => ( onSubgroupChange(opt.k)} /> ))}

{elementZSubgroup === 'none' ? 'One task per slice — every element in the band goes to that task.' : elementZSubgroup === 'class' ? 'Split each slice by IFC class (IfcWall, IfcSlab, …).' : elementZSubgroup === 'type' ? 'Split each slice by the element’s type name (IfcRelDefinesByType target).' : 'Split each slice by each element’s Name attribute.'}

); } interface SubgroupPillProps { label: string; active: boolean; onSelect: () => void; } /** * Compact 4-across segmented pill used for the Z-subgroup mode * (None / Class / Type / Name). Kept small and modest so it reads as a * setting, not a navigation target. */ function SubgroupPill({ label, active, onSelect }: SubgroupPillProps) { return ( ); }