Skip to content

Long-press + flyout: line, rectangle, circle geometry tools#11

Draft
tordans wants to merge 2 commits into
masterfrom
cursor/geometry-flyout-plus-4108
Draft

Long-press + flyout: line, rectangle, circle geometry tools#11
tordans wants to merge 2 commits into
masterfrom
cursor/geometry-flyout-plus-4108

Conversation

@tordans
Copy link
Copy Markdown
Owner

@tordans tordans commented May 31, 2026

Problem

As a mapper, I want a long-press on the + toolbar control to offer Line, Rectangle, and Circle so I can start structured ways/areas without only dropping isolated nodes.

As a mapper, when a point uses a generic preset with a wildcard tag (e.g. playground=* + playground=excavator), I want the localized type label from the preset field strings (e.g. „Spielbagger“) in the map pushpin tooltip—not only the generic preset name (e.g. „Spielplatzgerät“).

Implementation notes (by Cursor)

Geometry flyout

  • Long-press + ≥0.5s → action sheet; short press unchanged.
  • Line mode reuses extendSelectedWay; rectangle/circle use GeometryDrawMath + dashed preview.
  • Cancel via object selection or Undo.

Kind / type labels

  • PresetFeature.localizedKindLabel(for:) resolves wildcard preset tags via field strings options (first matching field in preset order).
  • Used in friendlyDescription() (pushpin, voice, pickers) and POI Type row (PresetDisplayForFeature).
  • Falls back to preset name when no strings entry exists.

Testing notes (by @tordans)

Geometry

  1. Short tap + — unchanged.
  2. Long-press + → sheet; Cancel OK.
  3. Line / rectangle / circle flows; Undo; portrait + landscape.
  4. Cancel mid-flow — no stuck preview.

Kind labels
5. playground=excavator (DE): pushpin shows „Spielbagger“, not „Spielplatzgerät“.
6. Tag without strings option — generic preset name unchanged.
7. Named POI — name still wins (existing rule).

Open in Web Open in Cursor 

cursoragent and others added 2 commits May 31, 2026 13:21
Long-press the map toolbar + button (≥0.5s) to open an action sheet with
Line, Rectangle, and Circle tools. Short press behavior is unchanged.

Each tool enters a dedicated map edit mode with rubber-band preview tied
to the crosshair. Rectangle and circle math live in GeometryDrawMath with
unit tests. Line mode reuses extendSelectedWay via successive crosshair taps.

Co-authored-by: Tobias <t@tobiasjordans.de>
When a matched preset uses a wildcard tag (e.g. playground=*) and the object
has a concrete value, use the field strings option title (Spielbagger for
playground=excavator in German) for pushpin tooltips, friendlyDescription,
and the POI Type row. Falls back to preset name when no strings entry exists.

Co-authored-by: Tobias <t@tobiasjordans.de>
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.

2 participants