-
Notifications
You must be signed in to change notification settings - Fork 351
improve handling of portrait display on iOS #459
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: main
Are you sure you want to change the base?
Conversation
|
Contributors are welcome to improve in future PRs! |
| case .loading: | ||
| // Already loading, wait and retry | ||
| try await Task.sleep(nanoseconds: 100_000_000) // 100ms | ||
| return try await load() |
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.
Replaced the recursive call with a while loop.
| .foregroundStyle(.secondary) | ||
| @Environment(\.horizontalSizeClass) var horizontalSizeClass | ||
|
|
||
| var status: some View { |
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.
Break the view up into a couple pieces that we can reassemble as either a single line (original) or a couple lines (portrait iOS).
| DisclosureGroup("Statistics") { | ||
| stats | ||
| .scaleEffect(0.8) | ||
| } |
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.
Same for the stats view -- it takes up a large potion of the screen on a smaller device. Scale the text slightly. The formatting is still poor, but usable.
Proposed changes
Fix #456
This isn't perfect, but the UI is usable on iOS portrait:
Specifically on
horizontalSizeClass == .compactthis will use aDisclosureGroupfor some of the controls and statistics. It also uses a multi-line layout for the controls (this is specifically what broke the layout).Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes