-
-
Notifications
You must be signed in to change notification settings - Fork 4
Fix: changing node type to "Climbing Area" — HTTP 500, wrong tags, broken re-detection #54
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
..., correct preset detection
- Add `climbing/area` node preset in ourPresets.ts with tags {climbing:'area'} and
addTags {climbing:'area', sport:'climbing'} — valid for nodes only
- Remove `type/site/climbing/area` geometry.push('point') hack; the relation preset
now stays relation-only so its type=site / site=climbing tags are never applied to nodes
- Replace 'type/site/climbing/area' with 'climbing/area' in EMPTY_OPTIONS (useOptions.tsx)
so the correct node preset is shown in the preset-change dropdown
- Deduplicate tags in PresetMenu.tsx: filter `prev` entries whose key is in `toAdd`,
preventing duplicate sport=climbing (which caused HTTP 500 on OSM API save)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes several issues when switching a node’s preset to "Climbing Area" in the edit dialog by introducing a node-specific preset, correcting the preset key used in the dropdown defaults, and preventing duplicate tags during preset changes.
Changes:
- Add a dedicated node preset
climbing/area(with node-valid tags) and translation sofindPresetcan re-detect it correctly. - Update preset dropdown defaults for openclimbing to use
climbing/areainstead of the relation preset key. - Prevent duplicate tag keys when applying a new preset’s
addTags/tags, avoiding invalid duplicate entries (e.g.,sport=climbingtwice).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/services/tagging/ourPresets.ts |
Adds a node-only climbing/area preset (and translation) and injects it into the preset set; removes the prior "relation preset geometry hack". |
src/components/FeaturePanel/EditDialog/EditContent/FeatureEditSection/PresetSelect/useOptions.tsx |
Updates openclimbing’s empty preset options to reference the new climbing/area preset key. |
src/components/FeaturePanel/EditDialog/EditContent/FeatureEditSection/PresetSelect/PresetMenu.tsx |
Deduplicates existing tags by key when switching presets to prevent duplicate tag entries on save. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Uh oh!
There was an error while loading. Please reload this page.
Three bugs when selecting "Climbing Area" from PresetSelect on a node: duplicate
sport=climbingcaused HTTP 500 on OSM API save; relation-only tagstype=site/site=climbingwere applied to nodes; and re-opening the saved node showed "Select the type" becausefindPresetcouldn't match it (the relation preset requirestype=sitewhich nodes never have).Changes
ourPresets.ts— add a dedicatedclimbing/areanode preset:tags: { climbing: 'area' }— matchable byfindPreseton nodes (fixes re-detection)addTags: { climbing: 'area', sport: 'climbing' }— notype=site/site=climbing(fixes wrong tags)geometry: ['point']type/site/climbing/area.geometry.push('point')hack that was leaking the relation preset into node editinguseOptions.tsx— replace'type/site/climbing/area'with'climbing/area'inEMPTY_OPTIONSso the correct node preset appears in the dropdownPresetMenu.tsx— deduplicate tags on preset change: any key already intoAddis now stripped fromprevbefore merging, preventing the duplicatesport=climbingthat caused the 500:Screenshots
Before fix (node shows "Select the type" after save):
Checklist