-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/remove client side engines #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
22e0ab3
feat(map-backend): add route thumbnail generation engine
chefmatteo fbeb57d
feat(activity-backend): wire thumbnail generation on activity create
chefmatteo 2bacbe1
feat(frontend): load MapTiler key at runtime from .env.local.json
chefmatteo 34cd0a3
fix(frontend): trailing slash on activities API, map timeout overlay,…
chefmatteo 5fd72ae
feat(frontend): Strava-style save dialog and fix post-delete navigation
chefmatteo 934f4f6
feat(frontend): redesign activity detail screen and fix pace formatting
chefmatteo 431001c
feat(frontend): Strava-style dark activity detail screen
chefmatteo 92816e2
fix(frontend): switch activity detail to light theme
chefmatteo 0540144
feat(frontend): remove segment/speed/elevation map chips
chefmatteo 540938f
refactor(frontend): remove duplicate _SaveStatCell, flatten _StyleBtn
chefmatteo fb2286c
Update backend/map-backend/domains/activities_service/api.py
chefmatteo 8ec3288
Update frontend/lib/features/activities/data/activities_repository.dart
chefmatteo 4da4d18
Update frontend/lib/screens/record/record_screen.dart
chefmatteo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- Run this in the Supabase SQL editor (or via psql against the Supabase Postgres). | ||
| -- Adds the thumbnail_url column to the Supabase activities table. | ||
| ALTER TABLE activities ADD COLUMN IF NOT EXISTS thumbnail_url text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| """Route thumbnail renderer — styled dark card with GPS route overlay using Pillow.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import io | ||
|
|
||
| from PIL import Image, ImageDraw | ||
|
|
||
| _BG_TOP = (20, 20, 28) # deep blue-black | ||
| _BG_BOTTOM = (10, 10, 16) | ||
| _GLOW_COLOR = (160, 55, 10) # dim orange for glow pass | ||
| _ROUTE_COLOR = (255, 90, 31) # app primary orange | ||
| _ROUTE_WIDTH = 4 | ||
| _PADDING = 0.15 # fraction of bbox added on each side | ||
|
|
||
|
|
||
| def _gradient_background(width: int, height: int) -> Image.Image: | ||
| """Top-to-bottom gradient from _BG_TOP to _BG_BOTTOM.""" | ||
| data = bytearray(width * height * 3) | ||
| for y in range(height): | ||
| t = y / max(height - 1, 1) | ||
| r = int(_BG_TOP[0] + (_BG_BOTTOM[0] - _BG_TOP[0]) * t) | ||
| g = int(_BG_TOP[1] + (_BG_BOTTOM[1] - _BG_TOP[1]) * t) | ||
| b = int(_BG_TOP[2] + (_BG_BOTTOM[2] - _BG_TOP[2]) * t) | ||
| row_start = y * width * 3 | ||
| for x in range(width): | ||
| i = row_start + x * 3 | ||
| data[i], data[i + 1], data[i + 2] = r, g, b | ||
| return Image.frombytes("RGB", (width, height), bytes(data)) | ||
|
|
||
|
|
||
| def render_route_png(points: list[tuple[float, float]], width: int, height: int) -> bytes: | ||
| """Return PNG bytes: orange route with glow on a dark gradient background. | ||
|
|
||
| Args: | ||
| points: ordered (lat, lon) pairs. | ||
| width: output image width in pixels. | ||
| height: output image height in pixels. | ||
| """ | ||
| img = _gradient_background(width, height) | ||
|
|
||
| if len(points) >= 2: | ||
| lats = [p[0] for p in points] | ||
| lons = [p[1] for p in points] | ||
| lat_span = (max(lats) - min(lats)) or 1e-4 | ||
| lon_span = (max(lons) - min(lons)) or 1e-4 | ||
| min_lat = min(lats) - lat_span * _PADDING | ||
| max_lat = max(lats) + lat_span * _PADDING | ||
| min_lon = min(lons) - lon_span * _PADDING | ||
| max_lon = max(lons) + lon_span * _PADDING | ||
| lat_span = max_lat - min_lat | ||
| lon_span = max_lon - min_lon | ||
|
|
||
| # ponytail: linear projection — close enough for ski-resort scale | ||
| def _to_px(lat: float, lon: float) -> tuple[int, int]: | ||
| return ( | ||
| int((lon - min_lon) / lon_span * (width - 1)), | ||
| int((max_lat - lat) / lat_span * (height - 1)), | ||
| ) | ||
|
|
||
| px = [_to_px(lat, lon) for lat, lon in points] | ||
| draw = ImageDraw.Draw(img) | ||
| draw.line(px, fill=_GLOW_COLOR, width=_ROUTE_WIDTH + 6) # glow pass | ||
| draw.line(px, fill=_ROUTE_COLOR, width=_ROUTE_WIDTH) # bright pass | ||
|
|
||
| buf = io.BytesIO() | ||
| img.save(buf, format="PNG", optimize=True) | ||
| return buf.getvalue() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔴 Critical
🧩 Analysis chain
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 1162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 323
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
# Read the supabase_client.py file from map-backend cat -n backend/map-backend/services/supabase_client.pyRepository: Syntraksoftware/Snowtrak
Length of output: 1503
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 4184
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 447
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 4161
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 15953
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 1160
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 3104
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 910
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 5553
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 9095
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 8765
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 162
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 579
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 5921
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 1576
🏁 Script executed:
Repository: Syntraksoftware/Snowtrak
Length of output: 1441
Private activity thumbnails permanently accessible due to public URL generation without visibility checks.
The
list_activities()endpoint docstring claims to return "public activities" but the underlyingactivity_client.list_activities()query contains no visibility filter—it retrieves all activities regardless of privacy status. Combined withupload_thumbnail()always returning public URLs viaget_public_url(), this exposes private activity thumbnails as permanently accessible assets outside authorization checks. Users believe private activities are protected, but the thumbnail assets remain discoverable and accessible to anyone with the URL.Consider filtering activities by
visibility = 'public'in the database query, or issuing signed URLs that expire after visibility/authorization verification instead of permanent public URLs.🤖 Prompt for AI Agents