From ae7137045baf1d98c725fbd5820b778760c23e08 Mon Sep 17 00:00:00 2001 From: Mario Mohar Date: Tue, 10 Nov 2026 08:32:37 +0100 Subject: [PATCH] feat: show the most used snippet language on the board --- devboard/client/src/pages/Dashboard.jsx | 12 ++++++++++++ devboard/client/src/utils/topLanguage.js | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 devboard/client/src/utils/topLanguage.js diff --git a/devboard/client/src/pages/Dashboard.jsx b/devboard/client/src/pages/Dashboard.jsx index c7e6c70..ba45ef2 100644 --- a/devboard/client/src/pages/Dashboard.jsx +++ b/devboard/client/src/pages/Dashboard.jsx @@ -43,6 +43,7 @@ import { } from "../components/common/Icons"; import { openVisit, touchVisit } from "../utils/lastVisit"; import { timeAgo } from "../utils/timeAgo"; +import { topLanguage } from "../utils/topLanguage"; import { BoardZoomContext, ZOOM_MAX, @@ -282,6 +283,8 @@ const Dashboard = () => { }; const debt = calculateDebtScore(); + const topLang = useMemo(() => topLanguage(tasks), [tasks]); + const [streak, setStreak] = useState(calculateStreak); const [showBurndown, setShowBurndown] = useState(false); const [standupCopied, setStandupCopied] = useState(false); @@ -1578,6 +1581,15 @@ ${stuck {streak} day streak )} + {topLang && ( + + mostly {topLang.language} + + )} + {debt.count > 0 && ( { + const counts = {}; + let total = 0; + for (const task of tasks || []) { + for (const snippet of task.snippets || []) { + const language = String(snippet?.language || "") + .trim() + .toLowerCase(); + if (!language) continue; + counts[language] = (counts[language] || 0) + 1; + total += 1; + } + } + const [language, count] = + Object.entries(counts).sort( + (a, b) => b[1] - a[1] || a[0].localeCompare(b[0]), + )[0] || []; + return language ? { language, count, total } : null; +};