Skip to content

fix(render_map_tool): keep zoom buttons below the summary chip when it wraps - #326

Open
mattpodwysocki wants to merge 2 commits into
mainfrom
fix/summary-chip-covers-zoom
Open

mattpodwysocki wants to merge 2 commits into
mainfrom
fix/summary-chip-covers-zoom

Conversation

@mattpodwysocki

Copy link
Copy Markdown
Contributor

Fixes #307.

Why

#278 (in 0.17.0) moved the zoom and layer buttons below the summary chip when it appears, which fixed the original report. But it measured the chip only at that moment. If a host narrows the frame or switches display mode afterwards, the chip wraps to more lines and covers the buttons again.

What

A ResizeObserver on the chip re-runs the existing placeTopLeftControls() whenever the chip changes size. Browsers without ResizeObserver keep today's behavior.

Checked

I rendered the map page in Chrome inside a host-style iframe with a longer route summary, then narrowed the iframe after the map was drawn:

Frame width Chip ends at + button on main Click on + (main) + button with this PR Click on + (this PR)
520 px 58 px 64–96 px button 64–96 px button
260 px 73 px 64–96 px (top 9 px covered) button 79–111 px button
200 px 103 px 64–96 px (fully covered) the chip 109–141 px button

Widening back to 520 px moves the buttons back up to 64 px.

  • New unit test: the chip grows from two lines to four, and the controls follow it. It fails on main (42px instead of 87px) and passes with this change.
  • Full suite and lint: pass (1,249 tests).

🤖 Generated with Claude Code

…t wraps

#278 placed the top-left controls below the chip when it appeared, but
measured the chip only once. If the host narrowed the frame afterwards,
the chip wrapped to more lines and covered the zoom buttons again. A
ResizeObserver on the chip now re-places them whenever its size changes.

Fixes #307

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattpodwysocki
mattpodwysocki requested a review from a team as a code owner November 6, 2026 18:23
@mattpodwysocki mattpodwysocki added the bug Something isn't working label Nov 6, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The summary chip covers the zoom controls in the map app.

2 participants