-
Notifications
You must be signed in to change notification settings - Fork 119
[MBL-19690][S] Misaligned submit button #3859
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
[MBL-19690][S] Misaligned submit button #3859
Conversation
refs: MBL-19690 builds: Student affects: Student release note: none
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.
Review Summary
This PR updates button constraints in quiz and assignment detail views to improve iOS 26+ compatibility. The changes include storyboard cleanup and programmatic constraint adjustments.
Issues Found
- Critical Layout Bug (StudentQuizDetailsViewController.storyboard:351): The takeButton constraints are marked as placeholders but the programmatic constraints are only added on iOS 26+. This will break the layout on iOS 25 and earlier devices.
- Code Duplication (StudentQuizDetailsViewController.swift:131-145): The constraint activation code is duplicated between iOS 26+ and fallback branches. Can be refactored to reduce duplication.
Positive Aspects
✅ Good fix in StudentAssignmentDetailsViewController.swift - correctly changed from view.bottomAnchor to view.safeAreaLayoutGuide.bottomAnchor for both iOS 26+ and earlier versions. This ensures consistent safe area handling.
✅ Storyboard cleanup - removed the <designables> section which contained hardcoded intrinsic content sizes. This is good for maintainability.
✅ Updated toolsVersion and removed unnecessary deployment identifier in storyboard.
Recommendations
- Fix the critical layout bug: Ensure takeButton has valid constraints on all iOS versions, not just iOS 26+
- Consider refactoring: Reduce code duplication in the constraint setup
- Test thoroughly: Verify button layout on iOS 25 and earlier simulators/devices
The assignment details fix looks good, but the quiz details implementation needs adjustment to prevent layout issues on older iOS versions.
| takeButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor), | ||
| takeButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor) | ||
| ]) | ||
| } |
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.
The constraint activation is duplicated between the iOS 26+ branch and the fallback branch. Consider moving the constraint activation outside the conditional and only applying the corner radius and insets conditionally:
if #available(iOS 26, *) {
takeButton.layer.cornerRadius = 25
}
let leading: CGFloat = if #available(iOS 26, *) { 20 } else { 0 }
let trailing: CGFloat = if #available(iOS 26, *) { -20 } else { 0 }
let bottom: CGFloat = if #available(iOS 26, *) { -8 } else { 0 }
NSLayoutConstraint.activate([
takeButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: leading),
takeButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: trailing),
takeButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: bottom)
])This reduces duplication and makes the code more maintainable.
Core/Core/Features/Quizzes/QuizDetails/Student/StudentQuizDetailsViewController.storyboard
Show resolved
Hide resolved
BuildsCommit: Align to safe area, make quiz details appear liquid-glass like (04375d1) |
rh12
left a comment
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.
QA + 1
refs: MBL-19690
builds: Student
affects: Student
release note: none
Opening assignment details from calendar showed a misaligned "Submit" button. Also, opening quiz details from the calendar showed the old "Take quiz" button. This PR fixes both issues.
Test plan
See ticket for steps to reproduce.
Screenshots
Checklist