Skip to content

Stop the map holding a 200 px level over the sharp one - #119

Merged
ryanbarlow97 merged 1 commit into
mainfrom
movement-map-sharp
Oct 8, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
movement-map-sharp

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

The movement map (and any TileLayer) could open blurry and stay that way until the next zoom. #115 didn't fix it because it wasn't the animation.

Cause. When the tile manifest is already cached (coming back to the Movement tab, for example), TileLayer renders before its viewport is measured. It sees scale 0, picks level 0 (200 px) and records it as settledLevel. Once the viewport is measured, the whole-map view wants level 2. Level 2 is also the backdrop, so there are no "current" tiles, and currentShown can never become true. The settled level was therefore never updated, and the 200 px level stayed held on top of the 800 px backdrop.

Fix.

  • At the backdrop's level, the level settles once the backdrop has loaded.
  • A held level that is coarser than the backdrop stands down as soon as the backdrop has loaded.

Checks.

  • New test: render at scale 0, then at the whole-map scale. Without the fix, level 0 stays visible.
  • Updated test: zooming out to an already-loaded backdrop now drops the sharper held tiles straight away rather than holding them indefinitely.
  • vitest run: 1971 passed. tsc --noEmit is clean.
  • Headless Chromium against the live tiles, opening Movement, then Players, then Movement. Before the fix, a level-0 tile was visible over the 16 level-2 tiles, matching the report. After the fix, only level 2 is visible.

🤖 Generated with Claude Code

A tile layer that rendered before its viewport was measured (a cached
manifest, so on coming back to the movement map) saw scale 0 and settled
on level 0. Once measured, the level it wanted was the backdrop, which has
no sharp tiles to wait for, so the settled level never moved on and the
200 px level stayed held on top of the 800 px backdrop until a zoom.

The backdrop's level now settles once the backdrop has loaded, and a held
level coarser than the backdrop stands down as soon as the backdrop is in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 632bd60e-0f04-485a-aec0-39b02de1eb4e
📥 Commits

Reviewing files that changed from the base of the PR and between a687876 and dd2733e.

📒 Files selected for processing (2)
  • frontend/app/components/map/TileLayer.test.tsx
  • frontend/app/components/map/TileLayer.tsx
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ryanbarlow97
ryanbarlow97 merged commit 48b7036 into main Oct 8, 2026
2 checks passed
@ryanbarlow97
ryanbarlow97 deleted the movement-map-sharp branch October 8, 2026 10:34
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