From 388618e62c32c9144adf28aa968bd4316056e029 Mon Sep 17 00:00:00 2001 From: mARTin Date: Sun, 5 Apr 2026 11:43:57 +0200 Subject: [PATCH] fix: URL and rich-text notes now work in someday area tasks TaskItem (used for all someday list tasks) was missing URL support entirely. Added: - onUrl prop wired to updateTaskUrl at both someday TaskItem render sites (slot tasks and unindexed/remaining tasks) - URL indicator (clickable link badge) shown inline on the task row - Link action button in the task-actions bar that opens an inline URL editor - URL popup with input, clear button, and open-in-new-tab shortcut Also upgraded TaskItem's notes editor from plain markdown textarea to RichTextEditor (same as GridTaskBlock), so inline hyperlinks in notes work in the someday area too. v1.82.1 --- package.json | 2 +- src/components/WeeklyView.tsx | 125 +++++++++++++++++++++++++++------- 2 files changed, 101 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 319baa8..5242d3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.82.0", + "version": "1.82.1", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index 77ee7e5..e096fa3 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -102,6 +102,7 @@ import { AVAILABLE_FONTS, isCustomFont } from "../lib/fontConstants"; import { translations } from "../lib/weeklyViewTranslations"; import { WeatherDisplayKey, WEATHER_DISPLAY_DEFAULTS } from "../lib/weeklyViewConstants"; const SettingsSidebar = dynamic(() => import("./SettingsSidebar"), { ssr: false }); +const RichTextEditor = dynamic(() => import("./RichTextEditor"), { ssr: false }); // Cookie helpers for per-device settings const DEVICE_SETTINGS_KEYS = ["viewDays", "cellDuration", "startHour", "endHour"]; @@ -8065,6 +8066,7 @@ export default function WeeklyView() { onUpdate={(title) => updateTask(task.id, title)} onDelete={() => deleteTask(task.id)} onNotes={() => setSelectedTaskForNotes(task)} + onUrl={(url) => updateTaskUrl(task.id, url)} onRollToggle={() => toggleTaskRolling(task.id)} onRecurrence={() => setSelectedTaskForRecurrence(task)} onDragStart={(e, t) => handleDragStart(e, t)} @@ -9268,6 +9270,7 @@ interface TaskItemProps { onUpdate: (title: string) => void; onDelete: () => void; onNotes: (notes: string) => void; + onUrl?: (url: string) => void; onRollToggle: () => void; onRecurrence: () => void; onDragStart: (e: DragEvent, task: Task) => void; @@ -9296,6 +9299,7 @@ function TaskItem({ onUpdate, onDelete, onNotes, + onUrl, onRollToggle, onRecurrence, onDragStart, @@ -9318,6 +9322,9 @@ function TaskItem({ const [editValue, setEditValue] = useState(task.title); const [isNotesOpen, setIsNotesOpen] = useState(false); const [notesValue, setNotesValue] = useState(task.markdownContent || ""); + const [isUrlOpen, setIsUrlOpen] = useState(false); + const [urlValue, setUrlValue] = useState(task.url || ""); + const urlInputRef = useRef(null); const [isSubTaskInputOpen, setIsSubTaskInputOpen] = useState(false); const [isSubTasksOpen, setIsSubTasksOpen] = useState(false); const [newSubTaskTitle, setNewSubTaskTitle] = useState(""); @@ -9383,6 +9390,17 @@ function TaskItem({ } }, [isNotesOpen]); + // Focus URL input when opened; sync when task.url changes + useEffect(() => { if (isUrlOpen) setTimeout(() => urlInputRef.current?.focus(), 50); }, [isUrlOpen]); + useEffect(() => { setUrlValue(task.url || ""); }, [task.url]); + + const handleUrlSave = (val: string) => { + setIsUrlOpen(false); + if (val.trim() !== (task.url || "") && onUrl) { + onUrl(val.trim()); + } + }; + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onUpdate(editValue); @@ -9690,6 +9708,27 @@ function TaskItem({ ); })()} + {/* URL indicator */} + {task.url && ( + e.stopPropagation()} + title={task.url} + style={{ + display: "inline-flex", alignItems: "center", + padding: "2px 5px", borderRadius: "4px", + background: "rgba(37,99,235,0.10)", color: "#2563eb", + textDecoration: "none", flexShrink: 0, + }} + > + + + + + + )} {/* Note indicator - toggles inline notes */} {task.markdownContent && task.markdownContent.trim().length > 0 && ( + {/* Delete */} - - - - md - -