From b6f5ba42ed9accd958651d1ba96255fbfc41314d Mon Sep 17 00:00:00 2001 From: mARTin Date: Mon, 23 Mar 2026 13:17:06 +0100 Subject: [PATCH] fix: show project icons in time grid (GridTaskBlock) view Add showProjectIcons prop to GridTaskBlock so project icons appear next to task titles in simple and calendar views, not just list view. v1.59.3 --- package.json | 2 +- src/components/GridTaskBlock.tsx | 17 ++++++++++++++++- src/components/WeeklyView.tsx | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9922ad0..1a65562 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.59.2", + "version": "1.59.3", "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/GridTaskBlock.tsx b/src/components/GridTaskBlock.tsx index 60d5d33..df9f6e8 100644 --- a/src/components/GridTaskBlock.tsx +++ b/src/components/GridTaskBlock.tsx @@ -2,7 +2,9 @@ import React, { useState, useRef, useEffect } from "react"; import { Repeat, Circle, X, ChevronDown } from "lucide-react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faGoogle, faMicrosoft, faApple } from "@fortawesome/free-brands-svg-icons"; -import { faServer } from "@fortawesome/free-solid-svg-icons"; +import { faServer, faFolder, IconDefinition } from "@fortawesome/free-solid-svg-icons"; +import MdiIcon from "@mdi/react"; +import { allIcons } from "./IconPicker"; import { Task, KanbanStage } from "./WeeklyView"; interface GridTaskBlockProps { @@ -33,6 +35,7 @@ interface GridTaskBlockProps { onSetEditingTaskId?: (id: string | null) => void; workingHoursStart: number; showTaskCheckboxes?: boolean; + showProjectIcons?: boolean; projects?: any[]; onProjectAssign?: (taskId: string, projectId: string | null) => void; kanbanStages?: KanbanStage[]; @@ -67,6 +70,7 @@ export function GridTaskBlock({ onSetEditingTaskId, workingHoursStart, showTaskCheckboxes, + showProjectIcons, projects, onProjectAssign, kanbanStages = [], @@ -302,6 +306,17 @@ export function GridTaskBlock({ /> )} + {showProjectIcons && task.project && (() => { + const found = allIcons.find(i => i.name === task.project!.icon); + if (found) { + return found.type === "fa" + ? + : ; + } + return task.project!.icon + ? {task.project!.icon} + : ; + })()} {task.title} {/* Subtask indicator */} {task.subTasks && task.subTasks.length > 0 && (() => { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index 69cef7b..5fd629a 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -7302,6 +7302,7 @@ export default function WeeklyView() { onSetEditingTaskId={setEditingTaskId} workingHoursStart={workingHoursStart} showTaskCheckboxes={effectiveShowTaskCheckboxes} + showProjectIcons={effectiveShowProjectIcons} projects={projects} onProjectAssign={assignProject} kanbanStages={kanbanStages}