Skip to content

Sprint3/feature/us2.2/set current location as starting location#212

Merged
khalillabban merged 5 commits intomainfrom
sprint3/feature/US2.2/set-current-location-as-starting-location
Feb 16, 2026
Merged

Sprint3/feature/us2.2/set current location as starting location#212
khalillabban merged 5 commits intomainfrom
sprint3/feature/US2.2/set-current-location-as-starting-location

Conversation

@zachcorber
Copy link
Copy Markdown
Collaborator

@zachcorber zachcorber commented Feb 15, 2026

  • The system automatically sets the starting point of navigation to the closest building to the user's current location
  • The starting point can be manually changed
  • Tests were compiled successfully with 97.7% coverage
Screenshot 2026-02-15 at 5 24 48 PM

Closes #7

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Owner

@khalillabban khalillabban left a comment

Choose a reason for hiding this comment

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

Wonderful work!

Comment thread app/CampusMapScreen.tsx Outdated
Comment thread components/NavigationBar.tsx Outdated
Comment thread app/CampusMapScreen.tsx
}, [campus]);

useEffect(() => {
const getUserBuilding = async () => {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Since the user story is “Use current location as starting point” (and AC says “option is available”), it might be better UX to request permission when the user opts in (e.g., taps “Use my location” or opens navigation) rather than on screen mount.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

We can forget this for now

Comment thread app/CampusMapScreen.tsx
const loc = await Location.getCurrentPositionAsync({});
const { latitude, longitude } = loc.coords;

const building = findNearestBuilding(latitude, longitude);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

findNearestBuilding will always return something, even if the user is nowhere near campus. That could set an incorrect start location. Consider adding a distance threshold and only auto-set when the nearest building is within X meters.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The main purpose of the app is to be a campus navigation system so it doesn't have much use if you're not at either campus so I don't think doing something like this is completely necessary.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

All good with me

Comment thread __tests__/NavigationBar.test.tsx
@sonarqubecloud
Copy link
Copy Markdown

@zachcorber zachcorber moved this from Backlog to In progress in Snorting Code Feb 15, 2026
@zachcorber zachcorber moved this from In progress to Backlog in Snorting Code Feb 15, 2026
Copy link
Copy Markdown
Owner

@khalillabban khalillabban left a comment

Choose a reason for hiding this comment

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

Great work!

@khalillabban khalillabban merged commit d812d06 into main Feb 16, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Snorting Code Feb 16, 2026
@khalillabban khalillabban deleted the sprint3/feature/US2.2/set-current-location-as-starting-location branch February 16, 2026 00:28
@zachcorber zachcorber restored the sprint3/feature/US2.2/set-current-location-as-starting-location branch February 20, 2026 03:14
@zachcorber zachcorber deleted the sprint3/feature/US2.2/set-current-location-as-starting-location branch February 20, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request user story

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

US-2.2: Automatically set current location as starting point

4 participants