From 9ae4bb539562a0d7264f4179da332c06b0d040cc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 15 Feb 2026 20:32:43 +0200 Subject: [PATCH] feat: add board background patterns (dots, grid, gradient) with settings dropdown --- src/components/board/BoardView.tsx | 28 ++++++++++++++++++-- src/components/layout/TopBar.tsx | 42 +++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/src/components/board/BoardView.tsx b/src/components/board/BoardView.tsx index f8f6a6c..2cb685b 100644 --- a/src/components/board/BoardView.tsx +++ b/src/components/board/BoardView.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useEffect, useCallback } from "react"; +import React, { useState, useRef, useEffect, useCallback } from "react"; import { Plus } from "lucide-react"; import { DndContext, @@ -30,6 +30,30 @@ function findColumnByCardId(board: Board, cardId: string) { return board.columns.find((col) => col.cardIds.includes(cardId)); } +function getBoardBackground(board: Board): React.CSSProperties { + const bg = board.settings.background; + if (bg === "dots") { + return { + backgroundImage: `radial-gradient(circle, currentColor 1px, transparent 1px)`, + backgroundSize: "20px 20px", + color: "oklch(50% 0 0 / 5%)", + }; + } + if (bg === "grid") { + return { + backgroundImage: `linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px)`, + backgroundSize: "24px 24px", + color: "oklch(50% 0 0 / 5%)", + }; + } + if (bg === "gradient") { + return { + background: `linear-gradient(135deg, ${board.color}08, ${board.color}03, transparent)`, + }; + } + return {}; +} + export function BoardView() { const board = useBoardStore((s) => s.board); const addColumn = useBoardStore((s) => s.addColumn); @@ -296,7 +320,7 @@ export function BoardView() { items={columnIds} strategy={horizontalListSortingStrategy} > -
+
{board.columns.map((column) => ( )} + {isBoardView && board && ( + + + + + + + Background + + {(["none", "dots", "grid", "gradient"] as const).map((bg) => ( + useBoardStore.getState().updateBoardSettings({ ...board.settings, background: bg })} + > + {bg.charAt(0).toUpperCase() + bg.slice(1)} + {board.settings.background === bg && ( + * + )} + + ))} + + + + + )} {savingStatus && ( {savingStatus}