/* Priority workspace */ function PriorityPage({ tweaks, onBackHome }) { const primary = tweaks.primaryColor; const [now, setNow] = React.useState(() => new Date()); const [selectedDate, setSelectedDate] = React.useState(getTodayInputValue); const [tasksByDate, setTasksByDate] = React.useState(() => { try { return JSON.parse(localStorage.getItem(PRIORITY_TASK_STORAGE_KEY) || '{}'); } catch (err) { return {}; } }); const [draftTask, setDraftTask] = React.useState(''); React.useEffect(() => { const timer = window.setInterval(() => setNow(new Date()), 1000); return () => window.clearInterval(timer); }, []); React.useEffect(() => { try { localStorage.setItem(PRIORITY_TASK_STORAGE_KEY, JSON.stringify(tasksByDate)); } catch (err) {} }, [tasksByDate]); const tasks = tasksByDate[selectedDate] || []; const completedTasks = tasks.filter(task => task.done); const addTask = (event) => { event.preventDefault(); const text = draftTask.trim(); if (!text) return; const task = { id: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`, text, done: false, createdAt: new Date().toISOString(), }; setTasksByDate(current => ({ ...current, [selectedDate]: [...(current[selectedDate] || []), task], })); setDraftTask(''); }; const updateTask = (taskId, patch) => { setTasksByDate(current => ({ ...current, [selectedDate]: (current[selectedDate] || []).map(task => task.id === taskId ? { ...task, ...patch } : task ), })); }; const removeTask = (taskId) => { setTasksByDate(current => ({ ...current, [selectedDate]: (current[selectedDate] || []).filter(task => task.id !== taskId), })); }; return (
Admin workspace

Priority

20: W 20: F 20: W BOD Request MTC Project Group Request Personal Project

Priority task

setDraftTask(event.target.value)} placeholder="Add task" style={priorityFieldStyle()} />
{tasks.length === 0 ? (
No priority task for this day.
) : tasks.map(task => (
updateTask(task.id, { done: event.target.checked })} style={{ width: 18, height: 18, accentColor: primary }} /> updateTask(task.id, { text: event.target.value })} style={{ ...priorityFieldStyle(), textDecoration: task.done ? 'line-through' : 'none', color: task.done ? 'rgba(var(--theme-text-rgb),0.46)' : 'var(--theme-text)', }} />
))}
); } function PriorityClock({ now }) { const blue = '#38BDF8'; const yellow = '#F5B96B'; const totalMinutes = now.getMinutes() + now.getSeconds() / 60 + now.getMilliseconds() / 60000; const angle = totalMinutes * 6; const pointer = priorityPolar(120, 120, 82, angle); const pointerOuter = priorityPolar(120, 120, 96, angle); return (
{Array.from({ length: 12 }).map((_, index) => { const tickAngle = index * 30; const p1 = priorityPolar(120, 120, 103, tickAngle); const p2 = priorityPolar(120, 120, 108, tickAngle); return ; })}
); } function FocusGarden({ tasks, color, date }) { const plantCount = tasks.length; const beds = plantCount > 0 ? tasks : Array.from({ length: 6 }).map((_, index) => ({ id: `seed-${index}`, text: 'Waiting', done: false, seed: true, })); const selectedDate = priorityParseDate(date); const dayLabel = selectedDate.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: '2-digit', }); return (
Focus Garden

{plantCount} plant{plantCount === 1 ? '' : 's'} grown

{dayLabel}
{beds.map((task, index) => ( ))}
); } function FocusPlant({ task, index, color }) { const tones = ['#22C55E', '#38BDF8', '#F5B96B', '#A855F7', '#F97316', '#10B981']; const tone = task.seed ? 'rgba(var(--theme-text-rgb),0.28)' : tones[index % tones.length]; const height = task.seed ? 22 : 38 + (index % 4) * 8; return (
{task.seed ? 'Complete a task' : task.text}
); } function PriorityPanel({ title, children }) { return (

{title}

{children}
); } function PriorityDatePicker({ value, onChange, color }) { const today = getTodayInputValue(); const date = priorityParseDate(value); const month = date.toLocaleDateString('en-US', { month: 'short' }); const weekday = date.toLocaleDateString('en-US', { weekday: 'short' }); const day = String(date.getDate()).padStart(2, '0'); const year = date.getFullYear(); const isToday = value === today; const shiftDate = (offset) => { const next = priorityParseDate(value); next.setDate(next.getDate() + offset); onChange(priorityFormatDate(next)); }; return (
); } function priorityDateButtonStyle(color) { return { width: 38, minWidth: 38, minHeight: 44, borderRadius: 14, border: `1px solid ${color}35`, background: `${color}12`, color, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', }; } function priorityParseDate(value) { const [year, month, day] = String(value || getTodayInputValue()).split('-').map(Number); return new Date(year || 1970, (month || 1) - 1, day || 1); } function priorityFormatDate(date) { const local = new Date(date.getTime() - date.getTimezoneOffset() * 60000); return local.toISOString().slice(0, 10); } function PriorityLine({ children, color = 'var(--theme-text)' }) { return (
{children}
); } function priorityFieldStyle() { return { width: '100%', minWidth: 0, padding: '11px 12px', borderRadius: 12, border: '1px solid rgba(var(--theme-text-rgb),0.1)', background: 'rgba(var(--theme-bg-rgb),0.42)', color: 'var(--theme-text)', fontFamily: 'Poppins, sans-serif', fontSize: 14, outline: 'none', }; } function priorityPolar(cx, cy, radius, angle) { const radians = (angle - 90) * Math.PI / 180; return { x: cx + radius * Math.cos(radians), y: cy + radius * Math.sin(radians), }; } function priorityArcPath(cx, cy, radius, startAngle, endAngle) { const start = priorityPolar(cx, cy, radius, endAngle); const end = priorityPolar(cx, cy, radius, startAngle); const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1; return `M ${start.x} ${start.y} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${end.x} ${end.y}`; }