Re: [openstreetmap/openstreetmap-website] Add 'canDownloadImage' layer option (PR #5416)

2024-12-18 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 2 commits. 7c15c9b0bab0ae64f00f71f2cc4d7c9bf52a0f55 Add 'canDownloadImage' layer option 276520135db18ed57524669dd03b4ec06778f827 Change image download warning message to a list -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5416/files/d74

[openstreetmap/openstreetmap-website] Add 'canDownloadImage' layer option (PR #5416)

2024-12-18 Thread Anton Khorev via rails-dev
Follows #5388. Removes hardcoded layer id checks in *Share > Image*, except for one special mapnik check. If a layer that can't be downloaded is selected, the message shows a list of available layers: Before: ![image](https://github.com/user-attachments/assets/ce67b154-f8e2-4d85-a62a-b0ff72a9e2

Re: [openstreetmap/openstreetmap-website] Refactor render_social_share_buttons helper (Issue #5415)

2024-12-18 Thread Anton Khorev via rails-dev
We have enough unused code in helpers. For example `auth_button` has `options` argument. Options for what? For link or image? Turns out it's for path. But it's never used. `user_image_url` also has `options`, also unused, and if you passed it, it would be used only in one branch. However all of

Re: [openstreetmap/openstreetmap-website] Refactor social sharing helper (PR #5417)

2024-12-18 Thread Anton Khorev via rails-dev
Are you sure you escape things correctly? ![image](https://github.com/user-attachments/assets/9425dadf-d460-4c95-9b61-9c55b34638bc) -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5417#issuecomment-2551977312 You are receiving thi

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

2024-12-18 Thread Tom Hughes via rails-dev
I've tested the performance of the underlying query and using the user with the most changesets in the last year (just over 50 thousand) it took a fraction over one second which is probably acceptable. That result (which was a full 365 days of data) serialised to just under 10Kb which is a fair

Re: [openstreetmap/openstreetmap-website] Use map tiles dark mode without leaflet-osm plugin (PR #5397)

2024-12-18 Thread Tom Hughes via rails-dev
@tomhughes commented on this pull request. This has gone rather further than I intended from my comments on #5396 by moving everything back into the web site code. My thinking was the leaflet-osm would still have the `darkUrl` attribute on the layer, and probably an option to the constructor th

Re: [openstreetmap/openstreetmap-website] Use map tiles dark mode without leaflet-osm plugin (PR #5397)

2024-12-18 Thread Marwin Hochfelsner via rails-dev
@tomhughes This is also further than I anticipated it would go. But I found it too hacky to overwrite the class's properties from the instance each time, and I especially wanted to avoid using `__proto__`. Yet I couldn't find a way to do that. But then I stumbled upon #5386 and its new layer de

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Anton Khorev via rails-dev
Merged #4985 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/4985#event-15703610802 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Anton Khorev via rails-dev
@AntonKhorev commented on this pull request. > @@ -75,4 +76,32 @@ def render_flash(flash) rescue StandardError flash.inspect if Rails.env.development? end + + # Generates a set of social share buttons based on the specified options. + def render_social_share_buttons(opts = {}) +

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Tom Hughes via rails-dev
@tomhughes commented on this pull request. > @@ -75,4 +76,32 @@ def render_flash(flash) rescue StandardError flash.inspect if Rails.env.development? end + + # Generates a set of social share buttons based on the specified options. + def render_social_share_buttons(opts = {}) +si

Re: [openstreetmap/openstreetmap-website] Move admin users list to its own controller (PR #5391)

2024-12-18 Thread Tom Hughes via rails-dev
Merged #5391 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5391#event-15704036203 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

[openstreetmap/openstreetmap-website] Center share popup inside the browser window (PR #5418)

2024-12-18 Thread Anton Khorev via rails-dev
What the existing share popup window placement does is it places the popup horizontally in the center of the screen. I don't know if the popup can get placed literally in the corner (https://github.com/openstreetmap/openstreetmap-website/issues/5414#issuecomment-2551615977), maybe with a multi-

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

2024-12-18 Thread Emin Kocan via rails-dev
> Oh, I forgot about this. But the user can now set his "Preferred Website > Color Scheme" which should be the basis of the theme not the browser setting. Thank you for the suggestion. I’ll refactor accordingly to ensure alignment with the preferred color scheme setting. > It is a very minor

Re: [openstreetmap/openstreetmap-website] Alternatives to popup windows for social sharing (Issue #5414)

2024-12-18 Thread Anton Khorev via rails-dev
Anyone who wants new tabs can already open the links in new tabs by middle-clicking. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5414#issuecomment-2552540697 You are receiving this because you are subscribed to this thread.

Re: [openstreetmap/openstreetmap-website] Center share popup inside the browser window (PR #5418)

2024-12-18 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 1 commit. 2c57c66195a2c3a280fb33bf0a8f433d20650516 Center share popup inside the browser window -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5418/files/3fc487a08918fcdab1ec1c10c36e9cf94146c050..2c57c66195a2c3a280fb33bf0a8f433d20650516 Yo

[openstreetmap/openstreetmap-website] Refactor social sharing helper (PR #5417)

2024-12-18 Thread Tom Hughes via rails-dev
This implements the refactorings suggested in #5415 and also improves the testing of the generated HTML to ensure that all the buttons are generated and reference the correct URL and title. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstr

Re: [openstreetmap/openstreetmap-website] Pass correct URL to Facebook sharing (PR #5412)

2024-12-18 Thread Andy Allan via rails-dev
Merged #5412 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5412#event-15704748998 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

[openstreetmap/openstreetmap-website] Alternatives to popup windows for social sharing (Issue #5414)

2024-12-18 Thread Andy Allan via rails-dev
I think that using a popup window for the social sharing functionality isn't a great user experience, but I would like to have a more detailed discussion about the pros and cons. In my mind, either one of these would be preferable: * Links open in a new tab, or * Use a [bootstrap modal dialog](

Re: [openstreetmap/openstreetmap-website] Alternatives to popup windows for social sharing (Issue #5414)

2024-12-18 Thread Tom Hughes via rails-dev
> I think that using a popup window for the social sharing functionality isn't > a great user experience I certainly agree with that - in my case it was opening in the opposite corner of my monitor to the main window. Plus popups are pretty rare on the web these days so it will just surprise pe

Re: [openstreetmap/openstreetmap-website] Add 'canEmbed' layer option (PR #5388)

2024-12-18 Thread Anton Khorev via rails-dev
There was something else, updated now. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5388#issuecomment-2551652330 You are receiving this because you are subscribed to this thread. Message ID: ___

Re: [openstreetmap/openstreetmap-website] Alternatives to popup windows for social sharing (Issue #5414)

2024-12-18 Thread Anton Khorev via rails-dev
> Links open in a new tab That's what already happens on small screens. If you do Bootstrap modal, it probably won't. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5414#issuecomment-2551596365 You are receiving this because y

Re: [openstreetmap/openstreetmap-website] Add Bluesky to social sharing buttons (PR #5411)

2024-12-18 Thread Andy Allan via rails-dev
Merged #5411 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5411#event-15704766492 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Pass correct URL to Facebook sharing (PR #5412)

2024-12-18 Thread Andy Allan via rails-dev
Merged thanks. Feels to me like some tests are missing from the original PR, which might have caught this. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5412#issuecomment-2551563781 You are receiving this because you are subscri

Re: [openstreetmap/openstreetmap-website] Move admin users list to its own controller (PR #5391)

2024-12-18 Thread Tom Hughes via rails-dev
Looks good to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5391#issuecomment-2551435630 You are receiving this because you are subscribed to this thread. Message ID: ___

[openstreetmap/openstreetmap-website] Convert social share helper library into a real helper (PR #5413)

2024-12-18 Thread Tom Hughes via rails-dev
This converts the confusingly named `SocialShareButtonHelper` which is really a library, but tested by a helper test, into a real helper and moves the actual `render_social_share_buttons` helper there from the application helper. The other methods are then private as they're only used by `rende

Re: [openstreetmap/openstreetmap-website] Use map tiles dark mode without leaflet-osm plugin (PR #5397)

2024-12-18 Thread Marwin Hochfelsner via rails-dev
Given my limited familiarity with this repo, I decided to place cornerstones in the space of possibilities I saw rather than try for a perfect solution the first few times without much feedback. But now that I see a more modular solution I'll put this PR on hold too, just fixing the missing fil

Re: [openstreetmap/openstreetmap-website] Use map tiles dark mode without leaflet-osm plugin (PR #5397)

2024-12-18 Thread Marwin Hochfelsner via rails-dev
@hlfan pushed 1 commit. e77f38b1f2c0eaf7be817563268bcca14eb34569 Propagate layer filter to property -- View it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5397/files/88c90f37fc7cc0dd3d1f0975565c7e75f392f155..e77f38b1f2c0eaf7be817563268bcca14eb34569 You are receiving t

Re: [openstreetmap/openstreetmap-website] Convert social share helper library into a real helper (PR #5413)

2024-12-18 Thread Andy Allan via rails-dev
Merged, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5413#issuecomment-2551593371 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev

Re: [openstreetmap/openstreetmap-website] Dark mode preference not respected after OAuth expiry (Issue #5407)

2024-12-18 Thread Andy Allan via rails-dev
I think this is unrelated to OAuth. I belive it's another way of asking for non-db preferences, so I'm closing this in favour of #5324 -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5407#issuecomment-2551569005 You are receivi

Re: [openstreetmap/openstreetmap-website] Add Bluesky to social sharing buttons (PR #5411)

2024-12-18 Thread Andy Allan via rails-dev
Merged, thanks -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5411#issuecomment-2551565358 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev m

Re: [openstreetmap/openstreetmap-website] Add 'canEmbed' layer option (PR #5388)

2024-12-18 Thread Andy Allan via rails-dev
This seems reasonable to me, but it's marked as a draft. Is there something else that needs working on first, or is it just the merge conflicts now? -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5388#issuecomment-2551501150 You

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Anton Khorev via rails-dev
> I think you mean users who are not logged in yes > As for preferences, I'm happy keeping most preferences available for only > logged in users, since account creation is free and we aim to serve our > mappers (who by definition have accounts) more than just casual visitors. > Storing prefere

Re: [openstreetmap/openstreetmap-website] Convert social share helper library into a real helper (PR #5413)

2024-12-18 Thread Andy Allan via rails-dev
Merged #5413 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5413#event-15704922466 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

[openstreetmap/openstreetmap-website] Refactor render_social_share_buttons helper (Issue #5415)

2024-12-18 Thread Andy Allan via rails-dev
The implementation of render_social_share_buttons can be refactored in a number of ways: * `html_safe` **must not be used**. It does not convert strings to a safe representation, it is an assertion that the string is always safe given every possible input. This method is probably too complex fo

Re: [openstreetmap/openstreetmap-website] Add 'canEmbed' layer option (PR #5388)

2024-12-18 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 3 commits. de0bf2549978f0b517c06c3eadaa477b37433ea6 Rename return values of getMapBaseLayerId() to layerId 2c84465cc2c131044cb290d596513723d4ce445a Add map.getMapBaseLayer() 8a8c2517f2e594bcecba1fda751ffd34b39dbe9a Add 'canEmbed' layer option -- View it on GitHub: https:/

Re: [openstreetmap/openstreetmap-website] Add 'canEmbed' layer option (PR #5388)

2024-12-18 Thread Andy Allan via rails-dev
Merged, thanks! -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5388#issuecomment-2551713385 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-dev

Re: [openstreetmap/openstreetmap-website] Add date and url settings for offline message (PR #5403)

2024-12-18 Thread Anton Khorev via rails-dev
@AntonKhorev pushed 7 commits. 5751f8e086035b30a96dc2ccd5b54c9a15e1abde Move map offline flash to partial d6afe1e4d14ad4e642ea3454545740a3294afab7 Use offline flash partial on edit page 4de0815b541a36b5cfe77d80f22c0800a4838433 Use offline flash partial on offline redirect target page 33eaeb800

Re: [openstreetmap/openstreetmap-website] Add 'canEmbed' layer option (PR #5388)

2024-12-18 Thread Andy Allan via rails-dev
Merged #5388 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5388#event-15705677103 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Add date and url settings for offline message (PR #5403)

2024-12-18 Thread Anton Khorev via rails-dev
Removed "database" from "maintenance": ![image](https://github.com/user-attachments/assets/8a40842d-d59d-4e03-8b8a-61b1f37b153a) ![image](https://github.com/user-attachments/assets/e729c6a1-978e-4114-af48-7b0792318759) -- Reply to this email directly or view it on GitHub: https://github.com/op

Re: [openstreetmap/openstreetmap-website] Add standard patch/put api message update action (PR #5410)

2024-12-18 Thread Tom Hughes via rails-dev
Looks good to me, thanks. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5410#issuecomment-2551213402 You are receiving this because you are subscribed to this thread. Message ID: ___

[openstreetmap/openstreetmap-website] Add Bluesky to social sharing buttons (PR #5411)

2024-12-18 Thread Tom Hughes via rails-dev
Adds Bluesky as an option in the social sharing buttons. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5411 -- Commit Summary -- * Add Bluesky to social sharing buttons -- File Changes -- A app/assets/images/

Re: [openstreetmap/openstreetmap-website] Use map tiles dark mode without leaflet-osm plugin (PR #5397)

2024-12-18 Thread Tom Hughes via rails-dev
> But I found it too hacky to overwrite the class's properties from the > instance each time, and I especially wanted to avoid using `__proto__`. Yet I > couldn't find a way to do that. I don't see any reason why what I was suggesting would need any of that but I've actually come up with a bett

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Anton Khorev via rails-dev
Merged, thanks. Although we're effectively outsourcing Mastodon host option to mastodonshare.com, it works for anonymous users too. Currently our preferences page is not available for anonymous users but we probably should make it available and save preferences to cookies. We have other prefere

Re: [openstreetmap/openstreetmap-website] Add standard patch/put api message update action (PR #5410)

2024-12-18 Thread Tom Hughes via rails-dev
Merged #5410 into master. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5410#event-15703693652 You are receiving this because you are subscribed to this thread. Message ID: ___ rails-

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Tom Hughes via rails-dev
@tomhughes commented on this pull request. > @@ -75,4 +76,32 @@ def render_flash(flash) rescue StandardError flash.inspect if Rails.env.development? end + + # Generates a set of social share buttons based on the specified options. + def render_social_share_buttons(opts = {}) +si

Re: [openstreetmap/openstreetmap-website] Dark mode preference not respected after OAuth expiry (Issue #5407)

2024-12-18 Thread Andy Allan via rails-dev
Closed #5407 as completed. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/issues/5407#event-15704788689 You are receiving this because you are subscribed to this thread. Message ID: ___ rai

[openstreetmap/openstreetmap-website] Pass correct URL to Facebook sharing (PR #5412)

2024-12-18 Thread Tom Hughes via rails-dev
It was trying to pass the literal text `params[:url]` as the URL due to incorrect quoting. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5412 -- Commit Summary -- * Pass correct URL to Facebook sharing -- File Ch

Re: [openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

2024-12-18 Thread Andy Allan via rails-dev
> anonymous users I think you mean users who are not logged in - "anonymous users" is the term we use for accounts with `user.data_public == false`. They are quite rare now since [they haven't been permitted for a long time](https://wiki.openstreetmap.org/wiki/Anonymous_edits). As for preferen

Re: [openstreetmap/openstreetmap-website] Add date and url settings for offline message (PR #5403)

2024-12-18 Thread Holger Jeromin via rails-dev
> Maybe we should just remove the references to database maintenance in favour > of this solution with a URL to an explanatory notice? Perhaps this is generic enough: ``` The OpenStreetMap database is currently in read-only mode while essential maintenance work is carried out. -- Reply to this

Re: [openstreetmap/openstreetmap-website] Use map tiles dark mode without leaflet-osm plugin (PR #5397)

2024-12-18 Thread Andy Allan via rails-dev
@gravitystorm requested changes on this pull request. I'm very happy to see this work, thanks @hlfan! The code looks fine to me, but I'm not a javascript expert so maybe there are better ways to write parts. Two other changes requested: * Please rework your commits (e.g. using `git rebase -i`)

[openstreetmap/openstreetmap-website] Improve note testing and text handling (PR #5419)

2024-12-18 Thread Anton Khorev via rails-dev
- Add test that would have failed in #5359. - Change the code that selects the text input from `$("textarea")` to `content.find("textarea")`. This should stop the html share code from getting posted to notes, although I couldn't reproduce that happening like @SomeoneElseOSM reported it yesterday

Re: [openstreetmap/openstreetmap-website] Alternatives to popup windows for social sharing (Issue #5414)

2024-12-18 Thread Emin Kocan via rails-dev
Popups were chosen initially, inspired by [rails-social-share-button](https://github.com/Bunlong/rails-social-share-button), which is now deprecated. I didn't thought too much about alternatives at the time. To be honest, I’m not a fan of popups either. Refactoring to open links in new tabs

Re: [openstreetmap/openstreetmap-website] Refactor render_social_share_buttons helper (Issue #5415)

2024-12-18 Thread Emin Kocan via rails-dev
First of all, thank you for taking the time to do this post-merge review @gravitystorm . I wish these points had been raised earlier so I could have reassessed and addressed them before merging. I completely agree with your observations. As mentioned earlier, I drew some inspiration from the ra

Re: [openstreetmap/openstreetmap-website] Refactor social sharing helper (PR #5417)

2024-12-18 Thread Emin Kocan via rails-dev
@kcne approved this pull request. Everything works well on my side. Thank you. -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5417#pullrequestreview-2513042514 You are receiving this because you are subscribed to this thread.

Re: [openstreetmap/openstreetmap-website] Refactor social sharing helper (PR #5417)

2024-12-18 Thread Emin Kocan via rails-dev
> Are you sure you escape things correctly? > ![image](https://private-user-images.githubusercontent.com/4158490/397057382-9425dadf-d460-4c95-9b61-9c55b34638bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJle

Re: [openstreetmap/openstreetmap-website] Refactor social sharing helper (PR #5417)

2024-12-18 Thread Anton Khorev via rails-dev
Looks like `&` gets unescaped in mastodonshare.com's redirect location. Request headers: ``` GET /?text=A%26B&url=http%3A%2F%2F127.0.0.1%3A3000%2Fuser%2Ffakeuser1%2Fdiary%2F86 HTTP/1.1 Host: mastodonshare.com ... ``` Response headers: ``` HTTP/1.1 302 Found ... Location: https://en.osm.town/sh