Standardize stair controls on slider inputs

This commit is contained in:
sudhir
2026-04-28 14:50:51 +05:30
parent 1c2746f538
commit 15daeaace6
4 changed files with 9 additions and 16 deletions
+1
View File
@@ -104,6 +104,7 @@
"motion": "^12.34.3", "motion": "^12.34.3",
"nanoid": "^5.1.6", "nanoid": "^5.1.6",
"tailwind-merge": "^3.5.0", "tailwind-merge": "^3.5.0",
"three-mesh-bvh": "^0.9.8",
"zod": "^4.3.6", "zod": "^4.3.6",
"zustand": "^5.0.11", "zustand": "^5.0.11",
}, },
@@ -9,14 +9,6 @@ import type {
} from '../../schema' } from '../../schema'
import { resolveLevelId } from '../../hooks/spatial-grid/spatial-grid-sync' import { resolveLevelId } from '../../hooks/spatial-grid/spatial-grid-sync'
import type {
AnyNode,
AnyNodeId,
CeilingNode,
SlabNode,
StairNode,
StairSegmentNode,
} from '../../schema'
import { DEFAULT_WALL_HEIGHT } from '../wall/wall-footprint' import { DEFAULT_WALL_HEIGHT } from '../wall/wall-footprint'
type Point2D = [number, number] type Point2D = [number, number]
@@ -20,7 +20,7 @@ const SPAWN_ICON = (
// eslint-disable-next-line @next/next/no-img-element // eslint-disable-next-line @next/next/no-img-element
<img <img
alt="Spawn Point" alt="Spawn Point"
src="/icons/spawn-point.svg" src="/icons/site.png"
style={{ width: '100%', height: '100%', objectFit: 'contain' }} style={{ width: '100%', height: '100%', objectFit: 'contain' }}
/> />
) )
@@ -294,7 +294,7 @@ export function StairPanel() {
/> />
{(node.slabOpeningMode ?? 'none') === 'destination' ? ( {(node.slabOpeningMode ?? 'none') === 'destination' ? (
<MetricControl <SliderControl
label="Opening Offset" label="Opening Offset"
max={0.5} max={0.5}
min={0} min={0}
@@ -340,7 +340,7 @@ export function StairPanel() {
{(node.stairType === 'curved' || node.stairType === 'spiral') && ( {(node.stairType === 'curved' || node.stairType === 'spiral') && (
<PanelSection title="Geometry"> <PanelSection title="Geometry">
<MetricControl <SliderControl
label="Width" label="Width"
max={10} max={10}
min={0.4} min={0.4}
@@ -350,7 +350,7 @@ export function StairPanel() {
unit="m" unit="m"
value={Math.round((node.width ?? 1) * 100) / 100} value={Math.round((node.width ?? 1) * 100) / 100}
/> />
<MetricControl <SliderControl
label="Rise" label="Rise"
max={10} max={10}
min={0.2} min={0.2}
@@ -360,7 +360,7 @@ export function StairPanel() {
unit="m" unit="m"
value={Math.round((node.totalRise ?? 2.5) * 100) / 100} value={Math.round((node.totalRise ?? 2.5) * 100) / 100}
/> />
<MetricControl <SliderControl
label="Steps" label="Steps"
max={32} max={32}
min={2} min={2}
@@ -378,7 +378,7 @@ export function StairPanel() {
/> />
)} )}
{(node.stairType === 'spiral' || !(node.fillToFloor ?? true)) && ( {(node.stairType === 'spiral' || !(node.fillToFloor ?? true)) && (
<MetricControl <SliderControl
label="Thickness" label="Thickness"
max={1} max={1}
min={0.02} min={0.02}
@@ -389,7 +389,7 @@ export function StairPanel() {
value={Math.round((node.thickness ?? 0.25) * 100) / 100} value={Math.round((node.thickness ?? 0.25) * 100) / 100}
/> />
)} )}
<MetricControl <SliderControl
label="Inner Radius" label="Inner Radius"
max={10} max={10}
min={node.stairType === 'spiral' ? 0.05 : 0.2} min={node.stairType === 'spiral' ? 0.05 : 0.2}
@@ -417,7 +417,7 @@ export function StairPanel() {
value={node.topLandingMode ?? 'none'} value={node.topLandingMode ?? 'none'}
/> />
{(node.topLandingMode ?? 'none') === 'integrated' && ( {(node.topLandingMode ?? 'none') === 'integrated' && (
<MetricControl <SliderControl
label="Top Landing" label="Top Landing"
max={5} max={5}
min={0.3} min={0.3}