icons for priority and colors for someday lists

This commit is contained in:
mARTin-B78 2026-05-01 14:49:54 +02:00
parent d3fedc4d0d
commit 291ff23859
4 changed files with 23 additions and 3 deletions

View File

@ -0,0 +1,12 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"files.associations": {
"*.css": "tailwindcss"
}
}
}

View File

@ -7,7 +7,7 @@ import { faGoogle, faMicrosoft, faApple } from "@fortawesome/free-brands-svg-ico
import { faServer, faFolder, IconDefinition } from "@fortawesome/free-solid-svg-icons";
import MdiIcon from "@mdi/react";
import { allIcons } from "./iconRegistry";
import { Task, KanbanStage } from "./WeeklyView";
import { Task, KanbanStage, getPriorityBadge } from "./WeeklyView";
interface GridTaskBlockProps {
task: Task;
@ -353,6 +353,14 @@ 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" }}>
{showPriorityIcons && (() => {
const pb = getPriorityBadge(task, priorityStyle, 11);
return pb ? (
<span title={pb.label} style={{ marginRight: "4px", display: "inline-flex", alignItems: "center", flexShrink: 0 }}>
{pb.node}
</span>
) : null;
})()}
<span style={{ marginRight: "4px" }}>{showProjectIcons && task.project && (() => {
const rawIcon = task.project!.icon || "";
const normalised = rawIcon.startsWith("fa") && rawIcon.length > 2 && rawIcon[2] === rawIcon[2].toUpperCase()

View File

@ -9715,7 +9715,7 @@ function makeBadgeCircle(text: string, color: string, size: number, label: strin
};
}
function getPriorityBadge(task: Task, style: string, size = 12): PriorityBadge | null {
export function getPriorityBadge(task: Task, style: string, size = 12): PriorityBadge | null {
if (style === "abcde") {
if (!task.priority || !PRIORITY_LETTER_COLORS[task.priority]) return null;
return makeBadgeCircle(task.priority, PRIORITY_LETTER_COLORS[task.priority], size + 2, task.priority);

File diff suppressed because one or more lines are too long