Skip to content

Fable bugfix 090726#699

Merged
lawsie merged 2 commits into
flipcomputing:mainfrom
lawsie:fable-bugfix-090726
Jul 9, 2026
Merged

Fable bugfix 090726#699
lawsie merged 2 commits into
flipcomputing:mainfrom
lawsie:fable-bugfix-090726

Conversation

@lawsie

@lawsie lawsie commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Scanned the repo with Claude Fable while I had access, and it found various bugs. This PR fixes a few of them:

  • Previously, Flock would crash if you pressed F while a gizmo was active
  • If you double clicked the duplicate gizmo, this would toggle it on/off but a duplicate would still be created when it shouldn't (and the cleanup was botched in the background)

Also removed some redundant code from a previous debug session.

Summary by CodeRabbit

  • Bug Fixes
    • Improved gizmo keyboard and canvas interaction reliability.
    • Fixed cleanup for delayed mouse/pick actions when exiting gizmo modes.
    • Hardened block deletion so missing items no longer trigger unnecessary errors or logging.
    • Removed temporary debug output from mesh attachment flows.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21c53745-426a-4c5e-9107-4ca5db52208a

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5ad21 and 414c89d.

📒 Files selected for processing (1)
  • ui/gizmos.js

📝 Walkthrough

Walkthrough

Updates ui/gizmos.js to add timer tracking (activeDuplicatePickTimer, listenerTimer) for canceling deferred click listeners during duplicate placement and canvas picking, cleared on gizmo exit. Simplifies deleteBlockWithUndo's not-found path, adjusts the KeyF keyboard binding, and removes temporary debug logging in attachToMesh.

Changes

Gizmo cleanup and hardening

Layer / File(s) Summary
Duplicate placement timer tracking
ui/gizmos.js
New activeDuplicatePickTimer state is assigned in startDuplicatePlacement in place of an uncaptured setTimeout, and cleared/nulled during exitGizmoState.
Canvas picking listener cleanup
ui/gizmos.js
pickMeshFromCanvas captures its deferred click-listener setup into listenerTimer, cleared during the registered onExit cleanup.
Block deletion and minor cleanups
ui/gizmos.js
deleteBlockWithUndo returns immediately when the target block isn't found (removing prior console logging), the KeyF handler is wrapped in an arrow callback inside noMod(...), and a temporary lock-debug console.log block is removed from attachToMesh.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • flipcomputing/flock#544: Both PRs manage duplicate-placement click/keyboard flow by storing a cancellable in-progress listener and cleaning it up on exit.
  • flipcomputing/flock#561: Both PRs extend exitGizmoState/onExit cleanup patterns to cancel and clear timers/listeners.
  • flipcomputing/flock#615: Both PRs touch the canvas-paint picking flow's onExit cleanup and click-listener/timer teardown.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is generic and date-coded, so it doesn't convey the main change in the patch. Rename it to describe the actual fix, e.g. "Fix gizmo F-key crash and duplicate placement cleanup".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lawsie lawsie merged commit e1035ef into flipcomputing:main Jul 9, 2026
3 checks passed
@lawsie lawsie deleted the fable-bugfix-090726 branch July 9, 2026 15:57
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