Skip to content

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Jan 29, 2026

Fixes #968

Summary by CodeRabbit

  • New Features
    • Two new geolocation settings: "Display GPS coordinates" and "Allow anonymous users to access GPS coordinates" — administrators can now control latitude/longitude visibility separately for authenticated and public users.
  • Settings UI
    • Added toggles in the general settings to manage the new GPS visibility options.
  • Documentation
    • Updated translations and settings descriptions across languages to clarify GPS coordinate vs. location display behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@ildyria ildyria requested a review from a team as a code owner January 29, 2026 19:50
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Introduces configurable GPS coordinate visibility: resource models now conditionally expose latitude/longitude/altitude based on config and authentication; a migration adds two config keys to control GPS display; translations and the settings UI are updated to surface the new options across locales.

Changes

Cohort / File(s) Summary
Resource Model GPS Gating
app/Http/Resources/Models/Utils/PreComputedPhotoData.php, app/Http/Resources/Models/Utils/PreformattedPhotoData.php
Refactored constructors to call new private helpers (set_gps_coordinates, set_location) that gate assignment of latitude, longitude, altitude, and location on gps_coordinate_display and gps_coordinate_display_public config flags and guest vs authenticated status.
Database Configuration Migration
database/migrations/2026_01_29_170000_hide_gps_coordinates.php
Adds a migration that inserts gps_coordinate_display and gps_coordinate_display_public config entries and updates details for existing location_show / location_show_public keys; includes up/down operations and config metadata.
Localization Files
lang/*/all_settings.php, lang/*/settings.php (multiple locales: ar, cz, de, el, en, es, fa, fr, hu, it, ja, nl, no, pl, pt, ru, sk, sv, vi, zh_CN, zh_TW, etc.)
Adds translation keys and detail texts for gps_coordinate_display and gps_coordinate_display_public across many languages; updates location_show and location_show_public descriptions to clarify scope.
Frontend Settings Component
resources/js/components/settings/General.vue
Adds two reactive boolean config fields and UI toggles (gps_coordinate_display, gps_coordinate_display_public) to the geolocation settings section and loads/saves them with existing config flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble on code where the coordinates hide,
I tuck lat and long safe, with configs as my guide.
If guests may not see them, I hop out of sight,
Else I whisper the numbers beneath the moonlight.
Tiny paws, big privacy—hop onward, delight! 🥕

🚥 Pre-merge checks | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (7)
lang/cz/settings.php (1)

70-71: Missing Czech translation for new GPS coordinate settings.

The new translation keys contain English text instead of Czech translations. Other entries in the geolocation section are properly translated to Czech (e.g., 'map_display' => 'Display the map given GPS coordinates' should also be Czech but isn't—this may be a pre-existing issue).

Consider translating these to Czech for consistency:

  • gps_coordinate_display → e.g., "Zobrazit GPS souřadnice"
  • gps_coordinate_display_public → e.g., "Povolit anonymním uživatelům přístup k GPS souřadnicím"
lang/ar/settings.php (1)

71-72: Missing Arabic translation for new GPS coordinate settings.

The new translation keys contain English text, but other entries in the geolocation section are properly translated to Arabic (e.g., Line 64: 'map_display' => 'عرض الخريطة بناءً على إحداثيات GPS').

These entries should be translated to Arabic for consistency with the rest of the file.

lang/fr/settings.php (1)

71-72: Missing French translation for new GPS coordinate settings.

The new translation keys contain English text, but other entries in the geolocation section are properly translated to French (e.g., Line 64: 'map_display' => 'Afficher la carte selon les coordonnées GPS').

Consider translating these to French:

  • gps_coordinate_display → e.g., "Afficher les coordonnées GPS"
  • gps_coordinate_display_public → e.g., "Permettre aux utilisateurs anonymes d'accéder aux coordonnées GPS"
lang/it/settings.php (1)

71-72: Translation missing: strings are in English instead of Italian.

The new GPS coordinate display settings are in English. For consistency with the rest of this Italian translation file, these should be translated:

  • 'gps_coordinate_display' => 'Display the GPS coordinates' → Italian translation needed
  • 'gps_coordinate_display_public' => 'Allow anonymous users to access the GPS coordinates' → Italian translation needed
lang/sv/all_settings.php (2)

72-73: Consider spelling out the coordinate fields in the label.

If the setting also hides altitude, a more explicit label helps avoid ambiguity.

💡 Suggested wording
-        'gps_coordinate_display' => 'Display the GPS coordinates.',
-        'gps_coordinate_display_public' => 'Allow anonymous users to access the GPS coordinates.',
+        'gps_coordinate_display' => 'Display GPS coordinates (latitude, longitude, altitude).',
+        'gps_coordinate_display_public' => 'Allow anonymous users to access GPS coordinates (latitude, longitude, altitude).',

399-402: Clarify that altitude is included if it’s hidden too.

If altitude is gated by this setting, the details copy should mention it explicitly.

💡 Suggested wording
-        'gps_coordinate_display' => 'Disabling this hides the Latitude and Longitude information from all users.',
-        'gps_coordinate_display_public' => 'Disabling this hides the Latitude and Longitude information from anonymous users.',
+        'gps_coordinate_display' => 'Disabling this hides latitude, longitude, and altitude for all users.',
+        'gps_coordinate_display_public' => 'Disabling this hides latitude, longitude, and altitude for anonymous users.',
database/migrations/2026_01_29_170000_hide_gps_coordinates.php (1)

15-17: PHPDoc array shape is missing the details key.

This can mislead readers and static analysis because details is present in each config entry.

♻️ Suggested docblock fix
-	 * `@return` array<int,array{key:string,value:string,is_secret:bool,cat:string,type_range:string,description:string,order?:int,not_on_docker?:bool,is_expert?:bool,level?:int}>
+	 * `@return` array<int,array{key:string,value:string,is_secret:bool,cat:string,type_range:string,description:string,details:string,order?:int,not_on_docker?:bool,is_expert?:bool,level?:int}>

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.19%. Comparing base (b96839d) to head (77c6189).
⚠️ Report is 2 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria merged commit 3212515 into master Jan 29, 2026
44 checks passed
@ildyria ildyria deleted the fix-968 branch January 29, 2026 20:56
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.

[Enhancement] Reworking the location_show_public option

2 participants