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
This commit is contained in:
mARTin 2026-03-23 13:17:06 +01:00
parent ccd069ae80
commit b6f5ba42ed
3 changed files with 18 additions and 2 deletions

View File

@ -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": {

View File

@ -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({
/>
)}
<span style={task.completed && showTaskCheckboxes ? { opacity: 0.5, flex: 1, display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: "2px" } : { flex: 1, display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: "2px" }}>
{showProjectIcons && task.project && (() => {
const found = allIcons.find(i => i.name === task.project!.icon);
if (found) {
return found.type === "fa"
? <FontAwesomeIcon icon={found.icon as IconDefinition} style={{ fontSize: "11px", marginRight: "4px", color: task.project!.color || "#888", flexShrink: 0 }} />
: <MdiIcon path={found.icon as string} size={0.5} color={task.project!.color || "#888"} style={{ marginRight: "3px", flexShrink: 0 }} />;
}
return task.project!.icon
? <span style={{ fontSize: "11px", marginRight: "3px", flexShrink: 0 }}>{task.project!.icon}</span>
: <FontAwesomeIcon icon={faFolder} style={{ fontSize: "11px", marginRight: "4px", color: task.project!.color || "#888", flexShrink: 0 }} />;
})()}
<span style={{ marginRight: "4px" }}>{task.title}</span>
{/* Subtask indicator */}
{task.subTasks && task.subTasks.length > 0 && (() => {

View File

@ -7302,6 +7302,7 @@ export default function WeeklyView() {
onSetEditingTaskId={setEditingTaskId}
workingHoursStart={workingHoursStart}
showTaskCheckboxes={effectiveShowTaskCheckboxes}
showProjectIcons={effectiveShowProjectIcons}
projects={projects}
onProjectAssign={assignProject}
kanbanStages={kanbanStages}