Skip to content

Add Geolocation#39

Open
erwanMarmelab wants to merge 2 commits into
mainfrom
2-add-geolocation
Open

Add Geolocation#39
erwanMarmelab wants to merge 2 commits into
mainfrom
2-add-geolocation

Conversation

@erwanMarmelab
Copy link
Copy Markdown
Collaborator

No description provided.

@erwanMarmelab erwanMarmelab requested a review from Copilot October 22, 2025 13:51
@erwanMarmelab erwanMarmelab linked an issue Oct 22, 2025 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
frequentito Ready Ready Preview Comment Oct 22, 2025 2:19pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a geolocation-based notification feature that reminds users to update their presence status when they are near the office. Users must opt-in to enable location tracking and notifications.

Key Changes:

  • Database migration adds geolocation_notifications_enabled preference column (default: true)
  • New GeolocationNotifier component monitors user location and sends proximity-based notifications
  • UI toggle in menu bar allows users to enable/disable location reminders

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
supabase/migrations/20251022120000_add_geolocation_notifications_to_profiles.sql Adds boolean column for geolocation notification preference to profiles table
docs/GEOLOCATION_FEATURE.md Comprehensive documentation covering feature overview, setup, testing, and troubleshooting
components/icons.tsx Adds LocationOnIcon and LocationOffIcon components for the toggle UI
components/Menu.tsx Implements geolocation toggle button with permission handling and state management
app/page.tsx Integrates GeolocationNotifier component into main page
app/GeolocationNotifier.tsx Core component implementing location tracking, distance calculation, and notification logic
.env Adds office coordinate environment variables

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -0,0 +1,5 @@
-- Add geolocation_notifications_enabled preference to profiles
alter table public.profiles
add column if not exists geolocation_notifications_enabled boolean not null default true;
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The column defaults to true, but the documentation states 'Default State: Disabled (users must opt-in)' and the comment in line 5 says 'Users must opt-in to geolocation-based notifications'. This contradicts the opt-in requirement. Change default true to default false to ensure users explicitly consent before location tracking is enabled.

Suggested change
add column if not exists geolocation_notifications_enabled boolean not null default true;
add column if not exists geolocation_notifications_enabled boolean not null default false;

Copilot uses AI. Check for mistakes.
Comment thread app/GeolocationNotifier.tsx Outdated
return R * c;
}

const OFFICE_RADIUS_METERS = 5000; // Notify when within 500m of office
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The constant value is 5000 meters but the comment says 500m. This inconsistency appears throughout the documentation which states 500 meters. Update the value to 500 to match the intended behavior, or update all documentation to reflect 5000 meters if that is the correct radius.

Suggested change
const OFFICE_RADIUS_METERS = 5000; // Notify when within 500m of office
const OFFICE_RADIUS_METERS = 500; // Notify when within 500m of office

Copilot uses AI. Check for mistakes.
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.

Add Geolocation

2 participants