style: apply biome lint fixes after portforward

This commit is contained in:
open-pascal
2026-05-20 00:54:11 +00:00
parent d48be77f5d
commit 3adae8acea
22 changed files with 92 additions and 98 deletions
+8 -16
View File
@@ -123,16 +123,13 @@ export const MATERIAL_CATALOG: MaterialCatalogItem[] = [
label: 'Hungarian Parquet 10',
category: 'wood',
description: 'Parquet wood finish',
previewThumbnailUrl:
'/material/wood/hungarian_parquet_10/Hungarian Parquet_10_baseColor.webp',
previewThumbnailUrl: '/material/wood/hungarian_parquet_10/Hungarian Parquet_10_baseColor.webp',
preset: {
maps: {
albedoMap: '/material/wood/hungarian_parquet_10/Hungarian Parquet_10_baseColor.webp',
metalnessMap:
'/material/wood/hungarian_parquet_10/Hungarian Parquet_10_specularLevel.webp',
metalnessMap: '/material/wood/hungarian_parquet_10/Hungarian Parquet_10_specularLevel.webp',
normalMap: '/material/wood/hungarian_parquet_10/Hungarian Parquet_10_normal.webp',
roughnessMap:
'/material/wood/hungarian_parquet_10/Hungarian Parquet_10_roughness.webp',
roughnessMap: '/material/wood/hungarian_parquet_10/Hungarian Parquet_10_roughness.webp',
},
mapProperties: {
color: '#ffffff',
@@ -163,13 +160,11 @@ export const MATERIAL_CATALOG: MaterialCatalogItem[] = [
label: 'Hungarian Parquet 2',
category: 'wood',
description: 'Parquet wood finish',
previewThumbnailUrl:
'/material/wood/hungarian_parquet_2/Hungarian Parquet_2_baseColor.webp',
previewThumbnailUrl: '/material/wood/hungarian_parquet_2/Hungarian Parquet_2_baseColor.webp',
preset: {
maps: {
albedoMap: '/material/wood/hungarian_parquet_2/Hungarian Parquet_2_baseColor.webp',
metalnessMap:
'/material/wood/hungarian_parquet_2/Hungarian Parquet_2_specularLevel.webp',
metalnessMap: '/material/wood/hungarian_parquet_2/Hungarian Parquet_2_specularLevel.webp',
normalMap: '/material/wood/hungarian_parquet_2/Hungarian Parquet_2_normal.webp',
roughnessMap: '/material/wood/hungarian_parquet_2/Hungarian Parquet_2_roughness.webp',
},
@@ -210,8 +205,7 @@ export const MATERIAL_CATALOG: MaterialCatalogItem[] = [
metalnessMap:
'/material/wood/square_parquet_21/Square Pattern Parquet_21_specularLevel.webp',
normalMap: '/material/wood/square_parquet_21/Square Pattern Parquet_21_normal.webp',
roughnessMap:
'/material/wood/square_parquet_21/Square Pattern Parquet_21_roughness.webp',
roughnessMap: '/material/wood/square_parquet_21/Square Pattern Parquet_21_roughness.webp',
},
mapProperties: {
color: '#ffffff',
@@ -246,12 +240,10 @@ export const MATERIAL_CATALOG: MaterialCatalogItem[] = [
'/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_baseColor.webp',
preset: {
maps: {
albedoMap:
'/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_baseColor.webp',
albedoMap: '/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_baseColor.webp',
metalnessMap:
'/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_specularLevel.webp',
normalMap:
'/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_normal.webp',
normalMap: '/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_normal.webp',
roughnessMap:
'/material/wood/square_wood_parquet_23/Square Pattern Parquet_23_roughness.webp',
},
@@ -404,12 +404,10 @@ function getCurvedOpeningPolygon(stair: StairNode, offset: number = 0): Point2D[
const totalSweep = stair.sweepAngle ?? Math.PI / 2
const baseOpeningSweep =
Math.abs(totalSweep) *
Math.max(
CURVED_STAIR_SLAB_OPENING_RATIO,
1 / Math.max(stair.stepCount ?? 1, 1),
)
Math.max(CURVED_STAIR_SLAB_OPENING_RATIO, 1 / Math.max(stair.stepCount ?? 1, 1))
const angleOffset = offset / Math.max(innerRadius, 0.1)
const openingSweep = Math.sign(totalSweep || 1) * Math.min(Math.abs(totalSweep), baseOpeningSweep + angleOffset * 2)
const openingSweep =
Math.sign(totalSweep || 1) * Math.min(Math.abs(totalSweep), baseOpeningSweep + angleOffset * 2)
const startAngle = totalSweep / 2 - openingSweep
const endAngle = totalSweep / 2
@@ -562,7 +560,12 @@ function getStairOpeningPolygons(
}
if (stair.stairType === 'curved') {
return [getCurvedOpeningPolygon(stair, Math.max((stair.openingOffset ?? 0) - STAIR_SLAB_OPENING_TIGHTENING, 0.15))]
return [
getCurvedOpeningPolygon(
stair,
Math.max((stair.openingOffset ?? 0) - STAIR_SLAB_OPENING_TIGHTENING, 0.15),
),
]
}
if (stair.stairType === 'spiral') {
@@ -358,7 +358,7 @@ export function FloorplanRegistryMoveOverlay() {
// plan scene; otherwise we'd react to 3D-canvas moves with garbage
// plan coords.
const target = event.target as Element | null
if (!target || !target.closest('[data-floorplan-scene]')) return
if (!target?.closest('[data-floorplan-scene]')) return
const m = toMeters(event.clientX, event.clientY)
if (!m) return
const [sx, sz] = snapPointToGrid([m[0], m[1]], GRID_STEP)
@@ -371,7 +371,7 @@ export function FloorplanRegistryMoveOverlay() {
const onPointerUp = (event: PointerEvent) => {
if (event.button !== 0) return
const target = event.target as Element | null
if (!target || !target.closest('[data-floorplan-scene]')) return
if (!target?.closest('[data-floorplan-scene]')) return
const snapped = lastSnapped
if (snapped) {
@@ -269,8 +269,6 @@ export const FloorplanRegistryLayer = memo(function FloorplanRegistryLayer() {
levelId,
nodes,
liveTransforms,
liveOverrides,
interactiveElevators,
selectedIdSet,
highlightedIdSet,
hoveredId,
@@ -518,9 +516,7 @@ export const FloorplanRegistryLayer = memo(function FloorplanRegistryLayer() {
higher-rank kinds (slabs, then walls / items / shelves) layer
on top in the expected document-order z-stack. */}
<g className="floorplan-registry-base">
{entries.map(({ id, base }) =>
base ? renderEntry(id, base, `base-${id}`) : null,
)}
{entries.map(({ id, base }) => (base ? renderEntry(id, base, `base-${id}`) : null))}
</g>
{/* Overlay pass — interactive handles (vertex / midpoint / edge /
move) and labels (text / dimensions). Painted after every base
@@ -7,7 +7,7 @@ import {
sceneRegistry,
useScene,
} from '@pascal-app/core'
import { useViewer, WalkthroughControls, ZONE_LAYER } from '@pascal-app/viewer'
import { useViewer, ZONE_LAYER } from '@pascal-app/viewer'
import { CameraControls, CameraControlsImpl } from '@react-three/drei'
import { useThree } from '@react-three/fiber'
import { useCallback, useEffect, useMemo, useRef } from 'react'
@@ -673,7 +673,7 @@ const BVHEcctrl = forwardRef<BVHEcctrlApi, EcctrlProps>(
rotationDeltaPos.current.copy(totalPlatformDeltaPos.current)
characterGroupRef.current.position.add(rotationDeltaPos.current)
yawQuaternion.current.setFromUnitVectors(upAxis.current, floatHitNormal.current)
}, [upAxis])
}, [])
const updateCharacterAnimation = useCallback(
(run: boolean, jump: boolean): CharacterAnimationStatus => {
@@ -756,7 +756,7 @@ const BVHEcctrl = forwardRef<BVHEcctrlApi, EcctrlProps>(
moveDirRef.current?.position.copy(characterSegment.current.end)
moveDirRef.current?.setDirection(currentLinVel.current)
moveDirRef.current?.setLength(currentLinVel.current.length() / maxWalkSpeed)
}, [characterSegment, maxWalkSpeed])
}, [maxWalkSpeed])
useFrame((_, delta) => {
elapsedRef.current += delta
@@ -3475,7 +3475,7 @@ function FloorplanZoneLabel({
if (textRef.current) {
setTextWidth(textRef.current.getComputedTextLength())
}
}, [zone.name])
}, [])
const isDeleteMode = mode === 'delete'
@@ -5136,7 +5136,7 @@ export function FloorplanPanel() {
useEffect(() => {
setHoveredGuideCorner(null)
}, [selectedGuide?.id])
}, [])
useEffect(() => {
if (!(selectedGuide && showGuides && canInteractWithGuides)) {
@@ -6087,7 +6087,7 @@ export function FloorplanPanel() {
}
scheduleMovingFloorplanNodeRefresh()
}, [hasPendingItemMeshFootprints, scheduleMovingFloorplanNodeRefresh])
}, [scheduleMovingFloorplanNodeRefresh])
// Subscribe to the live-transforms store so rotation/position changes that
// *don't* go through pointer events still refresh the floorplan — e.g. R/T
@@ -6631,7 +6631,7 @@ export function FloorplanPanel() {
pendingFenceDragRef.current = null
clearWallEndpointDrag()
clearWallCurveDrag()
}, [clearWallCurveDrag, clearWallEndpointDrag, levelId])
}, [clearWallCurveDrag, clearWallEndpointDrag])
useEffect(() => {
if (shouldShowSiteBoundaryHandles) {
@@ -840,7 +840,7 @@ const ViewerCanvas = memo(function ViewerCanvas({
window.removeEventListener('pointermove', handlePointerMove)
window.removeEventListener('pointerup', handlePointerUp)
}
}, [])
}, [setFloorplanPaneRatio])
useEffect(() => {
setIsCameraControlsHintVisible(!readCameraControlsHintDismissed())
@@ -85,7 +85,7 @@ export const StairEditSystem = () => {
}
prevActiveStairIds.current = activeStairIds
}, [selectedIds, selectedStairSignature])
}, [selectedIds])
return null
}
@@ -1496,7 +1496,16 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea
window.removeEventListener('keyup', onKeyUp)
window.removeEventListener('contextmenu', onContextMenu)
}
}, [asset, canPlaceOnFloor, canPlaceOnWall, canPlaceOnCeiling, draftNode])
}, [
asset,
canPlaceOnFloor,
canPlaceOnWall,
canPlaceOnCeiling,
draftNode,
gridSnapStep,
updateDimensionGuides,
updatePreviewGeometry,
])
// Refresh wireframe when the grid step changes mid-placement so the green/red
// box snaps to the new cell size right away.
@@ -1510,7 +1519,7 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea
)
updatePreviewGeometry(previewBounds)
updateDimensionGuides(previewBounds)
}, [gridSnapStep, asset, draftNode])
}, [gridSnapStep, asset, draftNode, updateDimensionGuides, updatePreviewGeometry])
// Wall/ceiling items are managed by their own surface entry events (ensureDraft / reparent).
const viewerLevelId = useViewer((s) => s.selection.levelId)
useEffect(() => {
@@ -1588,6 +1597,7 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea
initialDimensionBounds.dimensions[0],
initialDimensionBounds.dimensions[1],
initialDimensionBounds.dimensions[2],
initialDimensionBounds,
],
)
const basePlaneGeometry = useMemo(() => {
@@ -546,7 +546,7 @@ const BoxSelectToolInner: React.FC = () => {
canvas.removeEventListener('pointerdown', onCanvasPointerDown)
canvas.removeEventListener('pointerup', onCanvasPointerUp)
}
}, [camera, gl])
}, [gl, raycastToGround, syncPreviewSelectedIds])
// grid:move for cursor tracking + rectangle update during drag
useEffect(() => {
@@ -603,7 +603,7 @@ const BoxSelectToolInner: React.FC = () => {
return () => {
emitter.off('grid:move', onMove)
}
}, [])
}, [syncPreviewSelectedIds])
return (
<group>
+1 -4
View File
@@ -393,10 +393,7 @@ export default function DoorPanel() {
const isGarageDoor = node.doorCategory === 'garage' || doorType.startsWith('garage-')
const isSwingDoor = doorType === 'hinged' || doorType === 'double' || doorType === 'french'
const isSlideFoldDoor =
doorType === 'folding' ||
doorType === 'pocket' ||
doorType === 'barn' ||
doorType === 'sliding'
doorType === 'folding' || doorType === 'pocket' || doorType === 'barn' || doorType === 'sliding'
const isSlidingDoor = doorType === 'pocket' || doorType === 'barn' || doorType === 'sliding'
const isFoldingDoor = doorType === 'folding'
const isSectionalGarageDoor = doorType === 'garage-sectional'
+3 -4
View File
@@ -240,6 +240,7 @@ export default function ElevatorPanel() {
node?.type,
selectedId,
updateNode,
node,
])
const previewMetric = useCallback(
@@ -314,7 +315,7 @@ export default function ElevatorPanel() {
}, [clearLivePreview, node, setMovingNode, setSelection])
const handleDuplicate = useCallback(() => {
if (!(node && node.parentId)) return
if (!node?.parentId) return
triggerSFX('sfx:item-pick')
const duplicate = ElevatorNodeSchema.parse({
@@ -596,9 +597,7 @@ export default function ElevatorPanel() {
</div>
<select
className="h-9 w-full rounded-lg border border-border/50 bg-[#2C2C2E] px-2 text-sm text-foreground"
onChange={(event) =>
handleServiceBoundaryChange('fromLevelId', event.target.value)
}
onChange={(event) => handleServiceBoundaryChange('fromLevelId', event.target.value)}
value={fromLevelId}
>
{levels.map((level) => (
+1 -1
View File
@@ -5,8 +5,8 @@ import {
constrainWallMoveDeltaToAxis,
emitter,
type FenceNode,
getPerpendicularWallMoveAxis,
type GridEvent,
getPerpendicularWallMoveAxis,
type LevelNode,
useScene,
type WallMoveAxis,
-2
View File
@@ -11,9 +11,7 @@ import {
import {
ActionButton,
ActionGroup,
buildRoofSurfaceMaterialPatch,
duplicateRoofSubtree,
MaterialPicker,
PanelSection,
PanelWrapper,
SliderControl,
+1 -1
View File
@@ -34,7 +34,7 @@ export default function SpawnPanel() {
setDraftRotation(node.rotation)
useLiveTransforms.getState().clear(node.id)
}, [node?.id, node?.rotation, node?.type])
}, [node?.id, node?.rotation, node?.type, node])
const handleUpdate = useCallback(
(updates: Partial<SpawnNode>) => {
@@ -45,6 +45,8 @@ export const StairSegmentRenderer = ({ node }: { node: StairSegmentNode }) => {
parentNode?.sideMaterial,
parentNode?.treadMaterialPreset,
parentNode?.treadMaterial,
node,
parentNode,
])
const placeholderGeometry = useMemo(() => {
-2
View File
@@ -16,10 +16,8 @@ import {
import {
ActionButton,
ActionGroup,
buildStairSurfaceMaterialPatch,
DEFAULT_SPIRAL_STAIR_SWEEP_ANGLE,
duplicateStairSubtree,
MaterialPicker,
MetricControl,
PanelSection,
PanelWrapper,
+1 -1
View File
@@ -18,9 +18,9 @@ import {
getAngleToSegmentReference,
getSegmentAngleReferenceAtPoint,
markToolCancelConsumed,
type SegmentAngleReference,
snapWallDraftPoint,
triggerSFX,
type SegmentAngleReference,
type WallPlanPoint,
} from '@pascal-app/editor'
import { useViewer } from '@pascal-app/viewer'
+1 -1
View File
@@ -1,10 +1,10 @@
import { type NodeDefinition, ZoneNode as ZoneNodeSchema } from '@pascal-app/core'
import { buildZoneFloorplan } from './floorplan'
import {
zoneAddVertexAffordance,
zoneMoveEdgeAffordance,
zoneMoveVertexAffordance,
} from './floorplan-affordances'
import { buildZoneFloorplan } from './floorplan'
import { zoneParametrics } from './parametrics'
import { ZoneNode } from './schema'
@@ -9,7 +9,6 @@ import {
useScene,
} from '@pascal-app/core'
import { useFrame } from '@react-three/fiber'
import { useRef } from 'react'
import * as THREE from 'three'
import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js'
@@ -610,7 +609,7 @@ function generateStairRailingGeometry(
for (let index = 1; index < segmentRailPaths.length; index++) {
const previousPath = segmentRailPaths[index - 1]
const currentPath = segmentRailPaths[index]
if (!(previousPath && currentPath && currentPath.connectFromPrevious)) continue
if (!(previousPath && currentPath?.connectFromPrevious)) continue
if (previousPath.segment.segmentType === 'landing') continue
for (const sidePath of currentPath.sidePaths) {