-
Notifications
You must be signed in to change notification settings - Fork 3
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
Chart height on tablets #576
base: main
Are you sure you want to change the base?
Conversation
so afaik, the idea was to just limit the width e.g. to length (or 2* the length) of the shorter side of the device. Cause when we have full width, even full height is not enough for a readable chart. |
3bdca97
to
ed57791
Compare
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.
not exatcly what I've meant - but at least for the tablet it looks better. So we can go with this. Please test it on smaller phone as well, cause I suspect 1/2 of the height will look bad there. So adjusting this value for different screen sizes might be needed. Unless I'm wrong
} | ||
}).toList(), | ||
// child: AspectRatio( | ||
// aspectRatio: 1.5, |
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.
dead code :P - not nice
maxNumberOfUsers: maxNumberOfUsers, | ||
chartData: chartData, | ||
SizedBox( | ||
height: 0.5 * height, |
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.
it does look good on tablets, but please test it on smaller phone in horizontal view as well
@ellipsis review this |
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.
❌ Changes requested. Reviewed everything up to 5c73240 in 1 minute and 30 seconds
More details
- Looked at
218
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. lib/features/sks/sks_chart/presentation/sks_chart_card.dart:47
- Draft comment:
The height is hardcoded (0.5 * height). Add a comment clarifying why this factor is used and consider making it configurable. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
The 0.5 multiplier is indeed hardcoded and its purpose isn't immediately clear. However, this appears to be a UI layout decision - it's making the chart take up half the available height. UI layout constants like this are common and often don't need explanation. Making it configurable would add complexity without clear benefit.
The multiplier could be significant for the chart's visual design and making it configurable could allow for better adaptability in different contexts.
While true, UI layout constants are typically left as implementation details unless there's a specific need for configurability. No evidence suggests this needs to be configurable.
Delete the comment. This appears to be a straightforward UI layout decision, and the comment doesn't identify a clear issue that needs fixing.
2. lib/features/sks/sks_chart/presentation/sks_chart_sheet.dart:53
- Draft comment:
Changed ListView physics from NeverScrollableScrollPhysics to BouncingScrollPhysics. Confirm this change is intentional for the UX on tablets. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
This is a UI/UX change related to scrolling behavior. The comment is asking for confirmation of intention, which violates our rules. It's not pointing out a clear issue, just asking if the change was intentional. We should assume the author made this UI change deliberately.
Maybe this scroll physics change could cause actual functional issues on tablets that I'm not considering? Maybe there's a platform-specific bug being introduced?
Without clear evidence of an actual bug or issue, we should trust that the UI change was intentional. Scroll physics are a UI concern that the author likely tested.
Delete this comment as it merely asks for confirmation of a UI change without identifying any concrete issues.
3. lib/features/sks/sks_chart/presentation/chart_elements/sks_chart.dart:27
- Draft comment:
Removal of the AspectRatio wrapper: ensure that the chart scales well on all devices. If a fixed aspect ratio is important, consider using a responsive container or extracting the value into configuration. - Reason this comment was not posted:
Comment looked like it was already resolved.
4. lib/features/sks/sks_chart/presentation/chart_elements/sks_chart.dart:108
- Draft comment:
Remove commented-out AspectRatio code if it's no longer needed to keep the file clean. - Reason this comment was not posted:
Marked as duplicate.
5. lib/features/sks/sks_chart/presentation/sks_chart_card.dart:48
- Draft comment:
Using a magic multiplier (0.5 * height) to set the chart's height may reduce clarity. Consider extracting this value into a configuration constant or adding a comment to explain its rationale. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
This appears to be a UI layout decision where the chart is intentionally sized to half the available height. The multiplier 0.5 is a simple, common ratio that's self-explanatory in UI layouts. The height parameter was just added, suggesting this is an intentional design change to make the chart height configurable. Magic numbers are generally bad, but 0.5 in UI layouts is a common, clear ratio.
The comment raises a valid point about magic numbers in code. Constants can improve maintainability.
However, 0.5 is a simple, clear ratio commonly used in UI layouts - it's not truly a "magic number" that needs explanation. The code is more readable with the direct calculation.
The comment should be deleted as it suggests unnecessary complexity for a simple, clear UI layout calculation.
6. lib/features/sks/sks_chart/presentation/sks_chart_sheet.dart:53
- Draft comment:
Changing the ListView physics to BouncingScrollPhysics may affect user experience on non-iOS platforms. Confirm that this behavior is intended across all target devices. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the PR author to confirm their intention regarding a change in ListView physics. This violates the rule against asking for confirmation of intention. The comment does not provide a specific code suggestion or ask for a test to be written, which would make it acceptable.
7. lib/features/sks/sks_chart/presentation/chart_elements/sks_chart.dart:44
- Draft comment:
Typo detected: 'orangePomegranade' appears to be a misspelling. It likely should be 'orangePomegranate'. Please correct the spelling. - Reason this comment was not posted:
Comment was on unchanged code.
8. lib/features/sks/sks_chart/presentation/sks_chart_sheet.dart:34
- Draft comment:
Typographical error: the parameter 'prefferedHeightFactor' is misspelled. Consider renaming it to 'preferredHeightFactor' for clarity. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_lQ2A1hSEDp0j2vtZ
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
); | ||
} | ||
}).toList(), | ||
// child: AspectRatio( |
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.
Remove commented-out AspectRatio widget if it's no longer needed to keep the code clean.
What's the status for this? If it's ready please launch some photos showing current situation. Try to resolve conflicts as well |
Let me know if it can be kind of hardocoded like this. I tried fixing it better a long time and I failed. If I have to do it in an elegant way, it's gonna be painful.... @simon-the-shark @mikolaj-jalocha @tomasz-trela
Before
After
l10n.yaml examplanation - without synthetic-package: false - doesn't generate l10n files without it
Important
Adjust chart height for tablets by removing
AspectRatio
and adding dynamic height control inSksChartCard
.AspectRatio
fromSksChart
insks_chart.dart
to allow dynamic height adjustment.height
parameter toSksChartCard
insks_chart_card.dart
to control chart height.SksChartSheet
insks_chart_sheet.dart
to passsheetHeight
toSksChartCard
.physics
inSksChartSheet
fromNeverScrollableScrollPhysics
toBouncingScrollPhysics
.This description was created by
for 5c73240. It will automatically update as commits are pushed.