fix: break circular layout dependency causing RecycleView infinite loop (fixes #124)#126
fix: break circular layout dependency causing RecycleView infinite loop (fixes #124)#126RockyOmvi wants to merge 1 commit into
Conversation
…e loop The BusKillOptionItem had a circular sizing dependency: - item height = labellayout.height + dp(10) - radio/icon label height = labellayout.height - labellayout text_size width = root.width - icon_label.width - radio_button_label.width This caused an infinite layout loop when font settings changed, with Kivy logging 'unable to trigger refresh from data' repeatedly. Fix: remove height bindings from radio/icon labels, use fixed estimate for text_size width, and replace Clock.schedule_once refresh with direct data list reassignment for deterministic single-pass refresh. Fixes BusKill#124
|
INFO: No unicode characters found in PR's commits (source) |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates UI refresh behavior and option-item layout sizing to improve how option state changes are reflected and displayed.
Changes:
- Trigger
RecycleViewrefresh by reassigningrv.datainstead of schedulingrefresh_from_data. - Adjust
BusKillOptionItemsizing to use full width. - Replace dynamic
text_sizecalculation with a fixed-width subtraction.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/buskill_gui.py | Changes how the RecycleView is refreshed after mutating item dicts. |
| src/buskill.kv | Updates option-item layout sizing and label wrapping behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # trigger RecycleView refresh by replacing data list | ||
| self.rv.data = list(self.rv.data) |
| text: u'{0}\n[size=13sp][color=999999]{1}[/color][/size]'.format(root.option_human or root.value or '', root.desc or '') | ||
| font_size: '15sp' | ||
| text_size: root.width - icon_label.width - radio_button_label.width - (2*root.padding) - (2*root.spacing), None | ||
| text_size: root.width - dp(100), None |
|
@Copilot you're not welcome here. How do I ban you from our repo? Update: See also: |
|
@RockyOmvi Thanks for the PR :) Please note that this repo does not accept contributions that use AI Can you please tell us if you wrote this code, comments, and PR contents entirely by yourself? Or if you used AI for any part of it? |
Summary
Fixes #124 - RecycleView infinite layout loop when changing font settings.
Root Cause
The BusKillOptionItem had a circular sizing dependency in buskill.kv:
When a font setting changes:
Changes
src/buskill.kv
src/buskill_gui.py