Skip to content

Conversation

@petkybenedek
Copy link
Contributor

@petkybenedek petkybenedek commented Jan 26, 2026

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

BeforeAfter
BeforeAfter

Checklist

  • Follow-up e2e test ticket created
  • A11y checked
  • Tested on phone
  • Tested on tablet
  • Tested in dark mode
  • Tested in light mode
  • Approve from product

refs: MBL-19690
builds: Student
affects: Student
release note: none
Copy link

@claude claude bot left a 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

  1. Fix the critical layout bug: Ensure takeButton has valid constraints on all iOS versions, not just iOS 26+
  2. Consider refactoring: Reduce code duplication in the constraint setup
  3. 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)
])
}
Copy link

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.

@inst-danger
Copy link
Contributor

inst-danger commented Jan 26, 2026

Warnings
⚠️ This pull request will not generate a release note.

Affected Apps: Student

Builds: Student

MBL-19690

Coverage New % Master % Delta
Canvas iOS 91.42% 81.06% 10.36%

Generated by 🚫 dangerJS against 04375d1

@inst-danger
Copy link
Contributor

Builds

Commit: Align to safe area, make quiz details appear liquid-glass like (04375d1)
Build Number: 1209
Built At: Jan 26 16:35 CET (01/26 08:35 AM MST)

Student

@petkybenedek petkybenedek changed the title [MBL-19690][S] - Misaligned submit button [MBL-19690][S] Misaligned submit button Jan 26, 2026
@petkybenedek petkybenedek self-assigned this Jan 26, 2026
Copy link
Contributor

@rh12 rh12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA + 1

@petkybenedek petkybenedek merged commit e8b81fe into master Jan 27, 2026
13 checks passed
@petkybenedek petkybenedek deleted the bugfix/MBL-19690-Misaligned-resubmit-button branch January 27, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants