Skip to content

TASK-13: Add sidebar project list sorted by distance - #27

Open
z4ab wants to merge 6 commits into
devfrom
task-13-sidebar-project-list
Open

TASK-13: Add sidebar project list sorted by distance#27
z4ab wants to merge 6 commits into
devfrom
task-13-sidebar-project-list

Conversation

@z4ab

@z4ab z4ab commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Closes #16

What

Adds a scrollable project list to the sidebar showing nearby projects sorted by distance from the map center.

Backend Changes

  • backend/queries.pyspatial_search now includes distance_km (rounded to 2 decimals) in each result row
  • backend/models.py — Added distance_km: float | None to ProjectDetail

Frontend Changes

  • App.tsx — Lifts map center/zoom state up from MapView, passes to Sidebar
  • MapView.tsx — Added onMapMove callback prop; reports position on init and on every moveend
  • Sidebar.tsx — Complete rewrite:
    • Project list section fetches projects near current map center
    • Sorted by distance (closest first)
    • Each item shows: status dot, address, distance, type, value
    • Loading skeleton while fetching
    • Empty state message when no projects found
    • Compact legend at bottom
  • types.ts — Added distance_km to ProjectProperties

Verification

  • ruff check . — passes
  • ruff format --check . — passes

z4ab added 6 commits June 16, 2026 22:19
- Add distance_km to spatial search response in backend/queries.py
- Add distance_km to ProjectDetail model and frontend types
- Lift map center/zoom state to App.tsx for coordination
- Add onMapMove callback from MapView to parent
- Rewrite Sidebar to show scrollable project list sorted by distance
- Project list items show: status dot, address, distance, type, value
- Loading skeleton and empty state for project list
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.

1 participant