[openstreetmap/openstreetmap-website] Show tag changes in object history view (PR #6448)

Ian Dees notifications at github.com
Sun Oct 19 21:40:10 UTC 2025


@iandees commented on this pull request.



> @@ -72,6 +72,63 @@ def link_follow(object)
     "nofollow" if object.tags.empty?
   end
 
+  # Tag change highlighting methods for history view
+  def tag_changes_for_version(current_version, all_versions)
+    return {} unless current_version && all_versions
+
+    current_tags = current_version.tags || {}
+
+    # Find the previous version by sorting all versions and finding the one before current
+    sorted_versions = all_versions.sort_by(&:version)
+    current_index = sorted_versions.find_index { |v| v.version == current_version.version }
+    previous_version = current_index&.positive? ? sorted_versions[current_index - 1] : nil
+
+    # Don't compare with redacted versions unless we're showing redactions
+    previous_tags = if previous_version && (!previous_version.redacted? || params[:show_redactions])

Yep, definitely. I tried to do this with 3530bce.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6448#discussion_r2443505832
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6448/review/3354682363 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251019/c79f633d/attachment.htm>


More information about the rails-dev mailing list