Skip to content

104 map display for past runs#106

Merged
Pazl27 merged 15 commits into
masterfrom
104-map-display-for-past-runs
Jun 11, 2025
Merged

104 map display for past runs#106
Pazl27 merged 15 commits into
masterfrom
104-map-display-for-past-runs

Conversation

@Pazl27

@Pazl27 Pazl27 commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@Pazl27 Pazl27 linked an issue Jun 10, 2025 that may be closed by this pull request
Pazl27 added 3 commits June 10, 2025 18:05
@Pazl27 Pazl27 requested review from Copilot and manuel0804 June 10, 2025 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 support for planning, listing, and deleting past/​planned runs, along with UI dialog and mapping dependencies.

  • Introduces a reusable confirmation dialog component for run deletions.
  • Extends frontend API and backend endpoints for planned runs (CRUD).
  • Creates planned_runs schema, DTOs, DB service methods, and integration tests; adds Leaflet for map display.

Reviewed Changes

Copilot reviewed 38 out of 39 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/src/components/ConfirmDialog.vue New confirm dialog component for delete actions
website/src/api/service-api.ts getElevations helper with downsampling logic
website/src/api/backend-api.ts Client methods to fetch/plan/delete runs
website/package.json & website/index.html Added Leaflet and its CSS for map integration
rocket-backend/migrations/0002_create_infotables.up.sql Added planned_runs table schema
rocket-backend/internal/types/dto.go Defined PlannedRunDTO
rocket-backend/internal/server/run_handlers.go Handlers for planning, listing, deleting planned runs
rocket-backend/internal/server/routes.go Registered new /runs/plan routes
rocket-backend/internal/database/runs_table.go Service methods for planned_runs CRUD
rocket-backend/integration-tests/internal/server-tests/main_test.go Improved server startup readiness check
Files not reviewed (1)
  • website/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)

rocket-backend/internal/server/run_handlers.go:128

  • [nitpick] Handler name suggests singular but returns multiple runs; consider renaming to GetPlannedRunsHandler for clarity.
func (s *Server) GetPlannedRunHandler(c *gin.Context) {

rocket-backend/integration-tests/internal/server-tests/main_test.go:68

  • Go does not allow for range on an integer literal; use a classical for i := 0; i < 30; i++ loop to poll server readiness.
for range 30 {

</template>

<script setup lang="ts">
const props = defineProps<{

Copilot AI Jun 10, 2025

Copy link

Choose a reason for hiding this comment

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

Add a corresponding defineEmits<['confirm','cancel']>() call in <script setup> so TypeScript knows about the emitted events.

Copilot uses AI. Check for mistakes.
* Fetches elevations for an array of [lat, lng] coordinates.
* The input must be in [latitude, longitude] order.
*/
export async function getElevations(coords: [number, number][]): Promise<number[]|null[]> {

Copilot AI Jun 10, 2025

Copy link

Choose a reason for hiding this comment

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

The return type should be Promise<(number|null)[]> instead of Promise<number[]|null[]> to reflect that each element may be null.

Suggested change
export async function getElevations(coords: [number, number][]): Promise<number[]|null[]> {
export async function getElevations(coords: [number, number][]): Promise<(number|null)[]> {

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +80
ID string `json:"id"`
Route string `json:"route"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
Distance float64 `json:"distance"`

Copilot AI Jun 10, 2025

Copy link

Choose a reason for hiding this comment

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

Scanning a SQL TIMESTAMP into a Go string may fail; consider using time.Time for CreatedAt to match the column type.

Suggested change
ID string `json:"id"`
Route string `json:"route"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
Distance float64 `json:"distance"`
ID string `json:"id"`
Route string `json:"route"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
Distance float64 `json:"distance"`

Copilot uses AI. Check for mistakes.
@Pazl27 Pazl27 merged commit ada593e into master Jun 11, 2025
2 checks passed
@Pazl27 Pazl27 deleted the 104-map-display-for-past-runs branch June 11, 2025 11:17
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.

Map display for past runs

2 participants