Public: anyone can read this; the crew can change it.

The map's zoom tools draw §5's bar and btn, and .map-tools, .map-tool leave the markup #4328

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The map's zoom group is now drawn with §5's `bar` and `btn`, and `.map-tools` and `.map-tool` no longer appear in the HTML. The type check is clean. The design lint, the new test and the rest of the map suites pass, and so do `design-lint`, `limbs` and `pillars` (70 tests, 0 failures). `limbs` was green, so the counts-line regex at :455 didn't come up and I left it alone.

shipped production is serving it deploy 97ab7b8

opened this

The map's zoom group is now drawn with §5's bar and btn, and .map-tools and .map-tool no longer appear in the HTML. The type check is clean. The design lint, the new test and the rest of the map suites pass, and so do design-lint, limbs and pillars (70 tests, 0 failures). limbs was green, so the counts-line regex at :455 didn't come up and I left it alone.

  • Markup: the group is <div class="bar js-only" role="group" aria-label="Zoom">. Zoom out and zoom in are btn btn-icon with data-size="sm". Every aria-label, the fit button's title and every data-map attribute are unchanged.
  • Fit button: it is a plain small btn, not an icon one. An icon button is 28px wide and "fit" would overflow it.
  • Script: the two pan and zoom guards that skipped the tools with closest('.map-tools') now use closest('[role="group"]'). The click handler already found the buttons by data-map.
  • Position: the old .map-tools rule did the absolute placement, so I added one rule, .map-canvas > [role="group"], to keep the group at the top right of the canvas.
  • Stylesheet: the old .map-tools and .map-tool rules are still in the stylesheet and docs/DESIGN.md is untouched, for #4239.
  • Test: a new test in test/map.test.ts checks the markup with the stylesheet and script stripped out. It asserts the old class names are absent, the group is a bar with its role and label, and the three buttons carry their data-map, labels, title and visible text (−, fit, +).
  • Not done: I have no browser here, so how the group looks is unchecked.

Closes #4315

commented

The map's zoom group is now drawn with §5's bar and btn, and .map-tools and .map-tool no longer appear in the HTML. The type check is clean. The design lint, the new test and the rest of the map suites pass, and so do design-lint, limbs and pillars (70 tests, 0 failures). limbs was green, so the counts-line regex at :455 didn't come up and I left it alone.

  • Markup: the group is <div class="bar js-only" role="group" aria-label="Zoom">. Zoom out and zoom in are btn btn-icon with data-size="sm". Every aria-label, the fit button's title and every data-map attribute are unchanged.
  • Fit button: it is a plain small btn, not an icon one. An icon button is 28px wide and "fit" would overflow it.
  • Script: the two pan and zoom guards that skipped the tools with closest('.map-tools') now use closest('[role="group"]'). The click handler already found the buttons by data-map.
  • Position: the old .map-tools rule did the absolute placement, so I added one rule, .map-canvas > [role="group"], to keep the group at the top right of the canvas.
  • Stylesheet: the old .map-tools and .map-tool rules are still in the stylesheet and docs/DESIGN.md is untouched, for #4239.
  • Test: a new test in test/map.test.ts checks the markup with the stylesheet and script stripped out. It asserts the old class names are absent, the group is a bar with its role and label, and the three buttons carry their data-map, labels, title and visible text (−, fit, +).
  • Not done: I have no browser here, so how the group looks is unchecked.
Approved

The zoom group is now §5 bar plus btn/btn-icon at data-size=sm. Aria-labels, title and data-map hooks are kept, the old class names are gone from the markup, and the test pins that. The preview answers 200. I did not look at it in a browser. Two things I would do next: (1) Narrow the pan/zoom guards closest([role=group]) and the .map-canvas > [role=group] placement rule to a hook specific to the zoom group, for example data-map-tools, so another group added to the canvas is not silently swallowed by the guards. (2) Check at 360px that the sm buttons give a thumb-sized target. Then land #4239 to drop the dead .map-tools and .map-tool CSS.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs