Skip to content

[Maintainer] nodes: a cancel that only ends typed wall entry keeps the draft - #1251

Merged
Aymericr merged 2 commits into
mainfrom
cursor/wall-typed-cancel-keeps-draft-11c1
Nov 9, 2026
Merged

Aymericr merged 2 commits into
mainfrom
cursor/wall-typed-cancel-keeps-draft-11c1

Conversation

@Aymericr

@Aymericr Aymericr commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Follow-up to #1249, addressing the Cursor Bugbot finding Cancel during typed wall entry exits tool, which landed unfixed when #1249 merged.

While a typed wall session is open, a first cancel from any source (Escape, ⌘Z mid-draft, a toolbar cancel) now only clears the typed values. The next cancel drops the draft, and the Wall tool stays armed. Before this change, Escape already behaved this way, but ⌘Z and other cancel sources fell through unconsumed, so the global handler exited to Select and discarded the draft.

  • 3D wall tool (packages/nodes/src/wall/tool.tsx): the first-stage cancel now calls markToolCancelConsumed() before clearing the session, the same way the cabinet tool does.
  • 2D-only plan (floorplan-wall-typing-keys.ts, floorplan-panel.tsx): the plan's tool:cancel handler had the same gap. A new endFloorplanWallTypingOnCancel() keeps the plan's draft. In 2D-only view it also clears the session and consumes the cancel. In split view it leaves both to the 3D wall tool.
  • Docs: the typed-entry convention in wiki/architecture/tools.md now says the first cancel from any source ends typed entry.

There's one known limitation, which predates this PR: in split view, if the 3D tool's cancel listener runs before the plan's, the plan drops its copy of the draft while the 3D draft survives. Fixing it needs the 3D tool to publish a draft signal from the start click. Its chain start is only published after the first segment today, so this is left for a follow-up.

Typed wall length and angle entry is by @dkbbdev (#883, #887), combined in #1249. The fix and its tests are one squashed commit, and the docs are a separate commit; both carry a Co-authored-by trailer.

How to test

  1. bun dev, open a level, and pick the Wall tool in 3D-only view.
  2. Click a start point and type 3. The length HUD appears.
  3. Press ⌘Z (or Ctrl+Z). Expected: the HUD clears, the wall draft is still attached to the pointer, and the tool is still Wall.
  4. Press ⌘Z again. Expected: the draft is cancelled, and the tool is still Wall.
  5. Repeat in 2D-only view. Escape still behaves as before: the first press clears the typing, and the second cancels the draft.

Automated: packages/nodes/src/wall/tool-typed-cancel.test.tsx renders the real line WallTool and drives cancelActiveTool(), the ⌘Z path. Two cases in floorplan-wall-typing-keys.test.tsx cover the 2D-only and split-view plan handler. Both tests fail without the fix and pass with it.

bun run ci passed locally on bebb95fe, exit 0. The later commit changes only docs.

Screenshots / screen recording

N/A. This is a keyboard behaviour fix covered by tests and has no visual change.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch
Open in Web Open in Cursor 

Note

Low Risk
Targeted interaction fix in wall tool cancel handlers with new regression tests; no auth, data, or security surface.

Reviewed by Cursor Bugbot for commit 9236b27. Bugbot is set up for automated code reviews on this repo. Configure here.

Follow-up to #1249. A first cancel from any source (Escape, ⌘Z mid-draft,
a toolbar cancel) while a typed wall session is open now only clears the
typed values; the next cancel drops the draft and the tool stays armed.

- 3D wall tool: consume the first-stage cancel, as the cabinet tool does.
- 2D-only plan: `endFloorplanWallTypingOnCancel` clears the session and
  keeps the plan's draft; in split view it defers to the 3D wall tool.

Regression tests drive `cancelActiveTool()` (the ⌘Z path) through the real
WallTool and the plan's cancel handler.

Addresses Cursor Bugbot finding on #1249 ("Cancel during typed wall entry
exits tool").

Co-authored-by: dkbbdev <dkbbdev@users.noreply.github.com>
@Aymericr Aymericr added the bot:maintainer label Nov 9, 2026 — with Cursor
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T23:23:46.332937Z bebb95f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-authored-by: dkbbdev <dkbbdev@users.noreply.github.com>
@Aymericr
Aymericr merged commit 0b3bbdd into main Nov 9, 2026
4 checks passed
@Aymericr
Aymericr deleted the cursor/wall-typed-cancel-keeps-draft-11c1 branch November 9, 2026 23:34
cursor Bot pushed a commit that referenced this pull request Nov 10, 2026
…ments

Conflicts:
- packages/editor/src/i18n/locales/{en,en-XA}/messages.ts: compiled
  catalogs conflicted on both branches' new messages; regenerated with
  `bun run i18n:extract` rather than hand-merged. `bun run i18n:check`
  passes.

Everything else auto-merged; `bun run ci` covers the files both sides
touched (core/index.ts, floating-action-menu.tsx, en/messages.po).

Co-authored-by: sudhir <sudhir9297@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants