Replace preview_edit links with GeoJSON fenced blocks in coordinate proposed edits#2762
Conversation
…inate edits Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the server-side proposed-edits GitHub description generation for coordinate changes to embed GeoJSON directly in Markdown, replacing the previous preview URL approach, so GitHub can render interactive maps natively.
Changes:
- Coordinate proposed edits now produce a pretty-printed GeoJSON
Featurewrapped in ageojsonfenced code block. - Added a new description rendering path (
apply_set_as_blocks) to emit edits as Markdown blocks (instead of tables) for categories that need fenced blocks. - Routed coordinate edits through the new block rendering path while keeping image edits on the existing table rendering path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server/src/routes/feedback/proposed_edits/coordinate.rs | Replaces preview URL output with a GeoJSON Feature fenced in ```geojson for coordinate edits. |
| server/src/routes/feedback/proposed_edits/description.rs | Adds apply_set_as_blocks() to render edits as Markdown block/list output suitable for fenced code blocks, plus unit tests. |
| server/src/routes/feedback/proposed_edits/tmp_repo.rs | Switches coordinate edits to use apply_set_as_blocks() while leaving image edits on the table path. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot test_apply_set_as_blocks is failing. |
Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
Head branch was pushed to by a user without write access
Fixed in 8f57a8e. The test was asserting the old format (no blank line, no indentation). The |
Coordinate proposed-edit feedback was generating
https://nav.tum.de/api/preview_edit/...links in PR descriptions. This replaces them with inlinegeojsonfenced code blocks that GitHub renders natively as interactive maps.Proposed Change(s)
coordinate.rs—Coordinate::apply()now returns a pretty-printed RFC 7946 GeoJSONFeaturewrapped in a```geojsonfenced block instead of a preview URL:{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [11.668, 48.262] }, "properties": { "kind": "coordinate-change", "id": "mi", "to_lat": 48.262, "to_lon": 11.668 } }description.rs— Newapply_set_as_blocks()method renders edits as a bullet list where each block result is emitted with a blank line and 4-space indentation, so fenced code blocks are correctly nested under the list item in GitHub-flavored Markdown. Existingappply_set()table method is unchanged — image submissions continue to use it.tmp_repo.rs— Routes coordinate edits throughapply_set_as_blocks()and image edits throughappply_set().Checklist
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.