Show cache status in the TUI

This commit is contained in:
SirBlob committed 2026-11-01 22:58:56 -05:00
1 parent dfe3955604
commit 7e23fdcd8e
2 files changed
+27 -1

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
from rich.text import Text
CACHED = "cached"
PARTIAL = "partial"
MISSING = "missing"
STATE_STYLES = {CACHED: "green", PARTIAL: "yellow", MISSING: "red"}
def cache_state(has_details: bool, has_local_image: bool) -> str:
if not has_details:
return MISSING
return CACHED if has_local_image else PARTIAL
def cache_text(state: str) -> Text:
return Text(state, style=STATE_STYLES[state])