104 map display for past runs#106
Conversation
changed project structrue a bit
actions are on bad system need more time so wait more time
There was a problem hiding this comment.
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_runsschema, 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
GetPlannedRunsHandlerfor clarity.
func (s *Server) GetPlannedRunHandler(c *gin.Context) {
rocket-backend/integration-tests/internal/server-tests/main_test.go:68
- Go does not allow
for rangeon an integer literal; use a classicalfor i := 0; i < 30; i++loop to poll server readiness.
for range 30 {
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| const props = defineProps<{ |
There was a problem hiding this comment.
Add a corresponding defineEmits<['confirm','cancel']>() call in <script setup> so TypeScript knows about the emitted events.
| * 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[]> { |
There was a problem hiding this comment.
The return type should be Promise<(number|null)[]> instead of Promise<number[]|null[]> to reflect that each element may be null.
| export async function getElevations(coords: [number, number][]): Promise<number[]|null[]> { | |
| export async function getElevations(coords: [number, number][]): Promise<(number|null)[]> { |
| ID string `json:"id"` | ||
| Route string `json:"route"` | ||
| Name string `json:"name"` | ||
| CreatedAt string `json:"created_at"` | ||
| Distance float64 `json:"distance"` |
There was a problem hiding this comment.
Scanning a SQL TIMESTAMP into a Go string may fail; consider using time.Time for CreatedAt to match the column type.
| 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"` |
No description provided.