Skip to content

Commit 257387f

Browse files
authored
Merge pull request #15 from Soldiers33/jules-ux-loading-bar-2880780259693793498
🎨 Palette: Polish CLI loading bar output
2 parents 2465f86 + 2c28818 commit 257387f

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.Jules/palette.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Palette's Journal
2+
3+
## 2024-03-02 - Initial Setup
4+
**Learning:** Initializing journal for micro-UX tracking.
5+
**Action:** Starting UX improvement process for the command line application interface.
6+
7+
## 2025-03-02 - CLI Loading Bar Polish
8+
**Learning:** Multi-line progress indicators in CLI applications cause terminal clutter and push important historical context off-screen rapidly, making it harder for users to review output.
9+
**Action:** Updated `loading_bar` in Python scripts to use carriage returns (`\r`) with `flush=True` to clear and overwrite the current line, resulting in a significantly cleaner visual experience.

simulasyon_11.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class Colors:
3737
# ==============================================================================
3838

3939
def loading_bar(desc):
40-
print(f"{Colors.CYAN}{desc}...{Colors.ENDC}")
40+
print(f"\r{Colors.CYAN}{desc}...{Colors.ENDC}", end='', flush=True)
4141
time.sleep(0.01)
42-
print(f"{Colors.GREEN}[OK]{Colors.ENDC}")
42+
print(f"\r{Colors.GREEN}[OK]{Colors.ENDC} {Colors.CYAN}{desc}{Colors.ENDC}")
4343

4444

4545
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)