Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9a3002e
feat(wall): typed exact length during two-click wall drafting (#308)
dkbbdev Sep 17, 2026
11e8fa5
fix(wall): address review — commit typed length exactly, no buffer leaks
dkbbdev Sep 17, 2026
596c7e7
fix(wall): honor typed length on Enter/click exits, latest-ref for 2D…
dkbbdev Sep 17, 2026
817147f
feat(cabinet): add typed coordinate placement
dkbbdev Sep 17, 2026
27101de
fix(cabinet): address typed-placement review findings
dkbbdev Sep 17, 2026
4ec9ae8
fix(cabinet): typed-commit hardening + screen-space 2D HUD
dkbbdev Sep 17, 2026
2074553
fix(cabinet): typed-commit stretch seeding + click ends typing session
dkbbdev Sep 17, 2026
9eabd0a
fix(cabinet): keep typed entry reachable after large offsets
dkbbdev Sep 17, 2026
e709e8d
fix(cabinet): typed-entry cancel/island/short-wall hardening
dkbbdev Sep 17, 2026
7c7851a
fix(cabinet): typed-entry WYSIWYG click, click-swallow, miter station
dkbbdev Sep 17, 2026
bb8ea5e
fix(review): HIGH-2, HIGH-3, QUICKWIN-2
dkbbdev Sep 17, 2026
7eb477c
fix(cabinet): keep typing session on invalid click commit; comma togg…
dkbbdev Sep 17, 2026
51953c0
fix(cabinet): center a cabinet wider than its wall on typed entry
dkbbdev Sep 17, 2026
b6da3b6
merge: upstream main (hosting fixes #894-#896, settings dialog #904, …
dkbbdev Sep 22, 2026
afe71e4
fix(wall): re-derive typed endpoint at click commit time
dkbbdev Sep 22, 2026
43d7a64
fix(wall): let the 2D-only view own the typed Enter commit
dkbbdev Sep 28, 2026
7e114a8
fix(wall): round-4 bugbot fixes for the typed 2D draft
dkbbdev Oct 5, 2026
69100e1
merge: upstream main (authored objects, freeform elements, scripted o…
dkbbdev Oct 5, 2026
c0e8d53
merge: origin/main into #883 typed wall length
cursoragent Nov 9, 2026
8b0d800
merge: #887 typed cabinet coordinates
cursoragent Nov 9, 2026
8d5abd5
refactor(typed-entry): share one store, key convention and HUD betwee…
cursoragent Nov 9, 2026
442706e
feat(wall): type the drafted wall's angle as well as its length
cursoragent Nov 9, 2026
3a40b2b
docs(tools): describe the shared typed-entry convention
cursoragent Nov 9, 2026
a8008a1
fix(floorplan): take 2D-only typed wall keys ahead of the global shor…
cursoragent Nov 9, 2026
3e3c9f3
fix(wall): let a 3D typed Enter commit before the pointer moves
cursoragent Nov 9, 2026
cdff4af
fix(floorplan): keep the typed-entry HUD off the ghost it labels
cursoragent Nov 9, 2026
31e30e8
fix(wall): wrap the angle placeholder's rounded heading to 0°
cursoragent Nov 9, 2026
fdefebe
docs(tools): spell out the typed wall angle convention and pointer fo…
cursoragent Nov 9, 2026
ea9b5f5
test(floorplan): start the typed wall key test from an empty session
cursoragent Nov 9, 2026
d7aea0c
fix(floorplan): size the 2D wall typing HUD from the plan's own scale
cursoragent Nov 9, 2026
471747d
docs(floorplan): reflow the typing HUD comment
cursoragent Nov 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ export type DraftMeasurement = {
}

export function FloorplanDraftMeasurement({
lengthHidden = false,
measurement,
measurementStroke,
labelBackground,
labelText,
sceneRotationDeg,
unitsPerPixel,
}: {
/** Leave the length plate to something drawn in its place (the typed-entry HUD). */
lengthHidden?: boolean
measurement: DraftMeasurement
measurementStroke: string
labelBackground: string
Expand Down Expand Up @@ -68,7 +71,10 @@ export function FloorplanDraftMeasurement({

return (
<g pointerEvents="none">
<g transform={`translate(${cx} ${cy}) rotate(${labelAngleDeg})`}>
<g
display={lengthHidden ? 'none' : undefined}
transform={`translate(${cx} ${cy}) rotate(${labelAngleDeg})`}
>
<rect
fill={labelBg}
height={lengthPlateH}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import { useViewer } from '@pascal-app/viewer'
import { memo, useMemo } from 'react'
import { formatLinearMeasurement } from '../../../lib/measurements'
import usePlacementPreview from '../../../store/use-placement-preview'
import { usePlacementTyping } from '../../../store/use-placement-typing'
import { useFloorplanRender, useFloorplanSceneRotation } from '../floorplan-render-context'
import { FloorplanDimensionRenderer } from './floorplan-dimension-renderer'
import { FloorplanGeometryRenderer } from './floorplan-geometry-renderer'
import { FloorplanPlacementTypingHud } from './floorplan-placement-typing-hud'

export interface FloorplanNodePreviewProps {
node: AnyNode
Expand Down Expand Up @@ -139,14 +141,24 @@ export const FloorplanPlacementPreviewLayer = memo(function FloorplanPlacementPr
const dimensions = usePlacementPreview((s) => s.dimensions)
const activeDimensionId = usePlacementPreview((s) => s.activeDimensionId)
const dimensionInput = usePlacementPreview((s) => s.dimensionInput)
const typingProjectedPosition = usePlacementTyping((s) => s.projectedPosition)
const unit = useViewer((s) => s.unit)
const metricNotation = useViewer((s) => s.metricNotation)
const sceneRotationDeg = useFloorplanSceneRotation()
const unitsPerPixel = useFloorplanRender()?.unitsPerPixel ?? 1
if (!node) return null

return (
<g data-floorplan-placement-preview>
<FloorplanNodePreview contextNodes={contextNodes} node={node} parentNode={parentNode} />
{typingProjectedPosition ? (
<FloorplanPlacementTypingHud
sceneRotationDeg={sceneRotationDeg}
unitsPerPixel={unitsPerPixel}
x={typingProjectedPosition[0]}
y={typingProjectedPosition[2]}
/>
) : null}
<g data-floorplan-placement-dimensions>
{dimensions
.filter((dimension) => dimension.renderInFloorplan !== false)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { afterEach, expect, test } from 'bun:test'
import {
PLACEMENT_TYPING_LENGTH_ANGLE,
usePlacementTyping,
} from '../../../store/use-placement-typing'
import { renderCurrentMarkup } from '../../../test-utils/render-current-markup'
import { FloorplanPlacementTypingHud } from './floorplan-placement-typing-hud'

afterEach(() => {
usePlacementTyping.getState().clear()
})

test('sizes and counter-rotates the HUD from the props it is given', () => {
usePlacementTyping.getState().begin({ labels: PLACEMENT_TYPING_LENGTH_ANGLE, activeField: 0 })

const markup = renderCurrentMarkup(
<svg>
<FloorplanPlacementTypingHud sceneRotationDeg={30} unitsPerPixel={0.02} x={1} y={2} />
</svg>,
)

expect(markup).toContain('transform="translate(1 2) rotate(-30)"')
expect(markup).toMatch(/<foreignObject[^>]*width="4.72"/)
expect(markup).toContain('scale(0.02)')
})

test('renders nothing without a typing session', () => {
const markup = renderCurrentMarkup(
<svg>
<FloorplanPlacementTypingHud sceneRotationDeg={0} unitsPerPixel={0.02} x={0} y={0} />
</svg>,
)

expect(markup).not.toContain('foreignObject')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
'use client'

import { usePlacementTyping } from '../../../store/use-placement-typing'
import { PlacementCoordinateInput } from '../../tools/shared/placement-coordinate-input'

const HUD_WIDTH_PX = 236
const HUD_HEIGHT_PX = 64
const HUD_LIFT_PX = 14

/**
* The typed-entry HUD placed in the plan at `x`/`y` (level-local metres).
* HTML inside a `foreignObject` is laid out in CSS pixels equal to SVG user
* units, and the plan's `<g>` is zoomed and rotated, so the box is scaled by
* `unitsPerPixel` and counter-rotated to stay screen-sized and upright. Both
* come from the caller: the wall draft renders outside `FloorplanRenderProvider`.
* It sits just above its anchor, and only the HUD itself takes the pointer, so
* clicks on the ghost or the draft under it still land on the plan.
*/
export function FloorplanPlacementTypingHud({
placeholders,
sceneRotationDeg,
unitsPerPixel,
x,
y,
}: {
placeholders?: readonly string[]
sceneRotationDeg: number
unitsPerPixel: number
x: number
y: number
}) {
const isActive = usePlacementTyping((state) => state.isActive)
const scale = Math.max(unitsPerPixel, 1e-6)
if (!isActive) return null

return (
<g transform={`translate(${x} ${y}) rotate(${-sceneRotationDeg})`}>
<foreignObject
height={HUD_HEIGHT_PX * scale}
overflow="visible"
pointerEvents="none"
style={{ overflow: 'visible' }}
width={HUD_WIDTH_PX * scale}
x={(-HUD_WIDTH_PX / 2) * scale}
y={-(HUD_HEIGHT_PX + HUD_LIFT_PX) * scale}
>
<div
style={{
alignItems: 'flex-end',
display: 'flex',
height: HUD_HEIGHT_PX,
justifyContent: 'center',
overflow: 'visible',
pointerEvents: 'none',
transform: `scale(${scale})`,
transformOrigin: 'top left',
width: HUD_WIDTH_PX,
}}
>
<PlacementCoordinateInput placeholders={placeholders} />
</div>
</foreignObject>
</g>
)
}
Loading
Loading