From 212c9ee551dd58eae74fdadef3de2eec5301f0b7 Mon Sep 17 00:00:00 2001 From: maruf-pfc Date: Mon, 5 Jan 2026 16:24:16 +0600 Subject: [PATCH] fix: resolve module not found and UI freezing issues --- install.sh | 10 ++++------ src/bleach/tui/app.py | 7 +++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 246cc83..6ef7828 100755 --- a/install.sh +++ b/install.sh @@ -24,14 +24,12 @@ if ! command -v git &> /dev/null || ! command -v python3 &> /dev/null; then exit 1 fi -# 2. Update/Clone +# 2. Clean Install echo -e "${BLUE}[+] Fetching latest version...${NC}" -mkdir -p "$INSTALL_DIR" -if [ -d "$INSTALL_DIR/.git" ]; then - cd "$INSTALL_DIR" && git pull -q -else - git clone -q -b "$BRANCH" "$REPO_URL" "$INSTALL_DIR" +if [ -d "$INSTALL_DIR" ]; then + rm -rf "$INSTALL_DIR" fi +git clone -q -b "$BRANCH" "$REPO_URL" "$INSTALL_DIR" # 3. Setup Python Environment (Quietly) echo -e "${BLUE}[+] Preparing environment...${NC}" diff --git a/src/bleach/tui/app.py b/src/bleach/tui/app.py index 5a134bb..d3d28e6 100644 --- a/src/bleach/tui/app.py +++ b/src/bleach/tui/app.py @@ -1,3 +1,5 @@ +import asyncio + from textual.app import App, ComposeResult from textual.containers import Container, VerticalScroll from textual.widgets import ( @@ -252,10 +254,11 @@ async def _perform_cleanup(self, cleaners: list[Cleaner], log: RichLog) -> None: total = len(cleaners) total_freed_mb = 0.0 + loop = asyncio.get_running_loop() for cleaner in cleaners: log.write(f"Running: [bold cyan]{cleaner.name}[/]...") - # Yield control to UI loop - result = cleaner.clean() + # Run blocking I/O in a separate thread to keep UI responsive + result = await loop.run_in_executor(None, cleaner.clean) if result.success: msg = f" [green]✔ OK[/]: {result.message}"