Skip to content

fix(canvas): draw the frame size badge above neighbouring frames - #460

Merged
kgoedecke merged 3 commits into
mainfrom
kgoedecke/fix-frame-size-badge
Nov 9, 2026
Merged

kgoedecke merged 3 commits into
mainfrom
kgoedecke/fix-frame-size-badge

Conversation

@kgoedecke

Copy link
Copy Markdown
Collaborator

The selected frame's W × H badge lives in a screen-space layer (FrameLabelLayer) that was mounted before the zoomed world, so any frame overlapping its spot (common when zoomed out) painted over it.

The layer now mounts after the world and the pixel grid, below the rulers, so the badge is always on top of frames.

Tests: typecheck, frameResizeBrowser.test.ts.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change affects only how the canvas draws a selected frame’s size badge.

The change appears safe to merge, with a non-blocking request to test the badge above an overlapping frame.

Findings

  1. P2 Badge stacking goes untested ▶

Summary

Moves the selected frame's size badge above the world and pixel grid, while keeping it below the rulers.

  • The selected frame’s size badge stays above neighbouring frames.

Reviews (1) · Last reviewed commit: "fix(canvas): draw the frame size badge a..." · Reviewed by Greptile

Comment thread src/components/Stage.tsx
Comment on lines +1218 to +1220
{/* the selected frame's size badge, in screen px (FrameLabelLayer); after
the world so no frame, however it stacks, covers it */}
<div className="pointer-events-none absolute inset-0" ref={setLabelLayer} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge stacking goes untested

frameResizeBrowser.test.ts uses a separate fixture that still places its label layer before the world. It only checks the badge's text, so it passes with either version of this change and cannot catch the badge being hidden again.

Add a browser test that mounts Stage with a neighboring frame overlapping the selected frame's badge. Check that the badge paints above that frame at a zoomed-out level.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added tests/frameSizeBadgeBrowser.test.ts: it mounts the real Stage (rulers fixture) at 25% with a second frame under the selected one's badge, and checks the badge is the topmost element at its centre with a frame underneath. It fails against the previous Stage.tsx and passes with this change.

kgoedecke and others added 2 commits November 8, 2026 17:32
…frame

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ize-badge

# Conflicts:
#	src/components/Stage.tsx
@kgoedecke
kgoedecke merged commit 9e5b041 into main Nov 9, 2026
9 checks passed
kgoedecke added a commit that referenced this pull request Nov 16, 2026
Design tokens, prototypes, page backgrounds, version restores, Figma
imports, every export and Copy as PNG, rich text formatting and SVG / PDF
imports sent no events. Features agents can reach now report from the
server at the route, MCP tool and resident tool, on the person the work
belongs to and with where it came from, so agent use is counted too. The
browser-only ones capture with posthog-js, and every export, whichever
control started it, lands as one frames_exported with its source.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 78d0c3acb78dcb5010727afb93921c5e63e62137)
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