fix(tui): calendar segment reads producer event 'name' not 'title'#156
Conversation
The calendar status-line renderer read event 'title', but the Go calendar producer (and CalendarTestFixture) emit event 'name'. FlattenForTUI spreads producer fields verbatim with no rename layer, so in production the current event rendered '?' and an upcoming event fell through to "📅 Free" -- the Go->JSON->Python field-drift class (cf. weather bug #29). Part of issue #155; canonical side is the Go producer (consistent + fixtured + tested), matching how the weather/insights segments already work. Switch the renderer's four next_event/current title reads to name. Add tests/test_status_segments.py asserting a producer-shaped calendar fixture renders the event name (red before, green after). News-segment story 'title' is a distinct, correct field and is untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughIn ChangesCalendar segment field-name fix and regression tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Part of #155 (calendar half). Canonical side per maintainer decision: Python adapts to the Go producer.
Bug
The calendar status-line renderer reads event
title, but the Go calendar producer +CalendarTestFixtureemit eventname.FlattenForTUIspreads producer fields verbatim (no rename layer indata.py), so in production:📅 ?📅 Free(thenext_event.get("title")guard was always falsy)This is the Go→JSON→Python field-drift class (cf. weather bug #29).
Fix
tui/hookwise_tui/tabs/status.py: the calendar block's fourcurrent/next_eventtitlereads →name. The news segment'sstory["title"]is a distinct, correct field and is untouched.tui/tests/test_status_segments.py(new): feeds a producer-shaped calendar fixture into_render_segmentand asserts the eventnamerenders — red before, green after.Verification
main(📅 Free/?), pass after the fix.analytics,feeds) are pre-existing on clean main (verified by stash) and unrelated.Project half of #155 (renderer
repo→name,detached→dirty, producer addslast_commit_ts) follows in a separate PR.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests