[openstreetmap/openstreetmap-website] Add a page to change legacy trace visibility in bulk (PR #7368)

Ruben L. Mendoza notifications at github.com
Mon Sep 7 19:09:39 UTC 2026


From: #7321

This picks up #7324. I asked the author if they were still working on it, but there has been no reply, and the review comments are still open and now two weeks old. Moving traces off the old `private` and `public` visibilities is a priority for the GPS traces work, so I started again from master.


I took the existing PR as a starting point and updated it following the review comments. The page is now reachable from a "My Legacy Traces" tab, which only shows while the user still has legacy traces. Here is how it looks:

- The tab

<img width="964" height="224" alt="Screenshot 2026-09-03 at 3 09 47 PM" src="https://github.com/user-attachments/assets/bb35671d-0e83-4ee2-bdde-c2fdedb22827" />

- The page, with the filter by visibility and upload date

<img width="991" height="703" alt="Screenshot 2026-09-03 at 3 10 21 PM" src="https://github.com/user-attachments/assets/33a6170d-3398-47b9-8b10-35a3b1dfdba8" />

- The confirmation before the change

<img width="543" height="217" alt="image" src="https://github.com/user-attachments/assets/cc3000ed-8779-4973-a677-ac4fad490873" />



The only comment I did not apply is
[this suggestion](https://github.com/openstreetmap/openstreetmap-website/pull/7324#discussion_r3843092734) from @pablobm. 

I tried this, but it drops the last day. The filter gives a `Date` and `gpx_files.timestamp` is a `timestamp without time zone`, so the database reads the date as midnight:

```sql
-- ..filter_to
WHERE "gpx_files"."timestamp" <= '2026-09-03'  -- 00:00:00
```
A trace uploaded at  in other hours, e.g: 14:32 that day does not match. I kept ...(to + 1), which cuts at midnight of the next day and covers the full day, and added a test so it stays that way.

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/7368

-- Commit Summary --

  * Allow the traces page partial to be rendered from other controllers
  * Add a page to change the visibility of legacy traces
  * Link to the legacy traces page from the trace list

-- File Changes --

    A app/controllers/traces/legacy_visibilities_controller.rb (77)
    M app/controllers/traces_controller.rb (1)
    M app/helpers/trace_helper.rb (16)
    M app/views/traces/_page.html.erb (9)
    M app/views/traces/index.html.erb (5)
    A app/views/traces/legacy_visibilities/edit.html.erb (73)
    M config/locales/en.yml (29)
    M config/routes.rb (1)
    A test/controllers/traces/legacy_visibilities_controller_test.rb (160)
    M test/controllers/traces_controller_test.rb (18)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/7368.patch
https://github.com/openstreetmap/openstreetmap-website/pull/7368.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/7368 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260907/0b68e195/attachment-0001.htm>


More information about the rails-dev mailing list