Files
GridSnap/extension.js
Keith Smith ee2f4792ac Refactor _removeLastZone to avoid recreating entire editor
Simplified the _removeLastZone() function to be more efficient:

Before:
- Removed last zone from array
- Destroyed and recreated entire editor interface (_cancelEditor + startEditor)
- Recreated all remaining zones from scratch
- Caused visual flicker and was inefficient
- Could leave dangling event listeners

After:
- Remove last zone from zones array
- Remove and destroy only the last zone actor
- No need to update zone numbers (removing last zone doesn't affect other numbers)
- No editor recreation needed

Benefits:
- No visual flicker
- Much more efficient (O(1) instead of O(n))
- Cleaner code (15 lines vs 50+ lines)
- No risk of dangling event listeners from recreation
- Better user experience

Fixes TODO item #2.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 21:34:36 -07:00

36 KiB