[openstreetmap/openstreetmap-website] Activity indexes (PR #5747)

2025-03-03 Thread Emin Kocan via rails-dev
### Description This PR adds database indexes to improve query performance for the user activity feature as part of #5298. Specifically, it adds concurrent indexes on: - `gpx_files` table: `[user_id, timestamp]` index to optimize retrieval of user's GPS trace uploads - `notes` table: `[user_id,

Re: [openstreetmap/openstreetmap-website] Add date indexes on gpx_files and notes tables (PR #5747)

2025-03-05 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. 363e18165322b926ab5979ebdb0a1f6f8318b980 Add index on gpx_files.user_id and timestamp e57e5fc0cd34dfa318028b16cfe86726fba3385a Add index on notes.user_id and created_at -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5747/files/1f91bd

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-03-09 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. affa5257d62fef356828f0cd27ac3de5ccca9ac1 Add heatmap data caching and query for user contributions 356192f445bb253e60908292ba87f8abe3db96ff Add tests for heatmap data in UsersController -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-03-09 Thread Emin Kocan via rails-dev
@kcne commented on this pull request. > + + let cal = new CalHeatmap(); + let currentTheme = getTheme(); + + function renderHeatmap() { +cal.destroy(); +cal = new CalHeatmap(); + +cal.paint({ + itemSelector: "#cal-heatmap", + theme: currentTheme, + domain: { +

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-03-09 Thread Emin Kocan via rails-dev
@kcne commented on this pull request. > @@ -0,0 +1,102 @@ +//= link cal-heatmap/dist/cal-heatmap.css I’m not sure if we changed anything in the assets pipeline recently, but when I ran the code today, I kept getting errors about the missing `.css` file, even after compiling the assets. I got

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-03-10 Thread Emin Kocan via rails-dev
@kcne commented on this pull request. > @@ -0,0 +1,102 @@ +//= link cal-heatmap/dist/cal-heatmap.css Thanks for the feedback, Tom. Since the code inside `common.scss` was unnecessary, I removed it completely, linked the `.css` file to `manifest.js`, and included it in the view directly. Let m

Re: [openstreetmap/openstreetmap-website] Implement Balanced Full-Text Search for Diary Entries (PR #5156)

2025-03-10 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5156) Closing as not planned. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5156#issuecomment-2712115948 You are receiving this because you are subscribed to this thread.

Re: [openstreetmap/openstreetmap-website] Implement Balanced Full-Text Search for Diary Entries (PR #5156)

2025-03-10 Thread Emin Kocan via rails-dev
Closed #5156. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5156#event-16663113113 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev mailing

Re: [openstreetmap/openstreetmap-website] Add date indexes on gpx_files and notes tables (PR #5747)

2025-03-11 Thread Emin Kocan via rails-dev
@kcne commented on this pull request. > @@ -0,0 +1,7 @@ +class AddGpxFilesUserIdTimestampIndex < ActiveRecord::Migration[7.2] + disable_ddl_transaction! + + def change +add_index :gpx_files, [:user_id, :timestamp], :algorithm => :concurrently Very smart work around to be honest, would nev

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-03-11 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. 9a23dfc07cdc90f1eebbc876312b6b5f82ef508a Add heatmap data caching and query for user contributions 9be4b0f8b38141631bc1fd82552c341d90ec8b52 Add tests for heatmap data in UsersController -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-02-28 Thread Emin Kocan via rails-dev
@kcne commented on this pull request. > @@ -0,0 +1,100 @@ +//= require d3/dist/d3 +//= require cal-heatmap/dist/cal-heatmap +//= require popper This import is the same as the one inside `application.js` and was not introduced in this PR. It's provided by the [popper_js gem](https://github.com

Re: [openstreetmap/openstreetmap-website] Contribution activity on user page (Issue #5298)

2025-02-27 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5298) I've successfully implemented this locally and plan to start opening PRs for this soon. The implementation will be completed in stages, with the following plan: 1. Add new indexes to activity-related tables to optimize query perfo

Re: [openstreetmap/openstreetmap-website] Add UserActivities module for structured user activity history (PR #5761)

2025-03-12 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. bdfc3cfb953c65181365c005460c89f3daba7d85 Add UserActivities module for structured user activity history 7f06966ce61fe2f4718f79f5d1745f8b41548a9c Add tests for UserActivities module -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5761/f

Re: [openstreetmap/openstreetmap-website] Add UserActivities module for structured user activity history (PR #5761)

2025-03-12 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. b566bd65f0b0ff5eb7adcad77516b24b756b194b Add UserActivities module for structured user activity history 4927b1d62cebaa247e0708f5d708c8b99dddc353 Add tests for UserActivities module -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5761/f

Re: [openstreetmap/openstreetmap-website] Add UserActivities module for structured user activity history (PR #5761)

2025-03-12 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5761) > Did you try doing this via normal ActiveModel queries before resorting to raw > SQL queries? > > I certainly don't like the idea of interpolating arguments into the queries - > the fact that you called the argument `quoted_user_id

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-02-20 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5402) I've resolved the conflicts in `yarn.lock` again. Since changes keep getting merged into master, I keep running into conflicts. Are there any remaining issues to address, or is this good to merge now? -- Reply to this email directl

Re: [openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)

2025-02-20 Thread Emin Kocan via rails-dev
@kcne pushed 2 commits. 8b2400a8aeb9c9d53ce932aa9fbe3e978417cf49 Add heatmap data caching and query for user contributions 6882e4e5d76aac473e63fd918cd74f8aa1221de7 Add tests for heatmap data in UsersController -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/

Re: [openstreetmap/openstreetmap-website] Adds version to notes table and creates note_versions table (PR #5815)

2025-03-31 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5815) I'm not sure if this should be part of this PR—maybe we should address the issue in another PR. Regarding sorting by `timestamp`, we could always sort by `timestamp`/`updated_at` first and then by `id` to ensure a stable order of n

Re: [openstreetmap/openstreetmap-website] Add hide/show selection for contribution heatmap on edit profile page (PR #5853)

2025-03-31 Thread Emin Kocan via rails-dev
@kcne pushed 4 commits. 417c28de45ce9907aa0d6aac33fd3a6b12b65ab5 Add show_contribution_heatmap to the table via migration and update the profile controller 1df127c19f7b760120c81bb44f39434c8d1958a7 Add checkbox for contribution heatmap visibility on edit profile b73b42644e54f90df1e04b75e76250f9

Re: [openstreetmap/openstreetmap-website] Add hide/show selection for contribution heatmap on edit profile page (PR #5853)

2025-03-31 Thread Emin Kocan via rails-dev
@kcne pushed 4 commits. e341115ea627f2b546136aac2897811d9b3469fc Add show_contribution_heatmap to the table via migration and update the profile controller 8018a3d3aecdf5b8d177066d45fbfb607aedd893 Add checkbox for contribution heatmap visibility on edit profile e4071a47cb403efb1d6b409c627f9d6b

Re: [openstreetmap/openstreetmap-website] Add hide/show selection for contribution heatmap on edit profile page (PR #5853)

2025-03-31 Thread Emin Kocan via rails-dev
@kcne pushed 4 commits. bea3aa694991569ad7b6c1f7e3371215cd4059c7 Add show_contribution_heatmap to the table via migration and update the profile controller 98744254386de51192c308a8e79fe5dd3d14d6c5 Add checkbox for contribution heatmap visibility on edit profile 9ad6fe747a4cc2886f9e41736552c29d

Re: [openstreetmap/openstreetmap-website] Add hide/show selection for contribution heatmap on edit profile page (PR #5853)

2025-03-27 Thread Emin Kocan via rails-dev
@kcne pushed 4 commits. 7f465ec351c97e81a553e746be57f376d6ad4421 Add show_contribution_heatmap to the table via migration and update the profile controller a1927cf1eed92d0e2a3c58381a5fd89ffef37da7 Add checkbox for contribution heatmap visibility on edit profile d2ba6e56f9323ce9295e0a5b4169e3af

Re: [openstreetmap/openstreetmap-website] Add recent diaries partial to profile page (PR #6010)

2025-05-13 Thread Emin Kocan via rails-dev
@kcne pushed 1 commit. efdfaedeab560e0f4189d073e253ebc653ebb899 Add recent diaries partial to profile -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6010/files/b863bccd180438277586edb87e82bc37b0810440..efdfaedeab560e0f4189d073e253ebc653ebb899 You are receiving

Re: [openstreetmap/openstreetmap-website] Prerender heatmap in partial (PR #5998)

2025-05-12 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5998) Even though I spent quite a bit of time trying to make our custom configuration work alongside cal-heatmap, I have to say - this approach makes a lot more sense. Modifying the library ended up requiring more code than writing the co

Re: [openstreetmap/openstreetmap-website] Refactor Heatmap: Manual Labels & Yearly Template (PR #5906)

2025-05-12 Thread Emin Kocan via rails-dev
kcne left a comment (openstreetmap/openstreetmap-website#5906) Thanks everyone for the valuable feedback. I completely understand the concerns around code complexity. My initial intent was to address the visual inconsistency of showing "empty" days beyond today’s date and to ensure proper local

[openstreetmap/openstreetmap-website] Add recent diaries partial to profile page (PR #6010)

2025-05-13 Thread Emin Kocan via rails-dev