Skip to content

0.1.0-beta.20: pin another feature's card in place - #37

Merged
alexandermccormick merged 15 commits into
mainfrom
feat/pin-in-place
Nov 17, 2026
Merged

alexandermccormick merged 15 commits into
mainfrom
feat/pin-in-place

Conversation

@alexandermccormick

Copy link
Copy Markdown
Member

0.1.0-beta.20: a host can open another feature's card in place from a button inside a pinned card, with no camera pan and without releasing a held lens. Also: a hover lens's section card shows its tooltip body, legendDisplay on shapes, and the legend's unavailable row.

Spec: docs/superpowers/specs/2026-11-17-pin-in-place-design.md (with its addenda). Plan: docs/superpowers/plans/2026-11-17-pin-in-place.md.

New API

  • MapContext.pin(pluginId, refKey): boolean pins a listed feature's card from host code (a section card's "In township"). It replaces the open card and stays exactly where that card was when that point lies on the new feature's shape (pinned.inPlace); otherwise it goes to the feature's point in view. No camera move, no list focus, no selection change, no featureclick. Returns false while card is off, for a plugin not on the map or with hoverable: false, or for an unlisted feature. Pinning the feature already pinned changes nothing.
  • MapPlugin.itemFor(refKey) (optional): the item for a feature a plugin draws but doesn't list. shapesLens sets it.
  • legendDisplay?: "gradient" | "blocks" on shapesPlugin and shapesLens, as on pointsPlugin.
  • DataStatus unavailable gains an optional, already-translated message. New message key mapsdk_unavailable_line.

Behaviour

  • shapesLens: a hover lens held by a section's or notice's card stays held when the card is swapped for its centre township's, for as long as that card is open. A township's card pinned any other way (list focus, a tap) still doesn't hold it.
  • shapesLens: a drawn section's tooltip and pinned card show the lens's tooltip body under a hover lens too (until beta.19, only the name and the card's actions). They sit at the section's point in view, as a listed shape's do. The list still lists sections only while the lens is pinned.
  • The card:
    • When a click or key inside the card swaps it, focus moves to the card itself, labelled with the new name and drawn with a focus ring. The card is focusable only for that moment. Close and Esc still hand focus back to where it was before the card.
    • A pin from elsewhere, or after an await, leaves focus alone.
    • A card kept in place goes to its feature's point in view once a pan takes that place out of view.
  • The legend's unavailable row: the layer's name as a heading, then the source's message or "Isn't available right now", then the plugin's legendNote (hidden until now). Every unavailable row gains the heading; error rows are unchanged.

Hosts that set nothing see no change, apart from the legend's new heading on unavailable rows.

Checks

  • check, lint, npm test (1307), test:bundle, test:licenses, and e2e on Chromium and Firefox (86) pass locally.
  • The browser project passed 5 runs in a row on two cores (taskset -c 0,1).
  • Two fresh whole-branch reviews; their findings are fixed.
  • One older lens hover test ("hover raises the lens; moving into a neighbour's section recentres…") failed once under a full parallel run, then passed in every later run. It never opens a card.

@alexandermccormick
alexandermccormick merged commit c378832 into main Nov 17, 2026
1 check passed
@alexandermccormick
alexandermccormick deleted the feat/pin-in-place branch November 17, 2026 21:58
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