From 71b8dbcd28c6741c64e491d184ac21ac7b28d7c5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:59:42 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20animated=20prog?= =?UTF-8?q?ress=20bar=20for=20better=20immersion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced the static '...' loading indicator with a dynamic ASCII progress bar. This provides visual feedback during the simulation's 'loading' phases, making the CLI experience feel more responsive and polished. Changes: - Updated `loading_bar` in `simulasyon_11.py` to use an animated loop. - Added a journal entry in `.Jules/palette.md`. Co-authored-by: Soldiers33 <255096253+Soldiers33@users.noreply.github.com> --- .Jules/palette.md | 3 +++ simulasyon_11.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .Jules/palette.md diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 00000000..3dcdc92f --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2025-05-15 - Dynamic Loading Bar +**Learning:** Terminal-based "simulations" benefit greatly from small visual feedback cues like progress bars. +**Action:** Always check if a script uses `time.sleep` with static text and consider replacing it with a progress indicator for better user feedback. diff --git a/simulasyon_11.py b/simulasyon_11.py index 63f8da57..03f08e58 100644 --- a/simulasyon_11.py +++ b/simulasyon_11.py @@ -35,9 +35,14 @@ class Colors: # ============================================================================== def loading_bar(desc): - print(f"{Colors.CYAN}{desc}...{Colors.ENDC}") - time.sleep(0.01) - print(f"{Colors.GREEN}[OK]{Colors.ENDC}") + print(f"{Colors.CYAN}{desc}{Colors.ENDC}") + total = 20 + for i in range(total + 1): + time.sleep(0.02) + percent = int(100 * (i / total)) + bar = '█' * i + '-' * (total - i) + print(f"\r{Colors.CYAN}|{bar}| {percent}%{Colors.ENDC}", end="", flush=True) + print(f" {Colors.GREEN}[OK]{Colors.ENDC}") # ------------------------------------------------------------------------------