import { type Component, For, createMemo } from "solid-js"; import { store, calculateUrgencyScore, setActiveTaskId, setStore, matchesFilter } from "@/store"; import { cn } from "@/lib/utils"; import { Select, SelectContent, SelectItem, SelectTrigger } from "@/components/ui/select"; export const MatrixView: Component = () => { const activeTasks = createMemo(() => store.tasks.filter(t => !t.completed && !t.deletedAt && matchesFilter(t))); const scaleOptions = ["1", "7", "30", "60", "90"]; return (

Strategy Matrix

Urgency vs Priority mapping.

{/* Axis Labels */}
← Soon
Time:
Later →
← Low (Priority) High →
{/* Quadrant Lines */}
{/* Quadrant Labels */}
DO FIRST
SCHEDULE
DELEGATE
ELIMINATE
{/* Task Pips */} {(task) => { const getPosition = () => { // Continuous geometric urgency mapping const now = new Date().getTime(); const due = new Date(task.dueDate).getTime(); const diffHours = Math.max(0.1, (due - now) / (1000 * 60 * 60)); // Level formula: H = 24 * base^(10-v) => v = 10 - logBase(H/24) const base = Math.pow(Math.max(1, store.matrixScaleDays), 1 / 9); const continuousLevel = 10 - (Math.log(diffHours / 24) / Math.log(base)); const clampedLevel = Math.min(10, Math.max(1, continuousLevel)); // Map 1-10 level to 10-90% X coordinate (10 on left, 1 on right) const x = 100 - (((clampedLevel - 1) / 9) * 80 + 10); // Y-axis: Priority (1 to 10) // 10 = 10%, 1 = 90% const y = 100 - (((task.priority - 1) / 9) * 80 + 10); return { x, y }; }; const urgencyScore = calculateUrgencyScore(task.dueDate); // Map task size (0-10) to HSL Hue (240 = Blue/Cool, 0 = Red/Warm) // This creates a "true gradient" from small to large tasks. const taskSize = task.size ?? 5; const hue = (1 - (taskSize / 10)) * 240; const dotColor = `hsl(${hue}, 85%, 55%)`; return (
setActiveTaskId(task.id)} style={{ left: `${getPosition().x}%`, top: `${getPosition().y}%`, transform: 'translate(-50%, -50%)' }} >
{/* Tooltip */}

{task.title}

U: {urgencyScore} S: {task.size ?? 5} P: {task.priority}
); }}
); };