Commit Graph

126 Commits

Author SHA1 Message Date
Jonas Bark
5b2baf2e85 screenshots & iOS build 2026-05-13 09:30:13 +02:00
Jonas Bark
8bf449e2f4 Merge branch 'vs-improvements-asin-cw-cadence-filter' into feature/trainer-overlay-multi-window-native
VS improvements ported from Tacx-Virtual-Shifting (Berg0162):
- asin clamp + int saturation in calculateFECTrackResistanceGrade (#4a)
- cw plumbing from FTMS / Zwift envSim into VS physics calc (#7)
- opt-in CadenceFilter (median + power-aware jump limiter) (#9)
- ShiftingConfig.cadenceFilterEnabled + proxy seed
- telemetry: cadence_filter_enabled in support payload
- UI toggle in gear-ratios editor + 6-locale ARB translations

Plan: docs/superpowers/plans/2026-05-12-vs-improvements-asin-cw-cadence-filter.md
2026-05-13 09:06:39 +02:00
Jonas Bark
390d09b964 UI adjustments, add screenshot to support 2026-05-13 09:05:48 +02:00
Jonas Bark
33f786ab6d telemetry: include cadenceFilterEnabled in support payload
Without this, in-the-wild VS reports can't be correlated with whether
the new opt-in spike filter was active. Mirrors the existing
gradeSmoothing → grade_smoothing plumbing.
2026-05-13 08:40:49 +02:00
Jonas Bark
2b72b64f8e overlay: re-resolve live FitnessBikeDefinition + fix macOS close + recordError
Fixes the user-reported bugs after the auto-show landed:

1. Auto-opened overlay buttons did nothing
   The trainer emulator rebinds a fresh FitnessBikeDefinition each time
   its transport restarts (e.g. when a trainer app connects), so the
   `def` captured at show() time can already be stale by the time the
   user taps + / −. Action handlers now re-resolve through a new
   `LiveDefinitionLookup` callback on every dispatch. Navigation's
   auto-show and OverlaySettingsSection's manual show both pass a
   lookup that reads `device.emulator.activeDefinition` live.

2. Toggling "Show overlay during ride" off didn't close the panel
   The vendored macOS plugin's `closeWindow` handler ignored its args
   and called `closeWindow(NSApp.mainWindow)`, which either terminated
   the app or no-op'd silently. Patched it to honor
   `isMainWindow: false` and close the (single) secondary window.

3. "Error in overlay.position.decode: Unexpected character: light"
   The vendored macOS plugin packs the Dart entrypoint args in the
   order [routeName, theme, argsJson]; the Windows runner uses
   `std::map` iteration order. The sub-window was indexing `args[1]`
   blindly. Now it scans `args[1..]` for the first JSON-looking
   payload with `x`/`y`.

Also:
- TrainerOverlayController.show now takes optional `liveDef`; all
  three implementations (desktop, android, ios) thread it through.
- Navigation initState no longer early-`return`s after auto-show, so
  the post-frame system-UI / changelog logic still runs.
- All silent `catch (_) {}` blocks in the overlay code now forward
  via `recordError(e, s, context: '...')`. New project memory
  entry [feedback_record_error.md] documents the rule.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:48:53 +02:00
Jonas Bark
eed4b66e69 overlay: auto-show on startup when trainer connects + remove debug logs
Auto-show:
- Navigation initState now subscribes to core.connection.connectionStream
  when the persisted overlay_enabled flag is true. The first connected
  smart trainer with a FitnessBikeDefinition triggers
  TrainerOverlayService.show(...) with the persisted overlay fields.
- Subscription is one-shot (cancels itself after a successful show) and
  also checks already-connected devices on mount, so the overlay reopens
  whether the trainer was reconnected before or after Navigation mounted.

Debug-log cleanup:
- Removed the `bikecontrol_dart_alive.log` liveness probe, the
  `[main:entry]` / `[main:entry/stderr]` print + stderr.writeln, the
  `[overlay-main]` step-by-step logs in the sub-window dispatch, the
  `[main:wm-spy]` channel-handler wrapper, the `[overlay-run]` /
  `[overlay-sub]` action logs in desktop_overlay_window, the
  `[overlay-main]` action-receive / dispatch-fail logs in
  desktop_overlay_controller, the `[main]` Android handler-retry logs,
  and the noisy `[multi_window_native] CreateNewWindow` cerr in the
  Windows runner.
- Kept catch handlers as silent (or kDebugMode-guarded) where the
  original error path was still useful.

Also: MainFlutterWindow simplified back to NSWindow — the vendored
multi_window_native plugin now creates the overlay sub-window as an
NSPanel with .screenSaver level + .fullScreenAuxiliary itself, so
the main window no longer needs the canBecomeMain/canBecomeKey
NSPanel overrides or the .normal level pin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:35:31 +02:00
Jonas Bark
4f28061c9f overlay/desktop: fix macOS sub-window size + fullscreen elevation timing
Two macOS regressions reported by the user:

- Initial sub-window size way too large. multi_window_native's macOS
  plugin hard-codes the sub-window at 1000x1000 with minSize 800x900
  (see plugin source createNewWindow ~line 148). Override from Dart
  in `_runOverlay`: setMinimumSize(180, 100) then setSize(220, 140).

- Overlay no longer appears above fullscreened trainer apps. The
  plugin fires `onEngineCreatedCallback` BEFORE it creates the
  NSWindow + sets its contentViewController, so our previous single
  `DispatchQueue.main.async { ... }` raced the plugin's own setup and
  found nothing in NSApp.windows. Retry up to 30 times (0.1s apart)
  until the window with our `engine` appears, then apply
  `.statusBar` level + `.fullScreenAuxiliary` collection behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:05:41 +02:00
Jonas Bark
4f1edaa029 fix background 2026-05-12 11:56:48 +02:00
Jonas Bark
f4a5469c22 overlay/desktop: fix zone mismatch, transparent macOS bg, action diagnostics
Three issues:

1. Zone mismatch from runApp:104. The diagnostic
   `WidgetsFlutterBinding.ensureInitialized()` + ping MethodChannel call
   ran BEFORE `runZonedGuarded` and bound the binding to the root zone;
   `runApp` then fired inside the zone -> mismatch. Removed the outer
   diagnostic — Dart liveness is no longer the unknown here, and the
   file-write probe at the top of main() still confirms it if needed.

2. Black window background looks bad on macOS. Win32 can't do real
   transparency without WS_EX_LAYERED, so it needs the dark fill, but
   macOS handles NSWindow alpha properly via window_manager. Make the
   Scaffold backgroundColor platform-conditional:
   - Windows: opaque 0xFF111114
   - everything else: transparent

3. Button events from the overlay don't arrive in the main app. Adding
   debugPrint at both ends ([overlay-sub] −/+ tap and [overlay-main]
   action received) to see where the BroadcastToAll → Dart listener
   chain breaks. Behaviour unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:27:17 +02:00
Jonas Bark
805d0e410c overlay/desktop: use multi_window_native on both platforms with selective plugin registration
Drop desktop_multi_window entirely; unify macOS + Windows on
multi_window_native. Windows runner re-gets the CreateNewWindow /
CloseWindow / SetMainWindowMethodHandler plumbing with selective
sub-engine registration (only WindowManagerPlugin +
MultiWindowNativePlugin) to avoid the deadlock caused by full
RegisterPlugins on secondary engines. macOS MainFlutterWindow narrows
onEngineCreatedCallback from RegisterGeneratedPlugins to the same two
plugins for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 11:14:05 +02:00
Jonas Bark
7c06b3330f overlay/desktop: use desktop_multi_window on Windows, keep multi_window_native on macOS
Add `desktop_multi_window: ^0.3.0` alongside `multi_window_native: ^1.0.4`.
On Windows the sub-window is now spawned via `WindowController.create` with a
JSON `role=trainer-overlay` argument (detected in `main()` before any heavy
bootstrap), and state/actions flow over `WindowMethodChannel(kOverlayChannel)`.
macOS continues using `MultiWindowNative.createWindow` / `notifyAllWindows` /
`registerListener` unchanged.

Windows runner reverts all `multi_window_native` plumbing:
`SecondaryWindowContext`, `CreateNewWindow`, `CloseWindow`,
`SetMainWindowMethodHandler`, and the plugin source compiled directly into the
runner are removed. `flutter_window.cpp` instead registers
`DesktopMultiWindowSetWindowCreatedCallback` so every sub-engine gets plugins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 10:33:14 +02:00
Jonas Bark
1331d6eb3c overlay/desktop: add diagnostic prints to sub-window boot
Even a flat Container doesn't render in the sub-window on Windows.
Need to know whether Dart main() reaches runApp at all — if
`wm.windowManager.waitUntilReadyToShow()` or `getId()` blocks, the
engine never gets widgets to paint and we see the Win32 background
brush regardless of widget tree.

These prints land on the console attached to `flutter run` and will
show us the exact step that stalls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 10:00:08 +02:00
Jonas Bark
2470c4ad4b overlay/desktop: drop WindowOptions setup that wedges the Windows sub-window
`waitUntilReadyToShow(WindowOptions(...))` tries to apply size +
titleBarStyle + backgroundColor + alwaysOnTop all at once. On Windows
that combination misbehaves:

- `Colors.transparent` background can't be honoured without
  `WS_EX_LAYERED`, so it ends up filling the window with white.
- `TitleBarStyle.hidden` rewrites window styles mid-startup, which the
  sub-window's render surface doesn't recover from — the engine paints
  once at the wrong size and then sits idle.

The package example's `SecondScreen` never calls `waitUntilReadyToShow`
with options. Match that: apply each setting individually after the
engine boots — set alwaysOnTop, minimumSize, hasShadow, and (macOS only)
visibleOnAllWorkspaces. No titleBarStyle/backgroundColor on Windows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:35:46 +02:00
Jonas Bark
7d151cbc2c overlay/desktop: fix sub-window first-frame + visibility on Windows
Two issues caused the sub-window to show as "all white initially, white
box on black after resize":

- The runner's CreateNewWindow skipped FlutterWindow::OnCreate's engine
  kickoff (`SetNextFrameCallback` + `ForceRedraw`). The sub-window's
  engine then never spontaneously painted and stayed at its construction
  metrics; a manual resize forced a paint but with the old 220x100
  surface, hence the "white box that doesn't follow the window".
  Replicating the same boot sequence in CreateNewWindow.

- The Scaffold background used `Theme.of(context).colorScheme.background`,
  which resolves to near-white under shadcn's light theme, masking the
  gear card on its near-white surface. Win32 doesn't do real transparency
  without WS_EX_LAYERED anyway, so use an explicit opaque dark colour
  (0xFF111114) — gives the window a clear chrome regardless of the
  user's system theme.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:25:48 +02:00
Jonas Bark
c771329f79 fix dynamic island 2026-05-11 14:13:19 +02:00
Jonas Bark
9f4e038df3 fix multi window macOS 2026-05-11 10:02:09 +02:00
Jonas Bark
40d297ba64 overlay/desktop: switch to multi_window_native
Drops desktop_multi_window 0.3.0 in favour of multi_window_native 1.0.4
on a new branch (feature/trainer-overlay-multi-window-native).

Mechanism is different but the responsibilities map cleanly:
- `MultiWindowNative.createWindow([routeName, argsJson, theme])` spawns
  the sub-window; main() detects it via the first arg.
- Communication is broadcast by method name through
  `notifyAllWindows` + `registerListener`. Conventions:
    main → overlay: trainerOverlay.state
    overlay → main: trainerOverlay.action / ready / positionChanged
  Each side filters by method name; the API has no per-window targeting.
- The overlay window grabs its windowId via `windowManager.getId()` and
  broadcasts `trainerOverlay.ready` so the controller can later close it.
- `notifyUiRendered()` is called after the first frame, per the package's
  black-screen workaround on macOS/Windows.

Native shims:
- macOS MainFlutterWindow.swift: re-register plugins on every new
  sub-engine via `MultiWindowNativePlugin.onEngineCreatedCallback`. Kept
  the `.statusBar` / `.fullScreenAuxiliary` elevation for visibility
  above fullscreened trainer apps; the callback now finds the new
  sub-window's NSWindow by matching the FlutterViewController's engine.
- Windows flutter_window.cpp: reverted the desktop_multi_window callback;
  multi_window_native's Windows wiring requires a more invasive
  flutter_window.h / cpp change (SetOnCloseCallback, GetFlutterViewController,
  callback registration in main.cpp) which is TBD. The overlay is only
  verified on macOS in this branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 09:11:00 +02:00
Jonas Bark
f51ab099b7 android: silence the trainer-overlay foreground-service notification
Android's SYSTEM_ALERT_WINDOW + specialUse foreground service requires
*some* notification — we can't suppress it entirely. Empty the content
line and set visibility to secret so it doesn't appear on the lock
screen or as a heads-up; it lives unobtrusively in the notification
shade only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 07:56:16 +02:00
Jonas Bark
1554ac0788 fix gear change buttons 2026-05-10 11:10:22 +02:00
Jonas Bark
14599d9cda fix Android 2026-05-10 09:46:12 +02:00
Jonas Bark
0a3b560d4f Revert "fix(overlay/android): match working example for sizing, position, and root widget"
This reverts commit 56730fa25e.
2026-05-10 09:36:42 +02:00
Jonas Bark
99053d84da fix(overlay/android): match working example for sizing, position, and root widget
Two reasons the Android overlay was rendering invisibly:

1. flutter_overlay_window 0.5.0 passes the width/height args through to
   WindowManager.LayoutParams as RAW PIXELS (not dp). Passing width=400
   produced a ~100dp-wide strip on a high-density phone. The default y
   position is -statusBarHeightPx(), which hid most of the surface
   behind the status bar.
   - Use WindowSize.matchParent for width (-1 = MATCH_PARENT).
   - Use a generous pixel height (600).
   - Pass an explicit startPosition so y isn't negative.
   - Close any stale active overlay before re-showing (survives hot restart).

2. ShadcnApp does not produce stable layout constraints in the overlay's
   secondary Flutter engine. Match the package's working example: use
   MaterialApp + Material(color: transparent) at the root and a
   plain-Material overlay card with hardcoded colors. The shared
   TrainerOverlayView is for desktop only; Android needs its own
   minimal Material-friendly variant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 09:28:32 +02:00
Jonas Bark
1559caafda overlay: remove trainerOverlayMode ValueNotifier (now unused)
The global trainerOverlayMode notifier was only used by TrainerOverlayHost
to swap the main window UI. Both are gone; remove the notifier from
trainer_overlay_service.dart and drop the corresponding test assertion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:12:51 +02:00
Jonas Bark
1ea949ad01 overlay: rewrite DesktopOverlayController to use desktop_multi_window
Replace the compact-mode-of-main-window logic (which mutated
window_manager properties on the single main window) with a real
second-window approach:

- WindowController.create() spawns the overlay sub-window via
  desktop_multi_window.
- State is pushed from the main isolate at ~10 Hz (debounced) through
  WindowController.invokeMethod('state', json).
- The parent registers a WindowMethodChannel handler for 'hide',
  'toggleMode', and 'positionChanged' callbacks from the overlay.
- Dragging and window-move position persistence are handled in the
  sub-window via window_manager's WindowListener.onWindowMoved.
- No window_manager mutations on the main window at all.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:12:33 +02:00
Jonas Bark
0155231b2d overlay: add sub-window entry point and dispatch from main()
Add lib/services/overlay/desktop_overlay_window.dart with
runDesktopOverlayWindow(): configures the sub-window via window_manager
(220×140, frameless, transparent, always-on-top), registers a
setWindowMethodHandler for 'state'/'close' calls from the parent, and
routes 'hide'/'toggleMode'/'positionChanged' back via WindowMethodChannel.

Update main() to call WindowController.fromCurrentEngine() after
WidgetsFlutterBinding.ensureInitialized(); if the arguments indicate
role=trainer-overlay it dispatches to runDesktopOverlayWindow and
returns early, keeping all heavy init (Settings, IAP, Supabase) out of
the sub-window process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:12:22 +02:00
Jonas Bark
89c8351c63 fix live activity 2026-05-09 16:00:31 +02:00
Jonas Bark
1333894e3f fix(overlay): make Android overlay actually render and gate permission tile
The overlay isolate's overlayMain was annotated @pragma('vm:entry-point')
but the file was not imported anywhere, so Flutter never compiled it into
the binary. Android then logged 'Width is zero' followed by 'Destroying
the overlay window service' because the secondary engine couldn't find
the entry point. Importing it from android_overlay_controller.dart pulls
the file into the build.

Also gate the 'Grant overlay permission' settings tile on the actual
runtime permission state (FlutterOverlayWindow.isPermissionGranted),
hiding it once permission has been granted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 10:28:17 +02:00
Jonas Bark
4858fab743 fix(overlay): omit null values from iOS Live Activity payload
live_activities routes the map through NSUserDefaults in the App Group,
which crashes with NSInvalidArgumentException on null values. Swift's
Codable decoder maps missing keys to nil for Optional types, so omitting
power/cadence/ergTarget when null produces the same ContentState without
the crash.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 10:23:11 +02:00
Jonas Bark
bb66ee9cf9 fix(overlay): guard ios push against null _def race
Pass def explicitly to _snapshot(FitnessBikeDefinition) instead of
force-unwrapping _def! inside it. In _push(), capture both _activityId
and _def upfront and bail early if either is null, preventing a crash
when hide() clears them between a Timer callback and _push() executing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:45:54 +02:00
Jonas Bark
4a6f9f794a fix(overlay): restore opaque desktop background after hide
Set background color back to opaque black in _restore() before
reverting other window properties, so the transparent overlay color
does not leak into the restored main-window state on macOS/Windows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:44:00 +02:00
Jonas Bark
877855b6c2 feat(overlay): iOS controller backed by Live Activities (debounced 2 Hz)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:24:22 +02:00
Jonas Bark
3899c623a6 feat(review): suppress rate banner during trial period
Trial users haven't yet decided whether the app is worth paying for, so
prompting them to rate it produces noisy reviews. Hide the banner while
the trial is active; it returns once the user buys or the trial ends.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 09:19:20 +02:00
Jonas Bark
bc63f64402 feat(overlay): Android controller with permission flow and debounced state push
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:16:31 +02:00
Jonas Bark
f9a4a3f214 feat(overlay): Android overlay isolate entry point 2026-05-09 09:12:43 +02:00
Jonas Bark
0e8debd95d feat(overlay): desktop controller via window_manager (compact mode) 2026-05-08 23:09:09 +02:00
Jonas Bark
4444196175 refactor(overlay): rename OverlayState -> TrainerOverlayState to avoid Flutter collision
Removes the need to `hide OverlayState` on shadcn_flutter imports in
trainer_overlay_view.dart and its widget test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 23:06:24 +02:00
Jonas Bark
9c97c7d131 feat(overlay): platform router and global overlay-mode notifier 2026-05-08 23:00:45 +02:00
Jonas Bark
a1c6704d3b feat(overlay): TrainerOverlayController interface and no-op impl 2026-05-08 22:59:07 +02:00
Jonas Bark
f37c7bcd7d feat(overlay): OverlayField enum and OverlayState data class 2026-05-08 22:47:54 +02:00
Jonas Bark
6712a5803c fix reported issues 2026-04-28 10:38:04 +02:00
Jonas Bark
294aea1d2c refactor: swap proxy live telemetry for services list in debugText
The power / cadence / speed / hr fields aren't useful for diagnosing
a stuck Bridge or proxy issue — they're just current-rider state. The
BLE service & characteristic UUIDs are the actually-diagnostic bits,
and TelemetrySnapshot already builds that block as the chat freetext.

Promotes _buildServicesFreetext in telemetry_snapshot.dart to a
public buildProxyServicesFreetext, then has _describeProxyDevice in
menu.dart drop the live-metric fields and append the services block
indented under each proxy entry. Same exact text the support chat
freetext already includes, so report and freetext stay in lockstep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 09:41:22 +02:00
Jonas Bark
9771d046fe show support chat indicator 2026-04-28 08:57:46 +02:00
Jonas Bark
e999795655 feat: surface unread support-chat replies on the HelpButton
Adds a sticky 'support_chat_active' bool to Settings, flipped to true
the first time SupportChatService.openChat succeeds. HelpButton becomes
a StatefulWidget; if the flag is set in initState it kicks off a
background fetchChat() and counts admin-side messages whose createdAt
is later than the chat's lastSeenAt. When at least one is found, a
small destructive-coloured dot appears both on the button's leading
icon (top-right corner) and as the trailing slot of the inline 'Chat
with Support' menu entry.

Opening the chat clears the dot locally and re-runs the unread check
on return so the indicator stays in sync with what the user has now
seen. All checks are best-effort: missing auth, network errors, and
edge-function failures are swallowed and the dot just stays off.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 08:44:01 +02:00
Jonas Bark
30c4ae420b Merge branch 'claude/integrate-support-chat-qlJRP' into feat/proxy-device-details-page
# Conflicts:
#	lib/i10n/intl_de.arb
#	lib/i10n/intl_en.arb
#	lib/i10n/intl_es.arb
#	lib/i10n/intl_fr.arb
#	lib/i10n/intl_it.arb
#	lib/i10n/intl_pl.arb
#	lib/pages/proxy_device_details.dart
#	lib/pages/trainer_feedback.dart
2026-04-27 19:26:52 +02:00
Jonas Bark
6ca11bbe94 fix: replace SupabaseClient.supabaseUrl/supabaseKey with constants
The Supabase Dart SDK doesn't expose these getters on SupabaseClient,
so the support-chat attachment upload failed to compile. Hardcode the
URL (matching Supabase.initialize() in settings.dart and the existing
iap_status_widget.dart usage) and pull the anon key from the same
SUPABASE_ANON_KEY define for the raw multipart edge-function upload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 10:25:13 +02:00
Claude
14cbfb9b58 feat: replace trainer feedback and mail support with chat
Adds a Supabase-backed support chat that replaces the existing trainer
feedback page and the mail support entry in the help dropdown. The chat
captures the same telemetry snapshot (extracted into a shared
TelemetrySnapshot module) and supports threaded replies and attachments.

- New SupportChatService wrapping the four edge functions plus a signed
  URL helper for support-attachments storage.
- New SupportChatPage / SupportThreadPage with composer, attachment chips,
  optimistic send, sign-in gate, and pull-to-refresh.
- Help dropdown's Mail entry replaced with "Chat with Support" that
  pre-fills debugText() as freetext on the first message.
- Trainer device details "Provide Feedback" button now opens the chat
  with TelemetrySnapshot.fromDevice telemetry.
- Login screen gets a subordinate "Don't want to sign in? Write a mail
  instead" ghost button (mobile only) that opens the existing mailto.
- Telemetry helpers moved out of the deleted trainer feedback files into
  lib/services/telemetry_snapshot.dart; test rewritten for the new class.

https://claude.ai/code/session_0155Bb4kCYaxKh7zQfoQHZET
2026-04-27 08:18:23 +00:00
Jonas Bark
a003a1bb9b feat: add ReviewPromptService for session-based review timing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 12:07:06 +02:00
Jonas Bark
4e75d9fa0f feat: open Past Workouts in a sheet and surface duration / distance
Persists the WorkoutSummary alongside each saved workout as a sidecar
JSON file (workout-…fit.json) so the past-workouts list can render
duration, distance, avg power, and avg HR per row without parsing the
FIT. Reading is best-effort — older workouts without a sidecar fall
back to the previous filename-only layout.

Splits WorkoutsListPage into a Scaffold-wrapped page (kept for
backwards compatibility / desktop nav) and a chrome-free WorkoutsList
widget that the MiniWorkoutCard now mounts inside openSheet at the
bottom edge. WorkoutsList renders a small header and the "open folder"
shortcut when its showHeader flag is set so it stays self-contained
inside the sheet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 09:54:31 +02:00
Jonas Bark
3859dcb55a feat(workout): WorkoutRepository for local .fit file storage
Adds PastWorkout model, WorkoutRepository (save/list/delete) with UTC-stamped filenames, and wires it into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
76b6a03cc7 feat(workout): WorkoutRecorder with idle/recording/paused state machine
Implements WorkoutRecorder with start/pause/resume/stop transitions, 1 Hz
sampling loop via configurable tick timer, active duration tracking that
excludes pause time, and WorkoutResult with summary. Wires recorder into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00