Repository navigation
Keep the selection outline while dragging and zooming the map - #112
Merged
Merged
Conversation
The selected realm's rim and brightening are a CSS filter that stood down for the whole of any drag or zoom, so the realm lost its border and dimmed until the map settled. Measured on the live site, keeping it costs nothing on a drag and showed no frame-time difference on a zoom, so it now stays up. Mid-gesture the scale runs ahead of React, so the viewport writes the live scale into --map-rim-scale on each highlighted element and the rim keeps its on-screen width through a zoom instead of growing and snapping back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dragging or zooming the map with a realm selected removed its white outline and the slight brightening until the map settled. A CSS rule (
[data-gesturing] .map-selected-region { filter: none }) turned the highlight filter off for the whole of every gesture, because the filter was assumed too costly to redraw each frame.Change
data-gesturingattribute that only existed to drive it. The selection and hover highlights now stay up through drags and zooms.calc(rimPx / var(--map-rim-scale)). React sets--map-rim-scaleto the settled scale. Mid-gesture the transform runs ahead of React, soonLiveTransformwrites the live scale onto each.map-selected-region, and the rim keeps its on-screen width through a pinch or wheel zoom instead of growing or shrinking and then snapping back. React writes the same value once the gesture commits.mapFiltersSupportedHere).Measurements (headless Chromium against tfminecraft.net, 1440×900)
will-change: transformwas worse.Checks
tsc --noEmitpasses.vitest run: 1,948 tests pass.RecipeVehiclePreview.test.tsxtimed out once under load and passes alone.🤖 Generated with Claude Code