diff --git a/docs/STORAGE_SCHEMA.md b/docs/STORAGE_SCHEMA.md
index 16afe7d..11b6480 100644
--- a/docs/STORAGE_SCHEMA.md
+++ b/docs/STORAGE_SCHEMA.md
@@ -259,6 +259,72 @@ Stockage compact :
- `countdowns[].alertMode` vaut `off`, `visible` ou `site`, et est omis si `off`.
- L'activation d'une alerte est bloquée dans l'interface si la fréquence configurée est inférieure à 5 minutes pour les comptes à rebours récurrents (`time_pattern` et `interval`). Le blocage ne dépend pas du temps restant avant la prochaine échéance.
+## Outil Task Planner
+
+Type : `taskPlanner`
+
+```json
+{
+ "sortMode": "manual",
+ "weeklyResetDay": 1,
+ "resetTime": "00:00",
+ "lastResetAt": 1760000000000,
+ "tasks": [
+ {
+ "id": "task1",
+ "title": "Quête 1",
+ "description": "Préparer la route.",
+ "type": "daily",
+ "checked": true,
+ "checkedAt": 1760000000000
+ },
+ {
+ "id": "task2",
+ "title": "Quête 2",
+ "type": "weekly",
+ "weeklyResetDay": 3
+ }
+ ],
+ "relations": [
+ {
+ "id": "relation1",
+ "fromTaskId": "task1",
+ "toTaskId": "task2"
+ },
+ {
+ "id": "relation2",
+ "fromTaskId": "task2",
+ "toTaskId": "task1",
+ "dependency": true
+ }
+ ]
+}
+```
+
+Notes :
+
+- `type` vaut `unique`, `daily` ou `weekly`.
+- `sortMode` vaut `manual` ou `type`. Le tri par type affiche quotidiennes, hebdo, puis uniques.
+- `weeklyResetDay` suit les jours JavaScript : `0` dimanche, `1` lundi, ..., `6` samedi.
+- `resetTime` est global à l'outil et vaut `HH:MM`.
+- `weeklyResetDay` sur une tâche hebdo surcharge le jour global.
+- `relations` stocke les parents directionnels. `fromTaskId` désigne la tâche enfant, `toTaskId` son parent.
+- une tâche ne conserve qu'un seul parent.
+- `dependency: true` marque aussi ce parent comme pré requis.
+- Les pré requis sont non bloquants : ils affichent un avertissement si le parent requis n'est pas effectué.
+
+Stockage compact :
+
+- `sortMode` est omis si la valeur vaut `manual`.
+- `weeklyResetDay` global est omis si la valeur vaut `1`.
+- `resetTime` est omis si la valeur vaut `00:00`.
+- `lastResetAt` est omis si la valeur vaut `0`.
+- `description` est omis si vide.
+- `checked` et `checkedAt` sont omis si la tâche n'est pas effectuée.
+- `weeklyResetDay` unitaire est omis si non défini.
+- `relations` est omis si vide.
+- `relations[].dependency` est omis si `false`.
+
## Outil Liens
Type : `links`
diff --git a/tests/helpers/data-validation.mjs b/tests/helpers/data-validation.mjs
index f91a400..2acdfd5 100644
--- a/tests/helpers/data-validation.mjs
+++ b/tests/helpers/data-validation.mjs
@@ -189,6 +189,39 @@ export function validateSiteContent(site) {
"toolboxes.modules.timer.emptyCountdowns",
"toolboxes.modules.timer.renameTitle",
"toolboxes.modules.timer.deleteTitle",
+ "toolboxes.modules.taskPlanner.settingsTitle",
+ "toolboxes.modules.taskPlanner.settingsButtonLabel",
+ "toolboxes.modules.taskPlanner.sortModeLabel",
+ "toolboxes.modules.taskPlanner.globalWeeklyResetDayLabel",
+ "toolboxes.modules.taskPlanner.resetTimeLabel",
+ "toolboxes.modules.taskPlanner.titlePlaceholder",
+ "toolboxes.modules.taskPlanner.titleLabel",
+ "toolboxes.modules.taskPlanner.descriptionPlaceholder",
+ "toolboxes.modules.taskPlanner.descriptionLabel",
+ "toolboxes.modules.taskPlanner.typeLabel",
+ "toolboxes.modules.taskPlanner.uniqueType",
+ "toolboxes.modules.taskPlanner.dailyType",
+ "toolboxes.modules.taskPlanner.weeklyType",
+ "toolboxes.modules.taskPlanner.addButton",
+ "toolboxes.modules.taskPlanner.reorderTitle",
+ "toolboxes.modules.taskPlanner.reorderDisabledTitle",
+ "toolboxes.modules.taskPlanner.checkTitle",
+ "toolboxes.modules.taskPlanner.uncheckTitle",
+ "toolboxes.modules.taskPlanner.deleteTitle",
+ "toolboxes.modules.taskPlanner.showDescriptionTitle",
+ "toolboxes.modules.taskPlanner.hideDescriptionTitle",
+ "toolboxes.modules.taskPlanner.taskSettingsTitle",
+ "toolboxes.modules.taskPlanner.missingDependencyTitle",
+ "toolboxes.modules.taskPlanner.missingDependencyBadge",
+ "toolboxes.modules.taskPlanner.missingDependencyNotice",
+ "toolboxes.modules.taskPlanner.taskWeeklyResetDayLabel",
+ "toolboxes.modules.taskPlanner.inheritWeeklyResetDay",
+ "toolboxes.modules.taskPlanner.linksLabel",
+ "toolboxes.modules.taskPlanner.emptyLinks",
+ "toolboxes.modules.taskPlanner.addLinkLabel",
+ "toolboxes.modules.taskPlanner.dependencyCheckboxLabel",
+ "toolboxes.modules.taskPlanner.removeRelationTitle",
+ "toolboxes.modules.taskPlanner.emptyTasks",
"toolboxes.modules.imageAnnotation.addImage",
"toolboxes.modules.imageAnnotation.replaceImage",
"toolboxes.modules.imageAnnotation.pastePlaceholder",
diff --git a/tests/static-toolboxes.test.mjs b/tests/static-toolboxes.test.mjs
index 1604d0b..9ea371f 100644
--- a/tests/static-toolboxes.test.mjs
+++ b/tests/static-toolboxes.test.mjs
@@ -37,6 +37,7 @@ test("toolbox storage, cards and pages are wired", async () => {
assert.match(toolboxStorage, /export function normalizeCountersData/);
assert.match(toolboxStorage, /export function normalizeCalculatorData/);
assert.match(toolboxStorage, /export function normalizeTimerData/);
+ assert.match(toolboxStorage, /export function normalizeTaskPlannerData/);
assert.match(toolboxStorage, /export function normalizeImageAnnotationData/);
assert.match(toolboxStorage, /export function compactModuleDataForStorage\(type, value\)/);
assert.match(toolboxStorage, /scrollResults/);
@@ -77,6 +78,7 @@ test("toolbox module registry and modules expose expected behavior", async () =>
const notepadModule = await readFile("website/src/features/toolboxes/modules/NotepadModule.jsx", "utf8");
const calculatorModule = await readFile("website/src/features/toolboxes/modules/CalculatorModule.jsx", "utf8");
const timerModule = await readFile("website/src/features/toolboxes/modules/TimerModule.jsx", "utf8");
+ const taskPlannerModule = await readFile("website/src/features/toolboxes/modules/TaskPlannerModule.jsx", "utf8");
const checklistModule = await readFile("website/src/features/toolboxes/modules/ChecklistModule.jsx", "utf8");
const imagesModule = await readFile("website/src/features/toolboxes/modules/ImagesModule.jsx", "utf8");
const imageAnnotationModule = await readFile("website/src/features/toolboxes/modules/ImageAnnotationModule.jsx", "utf8");
@@ -97,6 +99,7 @@ test("toolbox module registry and modules expose expected behavior", async () =>
assert.match(moduleRegistry, /counters:/);
assert.match(moduleRegistry, /calculator:/);
assert.match(moduleRegistry, /timer:/);
+ assert.match(moduleRegistry, /taskPlanner:/);
assert.match(moduleRegistry, /imageAnnotation:/);
assert.match(moduleRegistry, /Annotation d'images/);
assert.match(moduleRegistry, /editable: false/);
@@ -134,6 +137,13 @@ test("toolbox module registry and modules expose expected behavior", async () =>
assert.match(timerModule, /stopwatch/);
assert.match(timerModule, /countdown/);
assert.match(timerModule, /normalizeTimerData/);
+ assert.match(taskPlannerModule, /export function TaskPlannerModule/);
+ assert.match(taskPlannerModule, /normalizeTaskPlannerData/);
+ assert.match(taskPlannerModule, /applyDueResets/);
+ assert.match(taskPlannerModule, /relations/);
+ assert.match(taskPlannerModule, /dependency/);
+ assert.match(taskPlannerModule, /task-planner-warning/);
+ assert.match(taskPlannerModule, /usePointerReorder/);
assert.match(checklistModule, /export function ChecklistModule/);
assert.match(checklistModule, /TextImportModal/);
assert.match(checklistModule, /Icon name="import"/);
diff --git a/tests/toolbox-modules.test.mjs b/tests/toolbox-modules.test.mjs
index 7437cec..c7cef72 100644
--- a/tests/toolbox-modules.test.mjs
+++ b/tests/toolbox-modules.test.mjs
@@ -3,6 +3,7 @@ import { test } from "node:test";
import assert from "node:assert/strict";
import { parseColonImportLines } from "../website/src/features/toolboxes/modules/textImport.js";
import { getTimePatternRecurrenceMs, getTimePatternTargetMs } from "../website/src/features/toolboxes/modules/timerUtils.js";
+import { compactModuleDataForStorage, createToolboxExportPayload, normalizeTaskPlannerData } from "../website/src/features/toolboxes/storage/toolboxStorage.js";
test("colon text import keeps urls intact after the first separator", () => {
assert.deepEqual(parseColonImportLines("Build:https://example.com/build?class=rogue\nPotion:10"), [
@@ -26,3 +27,82 @@ test("time pattern recurrence uses configured frequency instead of next remainin
assert.equal(getTimePatternRecurrenceMs("X:24:X"), 60 * 60 * 1000);
assert.equal(getTimePatternRecurrenceMs("X:X:30"), 60 * 1000);
});
+
+test("task planner data normalizes invalid settings and relations", () => {
+ const normalized = normalizeTaskPlannerData({
+ sortMode: "unknown",
+ weeklyResetDay: 9,
+ resetTime: "27:80",
+ tasks: [
+ { id: "task1", title: "Daily", type: "daily", checked: true, checkedAt: 1000 },
+ { id: "task2", title: "Weekly", type: "weekly", weeklyResetDay: 4 },
+ { id: "task3", title: "Invalid type", type: "later" }
+ ],
+ relations: [
+ { id: "link1", fromTaskId: "task1", toTaskId: "task2" },
+ { id: "dep1", fromTaskId: "task2", toTaskId: "task1", dependency: true },
+ { id: "bad", fromTaskId: "task1", toTaskId: "missing" },
+ { id: "self", fromTaskId: "task2", toTaskId: "task2" }
+ ]
+ });
+
+ assert.equal(normalized.sortMode, "manual");
+ assert.equal(normalized.weeklyResetDay, 1);
+ assert.equal(normalized.resetTime, "00:00");
+ assert.equal(normalized.tasks[1].weeklyResetDay, 4);
+ assert.equal(normalized.tasks[2].type, "unique");
+ assert.deepEqual(normalized.relations.map((relation) => relation.id), ["link1", "dep1"]);
+ assert.equal(normalized.relations[0].dependency, false);
+ assert.equal(normalized.relations[1].dependency, true);
+});
+
+test("task planner accepts temporary split links data as combined relations", () => {
+ const normalized = normalizeTaskPlannerData({
+ tasks: [
+ { id: "task1", title: "Daily", type: "daily" },
+ { id: "task2", title: "Weekly", type: "weekly" }
+ ],
+ links: [{ id: "link1", fromTaskId: "task1", toTaskId: "task2" }],
+ dependencies: [{ id: "dep1", fromTaskId: "task2", toTaskId: "task1" }]
+ });
+
+ assert.deepEqual(normalized.relations.map((relation) => relation.toTaskId), ["task2", "task1"]);
+ assert.equal(normalized.relations[0].dependency, false);
+ assert.equal(normalized.relations[1].dependency, true);
+});
+
+
+test("task planner storage compacts defaults and export remaps task relations", () => {
+ const compact = compactModuleDataForStorage("taskPlanner", {
+ sortMode: "type",
+ weeklyResetDay: 1,
+ resetTime: "00:00",
+ tasks: [
+ { id: "task1", title: "Daily", description: "", type: "daily", checked: false },
+ { id: "task2", title: "Weekly", description: "Run", type: "weekly", checked: true, checkedAt: 2000, weeklyResetDay: 5 }
+ ],
+ relations: [
+ { id: "link1", fromTaskId: "task1", toTaskId: "task2", dependency: false },
+ { id: "dep1", fromTaskId: "task2", toTaskId: "task1", dependency: true }
+ ]
+ });
+
+ assert.equal(compact.sortMode, "type");
+ assert.equal(compact.weeklyResetDay, undefined);
+ assert.equal(compact.resetTime, undefined);
+ assert.deepEqual(compact.tasks[0], { id: "task1", title: "Daily", type: "daily" });
+ assert.equal(compact.tasks[1].weeklyResetDay, 5);
+
+ const exported = createToolboxExportPayload(
+ { id: "toolbox1", name: "Planner", modules: [{ id: "module1", type: "taskPlanner" }], updatedAt: "2026-01-01T00:00:00.000Z" },
+ { "toolbox1:module1": compact }
+ );
+ const exportedPlanner = exported.modules.m1;
+ assert.deepEqual(exportedPlanner.tasks.map((task) => task.id), ["a1", "a2"]);
+ assert.equal(exportedPlanner.relations[0].fromTaskId, "a1");
+ assert.equal(exportedPlanner.relations[0].toTaskId, "a2");
+ assert.equal(exportedPlanner.relations[0].dependency, undefined);
+ assert.equal(exportedPlanner.relations[1].fromTaskId, "a2");
+ assert.equal(exportedPlanner.relations[1].toTaskId, "a1");
+ assert.equal(exportedPlanner.relations[1].dependency, true);
+});
diff --git a/website/public/data/site.json b/website/public/data/site.json
index 6063a45..458edc0 100644
--- a/website/public/data/site.json
+++ b/website/public/data/site.json
@@ -322,6 +322,41 @@
"renameTitle": "Renommer",
"deleteTitle": "Supprimer"
},
+ "taskPlanner": {
+ "settingsTitle": "Réglages du planificateur",
+ "settingsButtonLabel": "Paramètres des réinitialisations",
+ "sortModeLabel": "Tri automatique par type",
+ "globalWeeklyResetDayLabel": "Reset hebdo",
+ "resetTimeLabel": "Heure de reset",
+ "titlePlaceholder": "Nouvelle tâche",
+ "titleLabel": "Titre",
+ "descriptionPlaceholder": "Description",
+ "descriptionLabel": "Description",
+ "typeLabel": "Type",
+ "uniqueType": "Ponctuelle",
+ "dailyType": "Quotidienne",
+ "weeklyType": "Hebdomadaire",
+ "addButton": "Ajouter",
+ "reorderTitle": "Déplacer",
+ "reorderDisabledTitle": "Tri manuel désactivé",
+ "checkTitle": "Marquer effectué",
+ "uncheckTitle": "Marquer non effectué",
+ "deleteTitle": "Supprimer",
+ "showDescriptionTitle": "Afficher la description",
+ "hideDescriptionTitle": "Masquer la description",
+ "taskSettingsTitle": "Réglages de la tâche",
+ "missingDependencyTitle": "Pré requis non effectué",
+ "missingDependencyBadge": "Pré requis",
+ "missingDependencyNotice": "Pré requis parent non effectué",
+ "taskWeeklyResetDayLabel": "Jour hebdo",
+ "inheritWeeklyResetDay": "Global",
+ "linksLabel": "Parent",
+ "emptyLinks": "Aucun parent",
+ "addLinkLabel": "Définir un parent",
+ "dependencyCheckboxLabel": "Pré requis",
+ "removeRelationTitle": "Retirer",
+ "emptyTasks": "Aucune tâche planifiée."
+ },
"imageAnnotation": {
"addImage": "Ajouter une image",
"replaceImage": "Remplacer l'image",
diff --git a/website/public/static/icons/settings.svg b/website/public/static/icons/settings.svg
new file mode 100644
index 0000000..ec442de
--- /dev/null
+++ b/website/public/static/icons/settings.svg
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/website/public/static/icons/tasklist.svg b/website/public/static/icons/tasklist.svg
new file mode 100644
index 0000000..9a59d72
--- /dev/null
+++ b/website/public/static/icons/tasklist.svg
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/website/src/components/AppOverlays.jsx b/website/src/components/AppOverlays.jsx
index 06f25a2..3094bec 100644
--- a/website/src/components/AppOverlays.jsx
+++ b/website/src/components/AppOverlays.jsx
@@ -1,10 +1,22 @@
// Rôle : regroupe les modales, notifications et viewers rendus au-dessus de l'application.
import React from "react";
+import { Icon } from "./Icon.jsx";
import { ImageViewer } from "./ImageViewer.jsx";
import { ConfirmModal, CreateToolboxModal, LinkToolboxModal, NotificationToast } from "./ToolboxModals.jsx";
import { navigate } from "../router/hashRouter.js";
import { uid } from "../features/toolboxes/storage/toolboxStorage.js";
+export function InlineNotice({ className = "", iconName = "link", message, tone = "warning" }) {
+ if (!message) return null;
+ const classes = ["inline-notice", `is-${tone}`, className].filter(Boolean).join(" ");
+ return (
+
+
+ {message}
+
+ );
+}
+
export function AppOverlays({
actions,
confirmModal,
diff --git a/website/src/features/toolboxes/ToolboxPages.jsx b/website/src/features/toolboxes/ToolboxPages.jsx
index 5133967..3ce807f 100644
--- a/website/src/features/toolboxes/ToolboxPages.jsx
+++ b/website/src/features/toolboxes/ToolboxPages.jsx
@@ -17,6 +17,7 @@ import {
normalizeCountersData,
normalizeImageAnnotationData,
normalizeLinksData,
+ normalizeTaskPlannerData,
normalizeTimerData,
normalizeUrl,
uid
@@ -146,6 +147,7 @@ function ToolboxView({ siteContent, toolbox, toolboxGame, embedded, actions, sto
normalizeCalculatorData,
normalizeImageAnnotationData,
normalizeTimerData,
+ normalizeTaskPlannerData,
normalizeUrl,
hostnameFromUrl,
copyText,
diff --git a/website/src/features/toolboxes/modules/TaskPlannerModule.jsx b/website/src/features/toolboxes/modules/TaskPlannerModule.jsx
new file mode 100644
index 0000000..dd66d8c
--- /dev/null
+++ b/website/src/features/toolboxes/modules/TaskPlannerModule.jsx
@@ -0,0 +1,623 @@
+// Rôle : fournit l'outil task planner avec tâches récurrentes, parents et pré requis.
+import { useEffect, useMemo, useRef, useState } from "react";
+import { Icon } from "../../../components/Icon.jsx";
+import { InlineNotice } from "../../../components/AppOverlays.jsx";
+import { usePointerReorder } from "../../../hooks/usePointerReorder.js";
+
+const TASK_TYPES = ["daily", "weekly", "unique"];
+const WEEK_DAYS = [
+ { value: 1, label: "Lundi" },
+ { value: 2, label: "Mardi" },
+ { value: 3, label: "Mercredi" },
+ { value: 4, label: "Jeudi" },
+ { value: 5, label: "Vendredi" },
+ { value: 6, label: "Samedi" },
+ { value: 0, label: "Dimanche" }
+];
+
+function getTaskTypeLabel(type, textContent) {
+ if (type === "daily") return textContent.dailyType || "Quotidienne";
+ if (type === "weekly") return textContent.weeklyType || "Hebdomadaire";
+ return textContent.uniqueType || "Ponctuelle";
+}
+
+function parseResetTime(value) {
+ const [hours, minutes] = String(value || "00:00").split(":").map((part) => Number.parseInt(part, 10));
+ return {
+ hours: Number.isInteger(hours) ? Math.min(23, Math.max(0, hours)) : 0,
+ minutes: Number.isInteger(minutes) ? Math.min(59, Math.max(0, minutes)) : 0
+ };
+}
+
+function getLatestDailyReset(now, resetTime) {
+ const { hours, minutes } = parseResetTime(resetTime);
+ const reset = new Date(now);
+ reset.setHours(hours, minutes, 0, 0);
+ if (reset.getTime() > now) reset.setDate(reset.getDate() - 1);
+ return reset.getTime();
+}
+
+function getLatestWeeklyReset(now, resetTime, weekDay) {
+ const { hours, minutes } = parseResetTime(resetTime);
+ const reset = new Date(now);
+ reset.setHours(hours, minutes, 0, 0);
+ const dayDiff = (reset.getDay() - weekDay + 7) % 7;
+ reset.setDate(reset.getDate() - dayDiff);
+ if (reset.getTime() > now) reset.setDate(reset.getDate() - 7);
+ return reset.getTime();
+}
+
+function applyDueResets(data, now = Date.now()) {
+ let latestResetAt = data.lastResetAt;
+ let changed = false;
+ const tasks = data.tasks.map((task) => {
+ if (task.type === "unique") return task;
+ const resetAt = task.type === "daily"
+ ? getLatestDailyReset(now, data.resetTime)
+ : getLatestWeeklyReset(now, data.resetTime, task.weeklyResetDay ?? data.weeklyResetDay);
+ latestResetAt = Math.max(latestResetAt, resetAt);
+ if (!task.checked || resetAt <= (task.checkedAt || data.lastResetAt)) return task;
+ changed = true;
+ return { ...task, checked: false, checkedAt: 0 };
+ });
+
+ if (latestResetAt > data.lastResetAt) changed = true;
+ return changed ? { ...data, lastResetAt: latestResetAt, tasks } : data;
+}
+
+function moveTask(tasks, fromTaskId, toTaskId, placement = "before") {
+ const nextTasks = [...tasks];
+ const fromIndex = nextTasks.findIndex((task) => task.id === fromTaskId);
+ const toIndex = nextTasks.findIndex((task) => task.id === toTaskId);
+ if (fromIndex < 0 || toIndex < 0) return tasks;
+ const [moved] = nextTasks.splice(fromIndex, 1);
+ const targetIndex = nextTasks.findIndex((task) => task.id === toTaskId);
+ nextTasks.splice(placement === "after" ? targetIndex + 1 : targetIndex, 0, moved);
+ return nextTasks;
+}
+
+function sortTasks(tasks, sortMode) {
+ if (sortMode !== "type") return tasks;
+ const order = new Map(TASK_TYPES.map((type, index) => [type, index]));
+ return [...tasks].sort((a, b) => (order.get(a.type) ?? 99) - (order.get(b.type) ?? 99));
+}
+
+function getTaskTitle(tasks, taskId) {
+ return tasks.find((task) => task.id === taskId)?.title || "Tâche supprimée";
+}
+
+function getTaskParentId(taskId, relations, taskIds) {
+ return relations.find((relation) => relation.fromTaskId === taskId && taskIds.has(relation.toTaskId))?.toTaskId || "";
+}
+
+function getTaskParentMap(tasks, relations) {
+ const taskIds = new Set(tasks.map((task) => task.id));
+ const parentMap = new Map(tasks.map((task) => [task.id, getTaskParentId(task.id, relations, taskIds)]));
+ tasks.forEach((task) => {
+ const visited = new Set([task.id]);
+ let parentId = parentMap.get(task.id);
+ while (parentId) {
+ if (visited.has(parentId)) {
+ parentMap.set(task.id, "");
+ return;
+ }
+ visited.add(parentId);
+ parentId = parentMap.get(parentId);
+ }
+ });
+ return parentMap;
+}
+
+function getTasksForParent(tasks, parentMap, parentId, sortMode) {
+ return sortTasks(tasks.filter((task) => (parentMap.get(task.id) || "") === parentId), sortMode);
+}
+
+export function TaskPlannerModule({ toolboxId, moduleId, context, editing }) {
+ const data = context.normalizeTaskPlannerData(context.getModuleData(toolboxId, moduleId, { tasks: [] }));
+ const textContent = context.moduleText?.taskPlanner || {};
+ const [title, setTitle] = useState("");
+ const [type, setType] = useState("daily");
+ const [nowMs, setNowMs] = useState(() => Date.now());
+ const [settingsOpen, setSettingsOpen] = useState(false);
+ const [openDescriptions, setOpenDescriptions] = useState(() => new Set());
+ const [openTaskSettings, setOpenTaskSettings] = useState(() => new Set());
+ const [dependencyNoticeTaskIds, setDependencyNoticeTaskIds] = useState(() => new Set());
+ const dependencyNoticeTimeouts = useRef(new Map());
+ const parentMap = useMemo(() => getTaskParentMap(data.tasks, data.relations), [data.tasks, data.relations]);
+ const {
+ draggingId,
+ dropTarget,
+ startDrag
+ } = usePointerReorder({
+ targetSelector: ".task-planner-item",
+ getTargetId: (target) => target.dataset.taskId,
+ canDropOn: (target, draggingTaskId) => data.sortMode === "manual" && target.dataset.parentId === (parentMap.get(draggingTaskId) || ""),
+ onMove: (fromTaskId, toTaskId, placement) => save({ ...data, tasks: moveTask(data.tasks, fromTaskId, toTaskId, placement) })
+ });
+
+ function save(nextData) {
+ context.setModuleData(toolboxId, moduleId, nextData, "taskPlanner");
+ }
+
+ useEffect(() => {
+ const intervalId = window.setInterval(() => setNowMs(Date.now()), 60000);
+ return () => window.clearInterval(intervalId);
+ }, []);
+
+ useEffect(() => () => {
+ dependencyNoticeTimeouts.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
+ }, []);
+
+ useEffect(() => {
+ const resetData = applyDueResets(data, nowMs);
+ if (resetData !== data) save(resetData);
+ });
+
+ function addTask(event) {
+ event.preventDefault();
+ const cleanTitle = title.trim();
+ if (!cleanTitle) return;
+ save({
+ ...data,
+ tasks: [
+ ...data.tasks,
+ {
+ id: context.uid("task"),
+ title: cleanTitle,
+ description: "",
+ type,
+ checked: false,
+ checkedAt: 0
+ }
+ ]
+ });
+ setTitle("");
+ setType("daily");
+ }
+
+ function updateTask(taskId, updater) {
+ save({ ...data, tasks: data.tasks.map((task) => task.id === taskId ? updater(task) : task) });
+ }
+
+ function deleteTask(taskId) {
+ save({
+ ...data,
+ tasks: data.tasks.filter((task) => task.id !== taskId),
+ relations: data.relations.filter((relation) => relation.fromTaskId !== taskId && relation.toTaskId !== taskId)
+ });
+ }
+
+ function addLinkTarget(fromTaskId, toTaskId) {
+ if (!toTaskId || fromTaskId === toTaskId || data.relations.some((relation) => relation.fromTaskId === fromTaskId && relation.toTaskId === toTaskId)) return;
+ save({
+ ...data,
+ relations: [
+ ...data.relations.filter((relation) => relation.fromTaskId !== fromTaskId),
+ { id: context.uid("relation"), fromTaskId, toTaskId, dependency: false }
+ ]
+ });
+ }
+
+ function removeLinkTarget(fromTaskId, toTaskId) {
+ save({
+ ...data,
+ relations: data.relations.filter((relation) => relation.fromTaskId !== fromTaskId || relation.toTaskId !== toTaskId)
+ });
+ }
+
+ function setDependency(fromTaskId, toTaskId, dependency) {
+ const hasRelation = data.relations.some((relation) => relation.fromTaskId === fromTaskId && relation.toTaskId === toTaskId);
+ save({
+ ...data,
+ relations: hasRelation
+ ? data.relations.map((relation) => relation.fromTaskId === fromTaskId && relation.toTaskId === toTaskId ? { ...relation, dependency } : relation)
+ : [...data.relations, { id: context.uid("relation"), fromTaskId, toTaskId, dependency }]
+ });
+ }
+
+ function toggleSet(setter, taskId) {
+ setter((current) => {
+ const next = new Set(current);
+ if (next.has(taskId)) next.delete(taskId);
+ else next.add(taskId);
+ return next;
+ });
+ }
+
+ function showDependencyNotice(taskId) {
+ const currentTimeoutId = dependencyNoticeTimeouts.current.get(taskId);
+ if (currentTimeoutId) window.clearTimeout(currentTimeoutId);
+ setDependencyNoticeTaskIds((current) => new Set(current).add(taskId));
+ const timeoutId = window.setTimeout(() => {
+ dependencyNoticeTimeouts.current.delete(taskId);
+ setDependencyNoticeTaskIds((current) => {
+ const next = new Set(current);
+ next.delete(taskId);
+ return next;
+ });
+ }, 2600);
+ dependencyNoticeTimeouts.current.set(taskId, timeoutId);
+ }
+
+ return (
+
+
+
+
+
+
+ {editing && (
+
+ )}
+
+
+ {settingsOpen && (
+
+ )}
+
+
+ {data.tasks.length ? (
+ toggleSet(setOpenDescriptions, taskId)}
+ onToggleSettings={(taskId) => toggleSet(setOpenTaskSettings, taskId)}
+ onDependencyNotice={showDependencyNotice}
+ onUpdateTask={updateTask}
+ onDeleteTask={deleteTask}
+ onAddLinkTarget={addLinkTarget}
+ onRemoveLinkTarget={removeLinkTarget}
+ onSetDependency={setDependency}
+ />
+ ) : (
+ - {textContent.emptyTasks || "Aucune tâche planifiée."}
+ )}
+
+
+ );
+}
+
+function TaskPlannerBranch({
+ parentId,
+ parentMap,
+ tasks,
+ data,
+ draggingId,
+ dropTarget,
+ textContent,
+ openDescriptions,
+ openTaskSettings,
+ dependencyNoticeTaskIds,
+ onDragStart,
+ onToggleDescription,
+ onToggleSettings,
+ onDependencyNotice,
+ onUpdateTask,
+ onDeleteTask,
+ onAddLinkTarget,
+ onRemoveLinkTarget,
+ onSetDependency,
+ visited = new Set()
+}) {
+ const children = getTasksForParent(tasks, parentMap, parentId, data.sortMode).filter((task) => !visited.has(task.id));
+ if (!children.length) return null;
+ const nextVisited = new Set([...visited, ...children.map((task) => task.id)]);
+
+ return children.map((task) => {
+ const nestedChildren = getTasksForParent(tasks, parentMap, task.id, data.sortMode).filter((child) => !nextVisited.has(child.id));
+ return (
+ onToggleDescription(task.id)}
+ onToggleSettings={() => onToggleSettings(task.id)}
+ onDependencyNotice={onDependencyNotice}
+ onUpdateTask={onUpdateTask}
+ onDeleteTask={onDeleteTask}
+ onAddLinkTarget={onAddLinkTarget}
+ onRemoveLinkTarget={onRemoveLinkTarget}
+ onSetDependency={onSetDependency}
+ >
+ {nestedChildren.length ? (
+
+ ) : null}
+
+ );
+ });
+}
+
+function TaskPlannerItem({
+ task,
+ tasks,
+ data,
+ parentMap,
+ parentId,
+ draggingId,
+ dropTarget,
+ textContent,
+ descriptionOpen,
+ settingsOpen,
+ dependencyNoticeVisible,
+ onDragStart,
+ onToggleDescription,
+ onToggleSettings,
+ onDependencyNotice,
+ onUpdateTask,
+ onDeleteTask,
+ onAddLinkTarget,
+ onRemoveLinkTarget,
+ onSetDependency,
+ children
+}) {
+ const relations = data.relations.filter((relation) => relation.fromTaskId === task.id);
+ const missingDependencies = relations.filter((relation) => relation.dependency && !tasks.find((item) => item.id === relation.toTaskId)?.checked);
+ const relationTargets = tasks.filter((item) => item.id !== task.id && !relations.some((relation) => relation.toTaskId === item.id));
+ const noticeMessage = dependencyNoticeVisible && missingDependencies.length > 0 ? textContent.missingDependencyNotice || "Pré requis parent non effectué" : "";
+ const className = [
+ "task-planner-item",
+ task.checked ? "is-complete" : "",
+ missingDependencies.length ? "has-missing-dependency" : "",
+ draggingId === task.id ? "is-dragging" : "",
+ dropTarget.id === task.id ? "is-drop-target" : "",
+ dropTarget.id === task.id && dropTarget.placement === "after" ? "drop-after" : ""
+ ].filter(Boolean).join(" ");
+
+ function updateChecked(event) {
+ const checked = event.target.checked;
+ if (checked && missingDependencies.length > 0) onDependencyNotice(task.id);
+ onUpdateTask(task.id, (current) => ({
+ ...current,
+ checked,
+ checkedAt: checked ? Date.now() : 0
+ }));
+ }
+
+ return (
+
+
+
+
+
onUpdateTask(task.id, (current) => ({ ...current, title: event.target.value }))}
+ onBlur={(event) => onUpdateTask(task.id, (current) => ({ ...current, title: event.target.value.trim() || current.title }))}
+ aria-label={textContent.titleLabel || "Titre"}
+ />
+
+ {missingDependencies.length > 0 && (
+
+ {textContent.missingDependencyBadge || "Pré requis"}
+
+ )}
+
+
+
+
+
+
+
+ {descriptionOpen && (
+
+ );
+}
+
+function LinksEditor({ label, relations, task, tasks, parentMap, relationTargets, emptyLabel, addLabel, removeLabel, dependencyLabel, onAddLinkTarget, onRemoveLinkTarget, onSetDependency }) {
+ const descendantIds = new Set();
+ function collectDescendants(taskId) {
+ tasks.filter((item) => parentMap.get(item.id) === taskId).forEach((child) => {
+ descendantIds.add(child.id);
+ collectDescendants(child.id);
+ });
+ }
+ collectDescendants(task.id);
+ const availableTargets = relationTargets.filter((target) => !descendantIds.has(target.id));
+
+ return (
+
+
{label}
+
+ {relations.length ? relations.map((relation) => (
+
+ {getTaskTitle(tasks, relation.toTaskId)}
+
+
+
+ )) :
{emptyLabel}}
+
+
+
+ );
+}
diff --git a/website/src/features/toolboxes/modules/index.jsx b/website/src/features/toolboxes/modules/index.jsx
index 9aed93f..e5d69b0 100644
--- a/website/src/features/toolboxes/modules/index.jsx
+++ b/website/src/features/toolboxes/modules/index.jsx
@@ -11,6 +11,7 @@ import { ImageAnnotationModule } from "./ImageAnnotationModule.jsx";
import { LinksModule } from "./LinksModule.jsx";
import { NotepadModule } from "./NotepadModule.jsx";
import { ImagesModule } from "./ImagesModule.jsx";
+import { TaskPlannerModule } from "./TaskPlannerModule.jsx";
import { TimerModule } from "./TimerModule.jsx";
const MODULE_COMPONENTS = {
@@ -21,6 +22,7 @@ const MODULE_COMPONENTS = {
counters: { label: "Compteurs", icon: "abacus", Component: CountersModule, editable: true, scrollable: true },
calculator: { label: "Calculateur", icon: "calculator", Component: CalculatorModule, editable: false },
timer: { label: "Timer", icon: "clock", Component: TimerModule, editable: false },
+ taskPlanner: { label: "Planificateur de tâches", icon: "tasklist", Component: TaskPlannerModule, editable: true, scrollable: true },
imageAnnotation: { label: "Annotation d'images", icon: "map", Component: ImageAnnotationModule, editable: true }
};
diff --git a/website/src/features/toolboxes/storage/toolboxStorage.js b/website/src/features/toolboxes/storage/toolboxStorage.js
index 2250e30..65bdf41 100644
--- a/website/src/features/toolboxes/storage/toolboxStorage.js
+++ b/website/src/features/toolboxes/storage/toolboxStorage.js
@@ -1,9 +1,13 @@
// Rôle : normalise, compacte et sérialise les données toolbox persistées.
-const ID_PREFIXES = { tbx: "t", mod: "m", item: "i", section: "g", image: "s", link: "l", counter: "c", calc: "r", marker: "k", timer: "z" };
+const ID_PREFIXES = { tbx: "t", mod: "m", item: "i", section: "g", image: "s", link: "l", counter: "c", calc: "r", marker: "k", timer: "z", task: "a", relation: "e" };
const ID_ALPHABET = "abcdefghijklmnopqrstuvwxyz0123456789";
const TIMER_TABS = new Set(["stopwatch", "countdown"]);
const COUNTDOWN_TYPES = new Set(["duration", "daily_time", "time_pattern", "interval"]);
const TIMER_ALERT_MODES = new Set(["off", "visible", "site"]);
+const TASK_TYPES = new Set(["unique", "daily", "weekly"]);
+const TASK_SORT_MODES = new Set(["manual", "type"]);
+const DEFAULT_TASK_PLANNER_WEEKLY_RESET_DAY = 1;
+const DEFAULT_TASK_PLANNER_RESET_TIME = "00:00";
const TOOLBOX_ICON_BASE = "/static/img/toolbox-icons/";
const TOOLBOX_ICON_FILES = [
"toolbox.png",
@@ -34,6 +38,7 @@ const DEFAULT_MODULE_TITLES = {
counters: "Compteurs",
calculator: "Calculateur",
timer: "Timer",
+ taskPlanner: "Planificateur de tâches",
imageAnnotation: "Annotation d'images"
};
@@ -224,6 +229,22 @@ function isTimeString(value, allowWildcard = false) {
});
}
+function isClockTimeString(value) {
+ if (!/^\d{2}:\d{2}$/.test(String(value || ""))) return false;
+ const [hours, minutes] = String(value).split(":").map(Number);
+ return Number.isInteger(hours) && Number.isInteger(minutes) && hours >= 0 && hours <= 23 && minutes >= 0 && minutes <= 59;
+}
+
+function normalizeWeekDay(value, fallback = DEFAULT_TASK_PLANNER_WEEKLY_RESET_DAY) {
+ const parsed = Number.parseInt(value, 10);
+ return Number.isInteger(parsed) && parsed >= 0 && parsed <= 6 ? parsed : fallback;
+}
+
+function normalizeTimestamp(value) {
+ const parsed = Number(value);
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
+}
+
export function labelFromFileName(name) {
if (!name || name === "image.png") return "";
return name.replace(/\.[^.]+$/, "").trim();
@@ -300,6 +321,65 @@ export function normalizeTimerData(data) {
};
}
+function normalizeTaskPlannerTask(task) {
+ const title = String(task?.title || "").trim() || "Tâche";
+ const type = TASK_TYPES.has(task?.type) ? task.type : "unique";
+ const normalized = {
+ id: task?.id || uid("task"),
+ title,
+ description: String(task?.description || "").trim(),
+ type,
+ checked: task?.checked === true,
+ checkedAt: normalizeTimestamp(task?.checkedAt)
+ };
+ if (type === "weekly" && task?.weeklyResetDay !== undefined) normalized.weeklyResetDay = normalizeWeekDay(task.weeklyResetDay);
+ if (!normalized.checked) normalized.checkedAt = 0;
+ return normalized;
+}
+
+function normalizeTaskPlannerRelations(data, taskIds) {
+ const seen = new Set();
+ const seenChildren = new Set();
+ const legacyDependencies = new Set((Array.isArray(data?.dependencies) ? data.dependencies : [])
+ .map((relation) => `${relation?.fromTaskId || ""}:${relation?.toTaskId || ""}`));
+ const sourceRelations = Array.isArray(data?.relations)
+ ? data.relations
+ : [
+ ...(Array.isArray(data?.links) ? data.links : []),
+ ...(Array.isArray(data?.dependencies) ? data.dependencies : []).map((relation) => ({ ...relation, dependency: true }))
+ ];
+ return sourceRelations
+ .map((relation) => {
+ const fromTaskId = String(relation?.fromTaskId || "");
+ const toTaskId = String(relation?.toTaskId || "");
+ if (!taskIds.has(fromTaskId) || !taskIds.has(toTaskId) || fromTaskId === toTaskId) return null;
+ const key = `${fromTaskId}:${toTaskId}`;
+ if (seen.has(key) || seenChildren.has(fromTaskId)) return null;
+ seen.add(key);
+ seenChildren.add(fromTaskId);
+ return {
+ id: relation?.id || uid("relation"),
+ fromTaskId,
+ toTaskId,
+ dependency: relation?.dependency === true || legacyDependencies.has(key)
+ };
+ })
+ .filter(Boolean);
+}
+
+export function normalizeTaskPlannerData(data) {
+ const tasks = (Array.isArray(data?.tasks) ? data.tasks : []).map(normalizeTaskPlannerTask).filter(Boolean);
+ const taskIds = new Set(tasks.map((task) => task.id));
+ return {
+ sortMode: TASK_SORT_MODES.has(data?.sortMode) ? data.sortMode : "manual",
+ weeklyResetDay: normalizeWeekDay(data?.weeklyResetDay),
+ resetTime: isClockTimeString(data?.resetTime) ? data.resetTime : DEFAULT_TASK_PLANNER_RESET_TIME,
+ lastResetAt: normalizeTimestamp(data?.lastResetAt),
+ tasks,
+ relations: normalizeTaskPlannerRelations(data, taskIds)
+ };
+}
+
function clampPercent(value) {
const parsed = Number(value);
if (!Number.isFinite(parsed)) return 0;
@@ -433,6 +513,40 @@ export function compactModuleDataForStorage(type, value) {
}
return Object.keys(compact).length ? compact : null;
}
+ if (type === "taskPlanner") {
+ const normalized = normalizeTaskPlannerData(value);
+ const compact = {};
+ if (normalized.sortMode !== "manual") compact.sortMode = normalized.sortMode;
+ if (normalized.weeklyResetDay !== DEFAULT_TASK_PLANNER_WEEKLY_RESET_DAY) compact.weeklyResetDay = normalized.weeklyResetDay;
+ if (normalized.resetTime !== DEFAULT_TASK_PLANNER_RESET_TIME) compact.resetTime = normalized.resetTime;
+ if (normalized.lastResetAt) compact.lastResetAt = normalized.lastResetAt;
+ if (normalized.tasks.length) {
+ compact.tasks = normalized.tasks.map((task) => {
+ const compactTask = {
+ id: task.id,
+ title: task.title,
+ type: task.type
+ };
+ if (task.description) compactTask.description = task.description;
+ if (task.checked) compactTask.checked = true;
+ if (task.checked && task.checkedAt) compactTask.checkedAt = task.checkedAt;
+ if (task.type === "weekly" && task.weeklyResetDay !== undefined) compactTask.weeklyResetDay = task.weeklyResetDay;
+ return compactTask;
+ });
+ }
+ if (normalized.relations.length) {
+ compact.relations = normalized.relations.map((relation) => {
+ const compactRelation = {
+ id: relation.id,
+ fromTaskId: relation.fromTaskId,
+ toTaskId: relation.toTaskId
+ };
+ if (relation.dependency) compactRelation.dependency = true;
+ return compactRelation;
+ });
+ }
+ return Object.keys(compact).length ? compact : null;
+ }
return value;
}
@@ -511,6 +625,24 @@ function remapModuleDataForExport(type, data, nextId) {
return remapped;
}
+ if (type === "taskPlanner") {
+ const taskIdMap = new Map();
+ compact.tasks?.forEach((task) => taskIdMap.set(task.id, nextId("task")));
+ const remapped = { ...compact };
+ if (compact.tasks) remapped.tasks = compact.tasks.map((task) => ({ ...task, id: taskIdMap.get(task.id) }));
+ if (compact.relations) {
+ remapped.relations = compact.relations
+ .map((relation) => ({
+ ...relation,
+ id: nextId("relation"),
+ fromTaskId: taskIdMap.get(relation.fromTaskId),
+ toTaskId: taskIdMap.get(relation.toTaskId)
+ }))
+ .filter((relation) => relation.fromTaskId && relation.toTaskId);
+ }
+ return remapped;
+ }
+
return compact;
}
diff --git a/website/src/styles/_icons.scss b/website/src/styles/_icons.scss
index 6ede0b1..5c71a61 100644
--- a/website/src/styles/_icons.scss
+++ b/website/src/styles/_icons.scss
@@ -52,6 +52,16 @@
-webkit-mask-image: url("/static/icons/link.svg");
}
+.ui-icon-settings {
+ mask-image: url("/static/icons/settings.svg");
+ -webkit-mask-image: url("/static/icons/settings.svg");
+}
+
+.ui-icon-tasklist {
+ mask-image: url("/static/icons/tasklist.svg");
+ -webkit-mask-image: url("/static/icons/tasklist.svg");
+}
+
.ui-icon-edit {
mask-image: url("/static/icons/edit.svg");
-webkit-mask-image: url("/static/icons/edit.svg");
diff --git a/website/src/styles/_responsive.scss b/website/src/styles/_responsive.scss
index bddc9d7..f2613a7 100644
--- a/website/src/styles/_responsive.scss
+++ b/website/src/styles/_responsive.scss
@@ -205,6 +205,30 @@
grid-template-columns: 1fr;
}
+ .task-planner-settings,
+ .task-planner-task-settings {
+ grid-template-columns: 1fr;
+ }
+
+ .task-planner-line {
+ grid-template-columns: 30px 24px minmax(0, 1fr) auto;
+ }
+
+ .task-planner-type-select,
+ .task-planner-warning {
+ grid-column: 3 / -1;
+ }
+
+ .task-planner-actions {
+ grid-column: 4;
+ grid-row: 1;
+ }
+
+ .task-planner-description,
+ .task-planner-task-settings {
+ margin-left: 0;
+ }
+
.calculator-form {
grid-row: auto;
}
diff --git a/website/src/styles/_toolboxes.scss b/website/src/styles/_toolboxes.scss
index d398646..0fd6dbd 100644
--- a/website/src/styles/_toolboxes.scss
+++ b/website/src/styles/_toolboxes.scss
@@ -686,6 +686,11 @@
-webkit-mask-image: url("/static/icons/checklist.svg");
}
+.module-icon-tasklist {
+ mask-image: url("/static/icons/tasklist.svg");
+ -webkit-mask-image: url("/static/icons/tasklist.svg");
+}
+
.module-icon-picture {
mask-image: url("/static/icons/picture.svg");
-webkit-mask-image: url("/static/icons/picture.svg");
@@ -1164,10 +1169,455 @@ textarea:focus {
.module-add-panel + .links-list,
.module-add-panel + .checklist,
+.module-add-panel + .task-planner-list,
.module-add-panel + .counters-grid {
margin-top: 0;
}
+.task-planner-module {
+ display: grid;
+ gap: var(--space-4);
+ padding: var(--space-4);
+}
+
+.task-planner-topbar {
+ display: grid;
+ gap: 10px;
+ align-items: stretch;
+}
+
+.task-planner-topbar .inline-form {
+ padding: 0;
+}
+
+.task-planner-global-controls {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ gap: 10px;
+}
+
+.task-planner-settings-toggle,
+.task-planner-dropdown-button,
+.task-planner-settings-button {
+ display: inline-grid;
+ width: 34px;
+ min-width: 34px;
+ min-height: 34px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid rgba(165, 180, 252, 0.1);
+ border-radius: var(--radius-md);
+ background: rgba(21, 26, 48, 0.76);
+ color: var(--color-text-secondary);
+}
+
+.task-planner-settings-toggle {
+ grid-template-columns: 16px minmax(0, auto);
+ width: auto;
+ max-width: 100%;
+ padding: 0 12px;
+ gap: 8px;
+}
+
+.task-planner-settings-toggle span {
+ overflow: hidden;
+ font-size: var(--font-size-xs);
+ font-weight: 900;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.task-planner-settings-toggle .ui-icon,
+.task-planner-dropdown-button .ui-icon,
+.task-planner-settings-button .ui-icon {
+ width: 16px;
+ height: 16px;
+}
+
+.task-planner-settings {
+ display: grid;
+ grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.72fr);
+ gap: 10px;
+ padding: 12px;
+ border: 1px solid rgba(165, 180, 252, 0.12);
+ border-radius: var(--radius-md);
+ background:
+ linear-gradient(135deg, rgba(139, 92, 246, 0.06), transparent 58%),
+ rgba(7, 10, 24, 0.34);
+}
+
+.task-planner-settings label,
+.task-planner-weekly-override {
+ display: grid;
+ gap: 6px;
+ min-width: 0;
+}
+
+.task-planner-settings span,
+.task-planner-weekly-override span,
+.task-planner-relations > span {
+ color: var(--color-text-secondary);
+ font-size: var(--font-size-xs);
+ font-weight: 900;
+ text-transform: uppercase;
+}
+
+.task-planner-settings select,
+.task-planner-settings input,
+.task-planner-add-form select,
+.task-planner-type-select,
+.task-planner-weekly-override select,
+.task-planner-relations select {
+ width: 100%;
+ border: 1px solid var(--color-border);
+ border-radius: var(--radius-md);
+ background-color: rgba(15, 23, 42, 0.64);
+ color: var(--color-text-primary);
+}
+
+.task-planner-settings select option,
+.task-planner-add-form select option,
+.task-planner-type-select option,
+.task-planner-weekly-override select option,
+.task-planner-relations select option {
+ background: #11182f;
+ color: var(--color-text-primary);
+}
+
+.task-planner-add-form {
+ grid-template-columns: minmax(0, 1fr) minmax(120px, 0.36fr) auto;
+}
+
+.task-planner-list {
+ display: grid;
+ gap: 10px;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.task-planner-child-list {
+ position: relative;
+ gap: 8px;
+ margin-top: 8px;
+ padding-left: 22px;
+}
+
+.task-planner-child-list::before {
+ content: "";
+ position: absolute;
+ top: -4px;
+ bottom: 15px;
+ left: 7px;
+ width: 1px;
+ background: linear-gradient(180deg, rgba(246, 196, 83, 0.46), rgba(139, 92, 246, 0.18));
+}
+
+.task-planner-child-list > .task-planner-item {
+ position: relative;
+}
+
+.task-planner-child-list > .task-planner-item::before {
+ content: "";
+ position: absolute;
+ top: 25px;
+ left: -15px;
+ width: 11px;
+ height: 1px;
+ background: rgba(246, 196, 83, 0.46);
+}
+
+.task-planner-empty {
+ padding: var(--space-4);
+ border: 1px dashed rgba(165, 180, 252, 0.18);
+ border-radius: var(--radius-md);
+ color: var(--color-text-muted);
+ text-align: center;
+}
+
+.task-planner-item {
+ position: relative;
+ display: grid;
+ gap: 10px;
+ padding: 10px;
+ border: 1px solid rgba(165, 180, 252, 0.12);
+ border-radius: var(--radius-md);
+ background: rgba(5, 7, 17, 0.36);
+}
+
+.task-planner-item.is-complete > .task-planner-line {
+ opacity: 0.78;
+}
+
+.task-planner-item.has-missing-dependency {
+ border-color: rgba(246, 196, 83, 0.34);
+ background:
+ linear-gradient(135deg, rgba(246, 196, 83, 0.06), transparent 44%),
+ rgba(5, 7, 17, 0.36);
+}
+
+.task-planner-item.is-dragging {
+ cursor: grabbing;
+ opacity: 0.58;
+ transform: scale(0.99);
+}
+
+.task-planner-item.is-drop-target {
+ border-color: rgba(246, 196, 83, 0.72);
+ box-shadow: inset 0 3px 0 rgba(246, 196, 83, 0.8);
+}
+
+.task-planner-item.is-drop-target.drop-after {
+ box-shadow: inset 0 -3px 0 rgba(246, 196, 83, 0.8);
+}
+
+.task-planner-line {
+ display: grid;
+ grid-template-columns: 30px 24px minmax(0, 1fr) 134px auto auto;
+ gap: 8px;
+ align-items: center;
+}
+
+.task-planner-line > input[type="checkbox"] {
+ justify-self: center;
+}
+
+.task-planner-drag-handle,
+.task-planner-delete-button {
+ display: inline-grid;
+ width: 30px;
+ min-width: 30px;
+ min-height: 30px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid rgba(165, 180, 252, 0.1);
+ border-radius: var(--radius-md);
+ background: rgba(21, 26, 48, 0.76);
+ color: var(--color-text-secondary);
+}
+
+.task-planner-drag-handle:disabled {
+ cursor: not-allowed;
+ opacity: 0.3;
+}
+
+.task-planner-drag-handle .ui-icon,
+.task-planner-delete-button .ui-icon {
+ width: 15px;
+ height: 15px;
+}
+
+.task-planner-actions {
+ display: inline-flex;
+ justify-content: flex-end;
+ gap: 6px;
+}
+
+.task-planner-title-input {
+ font-weight: 800;
+}
+
+.task-planner-item.is-complete > .task-planner-line .task-planner-title-input {
+ color: var(--color-text-muted);
+ text-decoration: line-through;
+}
+
+.task-planner-type-select {
+ appearance: none;
+ -webkit-appearance: none;
+ width: 100%;
+ min-height: 36px;
+ overflow: hidden;
+ padding: 0 30px 0 10px;
+ border-color: rgba(165, 180, 252, 0.09);
+ text-overflow: ellipsis;
+ background-image:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c4b5fd' viewBox='-6.5 0 32 32'%3E%3Cpath d='M18.813 11.406l-7.906 9.906c-.75.906-1.906.906-2.625 0L.376 11.406c-.75-.938-.375-1.656.781-1.656h16.875c1.188 0 1.531.719.781 1.656z'/%3E%3C/svg%3E"),
+ linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(31, 41, 78, 0.08)),
+ linear-gradient(rgba(21, 26, 48, 0.38), rgba(21, 26, 48, 0.38));
+ background-position:
+ calc(100% - 10px) 50%,
+ 0 0,
+ 0 0;
+ background-size:
+ 11px 11px,
+ auto,
+ auto;
+ background-repeat: no-repeat;
+ color: var(--color-text-secondary);
+ font-size: var(--font-size-xs);
+ font-weight: 900;
+}
+
+.task-planner-type-select:hover,
+.task-planner-type-select:focus {
+ border-color: rgba(196, 181, 253, 0.22);
+ background-image:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f6c453' viewBox='-6.5 0 32 32'%3E%3Cpath d='M18.813 11.406l-7.906 9.906c-.75.906-1.906.906-2.625 0L.376 11.406c-.75-.938-.375-1.656.781-1.656h16.875c1.188 0 1.531.719.781 1.656z'/%3E%3C/svg%3E"),
+ linear-gradient(135deg, rgba(246, 196, 83, 0.06), rgba(139, 92, 246, 0.08)),
+ linear-gradient(rgba(21, 26, 48, 0.58), rgba(21, 26, 48, 0.58));
+ color: var(--color-text-primary);
+}
+
+.task-planner-warning {
+ padding: 4px 8px;
+ border: 1px solid rgba(246, 196, 83, 0.28);
+ border-radius: var(--radius-pill);
+ background: rgba(246, 196, 83, 0.08);
+ color: var(--color-accent-gold);
+ font-size: var(--font-size-xs);
+ font-weight: 900;
+ white-space: nowrap;
+}
+
+.inline-notice {
+ display: inline-flex;
+ width: fit-content;
+ max-width: 100%;
+ align-items: center;
+ gap: 7px;
+ padding: 5px 9px;
+ border: 1px solid rgba(246, 196, 83, 0.28);
+ border-radius: var(--radius-md);
+ background:
+ linear-gradient(135deg, rgba(246, 196, 83, 0.1), rgba(139, 92, 246, 0.08)),
+ rgba(9, 12, 28, 0.9);
+ box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
+ color: var(--color-accent-gold);
+ font-size: var(--font-size-xs);
+ font-weight: 900;
+ line-height: 1.2;
+ animation: inline-notice-in 160ms ease;
+}
+
+.inline-notice .ui-icon {
+ width: 14px;
+ height: 14px;
+ flex: 0 0 auto;
+}
+
+.task-planner-notice {
+ position: absolute;
+ top: 48px;
+ left: 72px;
+ z-index: 2;
+ pointer-events: none;
+}
+
+@keyframes inline-notice-in {
+ from {
+ opacity: 0;
+ transform: translateY(-2px);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.task-planner-description,
+.task-planner-task-settings {
+ margin-left: 62px;
+}
+
+.task-planner-description {
+ min-height: 72px;
+ resize: vertical;
+}
+
+.task-planner-task-settings {
+ display: grid;
+ grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr);
+ gap: 10px;
+ align-items: start;
+ padding: 10px;
+ border: 1px solid rgba(165, 180, 252, 0.1);
+ border-radius: var(--radius-md);
+ background: rgba(7, 10, 24, 0.24);
+}
+
+.task-planner-relations {
+ display: grid;
+ grid-column: span 1;
+ gap: 6px;
+ min-width: 0;
+}
+
+.task-planner-relations > div {
+ display: grid;
+ gap: 5px;
+ min-height: 28px;
+}
+
+.task-planner-relations em {
+ color: var(--color-text-muted);
+ font-size: var(--font-size-xs);
+ font-style: normal;
+}
+
+.task-planner-relation-chip {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto 28px;
+ gap: 8px;
+ align-items: center;
+ padding: 4px 5px 4px 9px;
+ border: 1px solid rgba(165, 180, 252, 0.12);
+ border-radius: var(--radius-md);
+ background: rgba(21, 26, 48, 0.46);
+}
+
+.task-planner-relation-chip > span {
+ min-width: 0;
+ overflow: hidden;
+ color: var(--color-text-secondary);
+ font-size: var(--font-size-xs);
+ font-weight: 800;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.task-planner-relation-chip label {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ color: var(--color-text-muted);
+ font-size: var(--font-size-xs);
+ font-weight: 800;
+}
+
+.task-planner-relation-chip label input {
+ min-height: 0;
+}
+
+.task-planner-relation-chip button {
+ display: inline-flex;
+ width: 26px;
+ min-width: 26px;
+ min-height: 26px;
+ align-items: center;
+ justify-content: center;
+ gap: 5px;
+ padding: 0;
+ border: 1px solid rgba(165, 180, 252, 0.12);
+ border-radius: var(--radius-md);
+ background: rgba(21, 26, 48, 0.58);
+ color: var(--color-text-secondary);
+ font-size: var(--font-size-xs);
+ font-weight: 800;
+}
+
+.task-planner-relation-chip button .ui-icon {
+ width: 12px;
+ height: 12px;
+}
+
+.task-planner-relations select {
+ min-height: 34px;
+ padding-inline: 10px;
+}
+
.counters-add-form {
grid-template-columns: minmax(0, 1fr) auto;
}
@@ -1336,6 +1786,52 @@ textarea:focus {
color: var(--color-text-primary);
}
+.timer-countdown-form select,
+.task-planner-settings select,
+.task-planner-add-form select,
+.task-planner-type-select,
+.task-planner-weekly-override select,
+.task-planner-relations select {
+ appearance: none;
+ -webkit-appearance: none;
+ overflow: hidden;
+ padding-right: 34px;
+ text-overflow: ellipsis;
+ background-image:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c4b5fd' viewBox='-6.5 0 32 32'%3E%3Cpath d='M18.813 11.406l-7.906 9.906c-.75.906-1.906.906-2.625 0L.376 11.406c-.75-.938-.375-1.656.781-1.656h16.875c1.188 0 1.531.719.781 1.656z'/%3E%3C/svg%3E"),
+ linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(31, 41, 78, 0.08)),
+ linear-gradient(rgba(21, 26, 48, 0.38), rgba(21, 26, 48, 0.38));
+ background-position:
+ calc(100% - 10px) 50%,
+ 0 0,
+ 0 0;
+ background-size:
+ 11px 11px,
+ auto,
+ auto;
+ background-repeat: no-repeat;
+}
+
+.timer-countdown-form select:hover,
+.timer-countdown-form select:focus,
+.task-planner-settings select:hover,
+.task-planner-settings select:focus,
+.task-planner-add-form select:hover,
+.task-planner-add-form select:focus,
+.task-planner-type-select:hover,
+.task-planner-type-select:focus,
+.task-planner-weekly-override select:hover,
+.task-planner-weekly-override select:focus,
+.task-planner-relations select:hover,
+.task-planner-relations select:focus {
+ border-color: rgba(196, 181, 253, 0.22);
+ background-image:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f6c453' viewBox='-6.5 0 32 32'%3E%3Cpath d='M18.813 11.406l-7.906 9.906c-.75.906-1.906.906-2.625 0L.376 11.406c-.75-.938-.375-1.656.781-1.656h16.875c1.188 0 1.531.719.781 1.656z'/%3E%3C/svg%3E"),
+ linear-gradient(135deg, rgba(246, 196, 83, 0.06), rgba(139, 92, 246, 0.08)),
+ linear-gradient(rgba(21, 26, 48, 0.58), rgba(21, 26, 48, 0.58));
+ color: var(--color-text-primary);
+}
+
.time-parts-input {
display: grid;
grid-template-columns: minmax(34px, 1fr) 4px minmax(34px, 1fr) 4px minmax(34px, 1fr);
@@ -1735,6 +2231,14 @@ textarea:focus {
.tool-split-entry > button:not(.tool-split-entry-summary, .tool-split-entry-value, .danger):hover,
.counter-actions button:not(.danger):hover,
.link-item button:not(.danger):hover,
+.task-planner-drag-handle:hover:not(:disabled),
+.task-planner-settings-toggle:hover,
+.task-planner-settings-toggle.active,
+.task-planner-dropdown-button:hover,
+.task-planner-dropdown-button.active,
+.task-planner-settings-button:hover,
+.task-planner-settings-button.active,
+.task-planner-relation-chip button:hover,
.module-scroll-button:hover,
.module-scroll-button.active,
.tool-split-scroll-toggle:hover,
@@ -1820,7 +2324,8 @@ textarea:focus {
.tool-split-action-button.danger,
.tool-split-entry > button.danger,
.counter-actions button.danger,
-.link-item button.danger {
+.link-item button.danger,
+.task-planner-delete-button.danger {
border-color: rgba(251, 113, 133, 0.2);
background: rgba(21, 26, 48, 0.88);
color: var(--color-danger);
@@ -1829,7 +2334,8 @@ textarea:focus {
.tool-split-action-button.danger:hover:not(:disabled),
.tool-split-entry > button.danger:hover,
.counter-actions button.danger:hover,
-.link-item button.danger:hover {
+.link-item button.danger:hover,
+.task-planner-delete-button.danger:hover {
border-color: rgba(251, 113, 133, 0.56);
background:
linear-gradient(135deg, rgba(80, 25, 42, 0.72), rgba(48, 18, 34, 0.82)) padding-box,
@@ -1843,7 +2349,8 @@ textarea:focus {
.tool-split-action-button.danger:hover .ui-icon,
.tool-split-entry > button.danger:hover .ui-icon,
.counter-actions button.danger:hover .ui-icon,
-.link-item button.danger:hover .ui-icon {
+.link-item button.danger:hover .ui-icon,
+.task-planner-delete-button.danger:hover .ui-icon {
background-color: #fff;
filter: drop-shadow(0 0 6px rgba(251, 113, 133, 0.26));
}