Replace mount/remove_children pattern (async issues, duplicate IDs)
with a single persistent #section-view Static widget that gets its
content updated via .update(). All sections now render correctly:
- Dashboard: summary table + latest blocks (fetched async from API)
- Bitcoin/Lightning/Platforms/Settings: info panels
- M key: return to main menu
Also added fetch_latest_blocks() and fetch_hashrate() data workers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each menu key now loads real content:
- A (Dashboard): block height, price, hashrate, difficulty, mempool
stats, and latest 5 blocks table — all from mempool.space API
- B (Bitcoin): submenu with blockchain features
- L (Lightning): channel management overview
- P (Platforms): API integrations list
- S (Settings): current mode and config info
- M: return to main menu from any section
New data fetchers: fetch_latest_blocks(), fetch_hashrate(),
fetch_mempool_info() expanded.
Dashboard loads async via run_worker(thread=True) with live
content replacement in the center panel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MainMenuScreen was a Textual Screen mounted inside a Vertical container,
which doesn't render. Create MainMenu as a Static widget instead:
- New tui/widgets/main_menu.py with Panel+Table menu
- Move keybindings (A/B/L/P/S/Q) to the App level
- Menu now renders correctly in the content area
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace run_in_thread (not available in Textual 0.89) with
run_worker(fn, thread=True) + call_from_thread for UI updates.
The TUI now launches correctly and fetches live data (block height,
BTC price, fee estimates) on startup and every 30 seconds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New pybitblock/tui/ package providing a modern terminal UI:
Structure:
tui/app.py - Main Textual App with CSS layout, auto-refresh
tui/screens/ - Screen classes (main_menu.py with keybindings)
tui/widgets/ - StatusBar widget with reactive block/price data
tui/workers/ - Async data fetchers (block height, price, fees, mempool)
Features:
- Persistent status bar with mode, block height, BTC price
- Side panel showing live fee estimates (fast/medium/slow)
- Keyboard navigation (A=PyBLOCK, B=Bitcoin, L=Lightning, etc.)
- Auto-refresh every 30 seconds via async workers
- Dark theme with Bitcoin-inspired color scheme
- CSS-based responsive layout
Launch: python3 PyBlock.py --tui
Fallback: python3 PyBlock.py (original CLI mode)
Added textual>=0.89 to requirements.txt.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>