From 07057e6c3db848e93a01079842eb9ca1b1d8947c Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 5 Oct 2026 22:56:06 +0100 Subject: [PATCH] Mark crops as planted (on the way) Co-Authored-By: Claude Opus 5.5 --- package.nix | 2 +- static/app.js | 34 +++++++++++++++++++++++++--------- static/index.html | 12 ++++++------ static/styles.css | 16 ++++++++++++++-- 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/package.nix b/package.nix index 45110f3..24c84fb 100644 --- a/package.nix +++ b/package.nix @@ -2,7 +2,7 @@ stdenvNoCC.mkDerivation { pname = "stardew-tracker"; - version = "1.3.1"; + version = "1.4.0"; src = ./.; nativeBuildInputs = [ makeWrapper ]; diff --git a/static/app.js b/static/app.js index 33eedad..bae6cae 100644 --- a/static/app.js +++ b/static/app.js @@ -19,6 +19,10 @@ const $$ = (selector, root = document) => [...root.querySelectorAll(selector)]; const escapeHtml = (value) => String(value).replace(/[&<>'"]/g, char => ({ "&": "&", "<": "<", ">": ">", "'": "'", '"': """ }[char])); const itemKey = crop => crop.sharedId || crop.id; + // Planting is tracked as its own shared flag so "on the way" never counts + // toward bundle completion. + const plantedId = key => `planted-${key}`; + const isPlanted = key => !state.checks[key] && Boolean(state.checks[plantedId(key)]); function saveDate() { localStorage.setItem("valley-year", state.year); @@ -126,7 +130,10 @@ if (birthday) cards.push(card("birthday", "Birthday", birthday, "A birthday gift gives 8ร— the usual friendship effect.", dailyId("birthday", birthday), giftGuide(birthday))); if (event) cards.push(card("event", "Event", event[0], event[1], dailyId("event", event[0]))); reminders().forEach(([title, copy]) => cards.push(card("reminder", "Reminder", title, copy, dailyId("reminder", title)))); - cropDeadlineCards().forEach(crop => cards.push(card("deadline", "Plant by today", crop.name, crop.purpose, itemKey(crop)))); + cropDeadlineCards().forEach(crop => { + const planted = isPlanted(itemKey(crop)); + cards.push(card(planted ? "deadline planted" : "deadline", planted ? "Planted ยท on the way" : "Plant by today", crop.name, crop.purpose, itemKey(crop))); + }); if (!cards.length) cards.push(card("quiet", "Open day", "Make your own luck", "No fixed birthdays, festivals, or last planting dates today.")); $("#today-cards").innerHTML = cards.join(""); const noun = cards.length === 1 ? "thing" : "things"; @@ -138,15 +145,21 @@ const rows = crops.map(crop => { const key = itemKey(crop); const checked = Boolean(state.checks[key]); - const overdue = state.day > crop.last && !checked; - const today = state.day === crop.last && !checked; - return `