Skip to content

Allow right-click edit entry when box display is turned off#1784

Merged
BryonLewis merged 2 commits into
mainfrom
fix/right-click-edit-hidden-layers
Jul 23, 2026
Merged

Allow right-click edit entry when box display is turned off#1784
BryonLewis merged 2 commits into
mainfrom
fix/right-click-edit-hidden-layers

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

Problem

With box display toggled off, right-clicking a detection to enter edit mode stops working (e.g. finalize a polygon, turn off box display, then right-click another detection — nothing happens until boxes are re-enabled).

Cause

Turning off box display called rectAnnotationLayer.disable(), which empties the layer's feature data. That layer's rectangles are the click target covering every detection, and geojs only fires feature mouse events on existing features — so a detection without a polygon had nothing left to right-click.

Fix

When box display is off, the rectangle layer now keeps its features as invisible hit targets: nothing is drawn (no stroke, no fill, no rotation arrow), left-clicks and hover tooltips ignore them, but right-click still enters edit mode. Editing is now reachable regardless of which display types are visible, and a duplicate emit from an overlapping polygon is already deduped by the click handler's same-tick guard.

🤖 Generated with Claude Code

Turning off box display emptied the rectangle layer's features, and
since that layer is the click target covering every detection, a
detection without a polygon had nothing left to right-click: entering
edit mode silently stopped working until boxes were re-enabled.

The rectangle layer now keeps its features as invisible hit targets
when box display is off: nothing is drawn (no stroke, fill, or rotation
arrow), left-clicks and hover tooltips ignore them, but right-click
still enters edit mode for the detection, regardless of which display
types are visible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mattdawkins
mattdawkins requested a review from BryonLewis July 23, 2026 13:03
BryonLewis
BryonLewis previously approved these changes Jul 23, 2026

@BryonLewis BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, did some testing and it resolves the bbox off issues. May have to revisit some stuff in the future regarding overlapping.

Resolve RectangleLayer fill() conflict by keeping both clickTargetsOnly
(invisible hit targets) and main's drawingOther+hasPoly fill suppression.

Co-authored-by: Cursor <cursoragent@cursor.com>
@BryonLewis
BryonLewis merged commit ec0c345 into main Jul 23, 2026
3 checks passed
@BryonLewis
BryonLewis deleted the fix/right-click-edit-hidden-layers branch July 23, 2026 17:14
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.

2 participants