// home/Tweaks.jsx — in-design Tweaks for the Today redesign.
// These refine the LOCKED direction; they do not reopen the nav system.
//   · Theme override (per-artboard / light / dark)
//   · Hero metric    (Bedtime — the onboarding payoff — vs Focus count)
//   · Active tab tint (single blue accent vs per-domain preview)

const HOME_TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "themeOverride": "Per artboard",
  "heroMetric": "Bedtime",
  "activeTint": "Blue (uniform)",
  "timeOfDay": "Auto",
  "heroPalette": ["#6E5C99", "#4E4391", "#2F2866"]
}/*EDITMODE-END*/;

function HomeTweaks() {
  const [t, setTweak] = window.useTweaks(HOME_TWEAK_DEFAULTS);
  return (
    <window.TweaksPanel title="Tweaks · Today redesign">
      <window.TweakSection label="Theme">
        <window.TweakRadio
          label="Override"
          value={t.themeOverride}
          options={['Per artboard', 'Light', 'Dark']}
          onChange={v => setTweak('themeOverride', v)}
        />
      </window.TweakSection>

      <window.TweakSection label="Hero gradient">
        <window.TweakSelect
          label="Time of day"
          value={t.timeOfDay}
          options={['Auto', 'Dawn', 'Morning', 'Afternoon', 'Evening', 'Night']}
          onChange={v => setTweak('timeOfDay', v)}
        />
        <window.TweakColor
          label="Palette"
          value={t.heroPalette}
          options={window.HERO_PALETTE_REPS}
          onChange={v => setTweak('heroPalette', v)}
        />
      </window.TweakSection>

      <window.TweakSection label="Hero metric">
        <window.TweakRadio
          label="Signature number"
          value={t.heroMetric}
          options={['Bedtime', 'Focus']}
          onChange={v => setTweak('heroMetric', v)}
        />
      </window.TweakSection>

      <window.TweakSection label="Tab bar">
        <window.TweakRadio
          label="Active tint"
          value={t.activeTint}
          options={['Blue (uniform)', 'Per-domain']}
          onChange={v => setTweak('activeTint', v)}
        />
      </window.TweakSection>
    </window.TweaksPanel>
  );
}
window.HomeTweaks = HomeTweaks;
window.HOME_TWEAK_DEFAULTS = HOME_TWEAK_DEFAULTS;
