From b561a606e013bc9c1b78a8a13de4b3081f264ac8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 29 Aug 2026 12:34:42 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20explicit=20empt?= =?UTF-8?q?y=20state=20for=20high=20score?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💡 What: Added an explicit empty state message ("None yet! Start clicking!") when the player has no high score. 🎯 Why: Improves onboarding and clarity by showing the user what to achieve, rather than hiding the personal best section entirely. 📸 Before/After: Visual change in terminal output. ♿ Accessibility: Improves cognitive accessibility by providing clearer system state feedback. Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/main.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.Jules/palette.md b/.Jules/palette.md index 05d4366..7a3ce83 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -33,3 +33,7 @@ ## 2024-04-24 - Avoiding Trailing Artifacts in CLI Applications **Learning:** When dynamically updating terminal lines using carriage return (`\r`), relying on hardcoded padding spaces to overwrite old text is brittle and leads to trailing text artifacts when new lines are shorter than previous ones. **Action:** Always use the ANSI escape sequence `\033[K` (Erase in Line) immediately after the carriage return (`\r`) to cleanly clear the line before writing new content, rather than manually managing padding spaces. + +## 2024-05-28 - Explicit Empty States in CLI +**Learning:** In terminal applications, users benefit from explicit empty states rather than simply hiding information when data is absent (e.g., a score of 0). This provides clearer system state and improves user onboarding. +**Action:** Always provide explicit, encouraging empty states for data or achievements rather than hiding the UI element when empty. diff --git a/src/main.cpp b/src/main.cpp index b9144b7..e0b4899 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -80,6 +80,8 @@ int main() { if (highscore > 0) { std::cout << " Personal Best: " << CLR_SCORE << formatWithCommas(highscore) << CLR_RESET << "\n\n"; + } else { + std::cout << " Personal Best: " << CLR_SCORE << "None yet! Start clicking!" << CLR_RESET << "\n\n"; } std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "