Slopgotchi pet widget added to context inspector
Summary
Added a decorative ASCII pet widget to the context inspector panel. Clicking the pet shows a red heart and cycles through ASCII art frames with a bounce animation.
Changes
src/tunacode/ui/slopgotchi/— New module (renamed fromtamagochi/)__init__.py— ExportsSlopgotchiHandler,SlopgotchiPanelStatepanel.py— Click handler, ASCII frame cycling, heart animation, margin bounce
src/tunacode/ui/app.py— Compose includes#field-pet,on_clickwalks parent tree to detect pet clicks,_touch_slopgotchiand_refresh_slopgotchimethodssrc/tunacode/ui/context_panel.py— Updated imports from slopgotchi modulesrc/tunacode/ui/styles/layout.tcss—#field-petstylingtests/unit/ui/test_context_panel_summary.py— Pet widget assertions
Key Lessons
- Textual click detection: Do NOT use
on_mouse_downwithevent.control is widgetfor Static widgets. Useon_clickand walkevent.widget.parenttree checking IDs. - Rich Text in Static: Never apply a single style to entire
Text(art, style=...)— it colors whitespace too. Build with.append()per segment instead.