-
Notifications
You must be signed in to change notification settings - Fork 816
fix: small UI bug in robotic arm screen #2763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: flutter
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR addresses a UI misalignment in the robotic arm duty cycle display by precomputing label positions and texts in the state provider and updating the chart widget to render only valid percentage labels from that precomputed list. Class diagram for updated RoboticArmStateProvider and data flowclassDiagram
class RoboticArmStateProvider {
+List<FlSpot> spots
+List<double> dutyCycles
+List<double> angleList
+List<Map<String, dynamic>> dutyLabelPoints
+Map<String, dynamic> getSummaryData()
}
class PlaybackSummaryDialog {
+build()
}
RoboticArmStateProvider <|-- PlaybackSummaryDialog : provides data
RoboticArmStateProvider : +dutyLabelPoints
PlaybackSummaryDialog : +labelPoints
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rahul31124 - I've reviewed your changes - here's some feedback:
- Replace the undefined
pwmSpots
check ingetTitlesWidget
with a check onlabelPoints
to avoid referencing an incorrect variable. - Clear or reinitialize the
dutyLabelPoints
list at the start of each data calculation (or scope it locally) to prevent accumulating stale entries across updates. - Consider creating a small data class for duty label points instead of using
Map<String, dynamic>
to improve type safety and readability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Replace the undefined `pwmSpots` check in `getTitlesWidget` with a check on `labelPoints` to avoid referencing an incorrect variable.
- Clear or reinitialize the `dutyLabelPoints` list at the start of each data calculation (or scope it locally) to prevent accumulating stale entries across updates.
- Consider creating a small data class for duty label points instead of using `Map<String, dynamic>` to improve type safety and readability.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/16052363193/artifacts/3458718896 |
Changes
Fixed a UI bug where duty cycle (%) was not aligning correctly if null values existed before. Resolved the issue by using a map to track and render percentages only for valid spots
Before

After

Checklist:
strings.xml
,dimens.xml
andcolors.xml
without hard coding any value.strings.xml
,dimens.xml
orcolors.xml
.Summary by Sourcery
Bug Fixes: