1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 19:44:44 +00:00

feat: Boost UI performance with pure bash string width calculation and truncation, and add visual feedback for cache hits in uninstall scripts.

This commit is contained in:
Tw93
2025-12-17 11:01:15 +08:00
parent 3053e05ce4
commit 27205c653d
4 changed files with 80 additions and 94 deletions

View File

@@ -83,6 +83,12 @@ scan_applications() {
[[ $cache_age -eq $(date +%s) ]] && cache_age=86401 # Handle missing file
if [[ $cache_age -lt $cache_ttl ]]; then
# Cache hit - return immediately
# Show brief flash of cache usage if in interactive mode
if [[ -t 2 ]]; then
echo -e "${GREEN}Loading from cache...${NC}" >&2
# Small sleep to let user see it (optional, but good for "feeling" the speed vs glitch)
sleep 0.3
fi
echo "$cache_file"
return 0
fi