mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
The chat-side sources rail and the settings cog drove two different data-source models — the rail hardcoded the legacy five sources and kept its selection in ephemeral drawer state that reset on close, while the cog edited the ten persisted clusters on User.coachPrefsJson. The prompt scope followed the persisted clusters, so what the rail showed could differ from what the model received. Bind the rail to the same persisted prefs: it now reads useCoachPrefs and writes the cluster toggles + analysis window through a shared useSaveCoachPrefs mutation, so a toggle sticks and the cog reflects it (and vice-versa). The chat request no longer sends a scope override, so the route resolves the source set and window from coachPrefsJson and the rail display cannot drift from the prompt. Drop the ephemeral scope state, the duplicate header window pill, and the legacy five-source rail model. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>