// Week Shape — 6 fixed weekly blocks, today highlighted. // Collapses/expands on click. State in sessionStorage only. No Supabase. const WEEK_BLOCKS = [ { id: 'mon', label: 'MON', name: 'CEO Hour', duration: '60 min', rule: 'Numbers. Pipeline. One structural fix. No clients.', dayIdx: [1] }, { id: 'tth', label: 'TUE–THU', name: 'Delivery', duration: '3–4 hrs/day', rule: 'Deep client work. Email off. Phone silent.', dayIdx: [2, 3, 4] }, { id: 'fri', label: 'FRI', name: 'Outreach + Sales', duration: '90 min', rule: '3 touches. 1 published piece. Follow-ups.', dayIdx: [5] }, { id: 'sat', label: 'SAT', name: 'Simplify', duration: '30 min', rule: 'What broke this week? Kill one distraction.', dayIdx: [6] }, { id: 'sun', label: 'SUN', name: 'Numbers + Plan', duration: '20 min', rule: 'Money in/out. Runway. Top 3 priorities for the week.', dayIdx: [0] }, { id: 'daily', label: 'DAILY', name: 'Shutdown', duration: '10 min by 6pm', rule: "Tomorrow's 3 tasks. Inbox zero. Close the laptop.", dayIdx: [] }, ]; // Returns 0-4 for the primary segment (matching WEEK_BLOCKS index), -1 for none. function getTodaySegment() { const d = new Date().getDay(); if (d === 1) return 0; if (d >= 2 && d <= 4) return 1; if (d === 5) return 2; if (d === 6) return 3; if (d === 0) return 4; return -1; } function WeekShape() { const initOpen = (() => { try { return sessionStorage.getItem('weekshape-open') === '1'; } catch (e) { return false; } })(); const [open, setOpen] = React.useState(initOpen); const todayIdx = getTodaySegment(); const toggle = () => { const next = !open; setOpen(next); try { sessionStorage.setItem('weekshape-open', next ? '1' : '0'); } catch (e) {} }; return (
{ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggle(); } }} style={{ background: 'var(--bg-elev)', border: '1px solid var(--border)', borderRadius: 10, cursor: 'pointer', userSelect: 'none', outline: 'none', overflow: 'hidden', }} onFocus={e => { e.currentTarget.style.boxShadow = 'var(--focus-ring)'; }} onBlur={e => { e.currentTarget.style.boxShadow = 'none'; }} > {/* — collapsed row — */}
{WEEK_BLOCKS.map((b, i) => { const isToday = i === todayIdx; const isDaily = b.id === 'daily'; const isPast = !isDaily && i < todayIdx; return (
0 ? '1px solid var(--border)' : 'none', opacity: isPast ? 0.4 : 1, background: isToday ? 'rgba(122,38,234,0.09)' : 'transparent', }}> {b.label} {b.name}
); })} {/* chevron */}
{/* — expanded rules row — */} {open && (
{WEEK_BLOCKS.map((b, i) => (
0 ? '1px solid var(--border)' : 'none', }}> {b.rule} {b.duration}
))}
)}
); } Object.assign(window, { WeekShape });