Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
## 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-08-25 - Provide explicit empty states for data
**Learning:** Hiding UI elements when data is empty (like a high score of 0) makes the system state less clear and misses an opportunity for user onboarding and encouragement.
**Action:** Provide explicit, encouraging empty states (e.g., "None yet! Play to set one!") instead of just hiding the element.
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_NORM << "None yet! (Play to set one!)" << CLR_RESET << "\n\n";
}

std::cout << "Controls:\n " << CLR_CTRL << "[h]" << CLR_RESET << " Toggle Hard Mode (10x Speed!)\n "
Expand Down
Loading