Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
ec9f228
Add plugin UI panel framework, surfaced in the Labs tab
claude May 24, 2026
812055b
Merge pull request #40 from TheAngryRaven/claude/cloud-logs-coaching-…
TheAngryRaven May 24, 2026
44030b3
Add Cloud Sync first-party plugin (Supabase file + garage sync)
claude May 24, 2026
0be69dd
Merge pull request #42 from TheAngryRaven/claude/cloud-logs-coaching-…
TheAngryRaven May 24, 2026
37e5646
Add position-based lap delta module (resampler + segment-projected gap)
claude May 24, 2026
28bec5d
Work in progress
lovable-dev[bot] May 24, 2026
bca7bc0
Changes
lovable-dev[bot] May 24, 2026
d4fee69
Changes
lovable-dev[bot] May 24, 2026
a94acb7
Changes
lovable-dev[bot] May 24, 2026
ee33297
Changes
lovable-dev[bot] May 24, 2026
dbaf2bf
Changes
lovable-dev[bot] May 24, 2026
3473b4e
Changes
lovable-dev[bot] May 24, 2026
755562c
Changes
lovable-dev[bot] May 24, 2026
33ffd27
Changes
lovable-dev[bot] May 24, 2026
a7978b4
Changes
lovable-dev[bot] May 24, 2026
8509876
Changes
lovable-dev[bot] May 24, 2026
5007efd
Changes
lovable-dev[bot] May 24, 2026
39ba316
Changes
lovable-dev[bot] May 24, 2026
cde181c
Changes
lovable-dev[bot] May 24, 2026
365aa16
Changes
lovable-dev[bot] May 24, 2026
13e666a
Changes
lovable-dev[bot] May 24, 2026
0658b9d
Added Auth gating & cloud sync
lovable-dev[bot] May 24, 2026
669c5a5
Merge pull request #43 from TheAngryRaven/claude/position-based-lap-d…
TheAngryRaven May 24, 2026
d4e9abe
Code edited in Lovable Code Editor
lovable-dev[bot] May 24, 2026
68ad498
Changes
lovable-dev[bot] May 24, 2026
18b4646
Changes
lovable-dev[bot] May 24, 2026
adbac16
Fixed preview SW caching
lovable-dev[bot] May 24, 2026
e5835f2
Phase 2: make position-based lap delta the default pace method
claude May 24, 2026
0d115e0
Changes
lovable-dev[bot] May 24, 2026
45baeb9
Changes
lovable-dev[bot] May 24, 2026
f0dcb21
Changes
lovable-dev[bot] May 24, 2026
bc23d29
Changes
lovable-dev[bot] May 24, 2026
309cf84
Renamed VITE vars to HTT_
lovable-dev[bot] May 24, 2026
b22f0fc
Changes
lovable-dev[bot] May 24, 2026
c5488ff
Added process.env to loadEnv
lovable-dev[bot] May 24, 2026
e386113
Merge branch 'BETA' into claude/position-based-lap-delta
TheAngryRaven May 24, 2026
c15ee54
ci: run workflows on Node 22 to match the lockfile's npm
claude May 24, 2026
c0d70bd
fix(ci): regenerate package-lock to sync with package.json
claude May 24, 2026
8c9bc67
Bump AI coach to 0.0.4 (fixes its panel packaging)
claude May 24, 2026
8a3aba3
Merge pull request #44 from TheAngryRaven/claude/position-based-lap-d…
TheAngryRaven May 24, 2026
9b5a5dc
Work in progress
lovable-dev[bot] May 24, 2026
0e83c38
Changes
lovable-dev[bot] May 24, 2026
8cb6da2
Set build flags to default true
lovable-dev[bot] May 24, 2026
b0bfef2
Phase A: plugin storage hook + inline mount primitive
claude May 24, 2026
9ad847b
Phase B: per-file cloud sync selection (opt-in toggle on each file row)
claude May 24, 2026
4c227af
Phase C: cloud-only files inline with per-file pull
claude May 24, 2026
ac3084d
Merge pull request #45 from TheAngryRaven/claude/plugin-file-sync
TheAngryRaven May 24, 2026
e9fe4d0
Changes
lovable-dev[bot] May 24, 2026
4659f1b
Applied cloud sync migration
lovable-dev[bot] May 24, 2026
df2dc4e
Cloud files inventory: list all cloud files, not just cloud-only
claude May 24, 2026
c3381c6
Pin the Cloud files list to the top of the Files tab
claude May 24, 2026
512905b
Merge pull request #46 from TheAngryRaven/claude/cloud-files-list
TheAngryRaven May 24, 2026
58bacc8
Add dedicated AI Coach tab (PanelSlot.Coach)
claude May 24, 2026
7ca87de
Bump coach plugin to ^0.1.0 (Coach-slot session debrief)
claude May 24, 2026
afaa8a7
Merge pull request #47 from TheAngryRaven/claude/ai-coach-dashboard-s…
TheAngryRaven May 24, 2026
ea83c31
Work in progress
lovable-dev[bot] May 24, 2026
c3ba787
Lovable update
lovable-dev[bot] May 24, 2026
d427cb6
Add canonical channel registry (single source of truth)
claude May 24, 2026
65e5edb
Normalize telemetry channels to canonical keys at parse time
claude May 24, 2026
8424592
Merge pull request #48 from TheAngryRaven/claude/canonical-channels
TheAngryRaven May 24, 2026
f423757
Add chromeless plugin panels (full-bleed dashboards)
claude May 24, 2026
fd7f5e6
Merge pull request #49 from TheAngryRaven/claude/plugin-chromeless-pa…
TheAngryRaven May 24, 2026
7527bb4
Pull in coach plugin v0.2.0 (analysis dashboard)
claude May 25, 2026
83faaac
Merge pull request #50 from TheAngryRaven/claude/plugin-chromeless-pa…
TheAngryRaven May 25, 2026
ecb8541
Refresh coach plugin to v0.2.2 (React 18 peer fix + Leaflet map)
claude May 25, 2026
985a8cb
Merge pull request #51 from TheAngryRaven/claude/plugin-chromeless-pa…
TheAngryRaven May 25, 2026
8ffa281
Changes
lovable-dev[bot] May 25, 2026
6ef7d96
Updated module to 0.2.3
lovable-dev[bot] May 25, 2026
5d21416
Refresh coach plugin to v0.2.3
claude May 25, 2026
bfc2793
Merge pull request #52 from TheAngryRaven/claude/plugin-chromeless-pa…
TheAngryRaven May 25, 2026
dcdf293
Changes
lovable-dev[bot] May 25, 2026
b6a8ba2
Rebuilt preview server
lovable-dev[bot] May 25, 2026
0f37fbe
Document storage tier: auto-sync, propagation deletes, quotas + Profi…
claude May 25, 2026
d6bd9aa
Rename storage "tiers" β†’ "storage types"
claude May 25, 2026
f0eb196
Merge pull request #53 from TheAngryRaven/claude/cloud-document-storage
TheAngryRaven May 25, 2026
ff8ff00
Changes
lovable-dev[bot] May 25, 2026
8221303
Changes
lovable-dev[bot] May 25, 2026
6b3f824
Added storage quota objects
lovable-dev[bot] May 25, 2026
c4bb544
Add unique, editable user display names
claude May 25, 2026
ca10963
Merge pull request #54 from TheAngryRaven/claude/cloud-document-storage
TheAngryRaven May 25, 2026
28147fc
Bump coach plugin to v0.2.4
claude May 25, 2026
baeb767
Merge pull request #55 from TheAngryRaven/claude/coach-0.2.4
TheAngryRaven May 25, 2026
667e3ad
Changes
lovable-dev[bot] May 25, 2026
81a6b0a
Changes
lovable-dev[bot] May 25, 2026
3699561
Applied missing profiles migration
lovable-dev[bot] May 25, 2026
830c503
Work in progress
lovable-dev[bot] May 25, 2026
3ac2acd
Lovable update
lovable-dev[bot] May 25, 2026
da67f51
Add cloud log deletion to the Profile tab
claude May 25, 2026
2e53bdd
Merge pull request #56 from TheAngryRaven/claude/cloud-log-deletion
TheAngryRaven May 25, 2026
ff0253d
Offline-aware, conflict-safe document sync (timestamp merge + pending…
claude May 25, 2026
fbb6ea7
Merge pull request #57 from TheAngryRaven/claude/sync-timestamp-merge
TheAngryRaven May 25, 2026
c03e774
Sync user tracks & courses (documents storage type)
claude May 25, 2026
3478e53
Merge pull request #58 from TheAngryRaven/claude/sync-tracks
TheAngryRaven May 25, 2026
945fff7
Propagate log deletes to the cloud + prevent orphaned blobs
claude May 25, 2026
82f79d5
Merge pull request #59 from TheAngryRaven/claude/log-delete-propagation
TheAngryRaven May 25, 2026
bf24e32
Partial document push when over the cloud quota
claude May 25, 2026
6d579bd
Merge pull request #60 from TheAngryRaven/claude/over-limit-partial-push
TheAngryRaven May 25, 2026
11402b6
Cloud cleanup: move sync to Files tab, pricing cards, register captcha
claude May 26, 2026
c183c59
Cloud sync: login on Profile, download-all in Files footer, pricing f…
claude May 26, 2026
d78e461
Merge remote-tracking branch 'origin/BETA' into claude/cloud-cleanup-…
claude May 26, 2026
aa970bf
Merge pull request #61 from TheAngryRaven/claude/cloud-cleanup-pricing
TheAngryRaven May 26, 2026
71f57b3
Add Stripe subscription backend (tiers, webhook, quota wiring)
claude May 26, 2026
1a1416d
Scope test coverage to logic, exclude the React view layer
claude May 26, 2026
438724f
Merge pull request #63 from TheAngryRaven/claude/coverage-report-ui-f…
TheAngryRaven May 26, 2026
a50290f
Merge pull request #62 from TheAngryRaven/claude/stripe-payments
TheAngryRaven May 26, 2026
d2fc96b
Add unit tests for parsers, reference/field utils, and garage events
claude May 26, 2026
9255f94
Add unit tests for GPS/math logic and video-overlay logic
claude May 26, 2026
f6bdb2e
Merge pull request #64 from TheAngryRaven/claude/coverage-report-ui-f…
TheAngryRaven May 26, 2026
834d7ec
Wire up subscription tier UI (upgrade / current / manage)
claude May 26, 2026
b439888
Update @perchwerks/eye-in-the-sky to 0.2.5
claude May 26, 2026
31537cc
Merge pull request #65 from TheAngryRaven/claude/coverage-report-ui-f…
TheAngryRaven May 26, 2026
b2f4d37
Merge pull request #66 from TheAngryRaven/claude/stripe-client-wiring
TheAngryRaven May 26, 2026
efe58c3
Work in progress
lovable-dev[bot] May 27, 2026
a9c2aae
Lovable update
lovable-dev[bot] May 27, 2026
25064e2
Add Terms of Service + rewrite Privacy Policy for cloud/AI/billing
claude May 27, 2026
9a6e662
Add a Premium subscription tier ($3/mo, Pro storage, no AI)
claude May 27, 2026
1edf93f
Move pricing cards above the registration form
claude May 27, 2026
fb583b3
Update Privacy Policy with operating entity and cloud/AI disclosures
claude May 27, 2026
2f4e284
Revert "Update Privacy Policy with operating entity and cloud/AI disc…
claude May 27, 2026
efbcd4a
Merge pull request #67 from TheAngryRaven/claude/pricing-card-reorder…
TheAngryRaven May 27, 2026
97a3fbf
Merge pull request #68 from TheAngryRaven/claude/premium-tier
TheAngryRaven May 27, 2026
ca0dbdc
Merge branch 'BETA' into claude/legal-docs-privacy-terms
TheAngryRaven May 27, 2026
bd5caaa
Merge pull request #69 from TheAngryRaven/claude/legal-docs-privacy-t…
TheAngryRaven May 27, 2026
21f39da
Add GDPR self-service data export, account deletion, and IP retention
claude May 27, 2026
8647b28
Complete Stripe integration: monthly/annual, signup plan select, grac…
claude May 27, 2026
aec4e6e
Add 16+ sign-up checkbox and content TTL for messages/submissions
claude May 27, 2026
21e5f2f
Gate the AI (Pro) tier as coming-soon, not self-service purchasable
claude May 27, 2026
ca106b1
Add customizable engine-type combobox for vehicles
claude May 27, 2026
c305a0f
Merge pull request #72 from TheAngryRaven/claude/vehicle-engine-custo…
TheAngryRaven May 27, 2026
d668805
Merge branch 'BETA' into claude/gdpr-compliance-features-SfQKQ
TheAngryRaven May 27, 2026
7a2eba0
Merge pull request #70 from TheAngryRaven/claude/gdpr-compliance-feat…
TheAngryRaven May 27, 2026
d9d0f3e
Merge remote-tracking branch 'origin/BETA' into claude/stripe-integra…
claude May 27, 2026
8780268
Merge pull request #71 from TheAngryRaven/claude/stripe-integration-s…
TheAngryRaven May 27, 2026
10e8202
Add lap snapshots: frozen "course fastest lap" per engine
claude May 27, 2026
12bef4e
Merge pull request #73 from TheAngryRaven/claude/lap-snapshot-feature…
TheAngryRaven May 27, 2026
97f7f1f
Changes
lovable-dev[bot] May 28, 2026
2440a3c
Deployed all 4 edge functions
lovable-dev[bot] May 28, 2026
21a51bc
Let snapshots be loaded as the reference lap
claude May 28, 2026
3e055b4
Merge pull request #74 from TheAngryRaven/claude/lap-snapshot-feature…
TheAngryRaven May 28, 2026
49ebdc3
Fix stale PostgREST schema cache breaking subscriptions + snapshot sync
claude May 28, 2026
b4d2b88
Expose the active reference snapshot to plugin panels
claude May 28, 2026
0793287
Self-heal lap-snapshot sync from the Profile panel
claude May 28, 2026
f61bd3e
Merge pull request #75 from TheAngryRaven/claude/snapshot-sync-billin…
TheAngryRaven May 28, 2026
9f0392e
Expose the session-assigned setup to plugin panels
claude May 28, 2026
0ec83c9
Merge pull request #76 from TheAngryRaven/claude/lap-snapshot-feature…
TheAngryRaven May 28, 2026
1ea22d4
Add missing lap_snapshots (user, course, engine) unique index
claude May 28, 2026
78f8357
Merge pull request #77 from TheAngryRaven/claude/lap-snapshots-unique…
TheAngryRaven May 28, 2026
86487c0
Changes
lovable-dev[bot] May 28, 2026
c2a0a79
Added `lap_snapshots` index
lovable-dev[bot] May 28, 2026
b8a77a7
Re-set lap_snapshots column defaults (id, updated_at)
claude May 28, 2026
f70af29
Bump @perchwerks/eye-in-the-sky to 0.3.0
claude May 28, 2026
a88e31b
Merge pull request #78 from TheAngryRaven/claude/lap-snapshots-column…
TheAngryRaven May 28, 2026
a29394b
Merge pull request #79 from TheAngryRaven/claude/eye-in-sky-v0.3.0-ibCZK
TheAngryRaven May 28, 2026
2111c36
Changes
lovable-dev[bot] May 28, 2026
aee2056
Ran migration and preview
lovable-dev[bot] May 28, 2026
2a82c2e
Add snapshot quota meter + local-storage hint to the Storage section
claude May 28, 2026
8cb783c
Merge pull request #80 from TheAngryRaven/claude/lap-snapshot-feature…
TheAngryRaven May 28, 2026
5f71af8
Derive snapshot count + limit client-side so the meter actually renders
claude May 28, 2026
fd72bf0
Merge pull request #81 from TheAngryRaven/claude/lap-snapshot-feature…
TheAngryRaven May 28, 2026
221ce95
Harden auth, billing, and account-deletion paths
claude May 28, 2026
868c64c
Fix cloud-sync cross-user leaks, orphan-GC race, and pull data loss
claude May 28, 2026
d72384d
Fix snapshot direction, pace reversal, plugin tabs, and migration drift
claude May 28, 2026
87b4ee5
Merge pull request #82 from TheAngryRaven/claude/beta-security-data-b…
TheAngryRaven May 29, 2026
662829d
updated and trimmed claude.md and extracted some of the information i…
TheAngryRaven May 29, 2026
bb90c4a
Merge pull request #93 from TheAngryRaven/updating-claudemd-aijskdu
TheAngryRaven May 29, 2026
78ad929
Work in progress
lovable-dev[bot] May 29, 2026
5f73252
Changes
lovable-dev[bot] May 29, 2026
7de93b3
Redeployed functions & server
lovable-dev[bot] May 29, 2026
7ffadea
Unify cloud storage into one pooled per-tier byte budget + segmented bar
TheAngryRaven May 29, 2026
7473e05
Merge pull request #94 from TheAngryRaven/claude/modifying-profile-st…
TheAngryRaven May 29, 2026
0e86792
Changes
lovable-dev[bot] May 29, 2026
ba2dde7
Redeployed functions, ran migrations
lovable-dev[bot] May 29, 2026
5e1e2db
Make documents + snapshots always free to sync; cap notes at 128 KB
claude May 30, 2026
6caa307
Merge pull request #96 from TheAngryRaven/claude/document-snapshot-fr…
TheAngryRaven May 30, 2026
40065d4
Merge branch 'BETA' into Main2beta-jdh2id
TheAngryRaven May 30, 2026
d804c92
Merge pull request #97 from TheAngryRaven/Main2beta-jdh2id
TheAngryRaven May 30, 2026
c0bdf2b
Add immutable, content-addressed setup revisions (session setup history)
claude May 30, 2026
292ce6e
Merge branch 'BETA' into claude/setup-snapshot-history-S3vLQ
TheAngryRaven May 30, 2026
bfbe911
Prune orphan setup revisions (throttled, local-only with cloud tombst…
claude May 30, 2026
271872f
Merge pull request #98 from TheAngryRaven/claude/setup-snapshot-histo…
TheAngryRaven May 30, 2026
d0a155b
Reorganize file browser into a Track β†’ Course β†’ logs hierarchy
claude May 30, 2026
68b4442
Persist auto-detected track/course immediately
claude May 30, 2026
80e7cfc
Merge pull request #99 from TheAngryRaven/claude/setup-snapshot-histo…
TheAngryRaven May 30, 2026
83db4b8
Merge profile/account card, drop push/pull, local storage signed out
claude May 30, 2026
26d72c2
Merge pull request #100 from TheAngryRaven/claude/user-profile-refact…
TheAngryRaven May 30, 2026
70ed87a
Merge cloud logs inline into the file browser; move bulk download to …
claude May 30, 2026
a4542ff
Grey out cloud-only (not-yet-downloaded) rows in the browser
claude May 30, 2026
931b3b4
Merge pull request #101 from TheAngryRaven/claude/cloud-files-inline-…
TheAngryRaven May 30, 2026
0a31436
Rework beta subscriptions + registration
claude May 30, 2026
117e0ac
Make Plus recommended, reorder sign-up, fix tablet grid
claude May 30, 2026
06bb8f6
Refine pricing card feature copy
claude May 30, 2026
bf82a92
Add "video uploads & sharing (coming soon)" to Plus card
claude May 30, 2026
11a4e7b
Harden stripe-webhook against demoting active subs to free
claude May 30, 2026
ee1f8b8
Merge pull request #102 from TheAngryRaven/claude/beta-subscriptions-…
TheAngryRaven May 30, 2026
b7c127f
Changes
lovable-dev[bot] May 30, 2026
aa57810
Redeployed edge functions
lovable-dev[bot] May 30, 2026
2b12b64
fix(supabase): make cloud-sync policy migrations idempotent
claude May 30, 2026
2c99914
Merge pull request #103 from TheAngryRaven/claude/supabase-migrations…
TheAngryRaven May 30, 2026
85b95cb
fix(supabase): align 20260528001943 function signatures to applied sc…
claude May 30, 2026
524c35f
Merge pull request #104 from TheAngryRaven/claude/supabase-migrations…
TheAngryRaven May 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 37 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
# =============================================================================
# Build-time configuration for Dove's DataViewer / HackTheTrack
# =============================================================================
#
# Two prefixes are accepted at build time (see vite.config.ts):
#
# VITE_* Standard Vite convention. Read directly from .env at build time.
# Easiest for local dev. NOT accepted by Lovable's secret store
# (Lovable rejects the VITE_ prefix because those values are
# public/bundled).
#
# HTT_* Mirror prefix accepted by Lovable workspace **build secrets**.
# If you don't want to commit .env values, set these in
# Workspace Settings -> Build Secrets and leave .env empty.
# They are copied into the VITE_* names at build time.
#
# Precedence per key: VITE_* > HTT_* > built-in public fallback.
#
# REMINDER: Lovable build secrets do NOT auto-inject into ad-hoc rebuilds in
# every environment yet. Until that's seamless, you may need to either:
# - regenerate this .env on each fresh build env, OR
# - re-set the HTT_* values in Workspace -> Build Secrets.
# =============================================================================

# --- Backend wiring (public anon values β€” safe to commit, but optional) ------
VITE_SUPABASE_PROJECT_ID="your-supabase-project-id"
VITE_SUPABASE_PUBLISHABLE_KEY="your-supabase-anon-key"
VITE_SUPABASE_URL="https://your-project.supabase.co"
# HTT_SUPABASE_PROJECT_ID=""
# HTT_SUPABASE_PUBLISHABLE_KEY=""
# HTT_SUPABASE_URL=""

# Set to "true" to enable the admin panel (/admin route, login UI).
# Default off β€” the public app works fully without admin features.
VITE_ENABLE_ADMIN="false"
# --- Feature flags -----------------------------------------------------------
# Set to "true" to enable public user accounts (Cloud Sync, Google sign-in,
# /register, /forgot-password, /reset-password, /auth/callback).
VITE_ENABLE_CLOUD="true"
# HTT_ENABLE_CLOUD="true"

# Set to "true" to expose the /register route.
VITE_ENABLE_REGISTRATION="false"
# Set to "true" to enable the admin panel (/admin route, login UI).
# Defaults ON so fresh builds get the full feature set.
VITE_ENABLE_ADMIN="true"
# HTT_ENABLE_ADMIN="true"

# Optional: Cloudflare Turnstile site key for the public contact form.
# Leave empty to skip CAPTCHA.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '22'
cache: 'npm'
- run: npm ci
# The build needs VITE_* env vars resolved at build time, including
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '22'
cache: 'npm'
- run: npm ci

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run test:run
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run typecheck
85 changes: 66 additions & 19 deletions .lovable/plan.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,78 @@
# Fix: Dialogs appearing behind the File Manager drawer

## Problem
## Goal

When the File Manager drawer is open (e.g. via the Bluetooth/Device tab) and a dialog opens on top of it (the BLE file download dialog from `DataloggerDownload`), the dialog renders *behind* the drawer.
Let any user (not just admins) sign up, sign in (email or Google), and reset their password so they can use Cloud Sync and future user features β€” **but keep the entire cloud/auth surface behind a single build-time flag** so the offline-first repo can ship with zero cloud code paths active. Admin status stays a separate concept driven by `user_roles`.

## Root cause
## Build-time gating model

Stacking values are inconsistent across the app:
One new flag controls all user-facing cloud auth: **`VITE_ENABLE_CLOUD`** (default `"false"`).

| Component | Overlay z | Content z |
|---|---|---|
| `src/components/ui/dialog.tsx` | `z-[9999]` | `z-[10000]` |
| `src/components/FileManagerDrawer.tsx` | `z-[10000]` (backdrop) | `z-[10001]` (panel) |
| `src/components/ui/sheet.tsx` | `z-50` | `z-50` |
| Flag | Controls |
|------|----------|
| `VITE_ENABLE_CLOUD` | Public auth routes (`/login`, `/register`, `/forgot-password`, `/reset-password`, `/auth/callback`), header "Sign in" entry, Cloud Sync Labs panel registration, Google OAuth button |
| `VITE_ENABLE_ADMIN` | `/admin` route + admin UI (unchanged) |
| `VITE_ENABLE_REGISTRATION` | **Retired** β€” registration follows `VITE_ENABLE_CLOUD` |

The drawer panel (`10001`) sits above the dialog content (`10000`), so any `Dialog` opened from inside the drawer is occluded.
When `VITE_ENABLE_CLOUD !== 'true'`:
- None of the new auth pages are imported (lazy boundaries + conditional `<Route>` mounting, same pattern as `/admin` today).
- The cloud-sync plugin's `index.ts` early-returns from `setup()` so it never contributes a panel β€” Labs tab stays absent unless something else contributes.
- The header "Sign in" affordance is not rendered.
- `AuthContext` still mounts (admin build needs it), but the new `signUp` / `signInWithGoogle` methods are no-ops behind the same flag check β€” or, cleaner, the Google-specific lovable client import stays inside the lazy page modules so it never lands in the main chunk.

## Fix
Admin builds independently set `VITE_ENABLE_ADMIN=true`; they continue to work whether cloud is on or off (admin login uses the existing `supabase.auth.signInWithPassword` path).

Raise the shared `Dialog` primitive above the custom drawer so every dialog opened from anywhere (drawer, page, etc.) always wins.
## Scope

In `src/components/ui/dialog.tsx`:
- `DialogOverlay`: `z-[9999]` β†’ `z-[10010]`
- `DialogContent`: `z-[10000]` β†’ `z-[10011]`
1. **Routing (`src/App.tsx`)**
- Add `const enableCloud = import.meta.env.VITE_ENABLE_CLOUD === 'true';`
- Mount the new public auth routes only when `enableCloud`. `/login` is mounted when `enableCloud || enableAdmin` (admin still needs it). Drop the `VITE_ENABLE_REGISTRATION` check.
- All new pages lazy-loaded so the disabled build never downloads them.

This keeps the drawer above normal page chrome but ensures any modal dialog (BLE download, export, confirmations, etc.) layers on top of it. No changes to `FileManagerDrawer` or `Sheet` are needed β€” the only known collision is dialog-vs-drawer, and `Sheet` (`z-50`) isn't used in conflict with the drawer.
2. **New pages (all lazy)**
- `src/pages/ForgotPassword.tsx` β€” email β†’ `supabase.auth.resetPasswordForEmail(email, { redirectTo: origin + '/reset-password' })`.
- `src/pages/ResetPassword.tsx` β€” public route, detects `type=recovery` hash, calls `supabase.auth.updateUser({ password })`, routes to `/`.
- `src/pages/AuthCallback.tsx` at `/auth/callback` β€” waits for `onAuthStateChange`, then redirects to `?next=` or `/`.

## Verification
3. **Rework `Login.tsx` / `Register.tsx`**
- Reframe copy from "Admin Login" β†’ "Sign in". Add a "Continue with Google" button at the top (rendered only when `enableCloud`).
- Forgot-password becomes a link to `/forgot-password` instead of an inline toggle.
- Keep the per-IP rate-limit edge function. Success redirects to `?next=` or `/` (admins land on `/admin` via the next param, set by header link).
- Registration always-on under cloud flag; keep email-confirm flow (no auto-confirm).

After the change: open the drawer β†’ Device tab β†’ trigger the BLE download dialog; the dialog and its overlay should sit above the drawer panel.
4. **Google sign-in via Lovable Cloud managed OAuth**
- Run `supabase--configure_social_auth` with `providers: ["google"]` (keep email).
- Use `lovable.auth.signInWithOAuth("google", { redirect_uri: origin + "/auth/callback" })` from the scaffolded `src/integrations/lovable/`. Import only from the cloud-flagged pages so it tree-shakes out otherwise.
- PWA: add `/^\/~oauth/` to `navigateFallbackDenylist` in `vite.config.ts` so OAuth redirects bypass the service worker.

5. **`AuthContext` additions**
- Add `signUp(email, password)` and `signInWithGoogle()` wrappers next to existing `login` / `resetPassword`. Admin role detection via `has_role` stays unchanged β€” regular users have no `user_roles` row, so `isAdmin` is `false`.

6. **Cloud Sync plugin (`src/plugins/cloud-sync/index.ts`)**
- In `setup()`, early-return when `VITE_ENABLE_CLOUD !== 'true'` so the Labs panel isn't contributed. `CloudSyncPanel.tsx` stays lazy and never imports.
- When enabled, replace the inline email/password form with: blurb + "Sign in" / "Create account" buttons routing to `/login?next=/` and `/register`, plus a "Continue with Google" shortcut using the new context method. Smaller panel, no duplicated auth UI.

7. **Header / nav affordance (`LandingPage.tsx` or top of `Index.tsx`)**
- Render a "Sign in" / account menu **only when `enableCloud`**. Signed-in users see email + Sign out; admins additionally see an Admin link (still gated by `isAdmin && enableAdmin`).

8. **Auth settings**
- Call `supabase--configure_auth`: `disable_signup: false`, `auto_confirm_email: false`, `external_anonymous_users_enabled: false`, `password_hibp_enabled: true`.

9. **Docs**
- `README.md`: add `VITE_ENABLE_CLOUD` row (default false; enables public auth + cloud sync); remove `VITE_ENABLE_REGISTRATION`; clarify `VITE_ENABLE_ADMIN` only gates `/admin`. Note offline-first invariant: with the flag off, no auth/cloud code runs.
- `CLAUDE.md`: update env vars section, architecture map, and plugin notes (cloud-sync now flag-gated).
- `CHANGELOG.md`: `[Unreleased]` entry under "Added" + "Changed" (flag rename).
- Update memory `mem://config/environment-variables` and `mem://architecture/cloud-sync-strategy` to reflect the new flag.

## Out of scope

- Apple / other social providers (easy follow-up; Lovable Cloud supports Apple).
- Profiles table / display names / avatars β€” current features key off `auth.uid()` only.
- Branded auth emails (`scaffold_auth_email_templates`) and custom email domain.

## Technical notes

- Files added: `src/pages/ForgotPassword.tsx`, `src/pages/ResetPassword.tsx`, `src/pages/AuthCallback.tsx`.
- Files changed: `src/App.tsx`, `src/pages/Login.tsx`, `src/pages/Register.tsx`, `src/contexts/AuthContext.tsx`, `src/plugins/cloud-sync/index.ts`, `src/plugins/cloud-sync/CloudSyncPanel.tsx`, `vite.config.ts` (PWA denylist), `src/components/LandingPage.tsx` (or `Index.tsx` header), `README.md`, `CLAUDE.md`, `CHANGELOG.md`.
- Tool-generated (do not hand-edit): `src/integrations/lovable/` from `configure_social_auth`. Even when generated, it only runs at import time from cloud-flagged pages β†’ stays out of the disabled build's bundle via lazy boundaries.
- No DB migration required.
- Verification: `npm run build` once with `VITE_ENABLE_CLOUD` unset (confirm auth chunks absent, Labs tab not auto-mounted), once with `VITE_ENABLE_CLOUD=true` (confirm routes + Google flow work).
Loading
Loading