Skip to content

fix: restore fence tool handlers dropped by null-guard commit#318

Merged
wass08 merged 1 commit into
mainfrom
fix/fence-tool-handlers
May 20, 2026
Merged

fix: restore fence tool handlers dropped by null-guard commit#318
wass08 merged 1 commit into
mainfrom
fix/fence-tool-handlers

Conversation

@wass08
Copy link
Copy Markdown
Collaborator

@wass08 wass08 commented May 20, 2026

Summary

251af2c ("fix: add null guards for cursorRef in fence and wall tool click handlers", merged in #315 / portforward of pr-309) added a ?. on cursorRef.current in onGridClick, but the same commit accidentally deleted:

  • the closing braces of the else branch and onGridClick itself, leaving the function syntactically unterminated, and
  • the trailing reset block (previewRef.current.visible = false, buildingState.current = 1, setDraftMeasurement(null)), and
  • the onKeyDown / onKeyUp / onCancel handler definitions — which are still referenced at the emitter.on(...) / emitter.off(...) sites below.

This left main failing to build:

src/fence/tool.tsx(527,4): error TS1128: Declaration or statement expected.
src/fence/tool.tsx(527,12): error TS1005: ';' expected.
…
src/fence/tool.tsx(518,31): error TS2552: Cannot find name 'onCancel'.
src/fence/tool.tsx(519,40): error TS2552: Cannot find name 'onKeyDown'.
src/fence/tool.tsx(520,38): error TS2552: Cannot find name 'onKeyUp'.

Restores the deleted block verbatim from the prior state (5bd2f51), keeping the intended cursorRef.current?. optional-chaining null guard.

Test plan

  • bun typecheck (passes)
  • bun run build (passes — both editor packages and downstream community app)
  • Smoke-test fence tool in the editor: place a fence, continue placing successive segments, press Esc to cancel, hold Shift for angle snap

🤖 Generated with Claude Code

251af2c added a `?.` on cursorRef in onGridClick but inadvertently
deleted the closing braces, the trailing reset block, and the
onKeyDown/onKeyUp/onCancel handlers — leaving onGridClick syntactically
unterminated and three undefined references at the emitter.on/off sites.
Restores the deleted block verbatim, keeping the optional-chaining null
guard on cursorRef.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wass08 wass08 merged commit e2d9ffb into main May 20, 2026
1 check passed
@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 20, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed May 20, 2026, 12:31 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant