Skip to content

Conversation

@rene78
Copy link

@rene78 rene78 commented Jan 4, 2022

Hey @tyrasd,
some more minor changes:

  • Tag comparison table opens when clicking on element (similar to achavi). To be discussed if the link to achavi is still needed or not.
    image
  • Button to download changesets instead of automatic download on pan and zoom. The long waiting times and frequent timeouts when querying overpass lead to a bad experience. With a button it is much better in my opinion.
    image
  • Vandalism Checker: Simple sanity checker for all the downloaded changesets. It summarizes all elements and tags which have been added or deleted in the changeset. If the sum is below a certain treshold (currently -3) then a traffic light changes to red to alert the users of latest-changes about this changeset. Ideas on how to improve the algorithm for this checker are welcome.
    Unbenannt
  • Button to zoom to changeset (this automatically activates the checkbox to stop automatic changeset downloads)
    Unbenannt
  • Button to toggle display of sidebar
    Unbenannt
  • Meta tags for sharing in social media (pic links go to rene78's version of repo. After merge this should be changed to tyrasd)
  • Loading animation during overpass query
    image
  • Highlight changeset on map when hovering over it in sidebar. Tooltip added.
  • Link to https://github.com/tyrasd/latest-changes when clicking on clock
  • "Scroll to top" button added to changesets sidebar. Button appears only after scrolling down a bit in the list.
    Unbenannt
  • Highlighting color changed to blue for people suffering from deuteranopia (see discussion)
    latest-changes-optimized-colors
  • Changesets with comments get a speech bubble symbol
    Unbenannt
  • Right mouse button opens context menu to load current map location in either OSM or Google Maps
    image

@rene78 rene78 changed the title Button to hide sidebar & details Button to hide sidebar & stop download tickbox & details May 19, 2022
rene78 and others added 30 commits July 26, 2025 20:38
.changeset-table width 100%
Code cleanup
3rd API call to get extended user data (total number of edits & sign-up date) implemented.
A race condition could occur if the user interacted with the changeset list immediately after clicking "Get Changesets" for a new location.

The Problem:
1.  The `run()` function would clear the `changesets` object in memory.
2.  However, the old UI list remained visible for a moment until the first API call returned.
3.  If a `mouseover` event fired on a stale list item during this window, the `click()` handler would be called with old data.
4.  This would pollute the new (and mostly empty) `changesets` object with a `highlightedChangeset` ID from the previous dataset.
5.  The next interaction with the new, fully-loaded list would then cause a `TypeError` when trying to access this non-existent changeset ID.

The Solution:
This commit moves the clearing of the results list (`d3.select('#results').html("")`) to the very beginning of the `run()` function.

By immediately removing the stale UI, we close the window for any user-triggered events on old data, thus preventing the race condition.
'Latest Changes' --> 'OSM Latest Changes'
Closes #3

The application would occasionally crash with an "Invalid LatLng object:
(NaN, NaN)" error when rendering changesets.

This was caused by a rare edge case in the Overpass `adiff` output that I do not fully understand which resulted in `osmtogeojson` generating GeoJSON
features with `null` values in their coordinate arrays.

This commit resolves the issue by adding a filter that sanitizes the
`allGeojsonFeatures` array before it is passed to Leaflet. Any feature
containing `null` values within its coordinate structure is now safely
discarded, preventing Leaflet from attempting to render invalid geometry
and crashing the application.
- Currently '//overpass-api.de/api/' runs into a lot of 504 errors. Thus changed to '//overpass.private.coffee/api/' in the hope that this instance works better.
- Ensures long text, such as URLs, in table cells wraps correctly to prevent horizontal overflow.
- Expands the changeset highlighting  to cover the entire '.result' list element for better visibility.
Added a 4th API call sequence to load comments for changesets with activity.
Since the OSM API requires fetching discussions individually:
1. Implemented a sequential async loop to avoid 429 Rate Limit errors.
2. Added AbortSignal integration to cancel pending fetches if the map is refreshed.
stop using the outdated /browse path
- Update `createTable` to link keys and values to the OSM Wiki (optimistic linking).
- Add logic to prevent Wiki linking for numeric values and free-text fields (e.g., names, refs).
- Add `linkify` and `escapeHtml` helper functions to convert text URLs into clickable `<a>` tags.
- Update `website`, `contact:website`, and similar keys to auto-prepend `http://` if the protocol is missing.
- Enable clickable URLs in changeset comments, discussion comments, and free-text tags (e.g., `note`, `description`).
- Skip Wiki linking for 'mobile'
- Add html 'title' tag for wiki links
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.

4 participants