Skip to content

Previous piece works on a closed circuit with nothing selected - #195

Merged
jiro-by-nori[bot] merged 1 commit into
mainfrom
fix/previous-piece-on-circuit
Nov 2, 2026
Merged

jiro-by-nori[bot] merged 1 commit into
mainfrom
fix/previous-piece-on-circuit

Conversation

@jiro-by-nori

@jiro-by-nori jiro-by-nori Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

🤖 Generated with Nori

  • Fixes a bug found while verifying Edit coaster track from a selected piece #194 on opencoaster.noriagentic.com. With nothing selected, Previous piece did nothing on a closed circuit. The lookup for "the last piece built" skipped every piece that had a next piece, and in a ring that is every piece.
  • With nothing selected, Previous now selects the last piece built (the same piece Demolish last piece removes), on unfinished track and on circuits alike.

Test Plan

  • Added to e2e/track-edit-selection.spec.ts: after rebuilding the circuit, press Previous piece and expect Selected piece 7 of 14 (the piece that closed the gap), then Track end. This failed before the fix and passes after it.
  • All 8 track-edit e2e combinations pass (WebGL2 and Canvas2D, desktop and Pixel 8).
  • typecheck, lint, prettier and src/ui unit tests pass.

Requested in Nori: https://demo.norisessions.com/chat/01a16c13-c814-7295-9955-b11ff875ed14

Share Nori with your team: https://www.npmjs.com/package/nori-skillsets

@jiro-by-nori
jiro-by-nori Bot merged commit 7c5857f into main Nov 2, 2026
1 check passed
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.

0 participants