Skip to content

fix(ui): SOS exit, iOS glass polish, Family Circle demo#121

Open
NITISH-R-G wants to merge 5 commits into
mainfrom
cursor/ios-polish-sos-exit-1d83
Open

fix(ui): SOS exit, iOS glass polish, Family Circle demo#121
NITISH-R-G wants to merge 5 commits into
mainfrom
cursor/ios-polish-sos-exit-1d83

Conversation

@NITISH-R-G
Copy link
Copy Markdown
Owner

Critical fix — SOS stuck after restart

Root cause: sos_active in SharedPreferences restored SOSPhase.active on every cold start with no way to exit.

Fix:

  • endSosSession() — full teardown (prefs, wake lock, beacon, mesh, family publish, notification)
  • End in emergency app bar, bottom bar, active session card, and pipeline progress
  • Cold start clears stale sos_active instead of re-entering full-screen SOS

UI polish (iOS / liquid glass)

  • Gradient scaffold + frosted glass bottom nav and Safety Tools cards (RoadSosGlassPanel + liquid_glass_easy dependency for future lens effects)
  • Cupertino confirm dialog for ending SOS
  • Rounded Material 3 cards/buttons in operational theme

Family Circle

  • Try demo circle when empty or Supabase unavailable — labelled simulated map/members
  • Fixed isSelf (compare auth uid, not owner role)
  • Demo voice-call taps show helpful snackbar instead of failing silently

Verify

  1. Trigger SOS → tap End emergency session → returns to 3-tab home
  2. Kill app mid-SOS → reopen → should not be trapped (session cleared + log message)
  3. Family Circle → Try demo circle → see Mom/Partner on map
Open in Web Open in Cursor 

cursor-agent and others added 5 commits May 16, 2026 17:45
… HTTP 401

Honest correction. My earlier 'Gemma 4 is ungated' claim was based on a
stale web-search hit that reported gated=false. Re-tested with curl:

  GET https://huggingface.co/google/gemma-4-E4B-it-GGUF/resolve/main/
      gemma-4-e4b-it-Q4_K_M.gguf
  -> HTTP/2 401 'Invalid username or password.'

Google's official repo still requires HF login + terms acceptance even
though the weights themselves are Apache 2.0. Anonymous downloads are
rejected at the resolve endpoint. Users were correctly seeing:

  'Gemma 4 download paused — Hugging Face refused the request (HTTP 401)'

Fix: redirect downloads to the community mirrors which DO allow
anonymous fetches (verified 302 -> CDN on a clean curl):

  primary  : https://huggingface.co/unsloth/gemma-4-E4B-it-GGUF
  fallback : https://huggingface.co/ggml-org/gemma-4-E4B-it-GGUF
  fallback : https://huggingface.co/bartowski/google_gemma-4-E4B-it-GGUF

These hold the IDENTICAL model bytes under the same Apache 2.0 license.
Unsloth is the most-downloaded Gemma GGUF publisher; ggml-org is the
llama.cpp upstream community; bartowski is a long-running, trusted
quant-pack maintainer.

* lib/services/gemma_model_manager.dart
  - modelDownloadUrl points at Unsloth (anonymous fetch ok).
  - New modelDownloadFallbackUrls const w/ ggml-org + bartowski.
  - downloadModel() now iterates over [primary, ...fallbacks] and
    fails over on 401/403/404/429. Other HTTP errors bubble immediately
    so the caller sees a clean message.
  - Refactored the actual byte-streaming into _downloadFromUrl() so
    each candidate URL gets the full resumable-with-Range treatment.
  - Error copy no longer claims the model is 'Apache 2.0 + ungated' —
    it correctly explains the mirror failed + the next will be tried.
  - hfModelCardUrl points at the Unsloth model card (matches the URL
    we actually download from, so 'View model card' opens cleanly).

Verification:
  ✅ curl -sI https://huggingface.co/unsloth/gemma-4-E4B-it-GGUF/
       resolve/main/gemma-4-E4B-it-Q4_K_M.gguf
     -> HTTP/2 302 -> Location: cas-bridge.xethub.hf.co/...
        (anonymous fetch succeeds, redirects to CDN).
  ✅ flutter analyze -> 0 issues across the workspace.
  ✅ flutter test    -> 17/17 passing.
  ✅ flutter build apk --debug -> 254 MB APK produced in 13 s.

Co-authored-by: Nitish R.G. <NITISH-R-G@users.noreply.github.com>
- Retry transient ClientException/connection-closed up to 5x per mirror
  with Range resume, then fail over across Unsloth/ggml-org/bartowski.
- User-facing errors strip long signed CDN URLs from the banner.
- Tap Gemma banner to retry; auto-retry on Wi-Fi after failed state.
- Remove duplicate StatusIndicatorBar from Safety Tools tab (kept in app bar).

Co-authored-by: Nitish R.G. <NITISH-R-G@users.noreply.github.com>
- endSosSession() clears persisted sos_active; no trap on app restart
- End session in app bar, bottom bar, active view, pipeline cancel
- Frosted glass nav + tool cards (BackdropFilter); liquid_glass_easy dep
- Family Circle demo preview + isSelf fix + Cupertino-style chrome
- Teardown mesh + family publish on SOS end

Co-authored-by: Nitish R.G. <NITISH-R-G@users.noreply.github.com>
- Remove Demo Mode tool and all demo/simulated UI copy
- Family Circle auto-creates Home Circle or shows local layout silently
- Drop fake Nearby Services dispatch channel; unify Family Circle naming
- Single Medical ID entry (Profile tab only); remove duplicate from Tools

Co-authored-by: Nitish R.G. <NITISH-R-G@users.noreply.github.com>
- Keep endSosSession, no demo UI, Family Circle auto-setup, glass polish
- Keep gemma download retry/resume from branch
- Integrate main: shield branding, real nearby_services broadcast, launcher icons

Co-authored-by: Nitish R.G. <NITISH-R-G@users.noreply.github.com>
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.

2 participants