Skip to content

Conversation

timDeHof
Copy link
Owner

@timDeHof timDeHof commented Aug 5, 2025

Description

This PR introduces location-specific pages accessible via slug-based URLs, replacing the previous ID-based navigation. The changes include enhanced map interactions with clickable markers that link to individual location pages, improved sidebar navigation using Vue Router's typed routing, and better database relationships for future location log functionality.

Technical Details

  • New API endpoint /api/locations/[slug].get.ts for fetching locations by slug

  • Enhanced map component with popup navigation buttons and improved selection state management

  • Updated sidebar store to use RouteLocationRaw for type-safe navigation

  • Added database relations and utility functions for consistent map point creation

  • Improved map animations with custom easing and zoom limits

closes #32

Summary by CodeRabbit

  • New Features

    • Added a detailed location view accessible from the dashboard, displaying location details and logs, with prompts to add logs if none exist.
    • Sidebar and map points now support navigation using router links for improved in-app routing.
    • Map points and sidebar items visually indicate selection using enhanced logic for accuracy.
  • Improvements

    • Location list items in the dashboard now link directly to their detailed views.
    • Map animation behavior updated for smoother transitions and better user experience.
    • Sidebar navigation is more flexible, supporting both URL strings and route objects.
  • Developer Experience

    • Introduced TypeScript type checking via a new npm script and dependency.

- Added slug field to location schema for URL-friendly identifiers
- Updated map and sidebar components with improved navigation handling
- Enhanced location queries and stores for better data management
- Added clickable points on map with proper routing
- Improved type safety and dependency versions
Copy link

vercel bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuxt-travel-log ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 2:37am

Copy link

coderabbitai bot commented Aug 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This change introduces location-specific navigation and selection logic across the sidebar, map, and dashboard. It adds new route-aware properties to map points and sidebar items, updates utility functions for point selection, implements a new dashboard location details page, and extends the database schema and queries for location relations. Several components and stores are refactored to support these new navigation and data structures.

Changes

Cohort / File(s) Change Summary
Sidebar Navigation and Button Refactor
components/sidebar-button.vue, stores/sidebar.ts, pages/dashboard.vue, stores/locations.ts, lib/types.ts
Sidebar button now supports both href and to props for navigation; sidebar items and button logic updated to use route objects. Sidebar item type updated; map point reference property renamed and navigation properties added to MapPoint.
Map Point Selection and Utility Functions
components/app/map.client.vue, pages/dashboard.vue, pages/dashboard/index.vue, utils/map-points.ts
Point selection logic refactored to use new utility functions for comparing points. Utility functions for creating map points from locations and checking selection added.
Location Page and API
pages/dashboard/location/[slug].vue, server/api/locations/[slug].get.ts, lib/db/queries/location.ts
New location details page and corresponding API endpoint fetch and display location data by slug. New DB query function for fetching a location by slug and user ID.
Database Relations and Types
lib/db/schema/location.ts, lib/db/schema/location-log.ts
Added relation definitions between locations and location logs. Exported type for selecting location records.
Map Store Animation Tweaks
stores/map.ts
Adjusted map animation parameters for smoother navigation and zoom control.
TypeScript Tooling
package.json
Added type checking script and dependency for improved type safety.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Sidebar
    participant Router
    participant DashboardPage
    participant API
    participant DB

    User->>Sidebar: Clicks location link
    Sidebar->>Router: Navigates to /dashboard/location/:slug
    Router->>DashboardPage: Loads location page
    DashboardPage->>API: GET /api/locations/:slug
    API->>DB: findLocation(slug, userId)
    DB-->>API: Location data (with logs)
    API-->>DashboardPage: Location data
    DashboardPage->>Sidebar: Updates sidebar with location-specific links
    DashboardPage->>Map: Updates map points for selected location
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Sidebar displays link back to "Locations" page (#32)
Sidebar displays link to this specific location (#32)
Sidebar displays link to edit this specific location (#32)
Location list in sidebar is no longer displayed on location details page (#32)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Added type checking script and vue-tsc devDependency (package.json) This tooling addition is not related to sidebar navigation or location links.
Map animation parameter tweaks (stores/map.ts) Animation and zoom parameter changes are unrelated to sidebar or location navigation objectives.

Possibly related PRs

Poem

A sidebar hops with links anew,
To places mapped and journeys true.
With slugs and routes, the code aligns,
Each point selected, logic shines.
The traveler’s wish now neatly done—
Dashboard and map, together run!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 335d5f6 and 1a38815.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • components/app/map.client.vue (2 hunks)
  • components/sidebar-button.vue (2 hunks)
  • lib/db/queries/location.ts (1 hunks)
  • lib/db/schema/location-log.ts (2 hunks)
  • lib/db/schema/location.ts (3 hunks)
  • lib/types.ts (2 hunks)
  • package.json (2 hunks)
  • pages/dashboard.vue (1 hunks)
  • pages/dashboard/index.vue (2 hunks)
  • pages/dashboard/location/[slug].vue (1 hunks)
  • server/api/locations/[slug].get.ts (1 hunks)
  • stores/locations.ts (2 hunks)
  • stores/map.ts (1 hunks)
  • stores/sidebar.ts (1 hunks)
  • utils/map-points.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ntl-32

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@timDeHof timDeHof merged commit 51154ae into main Aug 5, 2025
6 of 7 checks passed
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.

As a traveler, I want to I want to see location specific links in the sidebar
1 participant