koala73 / koala73/worldmonitor

Resize/orientation change does not re-thin mobile map labels before first interaction

Open
#4,547 1 comment 0 reactions 0 assignees View on GitHub
bug P2 performance
Dominant language
TypeScript
Stars
86.6k
Forks
13.1k
Avg merge
8h 4m
Merged PRs (30d)
825

Description

Follow-up from the adversarial review of #4541 (closes #4463).

## Summary
On mobile, label-overlap thinning is gated by `mobileLabelVisibilityArmed` until the first direct interaction (`src/components/Map.ts:3921` gate; flag set false at line 219 via `!this.isMobile`). A resize / orientation-change that re-renders overlays (`ResizeObserver` ~lines 297-311, resize handler ~330-332) runs `applyTransform()` but skips `updateLabelVisibility` while the flag is still disarmed.

## Failure scenario
If a mobile user rotates the device or the viewport changes size *before* touching the bare map, overlays re-layout but labels are not re-thinned, leaving stale overlap until the first map-body interaction.

## Notes / suggested fix
Lower priority than the zoom-control arming gap (already fixed in the #4541 follow-up). Options:
- Re-thin on resize once the map has been armed, or
- Treat the first post-layout paint as an arming trigger if a layout actually changed.

Keep the first-paint deferral intact for the initial load (the whole point of the optimization) — only re-thin on *subsequent* layout changes.

## Verification status
PARTIAL — mechanism reproduces in the real code; impact is minor (pre-interaction window only).

_Severity: low_

Contributor guide

Open the contributing guide

Research direction

Start in src/components/Map.ts at the mobileLabelVisibilityArmed gate around line 3921, the flag initialization near line 219, and the ResizeObserver and resize-handler paths around lines 297-332. Reproduce a resize or orientation change before direct map interaction and verify that subsequent layout changes re-thin overlapping labels while initial-load deferral remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.